Всем привет! Собственно вот такая проблема, после смерти, опыт игрока не уменьшается. Блин, где я только эту ошибку не искал...
L2PcInstance
PHP код:
public void doDie(L2Character killer)
{
// Kill the L2PcInstance
super.doDie(killer);
if (killer != null)
{
if (atEvent && killer instanceof L2PcInstance)
{
L2PcInstance pk = (L2PcInstance) killer;
pk.kills.add(getName());
}
onDieDropItem(killer); // Check if any item should be dropped
if (!isInsideZone(ZONE_PVP) && (!isGM() || Config.KARMA_DROP_GM))
{
if (Config.ALT_GAME_DELEVEL)
{
// Reduce the Experience of the L2PcInstance in function of the calculated Death Penalty
// NOTE: deathPenalty +- Exp will update karma
if (getSkillLevel(L2Skill.SKILL_LUCKY) < 0 || getStat().getLevel() > 4)
deathPenalty((killer instanceof L2PcInstance && this.getClan() != null && ((L2PcInstance)killer).getClan() != null && ((L2PcInstance)killer).getClan().isAtWarWith(this.getClanId())));
}
else
onDieUpdateKarma(); // Update karma if delevel is not allowed
}
}
setPvpFlag(0); // Clear the pvp flag
// Unsummon the Pet
if (getPet() != null)
getPet().unSummon(this);
// Unsummon Cubics
if (_cubics.size() > 0)
{
for (L2CubicInstance cubic : _cubics.values())
{
cubic.stopAction();
cubic.cancelDisappear();
}
_cubics.clear();
}
stopRentPet();
stopWaterTask();
}
L2Chacarcer:
PHP код:
public void doDie(L2Character killer)
{
// Enhance soul crystals of the attacker if this L2Attackable had its soul absorbed
try {
if (killer instanceof L2PcInstance)
{
levelSoulCrystals(killer);
}
}
catch (Exception e) { _log.log(Level.SEVERE, "", e); }
// Distribute Exp and SP rewards to L2PcInstance (including Summon owner) that hit the L2Attackable and to their Party members
try { calculateRewards(killer); } catch (Exception e) { _log.log(Level.SEVERE, "", e); }
// Notify the Quest Engine of the L2Attackable death if necessary
try {
if (killer instanceof L2PcInstance || killer instanceof L2SummonInstance)
{
// Get the L2PcInstance that killed the L2Attackable
L2PcInstance player = killer instanceof L2PcInstance?(L2PcInstance)killer:((L2SummonInstance)killer).getOwner();
// Get a table containing all QuestState to modify after the L2Attackable killing
QuestState[] quests = player.getQuestsForKills(this);
if (quests != null)
{
// Go through table containing all QuestState to modify
for (QuestState qs : quests)
{
// Notify the Quest Engine of the L2Attackable death
qs.getQuest().notifyKill(this, qs);
}
}
}
}
catch (Exception e) { _log.log(Level.SEVERE, "", e); }
// Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
super.doDie(killer);
}
Метод
deathPenalty
PHP код:
public void deathPenalty(boolean atwar)
{
// TODO Need Correct Penalty
// Get the level of the L2PcInstance
final int lvl = getLevel();
//The death steal you some Exp
double percentLost = -0.07 * lvl + 6.5;
if (getKarma() > 0)
percentLost *= Config.RATE_KARMA_EXP_LOST;
if (isFestivalParticipant() || atwar || isInsideZone(ZONE_SIEGE))
percentLost /= 4.0;
// Calculate the Experience loss
int lostExp = 0;
if (!atEvent)
if (lvl < Experience.MAX_LEVEL)
lostExp = (int) Math.round((getStat().getExpForLevel(lvl+1) - getStat().getExpForLevel(lvl)) * percentLost /100);
else
lostExp = (int) Math.round((getStat().getExpForLevel(Experience.MAX_LEVEL) - getStat().getExpForLevel(Experience.MAX_LEVEL - 1)) * percentLost /100);
// Get the Experience before applying penalty
_expBeforeDeath = getExp();
if (Config.DEBUG)
_log.fine(getName() + " died and lost " + lostExp + " experience.");
// Set the new Experience value of the L2PcInstance
getStat().addExp(-lostExp);
}
Я не могу понять, где происходит событие, когда после смерти минусуется экспа?
Ребята, помогите пожалуйста