fixed auto attack messing up cast anim

- fixed auto attack anim for mobs (<3 u ion)
- added hotbar timer updates (<3 u azia)
- fixed actor block bug
- cleaned up substate retardation
- fixed some targetfind issues
- added despawn state
- added messages for in progress commands
- added fields for aoe target, range, battleAnimation to server_battle_commands table
This commit is contained in:
Tahir Akhlaq
2017-08-31 05:56:43 +01:00
parent 4c7928da78
commit c5cc7c2f00
24 changed files with 550 additions and 330 deletions

View File

@@ -23,6 +23,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
public readonly PathFind pathFind;
private TargetFind targetFind;
private ActionQueue actionQueue;
private DateTime lastActionTime;
public AIContainer(Character actor, Controller controller, PathFind pathFind, TargetFind targetFind)
{
@@ -36,6 +37,16 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
actionQueue = new ActionQueue(owner);
}
public void UpdateLastActionTime()
{
lastActionTime = DateTime.Now;
}
public DateTime GetLastActionTime()
{
return lastActionTime;
}
public void Update(DateTime tick)
{
prevUpdate = latestUpdate;
@@ -186,13 +197,13 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
public bool IsEngaged()
{
// todo: check this is legit
return owner.currentMainState == SetActorStatePacket.MAIN_STATE_ACTIVE && owner.target != null;
return owner.currentMainState == SetActorStatePacket.MAIN_STATE_ACTIVE;
}
public bool IsDead()
{
return owner.currentMainState == SetActorStatePacket.MAIN_STATE_DEAD ||
owner.currentMainState == SetActorStatePacket.MAIN_STATE_DEAD2;
owner.currentMainState == SetActorStatePacket.MAIN_STATE_DEAD2 || owner.GetHP() == 0;
}
public bool IsRoaming()
@@ -253,10 +264,6 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
{
// todo: use invalid target id
// todo: this is retarded, call entity's changetarget function
owner.target = target;
owner.currentLockedTarget = target != null ? target.actorId : 0xC0000000;
owner.currentTarget = target != null ? target.actorId : 0xC0000000;
if (IsEngaged() || target == null)
{
@@ -293,8 +300,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
GetTargetFind()?.Reset();
owner.updateFlags |= ActorUpdateFlags.HpTpMp;
ChangeTarget(null);
owner.ChangeState(SetActorStatePacket.MAIN_STATE_PASSIVE);
ClearStates();
}