renamed mob stuff to battlenpc

- stubbed spawn/die/despawn functions
This commit is contained in:
Tahir Akhlaq
2017-07-07 22:08:48 +01:00
parent cc1929a9fb
commit d895357182
10 changed files with 63 additions and 124 deletions

View File

@@ -248,5 +248,16 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
{
}
public void InternalDie(DateTime tick, uint timeToFadeout)
{
}
public void InternalRaise(Character target)
{
// todo: place at target
// ForceChangeState(new RaiseState(target));
}
}
}

View File

@@ -1,63 +0,0 @@
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 MobController : Controller
{
public MobController(Character owner)
{
this.owner = owner;
this.lastUpdate = DateTime.Now;
}
public override void Update(DateTime tick)
{
// todo: handle aggro/deaggro and other shit here
((Mob)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)
{
}
}
}

View File

@@ -48,7 +48,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
public override void OnComplete()
{
var damage = FFXIVClassic_Map_Server.actors.chara.ai.utils.AttackUtils.CalculateDamage(owner, target);
var damage = utils.AttackUtils.CalculateDamage(owner, target);
lua.LuaEngine.GetInstance().CallLuaFunction(owner, target, "onAttack", false, damage);
@@ -73,29 +73,29 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai.state
// todo: actually check proc rate/random chance of whatever effect
effectId = list[0].GetEffectId();
}
this.errorPacket = BattleActionX01Packet.BuildPacket(target.actorId, owner.actorId, target.actorId, 0, effectId, 0, 0, 0, 0);
owner.zone.BroadcastPacketAroundActor(owner, errorPacket);
errorPacket = null;
// todo: which is actually the swing packet
//this.errorPacket = BattleActionX01Packet.BuildPacket(target.actorId, owner.actorId, target.actorId, 0, effectId, 0, (ushort)BattleActionX01PacketCommand.Attack, 0, 0);
//owner.zone.BroadcastPacketAroundActor(owner, errorPacket);
//errorPacket = null;
interrupt = true;
return;
}
else if (target.zone != owner.zone)
{
interrupt = true;
return;
}
else if (owner.aiContainer.IsDead())
{
// todo: this really shouldnt ever hit since we'd be clearing states on death
interrupt = true;
return;
}
interrupt = CanAttack();
interrupt = !CanAttack();
}
private bool CanAttack()
{
if (target.aiContainer.IsDead())
// todo: shouldnt need to check if owner is dead since all states would be cleared
if (owner.aiContainer.IsDead() || target.aiContainer.IsDead())
{
return false;
}
else if (target.zone != owner.zone)
{
return false;
}
else if (target is Player && ((Player)target).playerSession.isUpdatesLocked)
{
return false;
}