mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
Refactored how zones work. Cleaned out a lot of duplciations and smoothed out how Zones/PrivateAreas work.
This commit is contained in:
@@ -55,17 +55,17 @@ namespace Meteor.Map.actors.chara.ai
|
||||
{
|
||||
PreparePath(dest.X, dest.Y, dest.Z, stepSize, maxPath, polyRadius);
|
||||
}
|
||||
|
||||
//TODO: Verify pathfind with new area setup
|
||||
public void PreparePath(float x, float y, float z, float stepSize = 1.25f, int maxPath = 40, float polyRadius = 0.0f)
|
||||
{
|
||||
var pos = new Vector3(owner.positionX, owner.positionY, owner.positionZ);
|
||||
var dest = new Vector3(x, y, z);
|
||||
|
||||
Zone zone;
|
||||
if (owner.GetZone() is PrivateArea || owner.GetZone() is PrivateAreaContent)
|
||||
zone = (Zone)((PrivateArea)owner.GetZone()).GetParentZone();
|
||||
if (owner.CurrentArea is PrivateArea || owner.CurrentArea is PrivateAreaContent)
|
||||
zone = (Zone)((PrivateArea)owner.CurrentArea).GetParentZone();
|
||||
else
|
||||
zone = (Zone)owner.GetZone();
|
||||
zone = (Zone)owner.CurrentArea;
|
||||
|
||||
var sw = new System.Diagnostics.Stopwatch();
|
||||
sw.Start();
|
||||
|
@@ -285,7 +285,7 @@ namespace Meteor.Map.actors.chara.ai
|
||||
{
|
||||
foreach (var actorId in party.members)
|
||||
{
|
||||
AddTarget(owner.zone.FindActorInArea<Character>(actorId), withPet);
|
||||
AddTarget(owner.CurrentArea.FindActorInArea<Character>(actorId), withPet);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,7 +299,7 @@ namespace Meteor.Map.actors.chara.ai
|
||||
private void AddAllBattleNpcs(Character target, bool withPet)
|
||||
{
|
||||
int dist = (int)maxDistance;
|
||||
var actors = owner.zone.GetActorsAroundActor<BattleNpc>(target, dist);
|
||||
var actors = owner.CurrentArea.GetActorsAroundActor<BattleNpc>(target, dist);
|
||||
|
||||
foreach (BattleNpc actor in actors)
|
||||
{
|
||||
@@ -309,7 +309,7 @@ namespace Meteor.Map.actors.chara.ai
|
||||
|
||||
private void AddAllInZone(Character target, bool withPet)
|
||||
{
|
||||
var actors = owner.zone.GetAllActors<Character>();
|
||||
var actors = owner.CurrentArea.GetAllActors<Character>();
|
||||
foreach (Character actor in actors)
|
||||
{
|
||||
AddTarget(actor, withPet);
|
||||
@@ -319,7 +319,7 @@ namespace Meteor.Map.actors.chara.ai
|
||||
private void AddAllInRange(Character target, bool withPet)
|
||||
{
|
||||
int dist = (int)maxDistance;
|
||||
var actors = owner.zone.GetActorsAroundActor<Character>(target, dist);
|
||||
var actors = owner.CurrentArea.GetActorsAroundActor<Character>(target, dist);
|
||||
|
||||
foreach (Character actor in actors)
|
||||
{
|
||||
@@ -408,7 +408,7 @@ namespace Meteor.Map.actors.chara.ai
|
||||
return false;
|
||||
}
|
||||
|
||||
if (/*target.isZoning || owner.isZoning || */target.zone != owner.zone)
|
||||
if (/*target.isZoning || owner.isZoning || */target.CurrentArea != owner.CurrentArea)
|
||||
return false;
|
||||
|
||||
if (validTarget == ValidTarget.Self && aoeType == TargetFindAOEType.None && owner != target)
|
||||
|
Reference in New Issue
Block a user