More targeting changes

Added CanUse instead of CanAttack/CanWeaponSkill/CanCast since they all
check the same things anyway.

Fixed some bugs like mp checking against hp in AddMP.
This commit is contained in:
Yogurt
2019-05-29 19:46:29 -07:00
parent a458608322
commit 289e4dc24b
5 changed files with 41 additions and 100 deletions

View File

@@ -188,7 +188,7 @@ namespace FFXIVClassic_Map_Server.Actors
return true;
}
public override bool CanCast(Character target, BattleCommand spell)
public override bool CanUse(Character target, BattleCommand spell, CommandResult error = null)
{
// todo:
if (target == null)
@@ -209,18 +209,6 @@ namespace FFXIVClassic_Map_Server.Actors
return true;
}
public override bool CanWeaponSkill(Character target, BattleCommand skill)
{
// todo:
return true;
}
public override bool CanUseAbility(Character target, BattleCommand ability)
{
// todo:
return false;
}
public uint GetDespawnTime()
{
return despawnTime;
@@ -264,7 +252,7 @@ namespace FFXIVClassic_Map_Server.Actors
zone.BroadcastPacketsAroundActor(this, GetSpawnPackets(null, 0x01));
zone.BroadcastPacketsAroundActor(this, GetInitPackets());
charaWork.parameterSave.hp = charaWork.parameterSave.hpMax;
charaWork.parameterSave.mp = charaWork.parameterSave.mpMax;
charaWork.parameterSave.hp = (short[])charaWork.parameterSave.hpMax.Clone();
RecalculateStats();
OnSpawn();