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

@ -72,8 +72,7 @@ namespace Meteor.Map.Actors
this.uniqueIdentifier = uniqueId;
this.zoneId = spawnedArea.actorId;
this.zone = spawnedArea;
CurrentArea = spawnedArea;
this.actorClassId = actorClass.actorClassId;
@ -133,8 +132,7 @@ namespace Meteor.Map.Actors
this.uniqueIdentifier = uniqueId;
this.zoneId = spawnedArea.actorId;
this.zone = spawnedArea;
CurrentArea = spawnedArea;
this.actorClassId = actorClass.actorClassId;
@ -298,7 +296,7 @@ namespace Meteor.Map.Actors
public void ChangeNpcAppearance(uint id)
{
LoadNpcAppearance(id);
zone.BroadcastPacketAroundActor(this, CreateAppearancePacket());
CurrentArea.BroadcastPacketAroundActor(this, CreateAppearancePacket());
}
public void LoadNpcAppearance(uint id)
@ -431,7 +429,7 @@ namespace Meteor.Map.Actors
public void Despawn()
{
zone.DespawnActor(this);
CurrentArea.DespawnActor(this);
}
public override void Update(DateTime tick)
@ -463,7 +461,7 @@ namespace Meteor.Map.Actors
public override void OnDespawn()
{
zone.BroadcastPacketAroundActor(this, RemoveActorPacket.BuildPacket(this.actorId));
CurrentArea.BroadcastPacketAroundActor(this, RemoveActorPacket.BuildPacket(this.actorId));
QueuePositionUpdate(spawnX, spawnY, spawnZ);
LuaEngine.CallLuaBattleFunction(this, "onDespawn", this);
}