2017-08-02 23:06:11 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using FFXIVClassic_Map_Server.Actors;
|
|
|
|
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Map_Server.actors.chara.ai.state
|
|
|
|
|
{
|
|
|
|
|
class DeathState : State
|
|
|
|
|
{
|
|
|
|
|
DateTime despawnTime;
|
|
|
|
|
public DeathState(Character owner, DateTime tick, uint timeToFadeOut)
|
|
|
|
|
: base(owner, null)
|
|
|
|
|
{
|
2017-08-31 05:56:43 +01:00
|
|
|
|
owner.Disengage();
|
2017-09-05 05:05:25 +01:00
|
|
|
|
owner.ChangeState(SetActorStatePacket.MAIN_STATE_DEAD2);
|
2017-08-02 23:06:11 +01:00
|
|
|
|
canInterrupt = false;
|
|
|
|
|
startTime = tick;
|
|
|
|
|
despawnTime = startTime.AddSeconds(timeToFadeOut);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Update(DateTime tick)
|
|
|
|
|
{
|
2017-09-03 01:01:19 +01:00
|
|
|
|
// todo: set a flag on chara for accept raise, play animation and spawn
|
|
|
|
|
if (owner.GetMod((uint)Modifier.Raise) > 0)
|
|
|
|
|
{
|
|
|
|
|
owner.Spawn(tick);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-02 23:06:11 +01:00
|
|
|
|
// todo: handle raise etc
|
|
|
|
|
if (tick >= despawnTime)
|
|
|
|
|
{
|
2017-09-03 01:01:19 +01:00
|
|
|
|
// todo: for players, return them to homepoint
|
|
|
|
|
owner.Despawn(tick);
|
2017-08-02 23:06:11 +01:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|