Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean doDie(L2Character killer)
- {
- // killing is only possible one time
- synchronized (this)
- {
- if (isDead()) return false;
- // now reset currentHp to zero
- setCurrentHp(0);
- setIsDead(true);
- }
- // Set target to null and cancel Attack or Cast
- setTarget(null);
- // Stop movement
- stopMove(null);
- // Stop HP/MP/CP Regeneration task
- getStatus().stopHpMpRegeneration();
- // Stop all active skills effects in progress on the L2Character,
- // if the Character isn't affected by Soul of The Phoenix or Salvation
- if (this instanceof L2Playable && ((L2Playable)this).isPhoenixBlessed())
- {
- if (((L2Playable)this).getCharmOfLuck()) //remove Lucky Charm if player has SoulOfThePhoenix/Salvation buff
- ((L2Playable)this).stopCharmOfLuck(null);
- if (((L2Playable)this).isNoblesseBlessed())
- ((L2Playable)this).stopNoblesseBlessing(null);
- }
- // Same thing if the Character isn't a Noblesse Blessed L2PlayableInstance
- else if (this instanceof L2Playable && ((L2Playable)this).isNoblesseBlessed())
- {
- ((L2Playable)this).stopNoblesseBlessing(null);
- if (((L2Playable)this).getCharmOfLuck()) //remove Lucky Charm if player have Nobless blessing buff
- ((L2Playable)this).stopCharmOfLuck(null);
- }
- else
- stopAllEffectsExceptThoseThatLastThroughDeath();
- if (this instanceof L2PcInstance && ((L2PcInstance)this).getAgathionId() != 0)
- ((L2PcInstance)this).setAgathionId(0);
- calculateRewards(killer);
- // Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform
- broadcastStatusUpdate();
- // Notify L2Character AI
- if (hasAI())
- getAI().notifyEvent(CtrlEvent.EVT_DEAD);
- if (getWorldRegion() != null)
- getWorldRegion().onDeath(this);
- getAttackByList().clear();
- // If character is PhoenixBlessed
- // or has charm of courage inside siege battlefield (exact operation to be confirmed)
- // a resurrection popup will show up
- if (this instanceof L2Summon)
- {
- if (((L2Summon)this).isPhoenixBlessed() && ((L2Summon)this).getOwner() != null)
- ((L2Summon)this).getOwner().reviveRequest(((L2Summon)this).getOwner(), null, true);
- }
- if (this instanceof L2PcInstance)
- {
- if(((L2Playable)this).isPhoenixBlessed())
- ((L2PcInstance)this).reviveRequest(((L2PcInstance)this),null,false);
- else if (isAffected(CharEffectList.EFFECT_FLAG_CHARM_OF_COURAGE)
- && ((L2PcInstance)this).isInSiege())
- {
- ((L2PcInstance)this).reviveRequest(((L2PcInstance)this),null,false);
- }
- }
- try
- {
- if (_fusionSkill != null)
- abortCast();
- for (L2Character character : getKnownList().getKnownCharacters())
- if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
- character.abortCast();
- }
- catch (Exception e)
- {
- _log.log(Level.SEVERE, "deleteMe()", e);
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment