2017-07-08 00:20:55 +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.actors.chara.npc;
|
|
|
|
|
using FFXIVClassic_Map_Server.actors;
|
|
|
|
|
using FFXIVClassic_Map_Server.actors.chara;
|
|
|
|
|
using FFXIVClassic_Map_Server.actors.chara.ai;
|
|
|
|
|
using FFXIVClassic_Map_Server.actors.chara.ai.controllers;
|
|
|
|
|
using FFXIVClassic_Map_Server.packets.send.actor;
|
2017-07-12 18:46:39 +01:00
|
|
|
|
using FFXIVClassic_Map_Server.actors.chara.ai.state;
|
2017-07-08 00:20:55 +01:00
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Map_Server.Actors
|
|
|
|
|
{
|
2017-07-11 20:49:38 +01:00
|
|
|
|
[Flags]
|
|
|
|
|
enum AggroType
|
|
|
|
|
{
|
2017-07-27 22:19:20 +01:00
|
|
|
|
None = 0x00,
|
|
|
|
|
Sight = 0x01,
|
|
|
|
|
Scent = 0x02,
|
|
|
|
|
LowHp = 0x04,
|
|
|
|
|
IgnoreLevelDifference = 0x08
|
2017-07-11 20:49:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-08 00:20:55 +01:00
|
|
|
|
class BattleNpc : Npc
|
|
|
|
|
{
|
|
|
|
|
public HateContainer hateContainer;
|
2017-07-11 20:49:38 +01:00
|
|
|
|
public AggroType aggroType;
|
2017-07-08 00:20:55 +01:00
|
|
|
|
|
|
|
|
|
public BattleNpc(int actorNumber, ActorClass actorClass, string uniqueId, Area spawnedArea, float posX, float posY, float posZ, float rot,
|
|
|
|
|
ushort actorState, uint animationId, string customDisplayName)
|
|
|
|
|
: base(actorNumber, actorClass, uniqueId, spawnedArea, posX, posY, posZ, rot, actorState, animationId, customDisplayName)
|
|
|
|
|
{
|
|
|
|
|
this.aiContainer = new AIContainer(this, new BattleNpcController(this), new PathFind(this), new TargetFind(this));
|
2017-07-11 20:49:38 +01:00
|
|
|
|
|
2017-07-08 00:20:55 +01:00
|
|
|
|
this.currentSubState = SetActorStatePacket.SUB_STATE_MONSTER;
|
2017-07-11 20:49:38 +01:00
|
|
|
|
//this.currentMainState = SetActorStatePacket.MAIN_STATE_ACTIVE;
|
|
|
|
|
|
|
|
|
|
//charaWork.property[2] = 1;
|
|
|
|
|
//npcWork.hateType = 1;
|
|
|
|
|
|
2017-07-08 00:20:55 +01:00
|
|
|
|
this.hateContainer = new HateContainer(this);
|
2017-07-11 01:54:15 +01:00
|
|
|
|
this.allegiance = CharacterTargetingAllegiance.BattleNpcs;
|
2017-07-08 00:20:55 +01:00
|
|
|
|
}
|
2017-07-11 20:49:38 +01:00
|
|
|
|
|
|
|
|
|
public override void Update(DateTime tick)
|
|
|
|
|
{
|
|
|
|
|
// todo:
|
|
|
|
|
this.statusEffects.Update(tick);
|
|
|
|
|
}
|
2017-07-12 18:46:39 +01:00
|
|
|
|
|
|
|
|
|
///<summary> // todo: create an action object? </summary>
|
|
|
|
|
public bool OnAttack(AttackState state)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Spawn(DateTime tick)
|
|
|
|
|
{
|
|
|
|
|
base.Spawn(tick);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Die(DateTime tick)
|
|
|
|
|
{
|
|
|
|
|
base.Die(tick);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OnRoam(DateTime tick)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2017-07-08 00:20:55 +01:00
|
|
|
|
}
|
|
|
|
|
}
|