mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-23 05:07:47 +00:00
Handle dying in AddHP instead of OnDamageTaken.
This commit is contained in:
parent
ee1f4b0888
commit
75c6708ac5
2 changed files with 9 additions and 7 deletions
|
@ -638,8 +638,9 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
charaWork.parameterSave.mp = (short)mp;
|
||||
updateFlags |= ActorUpdateFlags.HpTpMp;
|
||||
}
|
||||
|
||||
// todo: the following functions are virtuals since we want to check hidden item bonuses etc on player for certain conditions
|
||||
public virtual void AddHP(int hp)
|
||||
public virtual void AddHP(int hp, CommandResultContainer resultContainer = null)
|
||||
{
|
||||
// dont wanna die ded, don't want to send update if hp isn't actually changed
|
||||
if (IsAlive() && hp != 0)
|
||||
|
@ -651,6 +652,9 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
charaWork.parameterSave.hp[0] = (short)addHp;
|
||||
|
||||
updateFlags |= ActorUpdateFlags.HpTpMp;
|
||||
|
||||
if (charaWork.parameterSave.hp[0] < 1)
|
||||
Die(Program.Tick, resultContainer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -692,9 +696,9 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
}
|
||||
}
|
||||
|
||||
public void DelHP(int hp)
|
||||
public void DelHP(int hp, CommandResultContainer resultContainer = null)
|
||||
{
|
||||
AddHP((short)-hp);
|
||||
AddHP((short)-hp, resultContainer);
|
||||
}
|
||||
|
||||
public void DelMP(int mp)
|
||||
|
@ -883,10 +887,6 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
//Don't know if store tp impacts this
|
||||
double tpModifier = 5 * Math.Pow(Math.E, (-0.0667 * GetLevel()));
|
||||
AddTP((int)Math.Ceiling(tpModifier * action.amount));
|
||||
|
||||
|
||||
if (charaWork.parameterSave.hp[0] < 1)
|
||||
Die(Program.Tick, actionContainer);
|
||||
}
|
||||
|
||||
public UInt64 GetTempVar(string name)
|
||||
|
|
|
@ -287,6 +287,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
// <actor> defeat/defeats <target>
|
||||
if (actionContainer != null)
|
||||
actionContainer.AddEXPAction(new CommandResult(actorId, 30108, 0));
|
||||
|
||||
if (lastAttacker.currentParty != null && lastAttacker.currentParty is Party)
|
||||
{
|
||||
foreach (var memberId in ((Party)lastAttacker.currentParty).members)
|
||||
|
@ -310,6 +311,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
|
||||
if (positionUpdates != null)
|
||||
positionUpdates.Clear();
|
||||
|
||||
aiContainer.InternalDie(tick, despawnTime);
|
||||
//this.ResetMoveSpeeds();
|
||||
// todo: reset cooldowns
|
||||
|
|
Loading…
Add table
Reference in a new issue