diff --git a/GameServer/ai/brain/ControlledNpcBrain.cs b/GameServer/ai/brain/ControlledNpcBrain.cs index 2d06714b82..89ef50062f 100644 --- a/GameServer/ai/brain/ControlledNpcBrain.cs +++ b/GameServer/ai/brain/ControlledNpcBrain.cs @@ -275,7 +275,7 @@ public virtual void Follow(GameObject target) /// public virtual void Stay() { - tempPosition = Body.Location; + tempPosition = Body.Coordinate; WalkState = eWalkState.Stay; Body.StopFollowing(); } @@ -285,10 +285,10 @@ public virtual void Stay() /// public virtual void ComeHere() { - tempPosition = Body.Location; + tempPosition = Body.Coordinate; WalkState = eWalkState.ComeHere; Body.StopFollowing(); - Body.PathTo(Owner.Location, Body.MaxSpeed); + Body.PathTo(Owner.Coordinate, Body.MaxSpeed); } /// @@ -297,10 +297,10 @@ public virtual void ComeHere() /// public virtual void Goto(GameObject target) { - tempPosition = Body.Location; + tempPosition = Body.Coordinate; WalkState = eWalkState.GoTarget; Body.StopFollowing(); - Body.PathTo(target.Location, Body.MaxSpeed); + Body.PathTo(target.Coordinate, Body.MaxSpeed); } public virtual void SetAggressionState(eAggressionState state) diff --git a/GameServer/ai/brain/DragonBrain.cs b/GameServer/ai/brain/DragonBrain.cs index 05249fbe68..424dc0a48a 100644 --- a/GameServer/ai/brain/DragonBrain.cs +++ b/GameServer/ai/brain/DragonBrain.cs @@ -218,7 +218,7 @@ private bool CheckTether() { GameDragon dragon = Body as GameDragon; if (dragon == null) return false; - return dragon.Location.DistanceTo(dragon.SpawnPosition) > dragon.TetherRange; + return dragon.Coordinate.DistanceTo(dragon.SpawnPosition) > dragon.TetherRange; } #endregion diff --git a/GameServer/ai/brain/Guards/KeepGuardBrain.cs b/GameServer/ai/brain/Guards/KeepGuardBrain.cs index 3e0108761c..d45bd112fd 100644 --- a/GameServer/ai/brain/Guards/KeepGuardBrain.cs +++ b/GameServer/ai/brain/Guards/KeepGuardBrain.cs @@ -75,18 +75,18 @@ public override void Think() // Tolakram - always clear the aggro list so if this is done by mistake the list will correctly re-fill on next think ClearAggroList(); - if (guard.Location.DistanceTo(guard.SpawnPosition, ignoreZ: true) > 50) + if (guard.Coordinate.DistanceTo(guard.SpawnPosition, ignoreZ: true) > 50) { guard.WalkToSpawn(); } } //Eden - Portal Keeps Guards max distance - if (guard.Level > 200 && guard.Location.DistanceTo(guard.SpawnPosition) > 2000) + if (guard.Level > 200 && guard.Coordinate.DistanceTo(guard.SpawnPosition) > 2000) { ClearAggroList(); guard.WalkToSpawn(); } - else if (guard.InCombat == false && guard.Location.DistanceTo(guard.SpawnPosition) > 6000) + else if (guard.InCombat == false && guard.Coordinate.DistanceTo(guard.SpawnPosition) > 6000) { ClearAggroList(); guard.WalkToSpawn(); diff --git a/GameServer/ai/brain/RoundsBrain.cs b/GameServer/ai/brain/RoundsBrain.cs index 9a358ae92c..d859224eaa 100644 --- a/GameServer/ai/brain/RoundsBrain.cs +++ b/GameServer/ai/brain/RoundsBrain.cs @@ -52,7 +52,7 @@ public override void AddToAggroList(GameLiving living, int aggroamount) { //save current position in path go to here and reload path point //insert path in pathpoint - PathPoint temporaryPathPoint = new PathPoint(Body.Location, Body.CurrentSpeed, Body.CurrentWayPoint.Type); + PathPoint temporaryPathPoint = new PathPoint(Body.Coordinate, Body.CurrentSpeed, Body.CurrentWayPoint.Type); temporaryPathPoint.Next = Body.CurrentWayPoint; temporaryPathPoint.Prev = Body.CurrentWayPoint.Prev; Body.CurrentWayPoint = temporaryPathPoint; diff --git a/GameServer/ai/brain/StandardMobBrain.cs b/GameServer/ai/brain/StandardMobBrain.cs index a233d0dd04..4f589e0a91 100644 --- a/GameServer/ai/brain/StandardMobBrain.cs +++ b/GameServer/ai/brain/StandardMobBrain.cs @@ -119,7 +119,7 @@ public override void Think() // check for returning to home if to far away if (Body.MaxDistance != 0 && !Body.IsReturningHome) { - int distance = (int)Body.Location.DistanceTo(Body.SpawnPosition); + int distance = (int)Body.Coordinate.DistanceTo(Body.SpawnPosition); int maxdistance = Body.MaxDistance > 0 ? Body.MaxDistance : -Body.MaxDistance * AggroRange / 100; if (maxdistance > 0 && distance > maxdistance) { @@ -132,7 +132,7 @@ public override void Think() if (!Body.AttackState && CanRandomWalk && !Body.IsRoaming && Util.Chance(DOL.GS.ServerProperties.Properties.GAMENPC_RANDOMWALK_CHANCE)) { var target = GetRandomWalkTarget(); - if (target.DistanceTo(Body.Location) <= GameNPC.CONST_WALKTOTOLERANCE) + if (target.DistanceTo(Body.Coordinate) <= GameNPC.CONST_WALKTOTOLERANCE) { Body.TurnTo(target); } @@ -146,7 +146,7 @@ public override void Think() //If the npc can move, and the npc is not casting, not moving, and not attacking or in combat else if (Body.MaxSpeedBase > 0 && Body.CurrentSpellHandler == null && !Body.IsMoving && !Body.AttackState && !Body.InCombat && !Body.IsMovingOnPath) { - if (Body.Location.DistanceTo(Body.SpawnPosition) > GameNPC.CONST_WALKTOTOLERANCE) + if (Body.Coordinate.DistanceTo(Body.SpawnPosition) > GameNPC.CONST_WALKTOTOLERANCE) Body.WalkToSpawn(); else if (Body.Orientation != Body.SpawnPosition.Orientation) Body.Orientation = Body.SpawnPosition.Orientation; @@ -170,7 +170,7 @@ public override void Think() } //If we are not attacking, and not casting, and not moving, and we aren't facing our spawn heading, we turn to the spawn heading - if( !Body.IsMovingOnPath && !Body.InCombat && !Body.AttackState && !Body.IsCasting && !Body.IsMoving && Body.Location.DistanceTo(Body.SpawnPosition) > 500) + if( !Body.IsMovingOnPath && !Body.InCombat && !Body.AttackState && !Body.IsCasting && !Body.IsMoving && Body.Coordinate.DistanceTo(Body.SpawnPosition) > 500) { Body.WalkToSpawn(); // Mobs do not walk back at 2x their speed.. Body.IsReturningHome = false; // We are returning to spawn but not the long walk home, so aggro still possible @@ -320,7 +320,7 @@ public virtual bool CheckFormation(ref int x, ref int y, ref int z) return false; } - public virtual Coordinate GetFormationLocation(Coordinate loc) + public virtual Coordinate GetFormationCoordinate(Coordinate loc) { var x = loc.X; var y = loc.Y; @@ -1567,7 +1567,7 @@ public virtual Coordinate GetRandomWalkTarget() if (PathCalculator.IsSupported(Body)) { int radius = Body.RoamingRange > 0 ? Body.RoamingRange : 500; - var target = PathingMgr.Instance.GetRandomPointAsync(Body.CurrentZone, Body.Location, radius); + var target = PathingMgr.Instance.GetRandomPointAsync(Body.CurrentZone, Body.Coordinate, radius); if (target.HasValue) return Coordinate.Create(x: (int)target.Value.X, y: (int)target.Value.Y, z: (int)target.Value.Z); } @@ -1589,7 +1589,7 @@ public virtual void DetectDoor() { ushort range= (ushort)((ThinkInterval/800)*Body.CurrentWayPoint.MaxSpeed); - foreach (IDoor door in Body.CurrentRegion.GetDoorsInRadius(Body.Location, range, false)) + foreach (IDoor door in Body.CurrentRegion.GetDoorsInRadius(Body.Coordinate, range, false)) { if (door is GameKeepDoor) { diff --git a/GameServer/behaviour/Actions/WalkToAction.cs b/GameServer/behaviour/Actions/WalkToAction.cs index 047e912f0d..0a44171082 100644 --- a/GameServer/behaviour/Actions/WalkToAction.cs +++ b/GameServer/behaviour/Actions/WalkToAction.cs @@ -40,9 +40,9 @@ public WalkToAction(GameNPC defaultNPC, IPoint3D destination, GameNPC npc) public override void Perform(DOLEvent e, object sender, EventArgs args) { GamePlayer player = BehaviourUtils.GuessGamePlayerFromNotify(e, sender, args); - var location = (P is IPoint3D) ? P.ToCoordinate() : player.Location; + var destination = (P is IPoint3D) ? P.ToCoordinate() : player.Coordinate; - Q.WalkTo(location, Q.CurrentSpeed); + Q.WalkTo(destination, Q.CurrentSpeed); } } diff --git a/GameServer/commands/gmcommands/AddHookPoint.cs b/GameServer/commands/gmcommands/AddHookPoint.cs index 01379590ec..436dfb572d 100644 --- a/GameServer/commands/gmcommands/AddHookPoint.cs +++ b/GameServer/commands/gmcommands/AddHookPoint.cs @@ -53,10 +53,10 @@ public void OnCommand(GameClient client, string[] args) DBKeepHookPoint dbkeephp = new DBKeepHookPoint(); dbkeephp.HookPointID = id; dbkeephp.KeepComponentSkinID = skin; - var newHookPointLocation = client.Player.Location - comp.Location; - dbkeephp.X = newHookPointLocation.X; - dbkeephp.Y = newHookPointLocation.Y; - dbkeephp.Z = newHookPointLocation.Z; + var keepComponentOffsetToPlayer = client.Player.Coordinate - comp.Coordinate; + dbkeephp.X = keepComponentOffsetToPlayer.X; + dbkeephp.Y = keepComponentOffsetToPlayer.Y; + dbkeephp.Z = keepComponentOffsetToPlayer.Z; dbkeephp.Heading = (client.Player.Orientation - comp.Orientation).InHeading; GameServer.Database.AddObject(dbkeephp); } diff --git a/GameServer/commands/gmcommands/GMinfo.cs b/GameServer/commands/gmcommands/GMinfo.cs index 6deb682742..a32cdee44c 100644 --- a/GameServer/commands/gmcommands/GMinfo.cs +++ b/GameServer/commands/gmcommands/GMinfo.cs @@ -228,7 +228,7 @@ public void OnCommand(GameClient client, string[] args) info.Add(" "); info.Add(" + Mob_ID: " + target.InternalID); - info.Add(" + Position: " + target.Location + ", " + target.Orientation.InHeading); + info.Add(" + Position: " + target.Coordinate + ", " + target.Orientation.InHeading); info.Add(" + OID: " + target.ObjectID); info.Add(" + Package ID: " + target.PackageID); @@ -450,7 +450,7 @@ public void OnCommand(GameClient client, string[] args) } info.Add(" "); - info.Add(" Location: X= " + target.Position.X + " ,Y= " + target.Position.Y + " ,Z= " + target.Position.Z); + info.Add(" Coordinate: X= " + target.Position.X + " ,Y= " + target.Position.Y + " ,Z= " + target.Position.Z); } #endregion StaticItem diff --git a/GameServer/commands/gmcommands/Player.cs b/GameServer/commands/gmcommands/Player.cs index 56500974cc..e608dc013b 100644 --- a/GameServer/commands/gmcommands/Player.cs +++ b/GameServer/commands/gmcommands/Player.cs @@ -2005,7 +2005,7 @@ public void OnCommand(GameClient client, string[] args) client.Out.SendMessage("\"" + player.Name + "\", " + player.CurrentRegionID + ", " + - player.Location + ", " + + player.Coordinate + ", " + player.Orientation.InHeading, eChatType.CT_System, eChatLoc.CL_SystemWindow); } diff --git a/GameServer/commands/gmcommands/keep.cs b/GameServer/commands/gmcommands/keep.cs index e20ca26bb6..bb86d0ed31 100644 --- a/GameServer/commands/gmcommands/keep.cs +++ b/GameServer/commands/gmcommands/keep.cs @@ -2140,7 +2140,7 @@ public void OnCommand(GameClient client, string[] args) (door as GameObject).RemoveFromWorld(); GameKeepDoor d = new GameKeepDoor(); d.Name = door.Name; - d.Position = Position.Create(keep.Region, door.Location, door.Orientation); + d.Position = Position.Create(keep.Region, door.Coordinate, door.Orientation); d.Level = 0; d.Model = 0xFFFF; d.DoorID = door.DoorID; diff --git a/GameServer/commands/gmcommands/keepguard.cs b/GameServer/commands/gmcommands/keepguard.cs index 09db6e6949..a61f5893e5 100644 --- a/GameServer/commands/gmcommands/keepguard.cs +++ b/GameServer/commands/gmcommands/keepguard.cs @@ -340,7 +340,7 @@ public void OnCommand(GameClient client, string[] args) { RemoveAllTempPathObjects(client); - PathPoint startpoint = new PathPoint(client.Player.Location, 5000, ePathType.Once); + PathPoint startpoint = new PathPoint(client.Player.Coordinate, 5000, ePathType.Once); client.Player.TempProperties.setProperty(TEMP_PATH_FIRST, startpoint); client.Player.TempProperties.setProperty(TEMP_PATH_LAST, startpoint); client.Player.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.KeepGuard.Path.CreationStarted"), eChatType.CT_System, eChatLoc.CL_SystemWindow); @@ -372,7 +372,7 @@ public void OnCommand(GameClient client, string[] args) } } - PathPoint newpp = new PathPoint(client.Player.Location, speedlimit, path.Type); + PathPoint newpp = new PathPoint(client.Player.Coordinate, speedlimit, path.Type); path.Next = newpp; newpp.Prev = path; client.Player.TempProperties.setProperty(TEMP_PATH_LAST, newpp); diff --git a/GameServer/commands/gmcommands/npc.cs b/GameServer/commands/gmcommands/npc.cs index 4a4469f780..0972accb9d 100644 --- a/GameServer/commands/gmcommands/npc.cs +++ b/GameServer/commands/gmcommands/npc.cs @@ -200,12 +200,12 @@ public void OnCommand(GameClient client, string[] args) speed = Convert.ToInt16(args[3]); } - var location = Coordinate.Nowhere; + var coordinate = Coordinate.Nowhere; switch (args[2].ToLower()) { case "me": { - location = client.Player.Location; + coordinate = client.Player.Coordinate; break; } @@ -216,7 +216,7 @@ public void OnCommand(GameClient client, string[] args) { if (targetplayer.Name.ToLower() == args[2].ToLower()) { - location = targetplayer.Location; + coordinate = targetplayer.Coordinate; break; } } @@ -225,7 +225,7 @@ public void OnCommand(GameClient client, string[] args) { if (target.Name.ToLower() == args[2].ToLower()) { - location = target.Location; + coordinate = target.Coordinate; break; } } @@ -233,13 +233,13 @@ public void OnCommand(GameClient client, string[] args) } } - if (location.Equals(Coordinate.Nowhere)) + if (coordinate.Equals(Coordinate.Nowhere)) { client.Out.SendMessage("Can't find name " + args[2].ToLower() + " near your target.", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } - npc.PathTo(location, speed); + npc.PathTo(coordinate, speed); client.Out.SendMessage("Your target is walking to your location!", eChatType.CT_System, eChatLoc.CL_SystemWindow); break; } diff --git a/GameServer/commands/gmcommands/object.cs b/GameServer/commands/gmcommands/object.cs index b1959269df..135676d513 100644 --- a/GameServer/commands/gmcommands/object.cs +++ b/GameServer/commands/gmcommands/object.cs @@ -108,7 +108,7 @@ public void OnCommand(GameClient client, string[] args) } info.Add(" "); - info.Add(" Location: X= " + targetObject.Position.X + " ,Y= " + targetObject.Position.Y + " ,Z= " + targetObject.Position.Z); + info.Add(" Coordinate: X= " + targetObject.Position.X + " ,Y= " + targetObject.Position.Y + " ,Z= " + targetObject.Position.Z); client.Out.SendCustomTextWindow( "[ " + name + " ]", info ); break; diff --git a/GameServer/commands/gmcommands/path.cs b/GameServer/commands/gmcommands/path.cs index 755b99a4f2..0e5b63d71b 100644 --- a/GameServer/commands/gmcommands/path.cs +++ b/GameServer/commands/gmcommands/path.cs @@ -100,7 +100,7 @@ private void PathCreate(GameClient client) //Remove old temp objects RemoveAllTempPathObjects(client); - PathPoint startpoint = new PathPoint(client.Player.Location, 5000, ePathType.Once); + PathPoint startpoint = new PathPoint(client.Player.Coordinate, 5000, ePathType.Once); client.Player.TempProperties.setProperty(TEMP_PATH_FIRST, startpoint); client.Player.TempProperties.setProperty(TEMP_PATH_LAST, startpoint); client.Player.Out.SendMessage("Path creation started! You can add new pathpoints via /path add now!", eChatType.CT_System, eChatLoc.CL_SystemWindow); @@ -143,7 +143,7 @@ private void PathAdd(GameClient client, string[] args) } } - PathPoint newpp = new PathPoint(client.Player.Location, speedlimit, path.Type); + PathPoint newpp = new PathPoint(client.Player.Coordinate, speedlimit, path.Type); newpp.WaitTime = waittime * 10; path.Next = newpp; newpp.Prev = path; diff --git a/GameServer/commands/gmcommands/walk.cs b/GameServer/commands/gmcommands/walk.cs index b6efa7d4a6..04008e465a 100644 --- a/GameServer/commands/gmcommands/walk.cs +++ b/GameServer/commands/gmcommands/walk.cs @@ -80,8 +80,8 @@ public void OnCommand(GameClient client, string[] args) return; } - var locationOffset = Vector.Create(x: xoff, y: yoff, z: zoff); - targetNPC.WalkTo(targetNPC.Location + locationOffset, speed); + var offset = Vector.Create(x: xoff, y: yoff, z: zoff); + targetNPC.WalkTo(targetNPC.Coordinate + offset, speed); } } } \ No newline at end of file diff --git a/GameServer/commands/playercommands/gtrange.cs b/GameServer/commands/playercommands/gtrange.cs index 6b6ac5e30e..8a421089ff 100644 --- a/GameServer/commands/playercommands/gtrange.cs +++ b/GameServer/commands/playercommands/gtrange.cs @@ -36,7 +36,7 @@ public void OnCommand(GameClient client, string[] args) if (client.Player.GroundTargetPosition != Position.Nowhere) { - var range = (int)client.Player.Location.DistanceTo(client.Player.GroundTargetPosition); + var range = (int)client.Player.Coordinate.DistanceTo(client.Player.GroundTargetPosition); client.Out.SendMessage(LanguageMgr.GetTranslation(client, "Scripts.Players.Gtrange.Range", range), eChatType.CT_System, eChatLoc.CL_SystemWindow); } else diff --git a/GameServer/commands/playercommands/where.cs b/GameServer/commands/playercommands/where.cs index 01cc4f8923..affd70582c 100644 --- a/GameServer/commands/playercommands/where.cs +++ b/GameServer/commands/playercommands/where.cs @@ -47,7 +47,7 @@ public void OnCommand(GameClient client, string[] args) return; } GameNPC npc = npcs[0]; - var orientation = targetnpc.Location.GetOrientationTo(npc.Location); + var orientation = targetnpc.Coordinate.GetOrientationTo(npc.Coordinate); string directionstring = LanguageMgr.GetCardinalDirection(client.Account.Language, orientation); targetnpc.SayTo(client.Player, eChatLoc.CL_SystemWindow, LanguageMgr.GetTranslation(client, "Scripts.Players.Where.Found", npc.Name, directionstring)); targetnpc.TurnTo(npc, 10000); diff --git a/GameServer/commands/playercommands/yell.cs b/GameServer/commands/playercommands/yell.cs index b9230fe737..cc2e51437a 100644 --- a/GameServer/commands/playercommands/yell.cs +++ b/GameServer/commands/playercommands/yell.cs @@ -50,7 +50,7 @@ public void OnCommand(GameClient client, string[] args) { if (player != client.Player) { - var directionToTarget = player.Location.GetOrientationTo(client.Player.Location); + var directionToTarget = player.Coordinate.GetOrientationTo(client.Player.Coordinate); var cardinalDirection = LanguageMgr.GetCardinalDirection(player.Client.Account.Language, directionToTarget); player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Players.Yell.FromDirection", client.Player.Name, cardinalDirection), eChatType.CT_Help, eChatLoc.CL_SystemWindow); } diff --git a/GameServer/gameobjects/CustomNPC/GameBoatStableMaster.cs b/GameServer/gameobjects/CustomNPC/GameBoatStableMaster.cs index b6474c59a5..aa693da446 100644 --- a/GameServer/gameobjects/CustomNPC/GameBoatStableMaster.cs +++ b/GameServer/gameobjects/CustomNPC/GameBoatStableMaster.cs @@ -131,7 +131,7 @@ public override bool ReceiveItem(GameLiving source, InventoryItem item) String destination = item.Name.Substring(LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE, "GameStableMaster.ReceiveItem.TicketTo").Length); PathPoint path = MovementMgr.LoadPath(item.Id_nb); //PathPoint path = MovementMgr.Instance.LoadPath(this.Name + "=>" + destination); - if ((path != null) && ((Math.Abs(path.Coordinate.X - Location.X)) < 500) && ((Math.Abs(path.Coordinate.Y - Location.Y)) < 500)) + if ((path != null) && ((Math.Abs(path.Coordinate.X - Coordinate.X)) < 500) && ((Math.Abs(path.Coordinate.Y - Coordinate.Y)) < 500)) { player.Inventory.RemoveCountFromStack(item, 1); InventoryLogging.LogInventoryAction(player, this, eInventoryActionType.Merchant, item.Template); diff --git a/GameServer/gameobjects/CustomNPC/GameStableMaster.cs b/GameServer/gameobjects/CustomNPC/GameStableMaster.cs index 02b16cd980..3f41b53fbf 100644 --- a/GameServer/gameobjects/CustomNPC/GameStableMaster.cs +++ b/GameServer/gameobjects/CustomNPC/GameStableMaster.cs @@ -130,7 +130,7 @@ public override bool ReceiveItem(GameLiving source, InventoryItem item) { PathPoint path = MovementMgr.LoadPath(item.Id_nb); - if ((path != null) && ((Math.Abs(path.Coordinate.X - Location.X)) < 500) && ((Math.Abs(path.Coordinate.Y - Location.Y)) < 500)) + if ((path != null) && ((Math.Abs(path.Coordinate.X - Coordinate.X)) < 500) && ((Math.Abs(path.Coordinate.Y - Coordinate.Y)) < 500)) { player.Inventory.RemoveCountFromStack(item, 1); InventoryLogging.LogInventoryAction(player, this, eInventoryActionType.Merchant, item.Template); diff --git a/GameServer/gameobjects/CustomNPC/Recharger.cs b/GameServer/gameobjects/CustomNPC/Recharger.cs index 9f41781498..97fc928188 100644 --- a/GameServer/gameobjects/CustomNPC/Recharger.cs +++ b/GameServer/gameobjects/CustomNPC/Recharger.cs @@ -54,7 +54,7 @@ public override bool Interact(GamePlayer player) if (!base.Interact(player)) return false; - TurnTo(player.Location); + TurnTo(player.Coordinate); SayTo(player, eChatLoc.CL_ChatWindow, LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Recharger.Interact")); return true; } diff --git a/GameServer/gameobjects/Dragons/Cuuldurach.cs b/GameServer/gameobjects/Dragons/Cuuldurach.cs index 6a6835e790..f0ead7a9cf 100644 --- a/GameServer/gameobjects/Dragons/Cuuldurach.cs +++ b/GameServer/gameobjects/Dragons/Cuuldurach.cs @@ -59,9 +59,9 @@ public override bool CheckAddSpawns() for (int glimmer = 1; glimmer <= 10; ++glimmer) { isMessenger = Util.Chance(25); - var spawnLocation = Location + Vector.Create(x: Util.Random(300, 600), y: Util.Random(300, 600)); + var spawnCoordinate = Coordinate + Vector.Create(x: Util.Random(300, 600), y: Util.Random(300, 600)); glimmerSpawn = SpawnTimedAdd((isMessenger) ? 620 : 621+Util.Random(2), - (isMessenger) ? Util.Random(47, 53) : Util.Random(57, 63), spawnLocation, 60, isMessenger); + (isMessenger) ? Util.Random(47, 53) : Util.Random(57, 63), spawnCoordinate, 60, isMessenger); // We got a messenger, tell it who its master is and which exit // to run to. @@ -113,7 +113,7 @@ public override void OnRetrieverArrived(GameNPC sender) // Spawn nasty adds. if (m_messengerList.Contains(sender)) - SpawnGlimmers(Util.Random(7, 10), sender.Location); + SpawnGlimmers(Util.Random(7, 10), sender.Coordinate); } /// @@ -121,13 +121,13 @@ public override void OnRetrieverArrived(GameNPC sender) /// retriever has reported back from, then make these spawns aggro the /// raid inside the lair. /// - private void SpawnGlimmers(int numAdds, Coordinate location) + private void SpawnGlimmers(int numAdds, Coordinate coordinate) { GameNPC glimmer; for (int add = 0; add < numAdds; ++add) { - var randomSpawnLocation = location + Vector.Create(x: Util.Random(250), y: Util.Random(250)); - glimmer = SpawnTimedAdd(624+Util.Random(2), Util.Random(62, 68), randomSpawnLocation, 120, false); + var randomSpawnCoordinate = coordinate + Vector.Create(x: Util.Random(250), y: Util.Random(250)); + glimmer = SpawnTimedAdd(624+Util.Random(2), Util.Random(62, 68), randomSpawnCoordinate, 120, false); if (glimmer != null && glimmer.Brain is StandardMobBrain && this.Brain is DragonBrain) { diff --git a/GameServer/gameobjects/Dragons/GameDragon.cs b/GameServer/gameobjects/Dragons/GameDragon.cs index 9f2ff4d5be..bd27d48729 100644 --- a/GameServer/gameobjects/Dragons/GameDragon.cs +++ b/GameServer/gameobjects/Dragons/GameDragon.cs @@ -94,7 +94,7 @@ public override void LoadFromDatabase(DataObject obj) String[] dragonName = Name.Split(new char[] { ' ' }); WorldMgr.GetRegion(CurrentRegionID).AddArea(new Area.Circle(String.Format("{0}'s Lair", dragonName[0]), - Location, LairRadius + 200)); + Coordinate, LairRadius + 200)); } public override bool HasAbility(string keyName) @@ -375,7 +375,7 @@ public virtual bool CheckAddSpawns() private INpcTemplate m_addTemplate; - protected GameNPC SpawnTimedAdd(int templateID, int level, Coordinate location, int uptime, bool isRetriever) + protected GameNPC SpawnTimedAdd(int templateID, int level, Coordinate coordinate, int uptime, bool isRetriever) { GameNPC add = null; @@ -398,7 +398,7 @@ protected GameNPC SpawnTimedAdd(int templateID, int level, Coordinate location, add.SetOwnBrain(new RetrieverMobBrain()); } add.Realm = 0; - add.Position = Position.Create(CurrentRegion.ID, location, Angle.Heading(Util.Random(0, 4095))); + add.Position = Position.Create(CurrentRegion.ID, coordinate, Angle.Heading(Util.Random(0, 4095))); add.CurrentSpeed = 0; add.Level = (byte)level; add.RespawnInterval = -1; diff --git a/GameServer/gameobjects/Dragons/Gjalpinulva.cs b/GameServer/gameobjects/Dragons/Gjalpinulva.cs index 9765ade8b5..51b4af2d2c 100644 --- a/GameServer/gameobjects/Dragons/Gjalpinulva.cs +++ b/GameServer/gameobjects/Dragons/Gjalpinulva.cs @@ -61,8 +61,8 @@ public override bool CheckAddSpawns() for (int dog = 1; dog <= 10; ++dog) { isRetriever = Util.Chance(25); - var spawnLocation = Location + Vector.Create(x: Util.Random(300, 600), y: Util.Random(300, 600)); - dogSpawn = SpawnTimedAdd((isRetriever) ? 610 : 611, (isRetriever) ? Util.Random(47, 53) : 37, spawnLocation, 60, isRetriever); + var spawnCoordinate = Coordinate + Vector.Create(x: Util.Random(300, 600), y: Util.Random(300, 600)); + dogSpawn = SpawnTimedAdd((isRetriever) ? 610 : 611, (isRetriever) ? Util.Random(47, 53) : 37, spawnCoordinate, 60, isRetriever); // We got a retriever, tell it who its master is and which exit // to run to. @@ -114,7 +114,7 @@ public override void OnRetrieverArrived(GameNPC sender) // Spawn nasty adds. if (m_retrieverList.Contains(sender)) - SpawnDrakulvs(Util.Random(7, 10), sender.Location); + SpawnDrakulvs(Util.Random(7, 10), sender.Coordinate); } /// @@ -125,15 +125,15 @@ public override void OnRetrieverArrived(GameNPC sender) /// /// /// - private void SpawnDrakulvs(int numAdds, Coordinate location) + private void SpawnDrakulvs(int numAdds, Coordinate coordinate) { GameNPC drakulv; bool isDisciple = false; for (int add = 0; add < numAdds; ++add) { isDisciple = Util.Chance(25); - var randomLocation = location + Vector.Create(x: Util.Random(250), y: Util.Random(250)); - drakulv = SpawnTimedAdd((isDisciple) ? 613 : 612, Util.Random(62, 68), randomLocation, 120, false); + var randomCoordinate = coordinate + Vector.Create(x: Util.Random(250), y: Util.Random(250)); + drakulv = SpawnTimedAdd((isDisciple) ? 613 : 612, Util.Random(62, 68), randomCoordinate, 120, false); if (drakulv != null && drakulv.Brain is StandardMobBrain && this.Brain is DragonBrain) { diff --git a/GameServer/gameobjects/Dragons/Golestandt.cs b/GameServer/gameobjects/Dragons/Golestandt.cs index 4438852ef2..8ede1590bd 100644 --- a/GameServer/gameobjects/Dragons/Golestandt.cs +++ b/GameServer/gameobjects/Dragons/Golestandt.cs @@ -50,8 +50,8 @@ public override bool CheckAddSpawns() int numAdds = Math.Max(1, PlayersInLair / 2); for (int add = 1; add <= numAdds; ++add) { - var spawnLocation = Location + Vector.Create(x: Util.Random(300, 600), y: Util.Random(300, 600)); - SpawnTimedAdd(600, Util.Random(57, 60), spawnLocation, 30, false); // granite giant pounder lvl 57-60 + var spawnCoordinate = Coordinate + Vector.Create(x: Util.Random(300, 600), y: Util.Random(300, 600)); + SpawnTimedAdd(600, Util.Random(57, 60), spawnCoordinate, 30, false); // granite giant pounder lvl 57-60 } return true; } diff --git a/GameServer/gameobjects/GameDoor.cs b/GameServer/gameobjects/GameDoor.cs index bd033edb4b..7e4195200a 100644 --- a/GameServer/gameobjects/GameDoor.cs +++ b/GameServer/gameobjects/GameDoor.cs @@ -246,7 +246,7 @@ public virtual void Close(GameLiving closer = null) /// public virtual void NPCManipulateDoorRequest(GameNPC npc, bool open) { - npc.TurnTo(Location); + npc.TurnTo(Coordinate); if (open && m_state != eDoorState.Open) this.Open(); else if (!open && m_state != eDoorState.Closed) diff --git a/GameServer/gameobjects/GameHouseVault.cs b/GameServer/gameobjects/GameHouseVault.cs index f7300b588a..8970f353d4 100644 --- a/GameServer/gameobjects/GameHouseVault.cs +++ b/GameServer/gameobjects/GameHouseVault.cs @@ -113,12 +113,12 @@ public bool Attach(House house, DBHouseHookpointItem hookedItem) _hookedItem = hookedItem; - var location = house.GetHookPointLocation(hookedItem.HookpointID); - if (location == Coordinate.Nowhere) return false; + var coordinate = house.GetHookPointCoordinate(hookedItem.HookpointID); + if (coordinate == Coordinate.Nowhere) return false; CurrentHouse = house; InHouse = true; - Position = Position.Create(house.RegionID, location, hookedItem.Heading); + Position = Position.Create(house.RegionID, coordinate, hookedItem.Heading); AddToWorld(); return true; diff --git a/GameServer/gameobjects/GameLiving.cs b/GameServer/gameobjects/GameLiving.cs index 74c7a56f68..9a9811c1c2 100644 --- a/GameServer/gameobjects/GameLiving.cs +++ b/GameServer/gameobjects/GameLiving.cs @@ -1964,7 +1964,7 @@ protected virtual AttackData MakeAttack(GameObject target, InventoryItem weapon, bool preCheck = false; if (ad.Target is GamePlayer) //only start if we are behind the player { - var angle = ad.Target.GetAngleTo(ad.Attacker.Location); + var angle = ad.Target.GetAngleTo(ad.Attacker.Coordinate); if (angle.InDegrees >= 150 && angle.InDegrees < 210) preCheck = true; } else preCheck = true; @@ -5663,8 +5663,8 @@ public virtual GameObject TargetObject } } - public virtual void TurnTo(Coordinate location, bool sendUpdate = true) - => Orientation = Location.GetOrientationTo(location); + public virtual void TurnTo(Coordinate coordinate, bool sendUpdate = true) + => Orientation = Coordinate.GetOrientationTo(coordinate); public virtual bool IsSitting { @@ -5672,11 +5672,11 @@ public virtual bool IsSitting set { } } - [Obsolete("Use GroundTargetLocation instead!")] + [Obsolete("Use GroundTargetPosition instead!")] public virtual Point3D GroundTarget => GroundTargetPosition.Coordinate.ToPoint3D(); - [Obsolete("Use GroundTargetLocation_set instead!")] + [Obsolete("Use GroundTargetPosition_set instead!")] public virtual void SetGroundTarget(int groundX, int groundY, int groundZ) => GroundTargetPosition = Position.Create(Position.RegionID, groundX, groundY, groundZ); diff --git a/GameServer/gameobjects/GameNPC.cs b/GameServer/gameobjects/GameNPC.cs index c2ed4dd0e4..7d1aa034d8 100644 --- a/GameServer/gameobjects/GameNPC.cs +++ b/GameServer/gameobjects/GameNPC.cs @@ -871,7 +871,7 @@ public bool IsOutOfTetherRange { if (TetherRange > 0) { - if (Location.DistanceTo(SpawnPosition) <= TetherRange) + if (Coordinate.DistanceTo(SpawnPosition) <= TetherRange) return false; else return true; @@ -971,16 +971,16 @@ public override GameObject TargetObject } public bool IsAtTargetLocation - => Motion.Destination.Equals(Location); + => Motion.Destination.Equals(Coordinate); - public override void TurnTo(Coordinate location, bool sendUpdate = true) + public override void TurnTo(Coordinate coordinate, bool sendUpdate = true) { if (IsStunned || IsMezzed) return; - Notify(GameNPCEvent.TurnTo, this, new TurnToEventArgs(location.X, location.Y)); + Notify(GameNPCEvent.TurnTo, this, new TurnToEventArgs(coordinate.X, coordinate.Y)); - if (sendUpdate) Orientation = Location.GetOrientationTo(location); - else base.Orientation = Location.GetOrientationTo(location); + if (sendUpdate) Orientation = Coordinate.GetOrientationTo(coordinate); + else base.Orientation = Coordinate.GetOrientationTo(coordinate); } [Obsolete("Use TurnTo(Coordinate[,bool]) instead.")] @@ -1025,7 +1025,7 @@ public virtual void TurnTo(GameObject target, bool sendUpdate) if (target == null || target.CurrentRegion != CurrentRegion) return; - TurnTo(target.Location, sendUpdate); + TurnTo(target.Coordinate, sendUpdate); } /// @@ -1075,7 +1075,7 @@ public RestoreHeadingAction(GameNPC actionSource) : base(actionSource) { oldOrientation = actionSource.Orientation; - m_oldPosition = actionSource.Location; + m_oldPosition = actionSource.Coordinate; } protected override void OnTick() @@ -1156,7 +1156,7 @@ public virtual void CancelWalkToTimer() [Obsolete("This is going to be removed.")] public virtual int GetTicksToArriveAt(IPoint3D target, int speed) { - return (int)Location.DistanceTo(target.ToCoordinate()) * 1000 / speed; + return (int)Coordinate.DistanceTo(target.ToCoordinate()) * 1000 / speed; } /// @@ -1195,7 +1195,7 @@ public virtual void WalkTo(Coordinate destination, short speed) CancelWalkToTimer(); - var notifyDestination = TargetObject != null ? TargetObject.Location : Coordinate.Nowhere; + var notifyDestination = TargetObject != null ? TargetObject.Coordinate : Coordinate.Nowhere; Notify(GameNPCEvent.WalkTo, this, new WalkToEventArgs(notifyDestination, speed)); StartArriveAtTargetAction((int)(Motion.RemainingDistance * 1000 / speed)); @@ -1455,7 +1455,7 @@ protected virtual int FollowTimerCallback(RegionTimer callingTimer) } //Calculate the difference between our position and the players position - var diffVec = followTarget.Location - Location; + var diffVec = followTarget.Coordinate - Coordinate; var distance = diffVec.Length; //if distance is greater then the max follow distance, stop following and return home @@ -1491,10 +1491,10 @@ protected virtual int FollowTimerCallback(RegionTimer callingTimer) } //If we're part of a formation, we can get out early. - var formationLocation = brain.GetFormationLocation(followTarget.Location); - if (formationLocation != Coordinate.Nowhere) + var formationCoordinate = brain.GetFormationCoordinate(followTarget.Coordinate); + if (formationCoordinate != Coordinate.Nowhere) { - WalkTo(formationLocation, MaxSpeed); + WalkTo(formationCoordinate, MaxSpeed); return ServerProperties.Properties.GAMENPC_FOLLOWCHECK_TIME; } } @@ -1526,14 +1526,14 @@ protected virtual int FollowTimerCallback(RegionTimer callingTimer) //Subtract the offset from the target's position to get //our target position - var destination = followTarget.Location - followOffset; + var destination = followTarget.Coordinate - followOffset; if (InCombat || Brain is BomberBrain) { PathTo(destination, MaxSpeed); } else { - var speed = (short)Location.DistanceTo(destination, ignoreZ: true); + var speed = (short)Coordinate.DistanceTo(destination, ignoreZ: true); PathTo(destination, speed); } return ServerProperties.Properties.GAMENPC_FOLLOWCHECK_TIME; @@ -1612,7 +1612,7 @@ public void MoveOnPath(short speed) PathingNormalSpeed = speed; - if (Location.DistanceTo(CurrentWayPoint.Coordinate) < 100) + if (Coordinate.DistanceTo(CurrentWayPoint.Coordinate) < 100) { // reaching a waypoint can start an ambient sentence FireAmbientSentence(eAmbientTrigger.moving); @@ -5379,7 +5379,7 @@ public void FireAmbientSentence(eAmbientTrigger trigger, GameLiving living = nul // broadcasted , yelled or talked ? if (chosen.Voice.StartsWith("b")) { - foreach (GamePlayer player in CurrentRegion.GetPlayersInRadius(Location, 25000, false, false)) + foreach (GamePlayer player in CurrentRegion.GetPlayersInRadius(Coordinate, 25000, false, false)) { player.Out.SendMessage(text, eChatType.CT_Broadcast, eChatLoc.CL_ChatWindow); } diff --git a/GameServer/gameobjects/GameObject.cs b/GameServer/gameobjects/GameObject.cs index 4a3a82764c..2ebbc3eb4c 100644 --- a/GameServer/gameobjects/GameObject.cs +++ b/GameServer/gameobjects/GameObject.cs @@ -142,7 +142,7 @@ public Zone CurrentZone { if (CurrentRegion != null) { - return CurrentRegion.GetZone(Location); + return CurrentRegion.GetZone(Coordinate); } return null; } @@ -150,7 +150,7 @@ public Zone CurrentZone public virtual Position Position { get; set; } - public Coordinate Location => Position.Coordinate; + public Coordinate Coordinate => Position.Coordinate; [Obsolete("Use .Position.X instead!")] public virtual int X @@ -197,7 +197,7 @@ public float GetAngle(IPoint2D point) => GetAngleTo(Coordinate.Create(point.X, point.Y)).InDegrees; public Angle GetAngleTo(Coordinate coordinate) - => Location.GetOrientationTo(coordinate) - Orientation; + => Coordinate.GetOrientationTo(coordinate) - Orientation; public int GetDistanceTo(GameObject obj, double zfactor = 1) => GetDistanceTo(obj.Position, zfactor); @@ -221,7 +221,7 @@ public virtual int GetDistanceTo(Position position, double zfactor) { if (Position.RegionID != position.RegionID) return int.MaxValue; - var offset = position.Coordinate - Location; + var offset = position.Coordinate - Coordinate; var dz = offset.Z * zfactor; return (int)(offset.Length2D + Math.Sqrt(dz*dz)); @@ -234,8 +234,8 @@ public bool IsWithinRadius(GameObject obj, int radius, bool ignoreZ = false) if (this.CurrentRegionID != obj.CurrentRegionID) return false; double distance; - if (ignoreZ) distance = Location.DistanceTo(obj.Location, ignoreZ: true); - else distance = Location.DistanceTo(obj.Location); + if (ignoreZ) distance = Coordinate.DistanceTo(obj.Coordinate, ignoreZ: true); + else distance = Coordinate.DistanceTo(obj.Coordinate); return distance < radius; } @@ -252,7 +252,7 @@ public virtual bool IsObjectInFront(GameObject target, double viewangle, bool ra { if (target == null) return false; - var angle = GetAngleTo(target.Location); + var angle = GetAngleTo(target.Coordinate); var isInFront = angle.InDegrees >= 360 - viewangle / 2 || angle.InDegrees < viewangle / 2; if (isInFront) return true; // if target is closer than 32 units it is considered always in view @@ -305,10 +305,10 @@ public virtual bool IsUnderwater { foreach(var area in hardcodedUnderWaterAreas) { - if(Location.X > area.BottomLeft.X - && Location.Y > area.BottomLeft.Y - && Location.X < area.TopRight.X - && Location.Y > area.TopRight.Y) + if(Coordinate.X > area.BottomLeft.X + && Coordinate.Y > area.BottomLeft.Y + && Coordinate.X < area.TopRight.X + && Coordinate.Y > area.TopRight.Y) { return false; } @@ -327,7 +327,7 @@ public virtual IList CurrentAreas get { if (CurrentZone != null) - return CurrentZone.GetAreasOfSpot(Location); + return CurrentZone.GetAreasOfSpot(Coordinate); return new List(); } set { } @@ -1185,7 +1185,7 @@ public IEnumerable GetPlayersInRadius(bool useCache, ushort radiusToCheck, bool } else { - return CurrentRegion.GetPlayersInRadius(Location, radiusToCheck, withDistance, ignoreZ); + return CurrentRegion.GetPlayersInRadius(Coordinate, radiusToCheck, withDistance, ignoreZ); } } return new Region.EmptyEnumerator(); @@ -1359,7 +1359,7 @@ public IEnumerable GetNPCsInRadius(bool useCache, ushort radiusToCheck, bool wit } else { - IEnumerable result = CurrentRegion.GetNPCsInRadius(Location, radiusToCheck, withDistance, ignoreZ); + IEnumerable result = CurrentRegion.GetNPCsInRadius(Coordinate, radiusToCheck, withDistance, ignoreZ); return result; } } @@ -1402,7 +1402,7 @@ public IEnumerable GetItemsInRadius(ushort radiusToCheck, bool withDistance) } else { - return CurrentRegion.GetItemsInRadius(Location, radiusToCheck, withDistance); + return CurrentRegion.GetItemsInRadius(Coordinate, radiusToCheck, withDistance); } } return new Region.EmptyEnumerator(); @@ -1441,7 +1441,7 @@ public IEnumerable GetDoorsInRadius(ushort radiusToCheck, bool withDistance) } else { - return CurrentRegion.GetDoorsInRadius(Location, radiusToCheck, withDistance); + return CurrentRegion.GetDoorsInRadius(Coordinate, radiusToCheck, withDistance); } } return new Region.EmptyEnumerator(); @@ -1555,7 +1555,7 @@ public override string ToString() .Append(" oid=").Append(ObjectID.ToString()) .Append(" state=").Append(ObjectState.ToString()) .Append(" reg=").Append(reg == null ? "null" : reg.ID.ToString()) - .Append(" loc=").Append(Location) + .Append(" loc=").Append(Coordinate) .ToString(); } @@ -1625,16 +1625,16 @@ public ushort GetHeading(Point2D p) return Position.Coordinate.GetOrientationTo(Coordinate.Create(p.X, p.Y)).InHeading; } - [Obsolete("Use .Location.DistanceTo(Coordinate) instead!")] + [Obsolete("Use .Coordinate.DistanceTo(Coordinate) instead!")] public bool IsWithinRadius(Point3D p, int radius, bool ignoreZ = false) { - return Location.DistanceTo(Coordinate.Create(p.X, p.Y, p.Z)) <= radius; + return Coordinate.DistanceTo(Coordinate.Create(p.X, p.Y, p.Z)) <= radius; } [Obsolete("Use Vector addition instead!")] public Point2D GetPointFromHeading(ushort heading, int distance) { - return (Location + Vector.Create(Angle.Heading(heading), distance)).ToPoint3D(); + return (Coordinate + Vector.Create(Angle.Heading(heading), distance)).ToPoint3D(); } public int GetDistance(GameObject obj2, double zFactor = 1) diff --git a/GameServer/gameobjects/GamePlayer.cs b/GameServer/gameobjects/GamePlayer.cs index c7e22daf4c..a07bf64cc5 100644 --- a/GameServer/gameobjects/GamePlayer.cs +++ b/GameServer/gameobjects/GamePlayer.cs @@ -1499,7 +1499,7 @@ public virtual void Release(eReleaseType releaseCommand, bool forced) //if we aren't releasing anywhere, release to the border keeps if (releasePosition.Coordinate == Coordinate.Zero) { - releasePosition = GameServer.KeepManager.GetBorderKeepLocation(((byte)Realm * 2) / 1); + releasePosition = GameServer.KeepManager.GetBorderKeepPosition(((byte)Realm * 2) / 1); } break; } @@ -1577,17 +1577,17 @@ public virtual void Release(eReleaseType releaseCommand, bool forced) { case eRealm.Albion: { - releasePosition = GameServer.KeepManager.GetBorderKeepLocation(1); + releasePosition = GameServer.KeepManager.GetBorderKeepPosition(1); break; } case eRealm.Midgard: { - releasePosition = GameServer.KeepManager.GetBorderKeepLocation(3); + releasePosition = GameServer.KeepManager.GetBorderKeepPosition(3); break; } case eRealm.Hibernia: { - releasePosition = GameServer.KeepManager.GetBorderKeepLocation(5); + releasePosition = GameServer.KeepManager.GetBorderKeepPosition(5); break; } } @@ -9980,7 +9980,7 @@ public override bool MoveTo(Position position) Out.SendPlayerJump(false); // are we jumping far enough to force a complete refresh? - if (Location.DistanceTo(positionBeforePort) > WorldMgr.REFRESH_DISTANCE) + if (Coordinate.DistanceTo(positionBeforePort) > WorldMgr.REFRESH_DISTANCE) { RefreshWorld(); } @@ -10013,7 +10013,7 @@ public override bool MoveTo(Position position) if (petBody.ControlledNpcList != null) foreach (IControlledBrain icb in petBody.ControlledNpcList) if (icb != null && icb.Body is GameNPC petBody2 - && petBody2.Location.DistanceTo(positionBeforePort) < 500) + && petBody2.Coordinate.DistanceTo(positionBeforePort) < 500) petBody2.MoveWithoutRemovingFromWorld(destination, false); } } @@ -10329,7 +10329,7 @@ public Zone LastPositionUpdateZone set { m_lastPositionUpdateZone = value; } } - public Coordinate LastUpdateLocation => Motion.Start.Coordinate; + public Coordinate LastUpdateCoordinate => Motion.Start.Coordinate; /// /// Holds the players max Z for fall damage @@ -12296,10 +12296,10 @@ public override void LoadFromDatabase(DataObject obj) //important, use CurrentRegion property //instead because it sets the Region too CurrentRegionID = (ushort)DBCharacter.Region; - if (CurrentRegion == null || CurrentRegion.GetZone(Location) == null) + if (CurrentRegion == null || CurrentRegion.GetZone(Coordinate) == null) { log.WarnFormat("Invalid region/zone on char load ({0}): x={1} y={2} z={3} reg={4}; moving to bind point." - , DBCharacter.Name, Location.X, Location.Y, Location.Z, DBCharacter.Region); + , DBCharacter.Name, Coordinate.X, Coordinate.Y, Coordinate.Z, DBCharacter.Region); Position = DBCharacter.GetBindPosition(); } @@ -12854,7 +12854,7 @@ protected override void OnTick() fieldOfListen += (npc.Level - player.Level) * 3; } - var angle = npc.GetAngleTo(player.Location); + var angle = npc.GetAngleTo(player.Coordinate); //player in front fieldOfView /= 2.0; diff --git a/GameServer/gameobjects/GameSiegeWeapon.cs b/GameServer/gameobjects/GameSiegeWeapon.cs index e15684c801..b817e0bafe 100644 --- a/GameServer/gameobjects/GameSiegeWeapon.cs +++ b/GameServer/gameobjects/GameSiegeWeapon.cs @@ -183,7 +183,7 @@ public string ItemId set { m_itemId = value; } } - public Coordinate AimLocation + public Coordinate AimCoordinate { get { @@ -272,7 +272,7 @@ public void Move() if (!CanUse()) return; if (!m_enableToMove) return; if (Owner == null || Owner.GroundTargetPosition == Position.Nowhere) return; - if (Location.DistanceTo(Owner.GroundTargetPosition) > 1000) + if (Coordinate.DistanceTo(Owner.GroundTargetPosition) > 1000) { Owner.Out.SendMessage("Ground target is too far away to move to!", eChatType.CT_System, eChatLoc.CL_SystemWindow); diff --git a/GameServer/gameutils/GamePlayerUtils.cs b/GameServer/gameutils/GamePlayerUtils.cs index b241aafa45..552be2f502 100644 --- a/GameServer/gameutils/GamePlayerUtils.cs +++ b/GameServer/gameutils/GamePlayerUtils.cs @@ -40,15 +40,15 @@ public static string GetSpotDescription(this Region reg, IPoint3D spot) [Obsolete("This is going to be removed.")] public static string GetSpotDescription(this Region reg, int x, int y, int z) { - var location = Coordinate.Create(x,y,z); + var coordinate = Coordinate.Create(x,y,z); if (reg != null) { - var area = reg.GetAreasOfSpot(location).OfType().FirstOrDefault(a => a.DisplayMessage && !string.IsNullOrEmpty(a.Description)); + var area = reg.GetAreasOfSpot(coordinate).OfType().FirstOrDefault(a => a.DisplayMessage && !string.IsNullOrEmpty(a.Description)); if (area != null) return area.Description; - var zone = reg.GetZone(location); + var zone = reg.GetZone(coordinate); if (zone != null) return zone.Description; @@ -67,11 +67,11 @@ public static string GetTranslatedSpotDescription(this Region reg, GameClient cl public static string GetTranslatedSpotDescription(this Region reg, GameClient client, int x, int y, int z) => GetTranslatedSpotDescription(reg, client, Coordinate.Create(x, y, z)); - public static string GetTranslatedSpotDescription(this Region reg, GameClient client, Coordinate location) + public static string GetTranslatedSpotDescription(this Region reg, GameClient client, Coordinate coordinate) { if (reg != null) { - var area = reg.GetAreasOfSpot(location).OfType().FirstOrDefault(a => a.DisplayMessage); + var area = reg.GetAreasOfSpot(coordinate).OfType().FirstOrDefault(a => a.DisplayMessage); // Try Translate Area First if (area != null) @@ -84,7 +84,7 @@ public static string GetTranslatedSpotDescription(this Region reg, GameClient cl return area.Description; } - var zone = reg.GetZone(location); + var zone = reg.GetZone(coordinate); // Try Translate Zone if (zone != null) diff --git a/GameServer/gameutils/IDoor.cs b/GameServer/gameutils/IDoor.cs index 7aa6667f8e..f35a3dcb32 100644 --- a/GameServer/gameutils/IDoor.cs +++ b/GameServer/gameutils/IDoor.cs @@ -32,7 +32,7 @@ public interface IDoor { string Name {get;} uint Flag {get;} - Coordinate Location { get; } + Coordinate Coordinate { get; } Angle Orientation { get; } ushort Heading {get;} ushort ZoneID { get; } diff --git a/GameServer/gameutils/InventoryLogging.cs b/GameServer/gameutils/InventoryLogging.cs index 39ead1c2ad..be09462aeb 100644 --- a/GameServer/gameutils/InventoryLogging.cs +++ b/GameServer/gameutils/InventoryLogging.cs @@ -53,7 +53,7 @@ public static class InventoryLogging }; public static Func GetGameObjectString = obj => - obj == null ? "(null)" : ("(" + obj.Name + ";" + obj.GetType() + ";" + obj.Location + ";" + obj.Position.RegionID + ")"); + obj == null ? "(null)" : ("(" + obj.Name + ";" + obj.GetType() + ";" + obj.Coordinate + ";" + obj.Position.RegionID + ")"); public static Func GetItemString = (item, count) => item == null ? "(null)" : ("(" + count + ";" + item.Name + ";" + item.Id_nb + ")"); diff --git a/GameServer/gameutils/PathPoint.cs b/GameServer/gameutils/PathPoint.cs index 9d51ff887e..057c24bcba 100644 --- a/GameServer/gameutils/PathPoint.cs +++ b/GameServer/gameutils/PathPoint.cs @@ -36,9 +36,9 @@ public class PathPoint [Obsolete("This is going to be removed.")] public PathPoint(PathPoint pp) : this(pp.Coordinate, pp.MaxSpeed, pp.Type) { } - public PathPoint(Coordinate location, int maxspeed, ePathType type) + public PathPoint(Coordinate coordinate, int maxspeed, ePathType type) { - Coordinate = location; + Coordinate = coordinate; MaxSpeed = maxspeed; Type = type; } diff --git a/GameServer/housing/House.cs b/GameServer/housing/House.cs index 71970c6f8a..bb32287477 100644 --- a/GameServer/housing/House.cs +++ b/GameServer/housing/House.cs @@ -635,15 +635,15 @@ public static void LoadHookpointOffsets() } } - [Obsolete("Use GetHookPointLocation(uint) instead! (Note: capitalization is different as well as return type)")] + [Obsolete("Use GetHookPointCoordinate(uint) instead!")] public Point3D GetHookpointLocation(uint n) { - var loc = GetHookPointLocation(n); + var loc = GetHookPointCoordinate(n); if(loc == Coordinate.Nowhere) return null; else return loc.ToPoint3D(); } - public Coordinate GetHookPointLocation(uint number) + public Coordinate GetHookPointCoordinate(uint number) { if (number > HousingConstants.MaxHookpointLocations) return Coordinate.Nowhere; @@ -702,8 +702,8 @@ public bool FillHookpoint(uint position, string templateID, ushort heading, int return false; //get location from slot - var location = GetHookPointLocation(position); - if (location == Coordinate.Nowhere) return false; + var coordinate = GetHookPointCoordinate(position); + if (coordinate == Coordinate.Nowhere) return false; GameObject hookpointObject = null; @@ -718,7 +718,7 @@ public bool FillHookpoint(uint position, string templateID, ushort heading, int } case eObjectType.HouseNPC: { - hookpointObject = GameServer.ServerRules.PlaceHousingNPC(this, item, location, GetHookpointHeading(position)); + hookpointObject = GameServer.ServerRules.PlaceHousingNPC(this, item, coordinate, GetHookpointHeading(position)); break; } case eObjectType.HouseBindstone: @@ -727,7 +727,7 @@ public bool FillHookpoint(uint position, string templateID, ushort heading, int hookpointObject.CurrentHouse = this; hookpointObject.InHouse = true; hookpointObject.OwnerID = templateID; - hookpointObject.Position = Position.Create(RegionID, location, heading); + hookpointObject.Position = Position.Create(RegionID, coordinate, heading); hookpointObject.Name = item.Name; hookpointObject.Model = (ushort) item.Model; hookpointObject.AddToWorld(); @@ -737,7 +737,7 @@ public bool FillHookpoint(uint position, string templateID, ushort heading, int } case eObjectType.HouseInteriorObject: { - hookpointObject = GameServer.ServerRules.PlaceHousingInteriorItem(this, item, location, heading); + hookpointObject = GameServer.ServerRules.PlaceHousingInteriorItem(this, item, coordinate, heading); break; } } @@ -759,7 +759,7 @@ public void EmptyHookpoint(GamePlayer player, GameObject obj, bool addToInventor return; } - int position = GetHookpointPosition(obj.Location); + int position = GetHookpointPosition(obj.Coordinate); if (position < 0) { diff --git a/GameServer/keeps/AbstractGameKeep.cs b/GameServer/keeps/AbstractGameKeep.cs index c164617c0d..13a5d359c5 100644 --- a/GameServer/keeps/AbstractGameKeep.cs +++ b/GameServer/keeps/AbstractGameKeep.cs @@ -1167,7 +1167,7 @@ protected void ResetPlayersOfKeep() foreach (GamePlayer player in component.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE)) { - int d = (int)hookpoint.Position.Coordinate.DistanceTo(player.Location, ignoreZ: true); + int d = (int)hookpoint.Position.Coordinate.DistanceTo(player.Coordinate, ignoreZ: true); if (d > distance) continue; diff --git a/GameServer/keeps/Gameobjects/FrontiersPortalStone.cs b/GameServer/keeps/Gameobjects/FrontiersPortalStone.cs index b3176a2e29..42369bb279 100644 --- a/GameServer/keeps/Gameobjects/FrontiersPortalStone.cs +++ b/GameServer/keeps/Gameobjects/FrontiersPortalStone.cs @@ -131,9 +131,9 @@ public override bool Interact(GamePlayer player) public void GetTeleportLocation(out int x, out int y) { var angle = Orientation + Angle.Heading(Util.Random(- 500, 500)); - var portLocation = Position + Vector.Create(angle, length: Util.Random(50, 150)); - x = portLocation.X; - y = portLocation.Y; + var portPosition = Position + Vector.Create(angle, length: Util.Random(50, 150)); + x = portPosition.X; + y = portPosition.Y; } public class TeleporterEffect : GameNPC diff --git a/GameServer/keeps/IKeepManager.cs b/GameServer/keeps/IKeepManager.cs index 3cfef9cac6..57e5f0b9f6 100644 --- a/GameServer/keeps/IKeepManager.cs +++ b/GameServer/keeps/IKeepManager.cs @@ -81,8 +81,8 @@ public interface IKeepManager bool IsEnemy(GameKeepDoor checker, GamePlayer target); bool IsEnemy(GameKeepComponent checker, GamePlayer target); byte GetHeightFromLevel(byte level); - Position GetBorderKeepLocation(int keepid); - [Obsolete("Use GetBorderKeepLocation(int) instead!")] + Position GetBorderKeepPosition(int keepid); + [Obsolete("Use GetBorderKeepPosition(int) instead!")] void GetBorderKeepLocation(int keepid, out int x, out int y, out int z, out ushort heading); int GetRealmKeepBonusLevel(eRealm realm); int GetRealmTowerBonusLevel(eRealm realm); diff --git a/GameServer/keeps/KeepManager.cs b/GameServer/keeps/KeepManager.cs index 5a0323d709..25c15cc47b 100644 --- a/GameServer/keeps/KeepManager.cs +++ b/GameServer/keeps/KeepManager.cs @@ -679,14 +679,14 @@ public virtual byte GetHeightFromLevel(byte level) public virtual void GetBorderKeepLocation(int keepid, out int x, out int y, out int z, out ushort heading) { - var result = GetBorderKeepLocation(keepid); + var result = GetBorderKeepPosition(keepid); x = result.X; y = result.Y; z = result.Z; heading = result.Orientation.InHeading; } - public virtual Position GetBorderKeepLocation(int keepid) + public virtual Position GetBorderKeepPosition(int keepid) { var newFrontierRegionID = (ushort)163; switch (keepid) diff --git a/GameServer/keeps/Managers/Position Manager.cs b/GameServer/keeps/Managers/Position Manager.cs index 4f0404c349..f6b3a796da 100644 --- a/GameServer/keeps/Managers/Position Manager.cs +++ b/GameServer/keeps/Managers/Position Manager.cs @@ -94,10 +94,10 @@ public static void LoadKeepItemPosition(DBKeepPosition pos, IKeepItem item) item.DbKeepPosition = pos; } - public static Vector SaveXY(GameKeepComponent component, Coordinate keepPointLocation) + public static Vector SaveXY(GameKeepComponent component, Coordinate keepPointCoordinate) { var angle = component.Keep.Orientation + component.RelativeOrientationToKeep; - var vector = keepPointLocation - component.Location; + var vector = keepPointCoordinate - component.Coordinate; return vector.RotatedClockwise(angle - Angle.Degrees(90)); } @@ -141,7 +141,7 @@ public static DBKeepPosition CreatePosition(string templateID, GameKeepComponent pos.ComponentRotation = component.ComponentHeading; pos.TemplateID = templateID; - var keepPositionOffset = SaveXY(component, player.Location); + var keepPositionOffset = SaveXY(component, player.Coordinate); pos.XOff = keepPositionOffset.X; pos.YOff = keepPositionOffset.Y; pos.ZOff = keepPositionOffset.Z; @@ -236,7 +236,7 @@ public static PathPoint LoadPatrolPath(string pathID, GameKeepComponent componen var pathPoint = new PathPoint(dbPathPoint, pathType); var relativeOffset = Vector.Create(pathPoint.Coordinate.X, -pathPoint.Coordinate.Y, pathPoint.Coordinate.Z) .RotatedClockwise(component.Orientation); - pathPoint.Coordinate = component.Location + relativeOffset; + pathPoint.Coordinate = component.Coordinate + relativeOffset; if (first == null) { @@ -323,7 +323,7 @@ public static void CreateDoor(int doorID, GamePlayer player) pos.ComponentRotation = component.ComponentHeading; pos.TemplateID = Guid.NewGuid().ToString(); - var keepPositionOffset = SaveXY(component, player.Location); + var keepPositionOffset = SaveXY(component, player.Coordinate); pos.XOff = keepPositionOffset.X; pos.YOff = keepPositionOffset.Y; pos.ZOff = keepPositionOffset.Z; diff --git a/GameServer/keeps/Relics/GameRelicPad.cs b/GameServer/keeps/Relics/GameRelicPad.cs index 77eef231be..c0ad351a4e 100644 --- a/GameServer/keeps/Relics/GameRelicPad.cs +++ b/GameServer/keeps/Relics/GameRelicPad.cs @@ -224,7 +224,7 @@ public class PadArea : Area.Circle GameRelicPad m_parent; public PadArea(GameRelicPad parentPad) - : base("", parentPad.Location, PAD_AREA_RADIUS) + : base("", parentPad.Coordinate, PAD_AREA_RADIUS) { m_parent = parentPad; } diff --git a/GameServer/packets/Client/168/DoorRequestHandler.cs b/GameServer/packets/Client/168/DoorRequestHandler.cs index 129cd0fb32..d9e75dfbd4 100644 --- a/GameServer/packets/Client/168/DoorRequestHandler.cs +++ b/GameServer/packets/Client/168/DoorRequestHandler.cs @@ -262,7 +262,7 @@ protected override void OnTick() } else { - if (player.Location.DistanceTo(mydoor.Location) < m_radius) + if (player.Coordinate.DistanceTo(mydoor.Coordinate) < m_radius) { if (m_doorState == 0x01) mydoor.Open(player); diff --git a/GameServer/packets/Client/168/HouseEnterLeaveRequestHandler.cs b/GameServer/packets/Client/168/HouseEnterLeaveRequestHandler.cs index f066745a91..87cf00b21d 100644 --- a/GameServer/packets/Client/168/HouseEnterLeaveRequestHandler.cs +++ b/GameServer/packets/Client/168/HouseEnterLeaveRequestHandler.cs @@ -79,7 +79,7 @@ protected override void OnTick() break; case 1: - if (player.Location.DistanceTo(_house.Position) > WorldMgr.VISIBILITY_DISTANCE + if (player.Coordinate.DistanceTo(_house.Position) > WorldMgr.VISIBILITY_DISTANCE || (player.CurrentRegionID != _house.RegionID)) { ChatUtil.SendSystemMessage(player, string.Format("You are too far away to enter house {0}.", _house.HouseNumber)); diff --git a/GameServer/packets/Client/168/HousingPlaceItemHandler.cs b/GameServer/packets/Client/168/HousingPlaceItemHandler.cs index 19ec79a933..0670222c0e 100644 --- a/GameServer/packets/Client/168/HousingPlaceItemHandler.cs +++ b/GameServer/packets/Client/168/HousingPlaceItemHandler.cs @@ -555,7 +555,7 @@ public void HandlePacket(GameClient client, GSPacketIn packet) } // if the hookpoint doesn't exist, prompt player to Log it in the database for us - if (house.GetHookPointLocation((uint)_position) == Coordinate.Nowhere) + if (house.GetHookPointCoordinate((uint)_position) == Coordinate.Nowhere) { client.Out.SendInventorySlotsUpdate(new[] { slot }); @@ -575,7 +575,7 @@ public void HandlePacket(GameClient client, GSPacketIn packet) } } } - else if (house.GetHookPointLocation((uint)_position) != Coordinate.Nowhere) + else if (house.GetHookPointCoordinate((uint)_position) != Coordinate.Nowhere) { var point = new DBHouseHookpointItem { @@ -698,7 +698,7 @@ public void HandlePacket(GameClient client, GSPacketIn packet) } // if hookpoint doesn't exist, prompt player to Log it in the database for us - if (house.GetHookPointLocation((uint)_position) == Coordinate.Nowhere) + if (house.GetHookPointCoordinate((uint)_position) == Coordinate.Nowhere) { client.Out.SendInventorySlotsUpdate(new[] { slot }); @@ -884,7 +884,7 @@ private void LogLocation(GamePlayer player, byte response) if (player.CurrentHouse == null) return; - var offset = player.Location - player.CurrentHouse.Position.Coordinate; + var offset = player.Coordinate - player.CurrentHouse.Position.Coordinate; var a = new HouseHookpointOffset { HouseModel = player.CurrentHouse.Model, diff --git a/GameServer/packets/Client/168/PlayerPositionUpdateHandler.cs b/GameServer/packets/Client/168/PlayerPositionUpdateHandler.cs index 95021047a6..9dde3e33c6 100644 --- a/GameServer/packets/Client/168/PlayerPositionUpdateHandler.cs +++ b/GameServer/packets/Client/168/PlayerPositionUpdateHandler.cs @@ -187,12 +187,12 @@ public void HandlePacket(GameClient client, GSPacketIn packet) if (timediff > 0) { - distance = (int)client.Player.LastUpdateLocation.DistanceTo(newLocation); + distance = (int)client.Player.LastUpdateCoordinate.DistanceTo(newLocation); coordsPerSec = distance * 1000 / timediff; - if (distance < 100 && client.Player.LastUpdateLocation.Z > 0) + if (distance < 100 && client.Player.LastUpdateCoordinate.Z > 0) { - jumpDetect = realZ - client.Player.LastUpdateLocation.Z; + jumpDetect = realZ - client.Player.LastUpdateCoordinate.Z; } } @@ -309,7 +309,7 @@ public void HandlePacket(GameClient client, GSPacketIn packet) client.Player.TempProperties.setProperty(LASTCPSTICK, environmentTick); } - if (client.Player.Location.X != newLocation.X || client.Player.Location.Y != newLocation.Y) + if (client.Player.Coordinate.X != newLocation.X || client.Player.Coordinate.Y != newLocation.Y) { client.Player.TempProperties.setProperty(LASTMOVEMENTTICK, client.Player.CurrentRegion.Time); } @@ -327,7 +327,7 @@ public void HandlePacket(GameClient client, GSPacketIn packet) // Because we may be in an instance we need to do the area check from the current region // rather than relying on the zone which is in the skinned region. - Tolakram - var newAreas = client.Player.CurrentRegion.GetAreasOfZone(newZone, client.Player.Location); + var newAreas = client.Player.CurrentRegion.GetAreasOfZone(newZone, client.Player.Coordinate); // Check for left areas if (oldAreas != null) @@ -598,7 +598,7 @@ public void HandlePacket(GameClient client, GSPacketIn packet) } outpak.WriteShort(content); } - var zoneCoord = client.Player.Location - client.Player.CurrentZone.Offset; + var zoneCoord = client.Player.Coordinate - client.Player.CurrentZone.Offset; outpak.WriteShort((ushort)zoneCoord.Z); outpak.WriteShort((ushort)zoneCoord.X); outpak.WriteShort((ushort)zoneCoord.Y); @@ -863,12 +863,12 @@ private void _HandlePacket1124(GameClient client, GSPacketIn packet) if (timediff > 0) { - distance = (int)client.Player.LastUpdateLocation.DistanceTo(newPosition.Coordinate); + distance = (int)client.Player.LastUpdateCoordinate.DistanceTo(newPosition.Coordinate); coordsPerSec = distance * 1000 / timediff; - if (distance < 100 && client.Player.LastUpdateLocation.Z > 0) + if (distance < 100 && client.Player.LastUpdateCoordinate.Z > 0) { - jumpDetect = (int)newPlayerZ - client.Player.LastUpdateLocation.Z; + jumpDetect = (int)newPlayerZ - client.Player.LastUpdateCoordinate.Z; } } @@ -992,7 +992,7 @@ private void _HandlePacket1124(GameClient client, GSPacketIn packet) // Because we may be in an instance we need to do the area check from the current region // rather than relying on the zone which is in the skinned region. - Tolakram - var newAreas = client.Player.CurrentRegion.GetAreasOfZone(newZone, client.Player.Location); + var newAreas = client.Player.CurrentRegion.GetAreasOfZone(newZone, client.Player.Coordinate); // Check for left areas if (oldAreas != null) diff --git a/GameServer/packets/Client/168/RegionChangeRequestHandler.cs b/GameServer/packets/Client/168/RegionChangeRequestHandler.cs index a43e0a9899..70779edce9 100644 --- a/GameServer/packets/Client/168/RegionChangeRequestHandler.cs +++ b/GameServer/packets/Client/168/RegionChangeRequestHandler.cs @@ -74,8 +74,8 @@ public void HandlePacket(GameClient client, GSPacketIn packet) ChatUtil.SendDebugMessage(client, $"Invalid Jump (ZonePoint table): [{jumpSpotId}]{((zonePoint == null) ? ". Entry missing!" : ". TargetRegion is 0!")}"); zonePoint = new ZonePoint(); zonePoint.Id = jumpSpotId; - string zonePointLocation = $"Region {player.CurrentRegionID} and coordinates ({player.Location})"; - Log.Error($"ZonePoint {jumpSpotId} at {zonePointLocation} on client {client.Version} missing. Either ZonePoint missing or RegionChangeRequestHandler needs to be updated."); + string zonePointToText = $"Region {player.CurrentRegionID} and coordinates ({player.Coordinate})"; + Log.Error($"ZonePoint {jumpSpotId} at {zonePointToText} on client {client.Version} missing. Either ZonePoint missing or RegionChangeRequestHandler needs to be updated."); } if (client.Account.PrivLevel > 1) diff --git a/GameServer/packets/Client/168/warmapshowrequesthandler.cs b/GameServer/packets/Client/168/warmapshowrequesthandler.cs index c1b4b8165c..f1564a4735 100644 --- a/GameServer/packets/Client/168/warmapshowrequesthandler.cs +++ b/GameServer/packets/Client/168/warmapshowrequesthandler.cs @@ -139,7 +139,7 @@ public void HandlePacket(GameClient client, GSPacketIn packet) case 5: //ligen case 6: //cain { - portPosition = GameServer.KeepManager.GetBorderKeepLocation(keepId); + portPosition = GameServer.KeepManager.GetBorderKeepPosition(keepId); break; } default: diff --git a/GameServer/packets/Server/PacketLib1110.cs b/GameServer/packets/Server/PacketLib1110.cs index 3a617ce48d..422174729b 100644 --- a/GameServer/packets/Server/PacketLib1110.cs +++ b/GameServer/packets/Server/PacketLib1110.cs @@ -164,10 +164,10 @@ public override void SendSiegeWeaponAnimation(GameSiegeWeapon siegeWeapon) using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.SiegeWeaponAnimation))) { pak.WriteInt((uint)siegeWeapon.ObjectID); - var aimLocation = siegeWeapon.AimLocation; - pak.WriteInt((uint)aimLocation.X); - pak.WriteInt((uint)aimLocation.Y); - pak.WriteInt((uint)aimLocation.Z); + var aimCoordinate = siegeWeapon.AimCoordinate; + pak.WriteInt((uint)aimCoordinate.X); + pak.WriteInt((uint)aimCoordinate.Y); + pak.WriteInt((uint)aimCoordinate.Z); pak.WriteInt((uint)(siegeWeapon.TargetObject == null ? 0 : siegeWeapon.TargetObject.ObjectID)); pak.WriteShort(siegeWeapon.Effect); pak.WriteShort((ushort)(siegeWeapon.SiegeWeaponTimer.TimeUntilElapsed)); // timer is no longer ( value / 100 ) @@ -188,12 +188,12 @@ public override void SendSiegeWeaponFireAnimation(GameSiegeWeapon siegeWeapon, i return; using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.SiegeWeaponAnimation))) { - var targetLocation = siegeWeapon.TargetObject.Position; - if(targetLocation == Position.Nowhere) targetLocation = siegeWeapon.GroundTargetPosition; + var targetPosition = siegeWeapon.TargetObject.Position; + if(targetPosition == Position.Nowhere) targetPosition = siegeWeapon.GroundTargetPosition; pak.WriteInt((uint) siegeWeapon.ObjectID); - pak.WriteInt((uint) (targetLocation.X)); - pak.WriteInt((uint) (targetLocation.Y)); - pak.WriteInt((uint) (targetLocation.Z + 50)); + pak.WriteInt((uint) (targetPosition.X)); + pak.WriteInt((uint) (targetPosition.Y)); + pak.WriteInt((uint) (targetPosition.Z + 50)); pak.WriteInt((uint) (siegeWeapon.TargetObject == null ? 0 : siegeWeapon.TargetObject.ObjectID)); pak.WriteShort(siegeWeapon.Effect); pak.WriteShort((ushort) (timer)); // timer is no longer ( value / 100 ) diff --git a/GameServer/packets/Server/PacketLib1112.cs b/GameServer/packets/Server/PacketLib1112.cs index fe139bcaa3..7dc35136bb 100644 --- a/GameServer/packets/Server/PacketLib1112.cs +++ b/GameServer/packets/Server/PacketLib1112.cs @@ -610,7 +610,7 @@ public override void SendPlayerForgedPosition(GamePlayer player) pak.WriteShort(content); } - var zoneCoordinate = player.Location - player.CurrentZone.Offset; + var zoneCoordinate = player.Coordinate - player.CurrentZone.Offset; pak.WriteShort((ushort)zoneCoordinate.Z); pak.WriteShort((ushort)zoneCoordinate.X); pak.WriteShort((ushort)zoneCoordinate.Y); diff --git a/GameServer/packets/Server/PacketLib1124.cs b/GameServer/packets/Server/PacketLib1124.cs index f6ef5334c4..38f387c07d 100644 --- a/GameServer/packets/Server/PacketLib1124.cs +++ b/GameServer/packets/Server/PacketLib1124.cs @@ -634,10 +634,10 @@ public override void SendSiegeWeaponAnimation(GameSiegeWeapon siegeWeapon) using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.SiegeWeaponAnimation))) { pak.WriteInt((uint)siegeWeapon.ObjectID); - var aimLocation = siegeWeapon.AimLocation; - pak.WriteInt((uint)aimLocation.X); - pak.WriteInt((uint)aimLocation.Y); - pak.WriteInt((uint)aimLocation.Z); + var aimCoordinate = siegeWeapon.AimCoordinate; + pak.WriteInt((uint)aimCoordinate.X); + pak.WriteInt((uint)aimCoordinate.Y); + pak.WriteInt((uint)aimCoordinate.Z); pak.WriteInt((uint)(siegeWeapon.TargetObject == null ? 0 : siegeWeapon.TargetObject.ObjectID)); pak.WriteShort(siegeWeapon.Effect); pak.WriteShort((ushort)(siegeWeapon.SiegeWeaponTimer.TimeUntilElapsed)); @@ -824,7 +824,7 @@ protected override void WriteGroupMemberMapUpdate(GSTCPPacketOut pak, GameLiving if (living.CurrentSpeed != 0) { Zone zone = living.CurrentZone; - var zoneCoordinate = living.Location - zone.Offset; + var zoneCoordinate = living.Coordinate - zone.Offset; if (zone == null) return; pak.WriteByte((byte)(0x40 | living.GroupIndex)); diff --git a/GameServer/packets/Server/PacketLib168.cs b/GameServer/packets/Server/PacketLib168.cs index 0d5d443fcd..8441d52c00 100644 --- a/GameServer/packets/Server/PacketLib168.cs +++ b/GameServer/packets/Server/PacketLib168.cs @@ -665,10 +665,10 @@ public virtual void SendMessage(string msg, eChatType type, eChatLoc loc) } protected ushort GetXOffsetInZone(GamePlayer player) - => (ushort)(player.Location.X - player.CurrentZone.Offset.X); + => (ushort)(player.Coordinate.X - player.CurrentZone.Offset.X); protected ushort GetYOffsetInZone(GamePlayer player) - => (ushort)(player.Location.Y - player.CurrentZone.Offset.Y); + => (ushort)(player.Coordinate.Y - player.CurrentZone.Offset.Y); public virtual void SendPlayerCreate(GamePlayer playerToCreate) { @@ -771,7 +771,7 @@ public virtual void SendObjectUpdate(GameObject obj) return; } - var currentZoneCoord = obj.Location - z.Offset; + var currentZoneCoord = obj.Coordinate - z.Offset; var targetZoneCoord = Coordinate.Zero; int speed = 0; @@ -807,7 +807,7 @@ public virtual void SendObjectUpdate(GameObject obj) if (npc.IsMoving && !npc.IsAtTargetLocation) { speed = npc.CurrentSpeed; - if (npc.Destination != Coordinate.Nowhere && npc.Destination != npc.Location) + if (npc.Destination != Coordinate.Nowhere && npc.Destination != npc.Coordinate) { Zone tz = npc.CurrentRegion.GetZone(npc.Destination); if (tz != null) @@ -2582,7 +2582,7 @@ public virtual void SendPlayerForgedPosition(GamePlayer player) } // Get Off Corrd - var zoneCoord = player.Location - player.CurrentZone.Offset; + var zoneCoord = player.Coordinate - player.CurrentZone.Offset; pak.WriteShort((ushort)zoneCoord.Z); pak.WriteShort((ushort)zoneCoord.X); @@ -4092,10 +4092,10 @@ public virtual void SendSiegeWeaponAnimation(GameSiegeWeapon siegeWeapon) using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.SiegeWeaponAnimation))) { pak.WriteInt((uint) siegeWeapon.ObjectID); - var aimLocation = siegeWeapon.AimLocation; - pak.WriteInt((uint)aimLocation.X); - pak.WriteInt((uint)aimLocation.Y); - pak.WriteInt((uint)aimLocation.Z); + var aimCoordinate = siegeWeapon.AimCoordinate; + pak.WriteInt((uint)aimCoordinate.X); + pak.WriteInt((uint)aimCoordinate.Y); + pak.WriteInt((uint)aimCoordinate.Z); pak.WriteInt((uint) (siegeWeapon.TargetObject == null ? 0 : siegeWeapon.TargetObject.ObjectID)); pak.WriteShort(siegeWeapon.Effect); pak.WriteShort((ushort) (siegeWeapon.SiegeWeaponTimer.TimeUntilElapsed/100)); diff --git a/GameServer/packets/Server/PacketLib172.cs b/GameServer/packets/Server/PacketLib172.cs index 331e11f35e..4e4434482c 100644 --- a/GameServer/packets/Server/PacketLib172.cs +++ b/GameServer/packets/Server/PacketLib172.cs @@ -168,7 +168,7 @@ public override void SendPlayerForgedPosition(GamePlayer player) pak.WriteShort(content); } - var zoneCoord = player.Location - player.CurrentZone.Offset; + var zoneCoord = player.Coordinate - player.CurrentZone.Offset; pak.WriteShort((ushort)zoneCoord.Z); pak.WriteShort((ushort)zoneCoord.X); pak.WriteShort((ushort)zoneCoord.Y); diff --git a/GameServer/packets/Server/PacketLib174.cs b/GameServer/packets/Server/PacketLib174.cs index 214e40ab8e..10e79240ed 100644 --- a/GameServer/packets/Server/PacketLib174.cs +++ b/GameServer/packets/Server/PacketLib174.cs @@ -382,7 +382,7 @@ protected virtual void WriteGroupMemberMapUpdate(GSTCPPacketOut pak, GameLiving pak.WriteByte((byte)(0x40 | living.GroupIndex)); //Dinberg - ZoneSkinID for group members aswell. pak.WriteShort(zone.ZoneSkinID); - var zoneCoord = living.Location - zone.Offset; + var zoneCoord = living.Coordinate - zone.Offset; pak.WriteShort((ushort)(zoneCoord.X)); pak.WriteShort((ushort)(zoneCoord.Y)); } diff --git a/GameServer/packets/Server/PacketLib190.cs b/GameServer/packets/Server/PacketLib190.cs index 56ee7affa3..48fbb1ec39 100644 --- a/GameServer/packets/Server/PacketLib190.cs +++ b/GameServer/packets/Server/PacketLib190.cs @@ -289,7 +289,7 @@ public override void SendPlayerForgedPosition(GamePlayer player) pak.WriteShort(content); } - var zoneCoord = player.Location - player.CurrentZone.Offset; + var zoneCoord = player.Coordinate - player.CurrentZone.Offset; pak.WriteShort((ushort)zoneCoord.Z); pak.WriteShort((ushort)zoneCoord.X); pak.WriteShort((ushort)zoneCoord.Y); diff --git a/GameServer/realmabilities/handlers/DecimationTrap.cs b/GameServer/realmabilities/handlers/DecimationTrap.cs index f81deee0f4..fe3811f462 100644 --- a/GameServer/realmabilities/handlers/DecimationTrap.cs +++ b/GameServer/realmabilities/handlers/DecimationTrap.cs @@ -61,7 +61,7 @@ public override void Execute(GameLiving living) if (living.GroundTargetPosition == Position.Nowhere) return; - if (living.Location.DistanceTo(living.GroundTargetPosition) > 1500 ) + if (living.Coordinate.DistanceTo(living.GroundTargetPosition) > 1500 ) return; GamePlayer player = living as GamePlayer; if (player == null) @@ -92,7 +92,7 @@ private int startSpell(RegionTimer timer) if (!owner.IsAlive) return 0; - traparea = new Area.Circle("decimation trap", owner.Location, 50); + traparea = new Area.Circle("decimation trap", owner.Coordinate, 50); owner.CurrentRegion.AddArea(traparea); region = owner.CurrentRegionID; @@ -163,7 +163,7 @@ private void DamageTarget(GameLiving target) ticktimer.Stop(); removeHandlers(); } - var dist = (int)target.Location.DistanceTo(Coordinate.Create(traparea.X, traparea.Y, traparea.Z)); + var dist = (int)target.Coordinate.DistanceTo(Coordinate.Create(traparea.X, traparea.Y, traparea.Z)); double mod = 1; if (dist > 0) mod = 1 - ((double)dist / 350); diff --git a/GameServer/realmabilities/handlers/NegativeMaelstromAbility.cs b/GameServer/realmabilities/handlers/NegativeMaelstromAbility.cs index 76e84ef3a9..9b8bcf1e76 100644 --- a/GameServer/realmabilities/handlers/NegativeMaelstromAbility.cs +++ b/GameServer/realmabilities/handlers/NegativeMaelstromAbility.cs @@ -29,7 +29,7 @@ public override void Execute(GameLiving living) return; } - if ( caster.GroundTargetPosition == Position.Nowhere || caster.Location.DistanceTo(caster.GroundTargetPosition) > 1500) + if ( caster.GroundTargetPosition == Position.Nowhere || caster.Coordinate.DistanceTo(caster.GroundTargetPosition) > 1500) { caster.Out.SendMessage("You groundtarget is too far away to use this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; diff --git a/GameServer/realmabilities/handlers/StaticTempestAbility.cs b/GameServer/realmabilities/handlers/StaticTempestAbility.cs index 533dfb7607..6114606548 100644 --- a/GameServer/realmabilities/handlers/StaticTempestAbility.cs +++ b/GameServer/realmabilities/handlers/StaticTempestAbility.cs @@ -78,7 +78,7 @@ public override void Execute(GameLiving living) } } Statics.StaticTempestBase st = new Statics.StaticTempestBase(m_stunDuration); - st.CreateStatic(caster, caster.TargetObject.Location, m_duration, 5, 360); + st.CreateStatic(caster, caster.TargetObject.Coordinate, m_duration, 5, 360); DisableSkill(living); } public override int GetReUseDelay(int level) diff --git a/GameServer/realmabilities/handlers/ThornweedFieldAbility.cs b/GameServer/realmabilities/handlers/ThornweedFieldAbility.cs index 5d3eb76543..9c8397c03d 100644 --- a/GameServer/realmabilities/handlers/ThornweedFieldAbility.cs +++ b/GameServer/realmabilities/handlers/ThornweedFieldAbility.cs @@ -36,7 +36,7 @@ public override void Execute(GameLiving living) caster.Out.SendMessage( "You must set a ground target to use this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow ); return; } - else if(caster.Location.DistanceTo(caster.GroundTargetPosition) > 1500) + else if(caster.Coordinate.DistanceTo(caster.GroundTargetPosition) > 1500) { caster.Out.SendMessage("Your ground target is too far away to use this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; diff --git a/GameServer/realmabilities/handlers/rr5/WallOfFlameAbility.cs b/GameServer/realmabilities/handlers/rr5/WallOfFlameAbility.cs index 1319ada790..0010b09b05 100644 --- a/GameServer/realmabilities/handlers/rr5/WallOfFlameAbility.cs +++ b/GameServer/realmabilities/handlers/rr5/WallOfFlameAbility.cs @@ -47,7 +47,7 @@ public override void Execute(GameLiving living) } Statics.WallOfFlameBase wof = new Statics.WallOfFlameBase(dmgValue); - wof.CreateStatic(caster, caster.Location, duration, 3, 150); + wof.CreateStatic(caster, caster.Coordinate, duration, 3, 150); DisableSkill(living); caster.StopCurrentSpellcast(); diff --git a/GameServer/relics/RelicPad.cs b/GameServer/relics/RelicPad.cs index 0c6b00d5e2..a1cbc40289 100644 --- a/GameServer/relics/RelicPad.cs +++ b/GameServer/relics/RelicPad.cs @@ -95,7 +95,7 @@ public class Surface : Area.Circle private RelicPad m_relicPad; public Surface(RelicPad relicPad) - : base("", relicPad.Location.X, relicPad.Location.Y, relicPad.Location.Z, RelicPad.Radius) + : base("", relicPad.Coordinate.X, relicPad.Coordinate.Y, relicPad.Coordinate.Z, RelicPad.Radius) { m_relicPad = relicPad; } diff --git a/GameServer/serverrules/AbstractServerRules.cs b/GameServer/serverrules/AbstractServerRules.cs index dc73b46798..b946b58dda 100644 --- a/GameServer/serverrules/AbstractServerRules.cs +++ b/GameServer/serverrules/AbstractServerRules.cs @@ -2204,7 +2204,7 @@ public virtual GameNPC PlaceHousingNPC(DOL.GS.Housing.House house, ItemTemplate /// /// Get a housing hookpoint NPC /// - public virtual GameNPC PlaceHousingNPC(DOL.GS.Housing.House house, ItemTemplate item, Coordinate location, ushort heading) + public virtual GameNPC PlaceHousingNPC(DOL.GS.Housing.House house, ItemTemplate item, Coordinate coordinate, ushort heading) { NpcTemplate npcTemplate = NpcTemplateMgr.GetTemplate(item.Bonus); @@ -2274,7 +2274,7 @@ public virtual GameNPC PlaceHousingNPC(DOL.GS.Housing.House house, ItemTemplate npc.CurrentHouse = house; npc.InHouse = true; npc.OwnerID = item.Id_nb; - npc.Position = Position.Create(house.RegionID, location, heading); + npc.Position = Position.Create(house.RegionID, coordinate, heading); if (!npc.IsPeaceful) { npc.Flags ^= GameNPC.eFlags.PEACE; @@ -2294,13 +2294,13 @@ public virtual GameNPC PlaceHousingNPC(DOL.GS.Housing.House house, ItemTemplate public virtual GameStaticItem PlaceHousingInteriorItem(DOL.GS.Housing.House house, ItemTemplate item, IPoint3D location, ushort heading) => PlaceHousingInteriorItem(house, item, location.ToCoordinate(), heading); - public virtual GameStaticItem PlaceHousingInteriorItem(DOL.GS.Housing.House house, ItemTemplate item, Coordinate location, ushort heading) + public virtual GameStaticItem PlaceHousingInteriorItem(DOL.GS.Housing.House house, ItemTemplate item, Coordinate coordinate, ushort heading) { GameStaticItem hookpointObject = new GameStaticItem(); hookpointObject.CurrentHouse = house; hookpointObject.InHouse = true; hookpointObject.OwnerID = item.Id_nb; - hookpointObject.Position = Position.Create(house.RegionID, location, heading); + hookpointObject.Position = Position.Create(house.RegionID, coordinate, heading); hookpointObject.Name = item.Name; hookpointObject.Model = (ushort)item.Model; hookpointObject.AddToWorld(); diff --git a/GameServer/serverrules/IServerRules.cs b/GameServer/serverrules/IServerRules.cs index 9be17e9ba1..99c9df6850 100644 --- a/GameServer/serverrules/IServerRules.cs +++ b/GameServer/serverrules/IServerRules.cs @@ -444,12 +444,12 @@ public interface IServerRules [Obsolete("Use .PlayerHousingNPC(House,ItemTemplate,Coordinate,ushort) instead!")] GameNPC PlaceHousingNPC(DOL.GS.Housing.House house, ItemTemplate item, IPoint3D location, ushort heading); - GameNPC PlaceHousingNPC(DOL.GS.Housing.House house, ItemTemplate item, Coordinate location, ushort heading); + GameNPC PlaceHousingNPC(DOL.GS.Housing.House house, ItemTemplate item, Coordinate coordinate, ushort heading); [Obsolete("Use .PlaceHousingInteriorItem(House,ItemTemplate,Coordinate,ushort) instead!")] GameStaticItem PlaceHousingInteriorItem(DOL.GS.Housing.House house, ItemTemplate item, IPoint3D location, ushort heading); - GameStaticItem PlaceHousingInteriorItem(DOL.GS.Housing.House house, ItemTemplate item, Coordinate location, ushort heading); + GameStaticItem PlaceHousingInteriorItem(DOL.GS.Housing.House house, ItemTemplate item, Coordinate coordinate, ushort heading); /// /// Create a new consignment merchant for housing diff --git a/GameServer/spells/Animist/SummonAnimistPet.cs b/GameServer/spells/Animist/SummonAnimistPet.cs index bb288f6ef1..64646ecd8d 100644 --- a/GameServer/spells/Animist/SummonAnimistPet.cs +++ b/GameServer/spells/Animist/SummonAnimistPet.cs @@ -44,7 +44,7 @@ public override bool CheckBeginCast(GameLiving selectedTarget) return false; } - if (Caster.Location.DistanceTo(Caster.GroundTargetPosition) > CalculateSpellRange()) + if (Caster.Coordinate.DistanceTo(Caster.GroundTargetPosition) > CalculateSpellRange()) { if (Caster is GamePlayer) MessageToCaster(LanguageMgr.GetTranslation((Caster as GamePlayer).Client, "SummonAnimistPet.CheckBeginCast.GroundTargetNotInSpellRange"), eChatType.CT_SpellResisted); @@ -76,7 +76,7 @@ public override void FinishSpellCast(GameLiving target) return; } - if (Caster.Location.DistanceTo(Caster.GroundTargetPosition) > CalculateSpellRange()) + if (Caster.Coordinate.DistanceTo(Caster.GroundTargetPosition) > CalculateSpellRange()) { if (Caster is GamePlayer) MessageToCaster(LanguageMgr.GetTranslation((Caster as GamePlayer).Client, "SummonAnimistPet.CheckBeginCast.GroundTargetNotInSpellRange"), eChatType.CT_SpellResisted); diff --git a/GameServer/spells/Animist/TurretSpellHandler.cs b/GameServer/spells/Animist/TurretSpellHandler.cs index dc7f5f3de9..3a13276ee3 100644 --- a/GameServer/spells/Animist/TurretSpellHandler.cs +++ b/GameServer/spells/Animist/TurretSpellHandler.cs @@ -74,7 +74,7 @@ public override void ApplyEffectOnTarget(GameLiving target, double effectiveness { if (target != null && target.CurrentRegion != null) { - foreach (GameNPC npc in target.CurrentRegion.GetNPCsInRadius(target.Location, (ushort)Spell.Radius, false, true)) + foreach (GameNPC npc in target.CurrentRegion.GetNPCsInRadius(target.Coordinate, (ushort)Spell.Radius, false, true)) { if (npc == null || !npc.IsAlive) { diff --git a/GameServer/spells/Archery/Archery.cs b/GameServer/spells/Archery/Archery.cs index 8ed5d06bf2..b3d5a79da5 100644 --- a/GameServer/spells/Archery/Archery.cs +++ b/GameServer/spells/Archery/Archery.cs @@ -108,7 +108,7 @@ public override bool CheckBeginCast(GameLiving selectedTarget) String targetType = m_spell.Target.ToLower(); if (targetType == "area") { - if (m_caster.Location.DistanceTo(m_caster.GroundTargetPosition) > CalculateSpellRange()) + if (m_caster.Coordinate.DistanceTo(m_caster.GroundTargetPosition) > CalculateSpellRange()) { MessageToCaster("Your area target is out of range. Select a closer target.", eChatType.CT_SpellResisted); return false; diff --git a/GameServer/spells/Masterlevel/Convoker.cs b/GameServer/spells/Masterlevel/Convoker.cs index 21aba549b3..b02c740d8d 100644 --- a/GameServer/spells/Masterlevel/Convoker.cs +++ b/GameServer/spells/Masterlevel/Convoker.cs @@ -625,7 +625,7 @@ public Convoker10SpellHandler(GameLiving caster, Spell spell, SpellLine line) : public override bool CheckBeginCast(GameLiving selectedTarget) { - if(!CheckCastLocation()) + if(!CheckCastCoordinate()) return false; return base.CheckBeginCast(selectedTarget); } @@ -668,7 +668,7 @@ public override void ApplyEffectOnTarget(GameLiving target, double effectiveness summoned.SetOwnBrain(controlledBrain); //Suncheck: // Is needed, else it can cause error (i.e. /cast-command) - if (position == Position.Nowhere) CheckCastLocation(); + if (position == Position.Nowhere) CheckCastCoordinate(); summoned.Position = position.With(orientation: Caster.Orientation + Angle.Degrees(180)); summoned.Realm = player.Realm; @@ -699,7 +699,7 @@ private int TitanGrows(RegionTimer timer) return 0; } - private bool CheckCastLocation() + private bool CheckCastCoordinate() { position = Caster.Position; if (Spell.Target.ToLower() == "area") diff --git a/GameServer/spells/Masterlevel/MasterLevelBase.cs b/GameServer/spells/Masterlevel/MasterLevelBase.cs index 0b800a3efa..a370d62247 100644 --- a/GameServer/spells/Masterlevel/MasterLevelBase.cs +++ b/GameServer/spells/Masterlevel/MasterLevelBase.cs @@ -1171,7 +1171,7 @@ public override void OnEffectPulse(GameSpellEffect effect) { return; } - var ranged = (int)storm.Location.DistanceTo(effect.Owner.Location); + var ranged = (int)storm.Coordinate.DistanceTo(effect.Owner.Coordinate); if (ranged > 3000) return; if (s.Name == "Dazzling Array") diff --git a/GameServer/spells/Masterlevel/Sojourner.cs b/GameServer/spells/Masterlevel/Sojourner.cs index ee6ec5d65d..7dd9be9721 100644 --- a/GameServer/spells/Masterlevel/Sojourner.cs +++ b/GameServer/spells/Masterlevel/Sojourner.cs @@ -312,7 +312,7 @@ private void ArriveAtTarget(DOLEvent e, object obj, EventArgs args) if (Caster is GamePlayer) { //Calculate random target - m_loc = m_npc.Location + Vector.Create(x: Util.Random(-1500, 1500), y: Util.Random(-1500, 1500));; + m_loc = m_npc.Coordinate + Vector.Create(x: Util.Random(-1500, 1500), y: Util.Random(-1500, 1500));; (Caster as GamePlayer).Out.SendCheckLOS((Caster as GamePlayer), m_npc, new CheckLOSResponse(ZephyrCheckLOS)); } } diff --git a/GameServer/spells/Masterlevel/Stormlord.cs b/GameServer/spells/Masterlevel/Stormlord.cs index 68d59ede8b..3a496b7794 100644 --- a/GameServer/spells/Masterlevel/Stormlord.cs +++ b/GameServer/spells/Masterlevel/Stormlord.cs @@ -154,7 +154,7 @@ public override void OnDirectEffect(GameLiving target, double effectiveness) int range = Util.Random(0, 750); double angle = Util.RandomDouble() * 2 * Math.PI; var offset = Vector.Create(x: (int)(range * Math.Cos(angle)), y: (int)(range * Math.Sin(angle)) ); - targetNPC.WalkTo(targetNPC.Location + offset, targetNPC.MaxSpeed); + targetNPC.WalkTo(targetNPC.Coordinate + offset, targetNPC.MaxSpeed); } } } diff --git a/GameServer/spells/SpellHandler.cs b/GameServer/spells/SpellHandler.cs index 278e6d5e6f..1c36b80cc4 100644 --- a/GameServer/spells/SpellHandler.cs +++ b/GameServer/spells/SpellHandler.cs @@ -750,7 +750,7 @@ public virtual bool CheckBeginCast(GameLiving selectedTarget, bool quiet) } if (targetType == "area") { - if (m_caster.Location.DistanceTo(m_caster.GroundTargetPosition) > CalculateSpellRange()) + if (m_caster.Coordinate.DistanceTo(m_caster.GroundTargetPosition) > CalculateSpellRange()) { if (!quiet) MessageToCaster("Your area target is out of range. Select a closer target.", eChatType.CT_SpellResisted); return false; @@ -1016,7 +1016,7 @@ public virtual bool CheckEndCast(GameLiving target) if (m_spell.Target.ToLower() == "area") { - if (m_caster.Location.DistanceTo(m_caster.GroundTargetPosition) > CalculateSpellRange()) + if (m_caster.Coordinate.DistanceTo(m_caster.GroundTargetPosition) > CalculateSpellRange()) { MessageToCaster("Your area target is out of range. Select a closer target.", eChatType.CT_SpellResisted); return false; @@ -1186,7 +1186,7 @@ public virtual bool CheckDuringCast(GameLiving target, bool quiet) if (m_spell.Target.ToLower() == "area") { - if (m_caster.Location.DistanceTo(m_caster.GroundTargetPosition) > CalculateSpellRange()) + if (m_caster.Coordinate.DistanceTo(m_caster.GroundTargetPosition) > CalculateSpellRange()) { if (!quiet) MessageToCaster("Your area target is out of range. Select a closer target.", eChatType.CT_SpellResisted); return false; @@ -1391,7 +1391,7 @@ public virtual bool CheckAfterCast(GameLiving target, bool quiet) if (m_spell.Target.ToLower() == "area") { - if (m_caster.Location.DistanceTo(m_caster.GroundTargetPosition) > CalculateSpellRange()) + if (m_caster.Coordinate.DistanceTo(m_caster.GroundTargetPosition) > CalculateSpellRange()) { if (!quiet) MessageToCaster("Your area target is out of range. Select a closer target.", eChatType.CT_SpellResisted); return false; @@ -2573,7 +2573,7 @@ public virtual bool StartSpell(GameLiving target) } else if (Spell.Target.ToLower() == "area") { - int dist = (int)t.Location.DistanceTo(Caster.GroundTargetPosition); + int dist = (int)t.Coordinate.DistanceTo(Caster.GroundTargetPosition); if (dist >= 0) ApplyEffectOnTarget(t, (effectiveness - CalculateAreaVariance(t, dist, Spell.Radius))); } diff --git a/GameServer/spells/negative/FearBrain.cs b/GameServer/spells/negative/FearBrain.cs index b29e6036ed..623f474c40 100644 --- a/GameServer/spells/negative/FearBrain.cs +++ b/GameServer/spells/negative/FearBrain.cs @@ -48,7 +48,7 @@ public override void Think() protected virtual void CalculateFleeTarget(GameLiving target) { - var targetAngle = Body.Location.GetOrientationTo(target.Location) + Angle.Degrees(180); + var targetAngle = Body.Coordinate.GetOrientationTo(target.Coordinate) + Angle.Degrees(180); Body.StopFollowing(); Body.StopAttack(); diff --git a/GameServer/styles/StyleProcessor.cs b/GameServer/styles/StyleProcessor.cs index 3d5d207e29..f512a30374 100644 --- a/GameServer/styles/StyleProcessor.cs +++ b/GameServer/styles/StyleProcessor.cs @@ -138,7 +138,7 @@ public static bool CanUseStyle(GameLiving living, Style style, InventoryItem wea return false; // get players angle on target - var angle = target.GetAngleTo(living.Location); + var angle = target.GetAngleTo(living.Coordinate); //player.Out.SendDebugMessage("Positional check: "+style.OpeningRequirementValue+" angle "+angle+" target heading="+target.Heading); switch ((Style.eOpeningPosition)style.OpeningRequirementValue) diff --git a/GameServer/world/Pathing/IPathingMgr.cs b/GameServer/world/Pathing/IPathingMgr.cs index aeea9bba8a..d39490a16c 100644 --- a/GameServer/world/Pathing/IPathingMgr.cs +++ b/GameServer/world/Pathing/IPathingMgr.cs @@ -19,7 +19,7 @@ public interface IPathingMgr (LinePath Path,PathingError Error) GetPathStraightAsync(Zone zone, Coordinate start, Coordinate end); - Vector3? GetRandomPointAsync(Zone zone, Coordinate centerLocation, float radius); + Vector3? GetRandomPointAsync(Zone zone, Coordinate center, float radius); /// /// Returns the closest point on the navmesh, if available, or no point found. diff --git a/GameServer/world/Pathing/LocalPathingMgr.cs b/GameServer/world/Pathing/LocalPathingMgr.cs index d58727535e..88e7af4b7d 100644 --- a/GameServer/world/Pathing/LocalPathingMgr.cs +++ b/GameServer/world/Pathing/LocalPathingMgr.cs @@ -195,7 +195,7 @@ private static float[] ToRecastFloats(Vector3 value) return new[] { value.X * LocalPathingMgr.CONVERSION_FACTOR, value.Z * LocalPathingMgr.CONVERSION_FACTOR, value.Y * LocalPathingMgr.CONVERSION_FACTOR }; } - private static float[] LocationToRecastFloatArray(Coordinate loc) + private static float[] CoordinateToRecastFloatArray(Coordinate loc) => new[] { loc.X * LocalPathingMgr.CONVERSION_FACTOR, (loc.Z + 8) * LocalPathingMgr.CONVERSION_FACTOR, @@ -213,8 +213,8 @@ private static float[] LocationToRecastFloatArray(Coordinate loc) query = new NavMeshQuery(_navmeshPtrs[zone.ID]); _navmeshQueries.Value.Add(zone.ID, query); } - var startFloats = LocationToRecastFloatArray(start); - var endFloats = LocationToRecastFloatArray(destination); + var startFloats = CoordinateToRecastFloatArray(start); + var endFloats = CoordinateToRecastFloatArray(destination); var numNodes = 0; var buffer = new float[MAX_POLY * 3]; @@ -234,7 +234,7 @@ private static float[] LocationToRecastFloatArray(Coordinate loc) } - public Vector3? GetRandomPointAsync(Zone zone, Coordinate centerLocation, float radius) + public Vector3? GetRandomPointAsync(Zone zone, Coordinate center, float radius) { if (!_navmeshPtrs.ContainsKey(zone.ID)) return null; @@ -249,7 +249,7 @@ private static float[] LocationToRecastFloatArray(Coordinate loc) _navmeshQueries.Value.Add(zone.ID, query); } var ptrs = _navmeshPtrs[zone.ID]; - var center = LocationToRecastFloatArray(centerLocation); + var centerAsFloatArray = CoordinateToRecastFloatArray(center); var cradius = (radius * CONVERSION_FACTOR); var outVec = new float[3]; @@ -259,7 +259,7 @@ private static float[] LocationToRecastFloatArray(Coordinate loc) var polyPickEx = new float[3] { 2.0f, 4.0f, 2.0f }; - var status = FindRandomPointAroundCircle(query, center, cradius, polyPickEx, filter, outVec); + var status = FindRandomPointAroundCircle(query, centerAsFloatArray, cradius, polyPickEx, filter, outVec); if ((status & dtStatus.DT_SUCCESS) != 0) result = new Vector3(outVec[0] * INV_FACTOR, outVec[2] * INV_FACTOR, outVec[1] * INV_FACTOR); diff --git a/GameServer/world/Pathing/NullPathingMgr.cs b/GameServer/world/Pathing/NullPathingMgr.cs index f2d6ad367c..afaa2e686c 100644 --- a/GameServer/world/Pathing/NullPathingMgr.cs +++ b/GameServer/world/Pathing/NullPathingMgr.cs @@ -20,7 +20,7 @@ public void Stop() public (LinePath, PathingError) GetPathStraightAsync(Zone zone, Coordinate start, Coordinate end) => (new LinePath(), PathingError.NavmeshUnavailable); - public Vector3? GetRandomPointAsync(Zone zone, Coordinate centerLocation, float radius) + public Vector3? GetRandomPointAsync(Zone zone, Coordinate center, float radius) => null; public Vector3? GetClosestPointAsync(Zone zone, Vector3 position, float xRange = 256, float yRange = 256, float zRange = 256) diff --git a/GameServer/world/Pathing/PathCalculator.cs b/GameServer/world/Pathing/PathCalculator.cs index e03b67fdd2..aa96fe4413 100644 --- a/GameServer/world/Pathing/PathCalculator.cs +++ b/GameServer/world/Pathing/PathCalculator.cs @@ -99,7 +99,7 @@ private bool ShouldPath(Coordinate target) /// public static bool ShouldPath(GameNPC owner, Coordinate destination) { - if (owner.Location.DistanceTo(destination) < MIN_PATHING_DISTANCE) + if (owner.Coordinate.DistanceTo(destination) < MIN_PATHING_DISTANCE) return false; // too close to path if (owner.IsFlying) return false; @@ -134,7 +134,7 @@ private void ReplotPath(Coordinate destination) try { var currentZone = Owner.CurrentZone; - var pathingResult = PathingMgr.Instance.GetPathStraightAsync(currentZone, Owner.Location, destination); + var pathingResult = PathingMgr.Instance.GetPathStraightAsync(currentZone, Owner.Coordinate, destination); if (pathingResult.Error != PathingError.NoPathFound && pathingResult.Error != PathingError.NavmeshUnavailable && !pathingResult.Path.Start.Equals(Coordinate.Nowhere)) @@ -167,7 +167,7 @@ public Coordinate CalculateNextLineSegment(Coordinate destination) ReplotPath(destination); } - while (path.PointCount > 0 && Owner.Location.DistanceTo(path.CurrentWayPoint) <= NODE_REACHED_DISTANCE) + while (path.PointCount > 0 && Owner.Coordinate.DistanceTo(path.CurrentWayPoint) <= NODE_REACHED_DISTANCE) { path.SelectNextWayPoint(); } diff --git a/GameServer/world/Region.cs b/GameServer/world/Region.cs index c36d1cce34..6b93cc41e1 100644 --- a/GameServer/world/Region.cs +++ b/GameServer/world/Region.cs @@ -980,7 +980,7 @@ public virtual void LoadFromDatabase(Mob[] mobObjs, ref long mobCount, ref long internal bool AddObject(GameObject obj) { //Thread.Sleep(10000); - Zone zone = GetZone(obj.Location); + Zone zone = GetZone(obj.Coordinate); if (zone == null) { if (log.IsWarnEnabled) @@ -1226,12 +1226,12 @@ public GameObject GetObject(ushort id) return m_objects[id - 1]; } - public Zone GetZone(Coordinate location) + public Zone GetZone(Coordinate coordinate) { foreach (var zone in m_zones) { - var isInZone = zone.Offset.X <= location.X && zone.Offset.Y <= location.Y - && (zone.Offset.X + zone.Width) > location.X && (zone.Offset.Y + zone.Height) > location.Y; + var isInZone = zone.Offset.X <= coordinate.X && zone.Offset.Y <= coordinate.Y + && (zone.Offset.X + zone.Width) > coordinate.X && (zone.Offset.Y + zone.Height) > coordinate.Y; if (isInZone) return zone; } return null; @@ -1384,10 +1384,10 @@ public virtual void RemoveArea(IArea area) public IList GetAreasOfSpot(int x, int y, int z) => GetAreasOfSpot(Coordinate.Create(x, y, z)); - public IList GetAreasOfSpot(Coordinate location) + public IList GetAreasOfSpot(Coordinate coordinate) { - var zone = GetZone(location); - return GetAreasOfZone(zone, location); + var zone = GetZone(coordinate); + return GetAreasOfZone(zone, coordinate); } public virtual IList GetAreasOfZone(Zone zone, Coordinate spot) @@ -1515,7 +1515,7 @@ protected IEnumerable GetInRadius(Zone.eGameObjectType type, Coordinate center, } } - private static bool CheckShortestDistance(Zone zone, Coordinate location, uint squareRadius) + private static bool CheckShortestDistance(Zone zone, Coordinate coordinate, uint squareRadius) { // coordinates of zone borders int xLeft = zone.Offset.X; @@ -1524,22 +1524,22 @@ private static bool CheckShortestDistance(Zone zone, Coordinate location, uint s int yBottom = zone.Offset.Y + zone.Height; long distance = 0; - if ((location.Y >= yTop) && (location.Y <= yBottom)) + if ((coordinate.Y >= yTop) && (coordinate.Y <= yBottom)) { - int xdiff = Math.Min(FastMath.Abs(location.X - xLeft), FastMath.Abs(location.X - xRight)); + int xdiff = Math.Min(FastMath.Abs(coordinate.X - xLeft), FastMath.Abs(coordinate.X - xRight)); distance = (long)xdiff * xdiff; } else { - if ((location.X >= xLeft) && (location.X <= xRight)) + if ((coordinate.X >= xLeft) && (coordinate.X <= xRight)) { - int ydiff = Math.Min(FastMath.Abs(location.Y - yTop), FastMath.Abs(location.Y - yBottom)); + int ydiff = Math.Min(FastMath.Abs(coordinate.Y - yTop), FastMath.Abs(coordinate.Y - yBottom)); distance = (long)ydiff * ydiff; } else { - int xdiff = Math.Min(FastMath.Abs(location.X - xLeft), FastMath.Abs(location.X - xRight)); - int ydiff = Math.Min(FastMath.Abs(location.Y - yTop), FastMath.Abs(location.Y - yBottom)); + int xdiff = Math.Min(FastMath.Abs(coordinate.X - xLeft), FastMath.Abs(coordinate.X - xRight)); + int ydiff = Math.Min(FastMath.Abs(coordinate.Y - yTop), FastMath.Abs(coordinate.Y - yBottom)); distance = (long)xdiff * xdiff + (long)ydiff * ydiff; } } @@ -1569,8 +1569,8 @@ public IEnumerable GetItemsInRadius(Coordinate center, ushort radius, bool withD public IEnumerable GetNPCsInRadius(Coordinate center, ushort radius, bool withDistance, bool ignoreZ) => GetInRadius(Zone.eGameObjectType.NPC, center, radius, withDistance, ignoreZ); - public IEnumerable GetPlayersInRadius(Coordinate location, ushort radius, bool withDistance, bool ignoreZ) - => GetInRadius(Zone.eGameObjectType.PLAYER, location, radius, withDistance, ignoreZ); + public IEnumerable GetPlayersInRadius(Coordinate coordinate, ushort radius, bool withDistance, bool ignoreZ) + => GetInRadius(Zone.eGameObjectType.PLAYER, coordinate, radius, withDistance, ignoreZ); public virtual IEnumerable GetDoorsInRadius(Coordinate center, ushort radius, bool withDistance) => GetInRadius(Zone.eGameObjectType.DOOR, center, radius, withDistance, false); @@ -1712,15 +1712,15 @@ public void Reset() public abstract class DistanceEnumerator : ObjectEnumerator { - protected Coordinate location; + protected Coordinate coordinate; public DistanceEnumerator(int x, int y, int z, ArrayList elements) : this(Coordinate.Create(x, y, z), elements) { } - public DistanceEnumerator(Coordinate location, ArrayList elements) + public DistanceEnumerator(Coordinate coordinate, ArrayList elements) : base(elements) { - this.location = location; + this.coordinate = coordinate; } } @@ -1729,15 +1729,15 @@ public class PlayerDistanceEnumerator : DistanceEnumerator public PlayerDistanceEnumerator(int x, int y, int z, ArrayList elements) : base(Coordinate.Create(x, y, z), elements) { } - public PlayerDistanceEnumerator(Coordinate location, ArrayList elements) - : base(location,elements) { } + public PlayerDistanceEnumerator(Coordinate coordinate, ArrayList elements) + : base(coordinate,elements) { } public override object Current { get { GamePlayer obj = (GamePlayer)m_currentObj; - return new PlayerDistEntry(obj, (int)obj.Location.DistanceTo(location)); + return new PlayerDistEntry(obj, (int)obj.Coordinate.DistanceTo(coordinate)); } } } @@ -1747,15 +1747,15 @@ public class NPCDistanceEnumerator : DistanceEnumerator public NPCDistanceEnumerator(int x, int y, int z, ArrayList elements) : base(Coordinate.Create(x, y, z), elements) { } - public NPCDistanceEnumerator(Coordinate location, ArrayList elements) - : base(location,elements) { } + public NPCDistanceEnumerator(Coordinate coordinate, ArrayList elements) + : base(coordinate,elements) { } public override object Current { get { GameNPC obj = (GameNPC)m_currentObj; - return new NPCDistEntry(obj, (int)obj.Location.DistanceTo(location)); + return new NPCDistEntry(obj, (int)obj.Coordinate.DistanceTo(coordinate)); } } } @@ -1765,15 +1765,15 @@ public class ItemDistanceEnumerator : DistanceEnumerator public ItemDistanceEnumerator(int x, int y, int z, ArrayList elements) : base(Coordinate.Create(x, y, z), elements) { } - public ItemDistanceEnumerator(Coordinate location, ArrayList elements) - : base(location,elements) { } + public ItemDistanceEnumerator(Coordinate coordinate, ArrayList elements) + : base(coordinate,elements) { } public override object Current { get { GameStaticItem obj = (GameStaticItem)m_currentObj; - return new ItemDistEntry(obj, (int)obj.Location.DistanceTo(location)); + return new ItemDistEntry(obj, (int)obj.Coordinate.DistanceTo(coordinate)); } } } @@ -1783,15 +1783,15 @@ public class DoorDistanceEnumerator : DistanceEnumerator public DoorDistanceEnumerator(int x, int y, int z, ArrayList elements) : base(Coordinate.Create(x, y, z), elements) { } - public DoorDistanceEnumerator(Coordinate location, ArrayList elements) - : base(location,elements) { } + public DoorDistanceEnumerator(Coordinate coordinate, ArrayList elements) + : base(coordinate,elements) { } public override object Current { get { IDoor obj = (IDoor)m_currentObj; - return new DoorDistEntry(obj, (int)obj.Location.DistanceTo(location)); + return new DoorDistEntry(obj, (int)obj.Coordinate.DistanceTo(coordinate)); } } } diff --git a/GameServer/world/WorldUpdateThread.cs b/GameServer/world/WorldUpdateThread.cs index 2916539e64..9569f2b082 100644 --- a/GameServer/world/WorldUpdateThread.cs +++ b/GameServer/world/WorldUpdateThread.cs @@ -424,7 +424,7 @@ public static void UpdatePlayerHousing(GamePlayer player, long nowTicks) IDictionary housesDict = HouseMgr.GetHouses(player.CurrentRegionID); // Build Vincinity List var houses = housesDict.Values - .Where(h => h != null && player.Location.DistanceTo(h.Position) <= HousingConstants.HouseViewingDistance) + .Where(h => h != null && player.Coordinate.DistanceTo(h.Position) <= HousingConstants.HouseViewingDistance) .ToArray(); try diff --git a/GameServer/world/Zone.cs b/GameServer/world/Zone.cs index e0575cf0b6..6d0dc3e2ea 100644 --- a/GameServer/world/Zone.cs +++ b/GameServer/world/Zone.cs @@ -466,7 +466,7 @@ public void ObjectEnterZone(GameObject p_Obj) { if (!m_initialized) InitializeZone(); - int subZoneIndex = GetSubZoneIndex(p_Obj.Location); + int subZoneIndex = GetSubZoneIndex(p_Obj.Coordinate); if ((subZoneIndex >= 0) && (subZoneIndex < SUBZONE_NBR)) { SubNodeElement element = new SubNodeElement(); @@ -513,7 +513,7 @@ private void ObjectEnterZone(eGameObjectType objectType, SubNodeElement element) { if (!m_initialized) InitializeZone(); - int subZoneIndex = GetSubZoneIndex(element.data.Location); + int subZoneIndex = GetSubZoneIndex(element.data.Coordinate); if (log.IsDebugEnabled) { @@ -539,16 +539,16 @@ private void ObjectEnterZone(eGameObjectType objectType, SubNodeElement element) /// Gets the lists of objects, located in the current Zone and of the given type, that are at most at a 'radius' distance from (x,y,z) /// The found objects are appended to the given 'partialList'. /// - internal ArrayList GetObjectsInRadius(eGameObjectType type, Coordinate location, ushort radius, ArrayList partialList, bool ignoreZ) + internal ArrayList GetObjectsInRadius(eGameObjectType type, Coordinate coordinate, ushort radius, ArrayList partialList, bool ignoreZ) { if (!m_initialized) InitializeZone(); // initialise parameters uint sqRadius = (uint)radius * (uint)radius; - int referenceSubzoneIndex = GetSubZoneIndex(location); + int referenceSubzoneIndex = GetSubZoneIndex(coordinate); int typeIndex = (int)type; - int xInZone = location.X - Offset.X; // x in zone coordinates - int yInZone = location.Y - Offset.Y; // y in zone coordinates + int xInZone = coordinate.X - Offset.X; // x in zone coordinates + int yInZone = coordinate.Y - Offset.Y; // y in zone coordinates int cellNbr = (radius >> SUBZONE_SHIFT) + 1; // radius in terms of subzone number int xInCell = xInZone >> SUBZONE_SHIFT; // xInZone in terms of subzone coord @@ -603,7 +603,7 @@ internal ArrayList GetObjectsInRadius(eGameObjectType type, Coordinate location, { // we are in the subzone of the observation point // => check all distances for all objects in the subzone - UnsafeAddToListWithDistanceCheck(startElement, location, sqRadius, typeIndex, currentSubZoneIndex, partialList, inZoneElements, outOfZoneElements, ignoreZ); + UnsafeAddToListWithDistanceCheck(startElement, coordinate, sqRadius, typeIndex, currentSubZoneIndex, partialList, inZoneElements, outOfZoneElements, ignoreZ); UnsafeUpdateSubZoneTimestamp(currentSubZoneIndex, typeIndex); } } @@ -636,7 +636,7 @@ internal ArrayList GetObjectsInRadius(eGameObjectType type, Coordinate location, lock (startElement) { - UnsafeAddToListWithDistanceCheck(startElement, location, sqRadius, typeIndex, currentSubZoneIndex, partialList, inZoneElements, outOfZoneElements, ignoreZ); + UnsafeAddToListWithDistanceCheck(startElement, coordinate, sqRadius, typeIndex, currentSubZoneIndex, partialList, inZoneElements, outOfZoneElements, ignoreZ); UnsafeUpdateSubZoneTimestamp(currentSubZoneIndex, typeIndex); } } @@ -713,7 +713,7 @@ private void UnsafeAddToListWithoutDistanceCheck(SubNodeElement startElement, in private void UnsafeAddToListWithDistanceCheck( SubNodeElement startElement, - Coordinate location, + Coordinate coordinate, uint sqRadius, int typeIndex, int subZoneIndex, @@ -747,7 +747,7 @@ private void UnsafeAddToListWithDistanceCheck( } else { - if (CheckSquareDistance(location, currentObject.Location, sqRadius, ignoreZ) && !partialList.Contains(currentObject)) + if (CheckSquareDistance(coordinate, currentObject.Coordinate, sqRadius, ignoreZ) && !partialList.Contains(currentObject)) { // the current object exists, is Active and still in the current subzone // moreover it is in the right range and not yet in the result set @@ -872,7 +872,7 @@ private bool ShouldElementMove(SubNodeElement currentElement, int typeIndex, int { // the current object exists, is Active and still in the Region where this Zone is located - int currentElementSubzoneIndex = GetSubZoneIndex(currentObject.Location); + int currentElementSubzoneIndex = GetSubZoneIndex(currentObject.Coordinate); if (currentElementSubzoneIndex == -1) { @@ -973,7 +973,7 @@ private void PlaceElementsInOtherZones(DOL.GS.Collections.Hashtable elements) for (int i = 0; i < currentList.Count; i++) { currentElement = (SubNodeElement)currentList[i]; - currentZone = ZoneRegion.GetZone(currentElement.data.Location); + currentZone = ZoneRegion.GetZone(currentElement.data.Coordinate); if (currentZone != null) { diff --git a/GameServerScripts/gameevents/DOLTestServer.cs b/GameServerScripts/gameevents/DOLTestServer.cs index 47b5a4a5d9..8fed5d3d0a 100644 --- a/GameServerScripts/gameevents/DOLTestServer.cs +++ b/GameServerScripts/gameevents/DOLTestServer.cs @@ -97,7 +97,7 @@ public static void DOLTestPlayerEnterWorld(DOLEvent e, object sender, EventArgs //If the player is > 10.000 coordinates away or in another region //we send a dialog to the player and register a dialog-callback var doltopiaLocation = Coordinate.Create(x: 531405, y: 479515); - if (player.CurrentRegionID != 1 || player.Location.DistanceTo(doltopiaLocation, ignoreZ: true) > 10000) + if (player.CurrentRegionID != 1 || player.Coordinate.DistanceTo(doltopiaLocation, ignoreZ: true) > 10000) player.Out.SendCustomDialog("Do you want to be teleported to DOLTopia?", new CustomDialogResponse(TeleportToDOLTopia)); } diff --git a/GameServerScripts/gameevents/FightingNPC.cs b/GameServerScripts/gameevents/FightingNPC.cs index 266a5d4e77..dd246570e1 100644 --- a/GameServerScripts/gameevents/FightingNPC.cs +++ b/GameServerScripts/gameevents/FightingNPC.cs @@ -156,30 +156,30 @@ public static void OnScriptsCompiled(DOLEvent e, object sender, EventArgs args) //We set the position, model and size of our trainees m_guardTrainee[0].Position = m_guardMaster.Position + Vector.Create(-70, -66); - m_guardTrainee[0].TurnTo(m_guardMaster.Location); + m_guardTrainee[0].TurnTo(m_guardMaster.Coordinate); m_guardTrainee[0].Model = (ushort) m_rnd.Next(32, 55); m_guardTrainee[0].Size = (byte) (45 + m_rnd.Next(10)); m_guardTrainee[1].Position = m_guardMaster.Position + Vector.Create(76, -29); - m_guardTrainee[1].TurnTo(m_guardMaster.Location); + m_guardTrainee[1].TurnTo(m_guardMaster.Coordinate); m_guardTrainee[1].Model = (ushort) m_rnd.Next(32, 55); m_guardTrainee[1].Size = (byte) (45 + m_rnd.Next(10)); m_guardTrainee[2].Position = m_guardMaster.Position + Vector.Create(-110, 22); - m_guardTrainee[2].TurnTo(m_guardMaster.Location); + m_guardTrainee[2].TurnTo(m_guardMaster.Coordinate); m_guardTrainee[2].Model = (ushort) m_rnd.Next(32, 55); m_guardTrainee[2].Size = (byte) (45 + m_rnd.Next(10)); m_guardTrainee[3].Position = m_guardMaster.Position + Vector.Create(-34, 88); - m_guardTrainee[3].TurnTo(m_guardMaster.Location); + m_guardTrainee[3].TurnTo(m_guardMaster.Coordinate); m_guardTrainee[3].Model = (ushort) m_rnd.Next(32, 55); m_guardTrainee[3].Size = (byte) (45 + m_rnd.Next(10)); m_guardTrainee[4].Position = m_guardMaster.Position + Vector.Create(52, 64); - m_guardTrainee[4].TurnTo(m_guardMaster.Location); + m_guardTrainee[4].TurnTo(m_guardMaster.Coordinate); m_guardTrainee[4].Model = (ushort) m_rnd.Next(32, 55); m_guardTrainee[4].Size = (byte) (45 + m_rnd.Next(10)); diff --git a/GameServerScripts/gameevents/FollowingNPC.cs b/GameServerScripts/gameevents/FollowingNPC.cs index 3f615d0697..92f5cb27c9 100644 --- a/GameServerScripts/gameevents/FollowingNPC.cs +++ b/GameServerScripts/gameevents/FollowingNPC.cs @@ -110,7 +110,7 @@ protected void CalculateWalkToSpot(object sender, ElapsedEventArgs args) } //Calculate the difference between our position and the players position - var diffVec = m_playerToFollow.Location - Location; + var diffVec = m_playerToFollow.Coordinate - Coordinate; //Calculate the distance to the player float distance = (float)Math.Sqrt(diffVec.X * diffVec.X + diffVec.Y * diffVec.Y); @@ -141,7 +141,7 @@ protected void CalculateWalkToSpot(object sender, ElapsedEventArgs args) speed = 50; //Make the mob walk to the new spot - var destination = m_playerToFollow.Location - Vector.Create((int)(diffVec.X/distance*50),(int)(diffVec.X/distance*50)); + var destination = m_playerToFollow.Coordinate - Vector.Create((int)(diffVec.X/distance*50),(int)(diffVec.X/distance*50)); PathTo(destination, (short)speed); } } diff --git a/GameServerScripts/gameevents/TalkingNPC.cs b/GameServerScripts/gameevents/TalkingNPC.cs index cb3ac5d7fd..9a06fb8f53 100644 --- a/GameServerScripts/gameevents/TalkingNPC.cs +++ b/GameServerScripts/gameevents/TalkingNPC.cs @@ -71,7 +71,7 @@ public override bool Interact(GamePlayer player) //Now we turn the npc into the direction of the person it is //speaking to. - TurnTo(player.Location); + TurnTo(player.Coordinate); //We send a message to player and make it appear in a popup //window. Text inside the [brackets] is clickable in popup @@ -98,7 +98,7 @@ public override bool WhisperReceive(GameLiving source, string str) //Now we turn the npc into the direction of the person it is //speaking to. - TurnTo(t.Location); + TurnTo(t.Coordinate); //We test what the player whispered to the npc and //send a reply. The Method SendReply used here is diff --git a/GameServerScripts/quests/Albion/GodelevasNeed.cs b/GameServerScripts/quests/Albion/GodelevasNeed.cs index 0a515557e3..08efeccac5 100644 --- a/GameServerScripts/quests/Albion/GodelevasNeed.cs +++ b/GameServerScripts/quests/Albion/GodelevasNeed.cs @@ -476,7 +476,7 @@ protected static void PlayerUseSlot(DOLEvent e, object sender, EventArgs args) InventoryItem item = player.Inventory.GetItem((eInventorySlot)uArgs.Slot); if (item != null && item.Id_nb == woodenBucket.Id_nb) { - if (player.Location.DistanceTo(cotswoldBridgeLocation) <= 500) + if (player.Coordinate.DistanceTo(cotswoldBridgeLocation) <= 500) { SendSystemMessage(player, "You use the wooden bucket and scoop up some fresh river water."); diff --git a/GameServerScripts/quests/Albion/RevengeTheOtherWhiteMeat.cs b/GameServerScripts/quests/Albion/RevengeTheOtherWhiteMeat.cs index 8ad035163d..1740e678fa 100644 --- a/GameServerScripts/quests/Albion/RevengeTheOtherWhiteMeat.cs +++ b/GameServerScripts/quests/Albion/RevengeTheOtherWhiteMeat.cs @@ -499,7 +499,7 @@ public override void Notify(DOLEvent e, object sender, EventArgs args) GameEventMgr.AddHandler(pigHerderWyatt, GameNPCEvent.ArriveAtTarget, new DOLEventHandler(OnCloseToDeadWilbur)); var offset = Vector.Create(x: -90, y: 90 ); - pigHerderWyatt.WalkTo(gArgs.Target.Location + offset, 200); + pigHerderWyatt.WalkTo(gArgs.Target.Coordinate + offset, 200); return; } diff --git a/GameServerScripts/quests/Albion/TraitorInCotswold.cs b/GameServerScripts/quests/Albion/TraitorInCotswold.cs index 8dd2da9be3..fcc67bc818 100644 --- a/GameServerScripts/quests/Albion/TraitorInCotswold.cs +++ b/GameServerScripts/quests/Albion/TraitorInCotswold.cs @@ -438,7 +438,7 @@ protected static void PlayerUseSlot(DOLEvent e, object sender, EventArgs args) InventoryItem item = player.Inventory.GetItem((eInventorySlot)uArgs.Slot); if (item != null && item.Id_nb == necklaceOfDoppelganger.Id_nb) { - if (player.Location.DistanceTo(felinEnd) <= 2500) + if (player.Coordinate.DistanceTo(felinEnd) <= 2500) { foreach (GamePlayer visPlayer in player.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE)) { diff --git a/GameServerScripts/quests/Albion/epic/Academy50.cs b/GameServerScripts/quests/Albion/epic/Academy50.cs index 009c00e6d8..4036ca49c4 100644 --- a/GameServerScripts/quests/Albion/epic/Academy50.cs +++ b/GameServerScripts/quests/Albion/epic/Academy50.cs @@ -1032,7 +1032,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) #endregion - morganaArea = WorldMgr.GetRegion(Morgana.CurrentRegionID).AddArea(new Area.Circle(null, Morgana.Location, 1000)); + morganaArea = WorldMgr.GetRegion(Morgana.CurrentRegionID).AddArea(new Area.Circle(null, Morgana.Coordinate, 1000)); morganaArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterMorganaArea)); GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest)); diff --git a/GameServerScripts/quests/Hibernia/TraitorInMagMell.cs b/GameServerScripts/quests/Hibernia/TraitorInMagMell.cs index 4c6c6585db..ec7b169fd1 100644 --- a/GameServerScripts/quests/Hibernia/TraitorInMagMell.cs +++ b/GameServerScripts/quests/Hibernia/TraitorInMagMell.cs @@ -435,7 +435,7 @@ protected static void PlayerUseSlot(DOLEvent e, object sender, EventArgs args) InventoryItem item = player.Inventory.GetItem((eInventorySlot)uArgs.Slot); if (item != null && item.Id_nb == necklaceOfDoppelganger.Id_nb) { - if (player.Location.DistanceTo(legadaEnd) <= 2500) + if (player.Coordinate.DistanceTo(legadaEnd) <= 2500) { foreach (GamePlayer visPlayer in player.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE)) { diff --git a/GameServerScripts/quests/Midgard/TraitorInMularn.cs b/GameServerScripts/quests/Midgard/TraitorInMularn.cs index ecb6bb9f79..d61fcd865b 100644 --- a/GameServerScripts/quests/Midgard/TraitorInMularn.cs +++ b/GameServerScripts/quests/Midgard/TraitorInMularn.cs @@ -439,7 +439,7 @@ protected static void PlayerUseSlot(DOLEvent e, object sender, EventArgs args) InventoryItem item = player.Inventory.GetItem((eInventorySlot)uArgs.Slot); if (item != null && item.Id_nb == necklaceOfDoppelganger.Id_nb) { - if (player.Location.DistanceTo(hindaEnd) <= 2500) + if (player.Coordinate.DistanceTo(hindaEnd) <= 2500) { foreach (GamePlayer visPlayer in player.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE)) {