Guest User

L2char

a guest
Apr 5th, 2011
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. public boolean doDie(L2Character killer)
  2. {
  3. // killing is only possible one time
  4. synchronized (this)
  5. {
  6. if (isDead()) return false;
  7. // now reset currentHp to zero
  8. setCurrentHp(0);
  9. setIsDead(true);
  10. }
  11.  
  12. // Set target to null and cancel Attack or Cast
  13. setTarget(null);
  14.  
  15. // Stop movement
  16. stopMove(null);
  17.  
  18. // Stop HP/MP/CP Regeneration task
  19. getStatus().stopHpMpRegeneration();
  20.  
  21. // Stop all active skills effects in progress on the L2Character,
  22. // if the Character isn't affected by Soul of The Phoenix or Salvation
  23. if (this instanceof L2Playable && ((L2Playable)this).isPhoenixBlessed())
  24. {
  25. if (((L2Playable)this).getCharmOfLuck()) //remove Lucky Charm if player has SoulOfThePhoenix/Salvation buff
  26. ((L2Playable)this).stopCharmOfLuck(null);
  27. if (((L2Playable)this).isNoblesseBlessed())
  28. ((L2Playable)this).stopNoblesseBlessing(null);
  29. }
  30. // Same thing if the Character isn't a Noblesse Blessed L2PlayableInstance
  31. else if (this instanceof L2Playable && ((L2Playable)this).isNoblesseBlessed())
  32. {
  33. ((L2Playable)this).stopNoblesseBlessing(null);
  34.  
  35. if (((L2Playable)this).getCharmOfLuck()) //remove Lucky Charm if player have Nobless blessing buff
  36. ((L2Playable)this).stopCharmOfLuck(null);
  37. }
  38. else
  39. stopAllEffectsExceptThoseThatLastThroughDeath();
  40.  
  41. if (this instanceof L2PcInstance && ((L2PcInstance)this).getAgathionId() != 0)
  42. ((L2PcInstance)this).setAgathionId(0);
  43. calculateRewards(killer);
  44.  
  45. // Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform
  46. broadcastStatusUpdate();
  47.  
  48. // Notify L2Character AI
  49. if (hasAI())
  50. getAI().notifyEvent(CtrlEvent.EVT_DEAD);
  51.  
  52. if (getWorldRegion() != null)
  53. getWorldRegion().onDeath(this);
  54.  
  55. getAttackByList().clear();
  56. // If character is PhoenixBlessed
  57. // or has charm of courage inside siege battlefield (exact operation to be confirmed)
  58. // a resurrection popup will show up
  59. if (this instanceof L2Summon)
  60. {
  61. if (((L2Summon)this).isPhoenixBlessed() && ((L2Summon)this).getOwner() != null)
  62. ((L2Summon)this).getOwner().reviveRequest(((L2Summon)this).getOwner(), null, true);
  63. }
  64. if (this instanceof L2PcInstance)
  65. {
  66. if(((L2Playable)this).isPhoenixBlessed())
  67. ((L2PcInstance)this).reviveRequest(((L2PcInstance)this),null,false);
  68. else if (isAffected(CharEffectList.EFFECT_FLAG_CHARM_OF_COURAGE)
  69. && ((L2PcInstance)this).isInSiege())
  70. {
  71. ((L2PcInstance)this).reviveRequest(((L2PcInstance)this),null,false);
  72. }
  73. }
  74. try
  75. {
  76. if (_fusionSkill != null)
  77. abortCast();
  78.  
  79. for (L2Character character : getKnownList().getKnownCharacters())
  80. if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
  81. character.abortCast();
  82. }
  83. catch (Exception e)
  84. {
  85. _log.log(Level.SEVERE, "deleteMe()", e);
  86. }
  87. return true;
  88. }
Advertisement
Add Comment
Please, Sign In to add comment