From 247b5ca7095e9f88b1b99b80d390fa1c11e0ebed Mon Sep 17 00:00:00 2001 From: Tahir Akhlaq Date: Sat, 8 Jul 2017 00:20:55 +0100 Subject: [PATCH] missed some files from previous commit --- .../ai/controllers/BattleNpcController.cs | 63 +++++++++++++++++++ .../chara/ai/controllers/PetController.cs | 12 ++++ .../actors/chara/npc/BattleNpc.cs | 29 +++++++++ .../actors/chara/npc/Pet.cs | 25 ++++++++ 4 files changed, 129 insertions(+) create mode 100644 FFXIVClassic Map Server/actors/chara/ai/controllers/BattleNpcController.cs create mode 100644 FFXIVClassic Map Server/actors/chara/ai/controllers/PetController.cs create mode 100644 FFXIVClassic Map Server/actors/chara/npc/BattleNpc.cs create mode 100644 FFXIVClassic Map Server/actors/chara/npc/Pet.cs diff --git a/FFXIVClassic Map Server/actors/chara/ai/controllers/BattleNpcController.cs b/FFXIVClassic Map Server/actors/chara/ai/controllers/BattleNpcController.cs new file mode 100644 index 00000000..1fe68e2c --- /dev/null +++ b/FFXIVClassic Map Server/actors/chara/ai/controllers/BattleNpcController.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using FFXIVClassic_Map_Server.Actors; + +namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers +{ + class BattleNpcController : Controller + { + public BattleNpcController(Character owner) + { + this.owner = owner; + this.lastUpdate = DateTime.Now; + } + + public override void Update(DateTime tick) + { + // todo: handle aggro/deaggro and other shit here + ((BattleNpc)this.owner).statusEffects.Update(tick); + } + + public override bool Engage(Character target) + { + // todo: check distance, last swing time, status effects + this.owner.aiContainer.InternalEngage(target); + return true; + } + + private bool TryEngage(Character target) + { + // todo: + return true; + } + + public override bool Disengage() + { + // todo: + return true; + } + + public override void Cast(Character target, uint spellId) + { + + } + + public override void Ability(Character target, uint abilityId) + { + + } + + public override void RangedAttack(Character target) + { + + } + + public override void MobSkill(Character target, uint mobSkillId) + { + + } + } +} diff --git a/FFXIVClassic Map Server/actors/chara/ai/controllers/PetController.cs b/FFXIVClassic Map Server/actors/chara/ai/controllers/PetController.cs new file mode 100644 index 00000000..dbe7e67f --- /dev/null +++ b/FFXIVClassic Map Server/actors/chara/ai/controllers/PetController.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers +{ + class PetController + { + } +} diff --git a/FFXIVClassic Map Server/actors/chara/npc/BattleNpc.cs b/FFXIVClassic Map Server/actors/chara/npc/BattleNpc.cs new file mode 100644 index 00000000..b7895e3d --- /dev/null +++ b/FFXIVClassic Map Server/actors/chara/npc/BattleNpc.cs @@ -0,0 +1,29 @@ +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; + +namespace FFXIVClassic_Map_Server.Actors +{ + class BattleNpc : Npc + { + public HateContainer hateContainer; + + 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)); + this.currentSubState = SetActorStatePacket.SUB_STATE_MONSTER; + this.hateContainer = new HateContainer(this); + } + } +} diff --git a/FFXIVClassic Map Server/actors/chara/npc/Pet.cs b/FFXIVClassic Map Server/actors/chara/npc/Pet.cs new file mode 100644 index 00000000..1ecaa67f --- /dev/null +++ b/FFXIVClassic Map Server/actors/chara/npc/Pet.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using FFXIVClassic_Map_Server.actors.chara.ai; +using FFXIVClassic_Map_Server.actors.chara.ai.controllers; +using FFXIVClassic_Map_Server.actors.chara.npc; +using FFXIVClassic_Map_Server.packets.send.actor; + +namespace FFXIVClassic_Map_Server.Actors +{ + class Pet : BattleNpc + { + public Pet(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)); + this.currentSubState = SetActorStatePacket.SUB_STATE_MONSTER; + this.hateContainer = new HateContainer(this); + } + } +}