public override async Task DoDieAsync(L2Character killer) { lock (this) { if (Dead) { return; } CharStatus.SetCurrentHp(0); Dead = true; } //Check For Exp if (killer is L2Player) { ((L2Player)killer).AddExpSp(this.Template.Exp, this.Template.Sp, true); } Target = null; await CharMovement.NotifyStopMove(true); if (IsAttacking()) { AbortAttack(); } CharStatus.StopHpMpRegeneration(); await BroadcastPacketAsync(new Die(this)); _spawnTable.RegisterRespawn(spawn); if (Template.CorpseTime <= 0) { return; } CorpseTimer = new Timer(Template.CorpseTime * 1000); CorpseTimer.Elapsed += new ElapsedEventHandler(RemoveCorpse); CorpseTimer.Start(); }
public override async Task DoDieAsync(L2Character killer) { lock (this) { if (Dead) { return; } CharStatus.SetCurrentHp(0); Dead = true; } Target = null; await Movement.NotifyStopMove(true); if (IsAttacking()) { AbortAttack(); } CharStatus.StopHpMpRegeneration(); await BroadcastPacketAsync(new Die(this)); _spawnTable.RegisterRespawn(spawn); if (Template.CorpseTime <= 0) { return; } CorpseTimer = new Timer(Template.CorpseTime * 1000); CorpseTimer.Elapsed += RemoveCorpse; CorpseTimer.Start(); }
public override void DoDie(L2Character killer) { lock (this) { if (Dead) { return; } CharStatus.SetCurrentHp(0); Dead = true; } Target = null; NotifyStopMove(true, true); if (IsAttacking()) { AbortAttack(); } CharStatus.StopHpMpRegeneration(); BroadcastPacket(new Die(this)); _spawnTable.RegisterRespawn(spawn); if (Template.CorpseTime <= 0) { return; } CorpseTimer = new Timer(Template.CorpseTime * 1000); CorpseTimer.Elapsed += new ElapsedEventHandler(RemoveCorpse); CorpseTimer.Start(); }