mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
renamed mob stuff to battlenpc
- stubbed spawn/die/despawn functions
This commit is contained in:
@@ -203,11 +203,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
|
||||
// time elapsed since last ai update
|
||||
|
||||
if (aiContainer != null)
|
||||
{
|
||||
this.aiContainer.Update(tick);
|
||||
}
|
||||
|
||||
this.aiContainer?.Update(tick);
|
||||
|
||||
/*
|
||||
var diffTime = (tick - lastAiUpdate);
|
||||
|
||||
@@ -369,7 +366,21 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public virtual void Spawn(DateTime tick)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void Die(DateTime tick)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected virtual void Despawn(DateTime tick)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
||||
|
@@ -1,29 +0,0 @@
|
||||
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 Mob : Npc
|
||||
{
|
||||
public HateContainer hateContainer;
|
||||
|
||||
public Mob(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 MobController(this), new PathFind(this), new TargetFind(this));
|
||||
this.currentSubState = SetActorStatePacket.SUB_STATE_MONSTER;
|
||||
this.hateContainer = new HateContainer(this);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user