04-07-2020, 05:27 PM
Всем привет! Собственно вот такая проблема, после смерти, опыт игрока не уменьшается. Блин, где я только эту ошибку не искал...
L2PcInstance
L2PcInstance
PHP код:
<?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 код:
<?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);
}