Refactored how zones work. Cleaned out a lot of duplciations and smoothed out how Zones/PrivateAreas work.

This commit is contained in:
Filip Maj
2022-02-05 14:05:32 -05:00
parent 56ba641e2a
commit 563118372a
32 changed files with 247 additions and 417 deletions

View File

@@ -50,7 +50,7 @@ namespace Meteor.Map.actors.chara.ai.state
public override bool Update(DateTime tick)
{
if ((target == null || owner.target != target || owner.target?.actorId != owner.currentLockedTarget) && owner.isAutoAttackEnabled)
owner.aiContainer.ChangeTarget(target = owner.zone.FindActorInArea<Character>(owner.currentTarget));
owner.aiContainer.ChangeTarget(target = owner.CurrentArea.FindActorInArea<Character>(owner.currentTarget));
if (target == null || target.IsDead())
{
@@ -91,7 +91,7 @@ namespace Meteor.Map.actors.chara.ai.state
// todo: send paralyzed/sleep message etc.
if (errorResult != null)
{
owner.zone.BroadcastPacketAroundActor(owner, CommandResultX01Packet.BuildPacket(errorResult.targetId, errorResult.animation, 0x765D, errorResult));
owner.CurrentArea.BroadcastPacketAroundActor(owner, CommandResultX01Packet.BuildPacket(errorResult.targetId, errorResult.animation, 0x765D, errorResult));
errorResult = null;
}
}