From 4e0cf36552a278197a0aa0cb0af18142cf586ac4 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Sat, 5 Feb 2022 17:48:49 -0500 Subject: [PATCH 1/6] Refactored some actor field names --- Map Server/Actors/Actor.cs | 102 ++++---- Map Server/Actors/Area/Area.cs | 38 +-- Map Server/Actors/Area/PrivateArea.cs | 4 +- Map Server/Actors/Area/Zone.cs | 2 +- .../Chara/Ai/Controllers/AllyController.cs | 2 +- .../Ai/Controllers/BattleNpcController.cs | 4 +- .../Actors/Chara/Ai/Helpers/TargetFind.cs | 2 +- .../Actors/Chara/Ai/State/AbilityState.cs | 6 +- .../Actors/Chara/Ai/State/AttackState.cs | 2 +- .../Actors/Chara/Ai/State/MagicState.cs | 8 +- .../Actors/Chara/Ai/State/WeaponSkillState.cs | 6 +- .../Actors/Chara/Ai/StatusEffectContainer.cs | 10 +- .../Actors/Chara/Ai/Utils/BattleUtils.cs | 8 +- Map Server/Actors/Chara/Character.cs | 52 ++-- Map Server/Actors/Chara/ItemPackage.cs | 74 +++--- Map Server/Actors/Chara/Npc/BattleNpc.cs | 4 +- Map Server/Actors/Chara/Npc/Npc.cs | 22 +- Map Server/Actors/Chara/Npc/Retainer.cs | 2 +- Map Server/Actors/Chara/Player/Player.cs | 224 +++++++++--------- .../Actors/Chara/ReferencedItemPackage.cs | 52 ++-- Map Server/Actors/Command/Command.cs | 2 +- Map Server/Actors/Debug/Debug.cs | 8 +- Map Server/Actors/Director/Director.cs | 10 +- .../Actors/Director/GuildleveDirector.cs | 2 +- Map Server/Actors/Group/ContentGroup.cs | 6 +- Map Server/Actors/Group/MonsterParty.cs | 4 +- Map Server/Actors/Group/Party.cs | 6 +- Map Server/Actors/Group/RelationGroup.cs | 4 +- .../Group/RetainerMeetingRelationGroup.cs | 4 +- Map Server/Actors/Group/TradeGroup.cs | 4 +- Map Server/Actors/Judge/Judge.cs | 2 +- Map Server/Actors/Quest/Quest.cs | 8 +- Map Server/Actors/StaticActors.cs | 2 +- Map Server/Actors/World/WorldMaster.cs | 8 +- Map Server/DataObjects/Session.cs | 12 +- Map Server/Database.cs | 110 ++++----- Map Server/Lua/LuaEngine.cs | 24 +- Map Server/Lua/LuaUtils.cs | 2 +- Map Server/PacketProcessor.cs | 10 +- Map Server/Server.cs | 2 +- Map Server/Utils/ActorPropertyPacketUtil.cs | 4 +- Map Server/WorldManager.cs | 66 +++--- 42 files changed, 462 insertions(+), 462 deletions(-) diff --git a/Map Server/Actors/Actor.cs b/Map Server/Actors/Actor.cs index fbe95e81..4460ef94 100644 --- a/Map Server/Actors/Actor.cs +++ b/Map Server/Actors/Actor.cs @@ -59,11 +59,11 @@ namespace Meteor.Map.Actors class Actor { public static uint INVALID_ACTORID = 0xC0000000; - public uint actorId; - public string actorName; + public uint Id; + public string Name; - public int displayNameId = -1; - public string customDisplayName; + public int LocalizedDisplayName = -1; + public string DisplayName; public ushort currentMainState = SetActorStatePacket.MAIN_STATE_PASSIVE; @@ -98,13 +98,13 @@ namespace Meteor.Map.Actors public Actor(uint actorId) { - this.actorId = actorId; + this.Id = actorId; } public Actor(uint actorId, string actorName, string className, List classParams) { - this.actorId = actorId; - this.actorName = actorName; + this.Id = actorId; + this.Name = actorName; this.className = className; this.classParams = classParams; @@ -143,17 +143,17 @@ namespace Meteor.Map.Actors public SubPacket CreateAddActorPacket(byte val) { - return AddActorPacket.BuildPacket(actorId, val); + return AddActorPacket.BuildPacket(Id, val); } public SubPacket CreateNamePacket() { - return SetActorNamePacket.BuildPacket(actorId, customDisplayName != null ? 0 : displayNameId, displayNameId == 0xFFFFFFFF | displayNameId == 0x0 | customDisplayName != null ? customDisplayName : ""); + return SetActorNamePacket.BuildPacket(Id, DisplayName != null ? 0 : LocalizedDisplayName, LocalizedDisplayName == 0xFFFFFFFF | LocalizedDisplayName == 0x0 | DisplayName != null ? DisplayName : ""); } public SubPacket CreateSpeedPacket() { - return SetActorSpeedPacket.BuildPacket(actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2], moveSpeeds[3]); + return SetActorSpeedPacket.BuildPacket(Id, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2], moveSpeeds[3]); } public SubPacket CreateSpawnPositonPacket(ushort spawnType) @@ -164,18 +164,18 @@ namespace Meteor.Map.Actors public SubPacket CreateSpawnPositonPacket(Player player, ushort spawnType) { //TODO: FIX THIS IF - uint playerActorId = player == null ? 0 : player.actorId; //Get Rid + uint playerActorId = player == null ? 0 : player.Id; //Get Rid SubPacket spawnPacket; - if (!spawnedFirstTime && playerActorId == actorId) - spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0, positionX, positionY, positionZ, rotation, 0x1, false); - else if (playerActorId == actorId) - spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, true); + if (!spawnedFirstTime && playerActorId == Id) + spawnPacket = SetActorPositionPacket.BuildPacket(Id, 0, positionX, positionY, positionZ, rotation, 0x1, false); + else if (playerActorId == Id) + spawnPacket = SetActorPositionPacket.BuildPacket(Id, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, true); else { if (this is Player) - spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0, positionX, positionY, positionZ, rotation, spawnType, false); + spawnPacket = SetActorPositionPacket.BuildPacket(Id, 0, positionX, positionY, positionZ, rotation, spawnType, false); else - spawnPacket = SetActorPositionPacket.BuildPacket(actorId, actorId, positionX, positionY, positionZ, rotation, spawnType, false); + spawnPacket = SetActorPositionPacket.BuildPacket(Id, Id, positionX, positionY, positionZ, rotation, spawnType, false); } //return SetActorPositionPacket.BuildPacket(actorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE); @@ -188,7 +188,7 @@ namespace Meteor.Map.Actors { SubPacket spawnPacket; - spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, false); + spawnPacket = SetActorPositionPacket.BuildPacket(Id, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, false); //return SetActorPositionPacket.BuildPacket(actorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE); @@ -199,12 +199,12 @@ namespace Meteor.Map.Actors public SubPacket CreatePositionUpdatePacket() { - return MoveActorToPositionPacket.BuildPacket(actorId, positionX, positionY, positionZ, rotation, moveState); + return MoveActorToPositionPacket.BuildPacket(Id, positionX, positionY, positionZ, rotation, moveState); } public SubPacket CreateStatePacket() { - return SetActorStatePacket.BuildPacket(actorId, currentMainState, 0); + return SetActorStatePacket.BuildPacket(Id, currentMainState, 0); } public List GetEventConditionPackets() @@ -218,37 +218,37 @@ namespace Meteor.Map.Actors if (eventConditions.talkEventConditions != null) { foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions) - subpackets.Add(SetTalkEventCondition.BuildPacket(actorId, condition)); + subpackets.Add(SetTalkEventCondition.BuildPacket(Id, condition)); } if (eventConditions.noticeEventConditions != null) { foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions) - subpackets.Add(SetNoticeEventCondition.BuildPacket(actorId, condition)); + subpackets.Add(SetNoticeEventCondition.BuildPacket(Id, condition)); } if (eventConditions.emoteEventConditions != null) { foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions) - subpackets.Add(SetEmoteEventCondition.BuildPacket(actorId, condition)); + subpackets.Add(SetEmoteEventCondition.BuildPacket(Id, condition)); } if (eventConditions.pushWithCircleEventConditions != null) { foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions) - subpackets.Add(SetPushEventConditionWithCircle.BuildPacket(actorId, condition)); + subpackets.Add(SetPushEventConditionWithCircle.BuildPacket(Id, condition)); } if (eventConditions.pushWithFanEventConditions != null) { foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions) - subpackets.Add(SetPushEventConditionWithFan.BuildPacket(actorId, condition)); + subpackets.Add(SetPushEventConditionWithFan.BuildPacket(Id, condition)); } if (eventConditions.pushWithBoxEventConditions != null) { foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions) - subpackets.Add(SetPushEventConditionWithTriggerBox.BuildPacket(actorId, condition)); + subpackets.Add(SetPushEventConditionWithTriggerBox.BuildPacket(Id, condition)); } return subpackets; @@ -265,37 +265,37 @@ namespace Meteor.Map.Actors if (eventConditions.talkEventConditions != null) { foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions) - subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, talkEnabled, 1, condition.conditionName)); + subpackets.Add(SetEventStatusPacket.BuildPacket(Id, talkEnabled, 1, condition.conditionName)); } if (eventConditions.noticeEventConditions != null) { foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions) - subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, noticeEnabled, 5, condition.conditionName)); + subpackets.Add(SetEventStatusPacket.BuildPacket(Id, noticeEnabled, 5, condition.conditionName)); } if (eventConditions.emoteEventConditions != null) { foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions) - subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, emoteEnabled, 3, condition.conditionName)); + subpackets.Add(SetEventStatusPacket.BuildPacket(Id, emoteEnabled, 3, condition.conditionName)); } if (eventConditions.pushWithCircleEventConditions != null) { foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions) - subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, pushEnabled, 2, condition.conditionName)); + subpackets.Add(SetEventStatusPacket.BuildPacket(Id, pushEnabled, 2, condition.conditionName)); } if (eventConditions.pushWithFanEventConditions != null) { foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions) - subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, pushEnabled, 2, condition.conditionName)); + subpackets.Add(SetEventStatusPacket.BuildPacket(Id, pushEnabled, 2, condition.conditionName)); } if (eventConditions.pushWithBoxEventConditions != null) { foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions) - subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, pushEnabled, 2, condition.conditionName)); + subpackets.Add(SetEventStatusPacket.BuildPacket(Id, pushEnabled, 2, condition.conditionName)); } return subpackets; @@ -303,17 +303,17 @@ namespace Meteor.Map.Actors public SubPacket CreateIsZoneingPacket() { - return SetActorIsZoningPacket.BuildPacket(actorId, false); + return SetActorIsZoningPacket.BuildPacket(Id, false); } public virtual SubPacket CreateScriptBindPacket(Player player) { - return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, classParams); + return ActorInstantiatePacket.BuildPacket(Id, Name, className, classParams); } public virtual SubPacket CreateScriptBindPacket() { - return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, classParams); + return ActorInstantiatePacket.BuildPacket(Id, Name, className, classParams); } public virtual List GetSpawnPackets(Player player, ushort spawnType) @@ -357,7 +357,7 @@ namespace Meteor.Map.Actors initProperties.AddByte(0x2138FD71, 1); initProperties.AddByte(0xFBFBCFB1, 1); initProperties.AddTarget(); - packets.Add(initProperties.BuildPacket(actorId)); + packets.Add(initProperties.BuildPacket(Id)); return packets; } @@ -367,12 +367,12 @@ namespace Meteor.Map.Actors if (actorObj == null) return false; else - return actorId == actorObj.actorId; + return Id == actorObj.Id; } public string GetName() { - return actorName; + return Name; } public string GetClassName() @@ -473,22 +473,22 @@ namespace Meteor.Map.Actors if ((updateFlags & ActorUpdateFlags.Speed) != 0) { - packets.Add(SetActorSpeedPacket.BuildPacket(actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2], moveSpeeds[3])); + packets.Add(SetActorSpeedPacket.BuildPacket(Id, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2], moveSpeeds[3])); } if ((updateFlags & ActorUpdateFlags.Name) != 0) { - packets.Add(SetActorNamePacket.BuildPacket(actorId, displayNameId, customDisplayName)); + packets.Add(SetActorNamePacket.BuildPacket(Id, LocalizedDisplayName, DisplayName)); } if ((updateFlags & ActorUpdateFlags.State) != 0) { - packets.Add(SetActorStatePacket.BuildPacket(actorId, currentMainState, 0x3B)); + packets.Add(SetActorStatePacket.BuildPacket(Id, currentMainState, 0x3B)); } if ((updateFlags & ActorUpdateFlags.SubState) != 0) { - packets.Add(SetActorSubStatePacket.BuildPacket(actorId, currentSubState)); + packets.Add(SetActorSubStatePacket.BuildPacket(Id, currentSubState)); } updateFlags = ActorUpdateFlags.None; @@ -538,7 +538,7 @@ namespace Meteor.Map.Actors uint zoneId = CurrentArea.ZoneId; int privLevel = CurrentArea.GetPrivateAreaType(); - actorName = String.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel); + Name = String.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel); } public bool SetWorkValue(Player player, string name, string uiFunc, object value) @@ -594,7 +594,7 @@ namespace Meteor.Map.Actors SetActorPropetyPacket changeProperty = new SetActorPropetyPacket(uiFunc); changeProperty.AddProperty(this, name); changeProperty.AddTarget(); - SubPacket subpacket = changeProperty.BuildPacket(player.actorId); + SubPacket subpacket = changeProperty.BuildPacket(player.Id); player.playerSession.QueuePacket(subpacket); subpacket.DebugPrintSubPacket(); return true; @@ -612,7 +612,7 @@ namespace Meteor.Map.Actors SetActorPropetyPacket changeProperty = new SetActorPropetyPacket(uiFunc); changeProperty.AddProperty(this, name); changeProperty.AddTarget(); - SubPacket subpacket = changeProperty.BuildPacket(player.actorId); + SubPacket subpacket = changeProperty.BuildPacket(player.Id); player.playerSession.QueuePacket(subpacket); subpacket.DebugPrintSubPacket(); return true; @@ -655,7 +655,7 @@ namespace Meteor.Map.Actors rotation = rot; // todo: handle zone? - CurrentArea.BroadcastPacketAroundActor(this, MoveActorToPositionPacket.BuildPacket(actorId, x, y, z, rot, moveState)); + CurrentArea.BroadcastPacketAroundActor(this, MoveActorToPositionPacket.BuildPacket(Id, x, y, z, rot, moveState)); } public void LookAt(Actor actor) @@ -666,7 +666,7 @@ namespace Meteor.Map.Actors } else { - Program.Log.Error("[{0}][{1}] Actor.LookAt() unable to find actor!", actorId, actorName); + Program.Log.Error("[{0}][{1}] Actor.LookAt() unable to find actor!", Id, Name); } } @@ -708,7 +708,7 @@ namespace Meteor.Map.Actors { if (target == null) { - Program.Log.Error("[{0}][{1}] IsFacing no target!", actorId, actorName); + Program.Log.Error("[{0}][{1}] IsFacing no target!", Id, Name); return false; } @@ -746,7 +746,7 @@ namespace Meteor.Map.Actors { if (target == null) { - Program.Log.Error(String.Format("[{0} {1}] FindRandomPointAroundTarget: no target found!", this.actorId, this.customDisplayName)); + Program.Log.Error(String.Format("[{0} {1}] FindRandomPointAroundTarget: no target found!", this.Id, this.DisplayName)); return GetPosAsVector3(); } return FindRandomPoint(target.positionX, target.positionY, target.positionZ, minRadius, maxRadius); @@ -762,11 +762,11 @@ namespace Meteor.Map.Actors { if (className != null) { - return string.Format("{0} [0x{1:X}]", className, actorId); + return string.Format("{0} [0x{1:X}]", className, Id); } else { - return string.Format("Unknown [0x{0:X}]", actorId); + return string.Format("Unknown [0x{0:X}]", Id); } } } diff --git a/Map Server/Actors/Area/Area.cs b/Map Server/Actors/Area/Area.cs index 91beb7d1..857ace3d 100644 --- a/Map Server/Actors/Area/Area.cs +++ b/Map Server/Actors/Area/Area.cs @@ -77,9 +77,9 @@ namespace Meteor.Map.Actors this.bgmNight = bgmNight; this.bgmBattle = bgmBattle; - this.displayNameId = 0; - this.customDisplayName = "_areaMaster"; - this.actorName = String.Format("_areaMaster@{0:X5}", zoneId << 8); + this.LocalizedDisplayName = 0; + this.DisplayName = "_areaMaster"; + this.Name = String.Format("_areaMaster@{0:X5}", zoneId << 8); this.classPath = classPath; this.className = classPath.Substring(classPath.LastIndexOf("/") + 1); @@ -113,7 +113,7 @@ namespace Meteor.Map.Actors { List lParams; lParams = LuaUtils.CreateLuaParamList(classPath, false, true, ZoneName, "/Area/Zone/ZoneDefault", -1, (byte)1, true, false, false, false, false, false, false, false); - return ActorInstantiatePacket.BuildPacket(actorId, actorName, "ZoneDefault", lParams); + return ActorInstantiatePacket.BuildPacket(Id, Name, "ZoneDefault", lParams); } public override List GetSpawnPackets() @@ -139,8 +139,8 @@ namespace Meteor.Map.Actors if (actor is Character) ((Character)actor).ResetTempVars(); - if (!mActorList.ContainsKey(actor.actorId)) - mActorList.Add(actor.actorId, actor); + if (!mActorList.ContainsKey(actor.Id)) + mActorList.Add(actor.Id, actor); int gridX = (int)actor.positionX / boundingGridSize; @@ -169,7 +169,7 @@ namespace Meteor.Map.Actors if (actor != null) lock (mActorList) { - mActorList.Remove(actor.actorId); + mActorList.Remove(actor.Id); int gridX = (int)actor.positionX / boundingGridSize; int gridY = (int)actor.positionZ / boundingGridSize; @@ -377,7 +377,7 @@ namespace Meteor.Map.Actors { foreach (Player player in mActorList.Values.OfType()) { - if (player.customDisplayName.ToLower().Equals(name.ToLower())) + if (player.DisplayName.ToLower().Equals(name.ToLower())) return player; } return null; @@ -471,7 +471,7 @@ namespace Meteor.Map.Actors if (isIsolated) continue; - SubPacket clonedPacket = new SubPacket(packet, a.actorId); + SubPacket clonedPacket = new SubPacket(packet, a.Id); Player p = (Player)a; p.QueuePacket(clonedPacket); } @@ -490,9 +490,9 @@ namespace Meteor.Map.Actors uint zoneId; if (this is PrivateArea) - zoneId = ((PrivateArea)this).GetParentZone().actorId; + zoneId = ((PrivateArea)this).GetParentZone().Id; else - zoneId = actorId; + zoneId = Id; Npc npc = new Npc(mActorList.Count + 1, actorClass, location.uniqueId, this, location.x, location.y, location.z, location.rot, location.state, location.animId, null); @@ -514,9 +514,9 @@ namespace Meteor.Map.Actors uint zoneId; if (this is PrivateArea) - zoneId = ((PrivateArea)this).GetParentZone().actorId; + zoneId = ((PrivateArea)this).GetParentZone().Id; else - zoneId = actorId; + zoneId = Id; Npc npc; if (isMob) @@ -547,9 +547,9 @@ namespace Meteor.Map.Actors uint zoneId; if (this is PrivateArea) - zoneId = ((PrivateArea)this).GetParentZone().actorId; + zoneId = ((PrivateArea)this).GetParentZone().Id; else - zoneId = actorId; + zoneId = Id; Npc npc = new Npc(mActorList.Count + 1, actorClass, uniqueId, this, x, y, z, 0, regionId, layoutId); @@ -592,7 +592,7 @@ namespace Meteor.Map.Actors if (player != null && !zoneWide) { - player.QueuePacket(SetWeatherPacket.BuildPacket(player.actorId, weather, transitionTime)); + player.QueuePacket(SetWeatherPacket.BuildPacket(player.Id, weather, transitionTime)); } if (zoneWide) { @@ -603,7 +603,7 @@ namespace Meteor.Map.Actors if (actor.Value is Player) { player = ((Player)actor.Value); - player.QueuePacket(SetWeatherPacket.BuildPacket(player.actorId, weather, transitionTime)); + player.QueuePacket(SetWeatherPacket.BuildPacket(player.Id, weather, transitionTime)); } } } @@ -615,7 +615,7 @@ namespace Meteor.Map.Actors lock (directorLock) { Director director = new Director(directorIdCount, this, path, hasContentGroup, args); - currentDirectors.Add(director.actorId, director); + currentDirectors.Add(director.Id, director); directorIdCount++; return director; } @@ -663,7 +663,7 @@ namespace Meteor.Map.Actors lock (directorLock) { GuildleveDirector director = new GuildleveDirector(directorIdCount, this, directorScriptPath, glid, difficulty, owner, args); - currentDirectors.Add(director.actorId, director); + currentDirectors.Add(director.Id, director); directorIdCount++; return director; } diff --git a/Map Server/Actors/Area/PrivateArea.cs b/Map Server/Actors/Area/PrivateArea.cs index 3de2b712..273f288c 100644 --- a/Map Server/Actors/Area/PrivateArea.cs +++ b/Map Server/Actors/Area/PrivateArea.cs @@ -66,8 +66,8 @@ namespace Meteor.Map.actors.area string realClassName = className.Substring(className.LastIndexOf("/") + 1); lParams = LuaUtils.CreateLuaParamList(classPath, false, true, ZoneName, PrivateAreaName, PrivateAreaType, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, false, false, false); - ActorInstantiatePacket.BuildPacket(actorId, actorName, realClassName, lParams).DebugPrintSubPacket(); - return ActorInstantiatePacket.BuildPacket(actorId, actorName, realClassName, lParams); + ActorInstantiatePacket.BuildPacket(Id, Name, realClassName, lParams).DebugPrintSubPacket(); + return ActorInstantiatePacket.BuildPacket(Id, Name, realClassName, lParams); } diff --git a/Map Server/Actors/Area/Zone.cs b/Map Server/Actors/Area/Zone.cs index 86198813..9c2511bd 100644 --- a/Map Server/Actors/Area/Zone.cs +++ b/Map Server/Actors/Area/Zone.cs @@ -95,7 +95,7 @@ namespace Meteor.Map.actors.area List lParams; lParams = LuaUtils.CreateLuaParamList(classPath, false, true, ZoneName, "", -1, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, true, isInstanceRaid, isEntranceDesion); - return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams); + return ActorInstantiatePacket.BuildPacket(Id, Name, className, lParams); } public void AddSpawnLocation(SpawnLocation spawn) diff --git a/Map Server/Actors/Chara/Ai/Controllers/AllyController.cs b/Map Server/Actors/Chara/Ai/Controllers/AllyController.cs index aeeec93d..196db7fd 100644 --- a/Map Server/Actors/Chara/Ai/Controllers/AllyController.cs +++ b/Map Server/Actors/Chara/Ai/Controllers/AllyController.cs @@ -66,7 +66,7 @@ namespace Meteor.Map.actors.chara.ai.controllers { if(owner.aiContainer.GetTargetFind().CanTarget((Character) chara.target) && chara.target is BattleNpc && ((BattleNpc)chara.target).hateContainer.HasHateForTarget(chara)) { - owner.Engage(chara.target.actorId); + owner.Engage(chara.target.Id); owner.hateContainer.AddBaseHate((Character) chara.target); break; } diff --git a/Map Server/Actors/Chara/Ai/Controllers/BattleNpcController.cs b/Map Server/Actors/Chara/Ai/Controllers/BattleNpcController.cs index b814c874..cf0e5e7f 100644 --- a/Map Server/Actors/Chara/Ai/Controllers/BattleNpcController.cs +++ b/Map Server/Actors/Chara/Ai/Controllers/BattleNpcController.cs @@ -417,8 +417,8 @@ namespace Meteor.Map.actors.chara.ai.controllers if (target != owner.target) { owner.target = target; - owner.currentLockedTarget = target?.actorId ?? Actor.INVALID_ACTORID; - owner.currentTarget = target?.actorId ?? Actor.INVALID_ACTORID; + owner.currentLockedTarget = target?.Id ?? Actor.INVALID_ACTORID; + owner.currentTarget = target?.Id ?? Actor.INVALID_ACTORID; foreach (var player in owner.CurrentArea.GetActorsAroundActor(owner, 50)) player.QueuePacket(owner.GetHateTypePacket(player)); diff --git a/Map Server/Actors/Chara/Ai/Helpers/TargetFind.cs b/Map Server/Actors/Chara/Ai/Helpers/TargetFind.cs index 3660ad70..6b7062c1 100644 --- a/Map Server/Actors/Chara/Ai/Helpers/TargetFind.cs +++ b/Map Server/Actors/Chara/Ai/Helpers/TargetFind.cs @@ -332,7 +332,7 @@ namespace Meteor.Map.actors.chara.ai { if (!(owner is BattleNpc)) { - Program.Log.Error($"TargetFind.AddAllInHateList() owner [{owner.actorId}] {owner.customDisplayName} {owner.actorName} is not a BattleNpc"); + Program.Log.Error($"TargetFind.AddAllInHateList() owner [{owner.Id}] {owner.DisplayName} {owner.Name} is not a BattleNpc"); } else { diff --git a/Map Server/Actors/Chara/Ai/State/AbilityState.cs b/Map Server/Actors/Chara/Ai/State/AbilityState.cs index 46966740..d2ca33db 100644 --- a/Map Server/Actors/Chara/Ai/State/AbilityState.cs +++ b/Map Server/Actors/Chara/Ai/State/AbilityState.cs @@ -40,7 +40,7 @@ namespace Meteor.Map.actors.chara.ai.state this.target = (skill.mainTarget & ValidTarget.SelfOnly) != 0 ? owner : target; - errorResult = new CommandResult(owner.actorId, 32553, 0); + errorResult = new CommandResult(owner.Id, 32553, 0); if (returnCode == 0) { OnStart(); @@ -59,7 +59,7 @@ namespace Meteor.Map.actors.chara.ai.state if (returnCode != 0) { interrupt = true; - errorResult = new CommandResult(owner.actorId, (ushort)(returnCode == -1 ? 32558 : returnCode), 0); + errorResult = new CommandResult(owner.Id, (ushort)(returnCode == -1 ? 32558 : returnCode), 0); } else { @@ -76,7 +76,7 @@ namespace Meteor.Map.actors.chara.ai.state owner.GetSubState().chantId = 0xf0; owner.SubstateModified(); //You ready [skill] (6F000002: BLM, 6F000003: WHM, 0x6F000008: BRD) - owner.DoBattleAction(skill.id, (uint)0x6F000000 | skill.castType, new CommandResult(target.actorId, 30126, 1, 0, 1)); + owner.DoBattleAction(skill.id, (uint)0x6F000000 | skill.castType, new CommandResult(target.Id, 30126, 1, 0, 1)); } } } diff --git a/Map Server/Actors/Chara/Ai/State/AttackState.cs b/Map Server/Actors/Chara/Ai/State/AttackState.cs index 7f770504..9ee73cf2 100644 --- a/Map Server/Actors/Chara/Ai/State/AttackState.cs +++ b/Map Server/Actors/Chara/Ai/State/AttackState.cs @@ -49,7 +49,7 @@ namespace Meteor.Map.actors.chara.ai.state public override bool Update(DateTime tick) { - if ((target == null || owner.target != target || owner.target?.actorId != owner.currentLockedTarget) && owner.isAutoAttackEnabled) + if ((target == null || owner.target != target || owner.target?.Id != owner.currentLockedTarget) && owner.isAutoAttackEnabled) owner.aiContainer.ChangeTarget(target = owner.CurrentArea.FindActorInArea(owner.currentTarget)); if (target == null || target.IsDead()) diff --git a/Map Server/Actors/Chara/Ai/State/MagicState.cs b/Map Server/Actors/Chara/Ai/State/MagicState.cs index de303721..a5a65022 100644 --- a/Map Server/Actors/Chara/Ai/State/MagicState.cs +++ b/Map Server/Actors/Chara/Ai/State/MagicState.cs @@ -47,7 +47,7 @@ namespace Meteor.Map.actors.chara.ai.state this.target = (spell.mainTarget & ValidTarget.SelfOnly) != 0 ? owner : target; - errorResult = new CommandResult(owner.actorId, 32553, 0); + errorResult = new CommandResult(owner.Id, 32553, 0); if (returnCode == 0 && owner.CanUse(this.target, spell, errorResult)) { OnStart(); @@ -65,7 +65,7 @@ namespace Meteor.Map.actors.chara.ai.state if (returnCode != 0) { interrupt = true; - errorResult = new CommandResult(target.actorId, (ushort)(returnCode == -1 ? 32553 : returnCode), 0, 0, 0, 1); + errorResult = new CommandResult(target.Id, (ushort)(returnCode == -1 ? 32553 : returnCode), 0, 0, 0, 1); } else { @@ -98,7 +98,7 @@ namespace Meteor.Map.actors.chara.ai.state } owner.GetSubState().chantId = 0xf0; owner.SubstateModified(); - owner.DoBattleAction(spell.id, (uint) 0x6F000000 | spell.castType, new CommandResult(target.actorId, 30128, 1, 0, 1)); //You begin casting (6F000002: BLM, 6F000003: WHM, 0x6F000008: BRD) + owner.DoBattleAction(spell.id, (uint) 0x6F000000 | spell.castType, new CommandResult(target.Id, 30128, 1, 0, 1)); //You begin casting (6F000002: BLM, 6F000003: WHM, 0x6F000008: BRD) } } } @@ -174,7 +174,7 @@ namespace Meteor.Map.actors.chara.ai.state if (HasMoved()) { - errorResult = new CommandResult(owner.actorId, 30211, 0); + errorResult = new CommandResult(owner.Id, 30211, 0); errorResult.animation = 0x7F000002; interrupt = true; return; diff --git a/Map Server/Actors/Chara/Ai/State/WeaponSkillState.cs b/Map Server/Actors/Chara/Ai/State/WeaponSkillState.cs index 27a4d190..b16c6bd7 100644 --- a/Map Server/Actors/Chara/Ai/State/WeaponSkillState.cs +++ b/Map Server/Actors/Chara/Ai/State/WeaponSkillState.cs @@ -41,7 +41,7 @@ namespace Meteor.Map.actors.chara.ai.state this.target = (skill.mainTarget & ValidTarget.SelfOnly) != 0 ? owner : target; - errorResult = new CommandResult(owner.actorId, 32553, 0); + errorResult = new CommandResult(owner.Id, 32553, 0); if (returnCode == 0 && owner.CanUse(this.target, skill, errorResult)) { OnStart(); @@ -60,7 +60,7 @@ namespace Meteor.Map.actors.chara.ai.state if (returnCode != 0) { interrupt = true; - errorResult = new CommandResult(owner.actorId, (ushort)(returnCode == -1 ? 32558 : returnCode), 0); + errorResult = new CommandResult(owner.Id, (ushort)(returnCode == -1 ? 32558 : returnCode), 0); } else { @@ -106,7 +106,7 @@ namespace Meteor.Map.actors.chara.ai.state owner.GetSubState().chantId = 0xf0; owner.SubstateModified(); //You ready [skill] (6F000002: BLM, 6F000003: WHM, 0x6F000008: BRD) - owner.DoBattleAction(skill.id, (uint)0x6F000000 | skill.castType, new CommandResult(target.actorId, 30126, 1, 0, 1)); + owner.DoBattleAction(skill.id, (uint)0x6F000000 | skill.castType, new CommandResult(target.Id, 30126, 1, 0, 1)); } } } diff --git a/Map Server/Actors/Chara/Ai/StatusEffectContainer.cs b/Map Server/Actors/Chara/Ai/StatusEffectContainer.cs index 39623d39..e5deb8f4 100644 --- a/Map Server/Actors/Chara/Ai/StatusEffectContainer.cs +++ b/Map Server/Actors/Chara/Ai/StatusEffectContainer.cs @@ -97,7 +97,7 @@ namespace Meteor.Map.actors.chara.ai { //Unsure why 10105 is the textId used //Also unsure why magicshield is used - CommandResult action = new CommandResult(owner.actorId, 10105, (uint)(HitEffect.MagicEffectType | HitEffect.MagicShield | HitEffect.NoResist), dotTick); + CommandResult action = new CommandResult(owner.Id, 10105, (uint)(HitEffect.MagicEffectType | HitEffect.MagicShield | HitEffect.NoResist), dotTick); utils.BattleUtils.HandleStoneskin(owner, action); // todo: figure out how to make red numbers appear for enemies getting hurt by dots resultContainer.AddAction(action); @@ -202,7 +202,7 @@ namespace Meteor.Map.actors.chara.ai if (newEffect != null && !newEffect.GetSilentOnGain()) { if (actionContainer != null) - actionContainer.AddAction(new CommandResult(owner.actorId, worldmasterTextId, newEffect.GetStatusEffectId() | (uint)HitEffect.StatusEffectType)); + actionContainer.AddAction(new CommandResult(owner.Id, worldmasterTextId, newEffect.GetStatusEffectId() | (uint)HitEffect.StatusEffectType)); } // wont send a message about losing effect here @@ -254,7 +254,7 @@ namespace Meteor.Map.actors.chara.ai { //Only send a message if we're using an actioncontainer and the effect normally sends a message when it's lost if (actionContainer != null) - actionContainer.AddAction(new CommandResult(owner.actorId, worldmasterTextId, effect.GetStatusEffectId() | (playEffect ? 0 : (uint)HitEffect.StatusLossType))); + actionContainer.AddAction(new CommandResult(owner.Id, worldmasterTextId, effect.GetStatusEffectId() | (playEffect ? 0 : (uint)HitEffect.StatusLossType))); } //hidden effects not in charawork @@ -382,7 +382,7 @@ namespace Meteor.Map.actors.chara.ai { owner.charaWork.status[index] = statusId; - statusSubpackets.Add(SetActorStatusPacket.BuildPacket(owner.actorId, (ushort)index, statusId)); + statusSubpackets.Add(SetActorStatusPacket.BuildPacket(owner.Id, (ushort)index, statusId)); owner.updateFlags |= ActorUpdateFlags.Status; } @@ -439,7 +439,7 @@ namespace Meteor.Map.actors.chara.ai SetStatusAtIndex(index, (ushort) (newEffectId - 200000)); SetTimeAtIndex(index, time); - return new CommandResult(owner.actorId, 30330, (uint) HitEffect.StatusEffectType | newEffectId); + return new CommandResult(owner.Id, 30330, (uint) HitEffect.StatusEffectType | newEffectId); } } } diff --git a/Map Server/Actors/Chara/Ai/Utils/BattleUtils.cs b/Map Server/Actors/Chara/Ai/Utils/BattleUtils.cs index 6907f4a6..264f04f1 100644 --- a/Map Server/Actors/Chara/Ai/Utils/BattleUtils.cs +++ b/Map Server/Actors/Chara/Ai/Utils/BattleUtils.cs @@ -513,7 +513,7 @@ namespace Meteor.Map.actors.chara.ai.utils if (skill != null && skill.numHits > 1) { if (action.hitNum == 1) - actionContainer?.AddAction(new CommandResult(attacker.actorId, 30441, 0)); + actionContainer?.AddAction(new CommandResult(attacker.Id, 30441, 0)); textIds = MultiHitTypeTextIds; } @@ -717,7 +717,7 @@ namespace Meteor.Map.actors.chara.ai.utils { //If we need an extra action to show the status text if (isAdditional) - results.AddAction(target.actorId, effect.GetStatusGainTextId(), skill.statusId | (uint) HitEffect.StatusEffectType); + results.AddAction(target.Id, effect.GetStatusGainTextId(), skill.statusId | (uint) HitEffect.StatusEffectType); } else action.worldMasterTextId = 32002;//Is this right? @@ -729,7 +729,7 @@ namespace Meteor.Map.actors.chara.ai.utils { //If we need an extra action to show the status text if (isAdditional) - results.AddAction(target.actorId, 30328, skill.statusId | (uint) HitEffect.StatusEffectType); + results.AddAction(target.Id, 30328, skill.statusId | (uint) HitEffect.StatusEffectType); } else action.worldMasterTextId = 32002;//Is this right? @@ -905,7 +905,7 @@ namespace Meteor.Map.actors.chara.ai.utils { expChainNumber = effect.GetTier(); timeLimit = (uint)(GetChainTimeLimit(expChainNumber)); - actionContainer?.AddEXPAction(new CommandResult(attacker.actorId, 33919, 0, expChainNumber, (byte)timeLimit)); + actionContainer?.AddEXPAction(new CommandResult(attacker.Id, 33919, 0, expChainNumber, (byte)timeLimit)); } totalBonus += GetChainBonus(expChainNumber); diff --git a/Map Server/Actors/Chara/Character.cs b/Map Server/Actors/Chara/Character.cs index 256421ab..914a7895 100644 --- a/Map Server/Actors/Chara/Character.cs +++ b/Map Server/Actors/Chara/Character.cs @@ -181,27 +181,27 @@ namespace Meteor.Map.Actors public SubPacket CreateAppearancePacket() { SetActorAppearancePacket setappearance = new SetActorAppearancePacket(modelId, appearanceIds); - return setappearance.BuildPacket(actorId); + return setappearance.BuildPacket(Id); } public SubPacket CreateInitStatusPacket() { - return (SetActorStatusAllPacket.BuildPacket(actorId, charaWork.status)); + return (SetActorStatusAllPacket.BuildPacket(Id, charaWork.status)); } public SubPacket CreateSetActorIconPacket() { - return SetActorIconPacket.BuildPacket(actorId, currentActorIcon); + return SetActorIconPacket.BuildPacket(Id, currentActorIcon); } public SubPacket CreateSubStatePacket() { - return SetActorSubStatePacket.BuildPacket(actorId, currentSubState); + return SetActorSubStatePacket.BuildPacket(Id, currentSubState); } public void SetQuestGraphic(Player player, int graphicNum) { - player.QueuePacket(SetActorQuestGraphicPacket.BuildPacket(actorId, graphicNum)); + player.QueuePacket(SetActorQuestGraphicPacket.BuildPacket(Id, graphicNum)); } public void SetCurrentContentGroup(ContentGroup group) @@ -240,20 +240,20 @@ namespace Meteor.Map.Actors if (onlySelf) { if (this is Player) - ((Player)this).QueuePacket(PlayAnimationOnActorPacket.BuildPacket(actorId, animId)); + ((Player)this).QueuePacket(PlayAnimationOnActorPacket.BuildPacket(Id, animId)); } else - CurrentArea.BroadcastPacketAroundActor(this, PlayAnimationOnActorPacket.BuildPacket(actorId, animId)); + CurrentArea.BroadcastPacketAroundActor(this, PlayAnimationOnActorPacket.BuildPacket(Id, animId)); } public void DoBattleAction(ushort commandId, uint animationId) { - CurrentArea.BroadcastPacketAroundActor(this, CommandResultX00Packet.BuildPacket(actorId, animationId, commandId)); + CurrentArea.BroadcastPacketAroundActor(this, CommandResultX00Packet.BuildPacket(Id, animationId, commandId)); } public void DoBattleAction(ushort commandId, uint animationId, CommandResult result) { - CurrentArea.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(actorId, animationId, commandId, result)); + CurrentArea.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(Id, animationId, commandId, result)); } public void DoBattleAction(ushort commandId, uint animationId, CommandResult[] results) @@ -263,12 +263,12 @@ namespace Meteor.Map.Actors while (true) { if (results.Length - currentIndex >= 10) - CurrentArea.BroadcastPacketAroundActor(this, CommandResultX18Packet.BuildPacket(actorId, animationId, commandId, results, ref currentIndex)); + CurrentArea.BroadcastPacketAroundActor(this, CommandResultX18Packet.BuildPacket(Id, animationId, commandId, results, ref currentIndex)); else if (results.Length - currentIndex > 1) - CurrentArea.BroadcastPacketAroundActor(this, CommandResultX10Packet.BuildPacket(actorId, animationId, commandId, results, ref currentIndex)); + CurrentArea.BroadcastPacketAroundActor(this, CommandResultX10Packet.BuildPacket(Id, animationId, commandId, results, ref currentIndex)); else if (results.Length - currentIndex == 1) { - CurrentArea.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(actorId, animationId, commandId, results[currentIndex])); + CurrentArea.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(Id, animationId, commandId, results[currentIndex])); currentIndex++; } else @@ -283,12 +283,12 @@ namespace Meteor.Map.Actors while (true) { if (results.Count - currentIndex >= 10) - CurrentArea.BroadcastPacketAroundActor(this, CommandResultX18Packet.BuildPacket(actorId, animationId, commandId, results, ref currentIndex)); + CurrentArea.BroadcastPacketAroundActor(this, CommandResultX18Packet.BuildPacket(Id, animationId, commandId, results, ref currentIndex)); else if (results.Count - currentIndex > 1) - CurrentArea.BroadcastPacketAroundActor(this, CommandResultX10Packet.BuildPacket(actorId, animationId, commandId, results, ref currentIndex)); + CurrentArea.BroadcastPacketAroundActor(this, CommandResultX10Packet.BuildPacket(Id, animationId, commandId, results, ref currentIndex)); else if (results.Count - currentIndex == 1) { - CurrentArea.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(actorId, animationId, commandId, results[currentIndex])); + CurrentArea.BroadcastPacketAroundActor(this, CommandResultX01Packet.BuildPacket(Id, animationId, commandId, results[currentIndex])); currentIndex++; } else @@ -405,14 +405,14 @@ namespace Meteor.Map.Actors if ((updateFlags & ActorUpdateFlags.Appearance) != 0) { - packets.Add(new SetActorAppearancePacket(modelId, appearanceIds).BuildPacket(actorId)); + packets.Add(new SetActorAppearancePacket(modelId, appearanceIds).BuildPacket(Id)); } if ((updateFlags & ActorUpdateFlags.State) != 0) { - packets.Add(SetActorStatePacket.BuildPacket(actorId, currentMainState, 0x0)); - packets.Add(CommandResultX00Packet.BuildPacket(actorId, 0x72000062, 0)); - packets.Add(CommandResultX01Packet.BuildPacket(actorId, 0x7C000062, 21001, new CommandResult(actorId, 0, 1))); + packets.Add(SetActorStatePacket.BuildPacket(Id, currentMainState, 0x0)); + packets.Add(CommandResultX00Packet.BuildPacket(Id, 0x72000062, 0)); + packets.Add(CommandResultX01Packet.BuildPacket(Id, 0x7C000062, 21001, new CommandResult(Id, 0, 1))); updateFlags &= ~ActorUpdateFlags.State; //DoBattleAction(21001, 0x7C000062, new BattleAction(this.actorId, 0, 1, 0, 0, 1)); //Attack Mode @@ -420,7 +420,7 @@ namespace Meteor.Map.Actors if ((updateFlags & ActorUpdateFlags.SubState) != 0) { - packets.Add(SetActorSubStatePacket.BuildPacket(actorId, currentSubState)); + packets.Add(SetActorSubStatePacket.BuildPacket(Id, currentSubState)); //packets.Add(CommandResultX00Packet.BuildPacket(actorId, 0x72000062, 0)); //packets.Add(CommandResultX01Packet.BuildPacket(actorId, 0x7C000062, 21001, new CommandResult(actorId, 0, 1))); @@ -1126,7 +1126,7 @@ namespace Meteor.Map.Actors ushort totalDamage = 0; for (int hitNum = 1; hitNum <= command.numHits; hitNum++) { - var action = new CommandResult(chara.actorId, command, (byte)GetHitDirection(chara), (byte) hitNum); + var action = new CommandResult(chara.Id, command, (byte)GetHitDirection(chara), (byte) hitNum); //uncached script lua.LuaEngine.CallLuaBattleCommandFunction(this, command, folder, "onSkillFinish", this, chara, command, action, actions); @@ -1145,7 +1145,7 @@ namespace Meteor.Map.Actors //30442: [hitCount]fold Attack! [chara] takes a total of totalDamage points of damage. //30450: All attacks miss! ushort textId = (ushort) (hitTarget ? 30442 : 30450); - actions.AddAction(new CommandResult(chara.actorId, textId, 0, totalDamage, (byte)hitCount)); + actions.AddAction(new CommandResult(chara.Id, textId, 0, totalDamage, (byte)hitCount)); } } @@ -1153,7 +1153,7 @@ namespace Meteor.Map.Actors } else { - actions.AddAction(new CommandResult(actorId, 30202, 0)); + actions.AddAction(new CommandResult(Id, 30202, 0)); } DelMP(command.CalculateMpCost(this)); @@ -1188,9 +1188,9 @@ namespace Meteor.Map.Actors if (!itemPackages.ContainsKey((ushort)id)) return; - player.QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true)); + player.QueuePacket(InventoryBeginChangePacket.BuildPacket(Id, true)); itemPackages[(ushort)id].SendFullPackage(player); - player.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId)); + player.QueuePacket(InventoryEndChangePacket.BuildPacket(Id)); } public void AddItem(uint catalogID) @@ -1297,7 +1297,7 @@ namespace Meteor.Map.Actors public InventoryItem GetItem(LuaUtils.ItemRefParam reference) { - if (reference.actorId != actorId) + if (reference.actorId != Id) return null; if (itemPackages.ContainsKey(reference.itemPackage)) { diff --git a/Map Server/Actors/Chara/ItemPackage.cs b/Map Server/Actors/Chara/ItemPackage.cs index be458b39..39beea0a 100644 --- a/Map Server/Actors/Chara/ItemPackage.cs +++ b/Map Server/Actors/Chara/ItemPackage.cs @@ -196,9 +196,9 @@ namespace Meteor.Map.actors.chara.player if (owner is Player) { - (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); SendUpdate(); - (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } return ERROR_SUCCESS; @@ -273,9 +273,9 @@ namespace Meteor.Map.actors.chara.player if (owner is Player) { - (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); SendUpdate(); - (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } return ERROR_SUCCESS; @@ -306,9 +306,9 @@ namespace Meteor.Map.actors.chara.player if (owner is Player) { - (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); SendUpdate(); - (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } return ERROR_SUCCESS; @@ -399,9 +399,9 @@ namespace Meteor.Map.actors.chara.player if (owner is Player) { - (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); SendUpdate(); - (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } } @@ -450,9 +450,9 @@ namespace Meteor.Map.actors.chara.player if (owner is Player) { - (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); SendUpdate(); - (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } } @@ -471,9 +471,9 @@ namespace Meteor.Map.actors.chara.player if (owner is Player) { - (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); SendUpdate(); - (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } } @@ -501,9 +501,9 @@ namespace Meteor.Map.actors.chara.player if (owner is Player) { - (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); SendUpdate(); - (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } } } @@ -520,9 +520,9 @@ namespace Meteor.Map.actors.chara.player if (owner is Player) { - (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); SendUpdate(); - (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + (owner as Player).QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } } @@ -606,9 +606,9 @@ namespace Meteor.Map.actors.chara.player #region Packet Functions public void SendFullPackage(Player player) { - player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, itemPackageCapacity, itemPackageCode)); + player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.Id, itemPackageCapacity, itemPackageCode)); SendItemPackets(player, 0); - player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); + player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.Id)); } public void SendUpdate() @@ -641,12 +641,12 @@ namespace Meteor.Map.actors.chara.player if (!holdingUpdates) Array.Clear(isDirty, 0, isDirty.Length); - player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, itemPackageCapacity, itemPackageCode)); + player.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.Id, itemPackageCapacity, itemPackageCode)); //Send Updated Slots SendItemPackets(player, items); //Send Remove packets for tail end SendItemPackets(player, slotsToRemove); - player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); + player.QueuePacket(InventorySetEndPacket.BuildPacket(owner.Id)); //If player is updating their normal inventory, we need to send //an equip update as well to resync the slots. if (player.Equals(owner) && itemPackageCode == NORMAL) @@ -655,7 +655,7 @@ namespace Meteor.Map.actors.chara.player private void SendItemPackets(Player player, InventoryItem item) { - player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, item)); + player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.Id, item)); } private void SendItemPackets(Player player, List items) @@ -665,16 +665,16 @@ namespace Meteor.Map.actors.chara.player while (true) { if (items.Count - currentIndex >= 64) - player.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + player.QueuePacket(InventoryListX64Packet.BuildPacket(owner.Id, items, ref currentIndex)); else if (items.Count - currentIndex >= 32) - player.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + player.QueuePacket(InventoryListX32Packet.BuildPacket(owner.Id, items, ref currentIndex)); else if (items.Count - currentIndex >= 16) - player.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + player.QueuePacket(InventoryListX16Packet.BuildPacket(owner.Id, items, ref currentIndex)); else if (items.Count - currentIndex > 1) - player.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + player.QueuePacket(InventoryListX08Packet.BuildPacket(owner.Id, items, ref currentIndex)); else if (items.Count - currentIndex == 1) { - player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex])); + player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.Id, items[currentIndex])); currentIndex++; } else @@ -693,16 +693,16 @@ namespace Meteor.Map.actors.chara.player while (true) { if (endOfListIndex - currentIndex >= 64) - player.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); + player.QueuePacket(InventoryListX64Packet.BuildPacket(owner.Id, lst, ref currentIndex)); else if (endOfListIndex - currentIndex >= 32) - player.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); + player.QueuePacket(InventoryListX32Packet.BuildPacket(owner.Id, lst, ref currentIndex)); else if (endOfListIndex - currentIndex >= 16) - player.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); + player.QueuePacket(InventoryListX16Packet.BuildPacket(owner.Id, lst, ref currentIndex)); else if (endOfListIndex - currentIndex > 1) - player.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, lst, ref currentIndex)); + player.QueuePacket(InventoryListX08Packet.BuildPacket(owner.Id, lst, ref currentIndex)); else if (endOfListIndex - currentIndex == 1) { - player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, list[currentIndex])); + player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.Id, list[currentIndex])); currentIndex++; } else @@ -712,7 +712,7 @@ namespace Meteor.Map.actors.chara.player private void SendItemPackets(Player player, ushort index) { - player.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, index)); + player.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.Id, index)); } private void SendItemPackets(Player player, List indexes) @@ -722,16 +722,16 @@ namespace Meteor.Map.actors.chara.player while (true) { if (indexes.Count - currentIndex >= 64) - player.QueuePacket(InventoryRemoveX64Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); + player.QueuePacket(InventoryRemoveX64Packet.BuildPacket(owner.Id, indexes, ref currentIndex)); else if (indexes.Count - currentIndex >= 32) - player.QueuePacket(InventoryRemoveX32Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); + player.QueuePacket(InventoryRemoveX32Packet.BuildPacket(owner.Id, indexes, ref currentIndex)); else if (indexes.Count - currentIndex >= 16) - player.QueuePacket(InventoryRemoveX16Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); + player.QueuePacket(InventoryRemoveX16Packet.BuildPacket(owner.Id, indexes, ref currentIndex)); else if (indexes.Count - currentIndex > 1) - player.QueuePacket(InventoryRemoveX08Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); + player.QueuePacket(InventoryRemoveX08Packet.BuildPacket(owner.Id, indexes, ref currentIndex)); else if (indexes.Count - currentIndex == 1) { - player.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, indexes[currentIndex])); + player.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.Id, indexes[currentIndex])); currentIndex++; } else diff --git a/Map Server/Actors/Chara/Npc/BattleNpc.cs b/Map Server/Actors/Chara/Npc/BattleNpc.cs index c7507c41..3cd384ce 100644 --- a/Map Server/Actors/Chara/Npc/BattleNpc.cs +++ b/Map Server/Actors/Chara/Npc/BattleNpc.cs @@ -286,7 +286,7 @@ namespace Meteor.Map.Actors //I think this is, or should be odne in DoBattleAction. Packet capture had the message in the same packet as an attack // defeat/defeats if (actionContainer != null) - actionContainer.AddEXPAction(new CommandResult(actorId, 30108, 0)); + actionContainer.AddEXPAction(new CommandResult(Id, 30108, 0)); if (lastAttacker.currentParty != null && lastAttacker.currentParty is Party) { @@ -320,7 +320,7 @@ namespace Meteor.Map.Actors } else { - var err = String.Format("[{0}][{1}] {2} {3} {4} {5} tried to die ded", actorId, GetUniqueId(), positionX, positionY, positionZ, CurrentArea.GetName()); + var err = String.Format("[{0}][{1}] {2} {3} {4} {5} tried to die ded", Id, GetUniqueId(), positionX, positionY, positionZ, CurrentArea.GetName()); Program.Log.Error(err); //throw new Exception(err); } diff --git a/Map Server/Actors/Chara/Npc/Npc.cs b/Map Server/Actors/Chara/Npc/Npc.cs index 6f38fb2a..e62b1e90 100644 --- a/Map Server/Actors/Chara/Npc/Npc.cs +++ b/Map Server/Actors/Chara/Npc/Npc.cs @@ -58,7 +58,7 @@ namespace Meteor.Map.Actors public NpcSpawnType npcSpawnType; public Npc(int actorNumber, ActorClass actorClass, string uniqueId, Area spawnedArea, float posX, float posY, float posZ, float rot, ushort actorState, uint animationId, string customDisplayName) - : base((4 << 28 | spawnedArea.actorId << 19 | ((uint)actorNumber + 5))) + : base((4 << 28 | spawnedArea.Id << 19 | ((uint)actorNumber + 5))) { this.positionX = posX; this.positionY = posY; @@ -67,8 +67,8 @@ namespace Meteor.Map.Actors this.currentMainState = actorState; this.animationId = animationId; - this.displayNameId = actorClass.displayNameId; - this.customDisplayName = customDisplayName; + this.LocalizedDisplayName = actorClass.displayNameId; + this.DisplayName = customDisplayName; this.uniqueIdentifier = uniqueId; @@ -119,7 +119,7 @@ namespace Meteor.Map.Actors } public Npc(int actorNumber, ActorClass actorClass, string uniqueId, Area spawnedArea, float posX, float posY, float posZ, float rot, uint layout, uint instance) - : base((4 << 28 | spawnedArea.actorId << 19 | (uint)actorNumber)) + : base((4 << 28 | spawnedArea.Id << 19 | (uint)actorNumber)) { this.positionX = posX; this.positionY = posY; @@ -128,7 +128,7 @@ namespace Meteor.Map.Actors this.currentMainState = 0; this.animationId = 0; - this.displayNameId = actorClass.displayNameId; + this.LocalizedDisplayName = actorClass.displayNameId; this.uniqueIdentifier = uniqueId; @@ -158,7 +158,7 @@ namespace Meteor.Map.Actors public SubPacket CreateAddActorPacket() { - return AddActorPacket.BuildPacket(actorId, 8); + return AddActorPacket.BuildPacket(Id, 8); } // actorClassId, [], [], numBattleCommon, [battleCommon], numEventCommon, [eventCommon], args for either initForBattle/initForEvent @@ -183,7 +183,7 @@ namespace Meteor.Map.Actors lParams = LuaUtils.CreateLuaParamList(classPathFake, false, false, false, false, false, 0xF47F6, false, false, 0, 0); isStatic = true; //ActorInstantiatePacket.BuildPacket(actorId, actorName, classNameFake, lParams).DebugPrintSubPacket(); - return ActorInstantiatePacket.BuildPacket(actorId, actorName, classNameFake, lParams); + return ActorInstantiatePacket.BuildPacket(Id, Name, classNameFake, lParams); } else { @@ -197,7 +197,7 @@ namespace Meteor.Map.Actors } //ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams).DebugPrintSubPacket(); - return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams); + return ActorInstantiatePacket.BuildPacket(Id, Name, className, lParams); } public override List GetSpawnPackets(Player player, ushort spawnType) @@ -209,7 +209,7 @@ namespace Meteor.Map.Actors subpackets.Add(CreateSpawnPositonPacket(0x0)); if (isMapObj) - subpackets.Add(SetActorBGPropertiesPacket.BuildPacket(actorId, instance, layout)); + subpackets.Add(SetActorBGPropertiesPacket.BuildPacket(Id, instance, layout)); else subpackets.Add(CreateAppearancePacket()); @@ -424,7 +424,7 @@ namespace Meteor.Map.Actors public void PlayMapObjAnimation(Player player, string animationName) { - player.QueuePacket(PlayBGAnimation.BuildPacket(actorId, animationName)); + player.QueuePacket(PlayBGAnimation.BuildPacket(Id, animationName)); } public void Despawn() @@ -461,7 +461,7 @@ namespace Meteor.Map.Actors public override void OnDespawn() { - CurrentArea.BroadcastPacketAroundActor(this, RemoveActorPacket.BuildPacket(this.actorId)); + CurrentArea.BroadcastPacketAroundActor(this, RemoveActorPacket.BuildPacket(this.Id)); QueuePositionUpdate(spawnX, spawnY, spawnZ); LuaEngine.CallLuaBattleFunction(this, "onDespawn", this); } diff --git a/Map Server/Actors/Chara/Npc/Retainer.cs b/Map Server/Actors/Chara/Npc/Retainer.cs index 6e2449e1..b55d0d00 100644 --- a/Map Server/Actors/Chara/Npc/Retainer.cs +++ b/Map Server/Actors/Chara/Npc/Retainer.cs @@ -39,7 +39,7 @@ namespace Meteor.Map.actors.chara.npc { this.retainerId = retainerId; this.ownerPlayer = player; - this.actorName = String.Format("_rtnre{0:x7}", actorId); + this.Name = String.Format("_rtnre{0:x7}", Id); itemPackages[ItemPackage.NORMAL] = new ItemPackage(this, MAXSIZE_INVENTORY_NORMAL, ItemPackage.NORMAL); itemPackages[ItemPackage.CURRENCY_CRYSTALS] = new ItemPackage(this, MAXSIZE_INVENTORY_CURRANCY, ItemPackage.CURRENCY_CRYSTALS); diff --git a/Map Server/Actors/Chara/Player/Player.cs b/Map Server/Actors/Chara/Player/Player.cs index e374793d..517db81c 100644 --- a/Map Server/Actors/Chara/Player/Player.cs +++ b/Map Server/Actors/Chara/Player/Player.cs @@ -173,7 +173,7 @@ namespace Meteor.Map.Actors public Player(Session cp, uint actorID) : base(actorID) { playerSession = cp; - actorName = String.Format("_pc{0:00000000}", actorID); + Name = String.Format("_pc{0:00000000}", actorID); className = "Player"; moveSpeeds[0] = SetActorSpeedPacket.DEFAULT_STOP; @@ -279,14 +279,14 @@ namespace Meteor.Map.Actors public List Create0x132Packets() { List packets = new List(); - packets.Add(_0x132Packet.BuildPacket(actorId, 0xB, "commandForced")); - packets.Add(_0x132Packet.BuildPacket(actorId, 0xA, "commandDefault")); - packets.Add(_0x132Packet.BuildPacket(actorId, 0x6, "commandWeak")); - packets.Add(_0x132Packet.BuildPacket(actorId, 0x4, "commandContent")); - packets.Add(_0x132Packet.BuildPacket(actorId, 0x6, "commandJudgeMode")); - packets.Add(_0x132Packet.BuildPacket(actorId, 0x100, "commandRequest")); - packets.Add(_0x132Packet.BuildPacket(actorId, 0x100, "widgetCreate")); - packets.Add(_0x132Packet.BuildPacket(actorId, 0x100, "macroRequest")); + packets.Add(_0x132Packet.BuildPacket(Id, 0xB, "commandForced")); + packets.Add(_0x132Packet.BuildPacket(Id, 0xA, "commandDefault")); + packets.Add(_0x132Packet.BuildPacket(Id, 0x6, "commandWeak")); + packets.Add(_0x132Packet.BuildPacket(Id, 0x4, "commandContent")); + packets.Add(_0x132Packet.BuildPacket(Id, 0x6, "commandJudgeMode")); + packets.Add(_0x132Packet.BuildPacket(Id, 0x100, "commandRequest")); + packets.Add(_0x132Packet.BuildPacket(Id, 0x100, "widgetCreate")); + packets.Add(_0x132Packet.BuildPacket(Id, 0x100, "macroRequest")); return packets; } @@ -304,7 +304,7 @@ namespace Meteor.Map.Actors public override SubPacket CreateScriptBindPacket(Player requestPlayer) { List lParams; - if (IsMyPlayer(requestPlayer.actorId)) + if (IsMyPlayer(requestPlayer.Id)) { if (loginInitDirector != null) lParams = LuaUtils.CreateLuaParamList("/Chara/Player/Player_work", false, false, true, loginInitDirector, true, 0, false, timers, true); @@ -314,29 +314,29 @@ namespace Meteor.Map.Actors else lParams = LuaUtils.CreateLuaParamList("/Chara/Player/Player_work", false, false, false, false, false, true); - ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams).DebugPrintSubPacket(); + ActorInstantiatePacket.BuildPacket(Id, Name, className, lParams).DebugPrintSubPacket(); - return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams); + return ActorInstantiatePacket.BuildPacket(Id, Name, className, lParams); } public override List GetSpawnPackets(Player requestPlayer, ushort spawnType) { List subpackets = new List(); subpackets.Add(CreateAddActorPacket(8)); - if (IsMyPlayer(requestPlayer.actorId)) + if (IsMyPlayer(requestPlayer.Id)) subpackets.AddRange(Create0x132Packets()); subpackets.Add(CreateSpeedPacket()); subpackets.Add(CreateSpawnPositonPacket(this, spawnType)); subpackets.Add(CreateAppearancePacket()); subpackets.Add(CreateNamePacket()); - subpackets.Add(_0xFPacket.BuildPacket(actorId)); + subpackets.Add(_0xFPacket.BuildPacket(Id)); subpackets.Add(CreateStatePacket()); subpackets.Add(CreateSubStatePacket()); subpackets.Add(CreateInitStatusPacket()); subpackets.Add(CreateSetActorIconPacket()); subpackets.Add(CreateIsZoneingPacket()); - subpackets.AddRange(CreatePlayerRelatedPackets(requestPlayer.actorId)); + subpackets.AddRange(CreatePlayerRelatedPackets(requestPlayer.Id)); subpackets.Add(CreateScriptBindPacket(requestPlayer)); return subpackets; } @@ -356,7 +356,7 @@ namespace Meteor.Map.Actors isMale = false; break; } - return SetActorNamePacket.BuildPacket(actorId, customDisplayName != null ? 0 : displayNameId, displayNameId == 0xFFFFFFFF | displayNameId == 0x0 | customDisplayName != null ? customDisplayName : "", isMale); + return SetActorNamePacket.BuildPacket(Id, DisplayName != null ? 0 : LocalizedDisplayName, LocalizedDisplayName == 0xFFFFFFFF | LocalizedDisplayName == 0x0 | DisplayName != null ? DisplayName : "", isMale); } public List CreatePlayerRelatedPackets(uint requestingPlayerActorId) @@ -364,37 +364,37 @@ namespace Meteor.Map.Actors List subpackets = new List(); if (gcCurrent != 0) - subpackets.Add(SetGrandCompanyPacket.BuildPacket(actorId, gcCurrent, gcRankLimsa, gcRankGridania, gcRankUldah)); + subpackets.Add(SetGrandCompanyPacket.BuildPacket(Id, gcCurrent, gcRankLimsa, gcRankGridania, gcRankUldah)); if (currentTitle != 0) - subpackets.Add(SetPlayerTitlePacket.BuildPacket(actorId, currentTitle)); + subpackets.Add(SetPlayerTitlePacket.BuildPacket(Id, currentTitle)); if (currentJob != 0) - subpackets.Add(SetCurrentJobPacket.BuildPacket(actorId, currentJob)); + subpackets.Add(SetCurrentJobPacket.BuildPacket(Id, currentJob)); if (IsMyPlayer(requestingPlayerActorId)) { - subpackets.Add(SetSpecialEventWorkPacket.BuildPacket(actorId)); + subpackets.Add(SetSpecialEventWorkPacket.BuildPacket(Id)); if (hasChocobo && chocoboName != null && !chocoboName.Equals("")) { - subpackets.Add(SetChocoboNamePacket.BuildPacket(actorId, chocoboName)); - subpackets.Add(SetHasChocoboPacket.BuildPacket(actorId, hasChocobo)); + subpackets.Add(SetChocoboNamePacket.BuildPacket(Id, chocoboName)); + subpackets.Add(SetHasChocoboPacket.BuildPacket(Id, hasChocobo)); } if (hasGoobbue) - subpackets.Add(SetHasGoobbuePacket.BuildPacket(actorId, hasGoobbue)); + subpackets.Add(SetHasGoobbuePacket.BuildPacket(Id, hasGoobbue)); - subpackets.Add(SetAchievementPointsPacket.BuildPacket(actorId, achievementPoints)); + subpackets.Add(SetAchievementPointsPacket.BuildPacket(Id, achievementPoints)); subpackets.Add(Database.GetLatestAchievements(this)); subpackets.Add(Database.GetAchievementsPacket(this)); } if (mountState == 1) - subpackets.Add(SetCurrentMountChocoboPacket.BuildPacket(actorId, chocoboAppearance, rentalExpireTime, rentalMinLeft)); + subpackets.Add(SetCurrentMountChocoboPacket.BuildPacket(Id, chocoboAppearance, rentalExpireTime, rentalMinLeft)); else if (mountState == 2) - subpackets.Add(SetCurrentMountGoobbuePacket.BuildPacket(actorId, 1)); + subpackets.Add(SetCurrentMountGoobbuePacket.BuildPacket(Id, 1)); //Inn Packets (Dream, Cutscenes, Armoire) if (CurrentArea.isInn) @@ -402,8 +402,8 @@ namespace Meteor.Map.Actors SetCutsceneBookPacket cutsceneBookPacket = new SetCutsceneBookPacket(); for (int i = 0; i < 2048; i++) cutsceneBookPacket.cutsceneFlags[i] = true; - QueuePacket(cutsceneBookPacket.BuildPacket(actorId, "", 11, 1, 1)); - QueuePacket(SetPlayerDreamPacket.BuildPacket(actorId, 0x16, GetInnCode())); + QueuePacket(cutsceneBookPacket.BuildPacket(Id, "", 11, 1, 1)); + QueuePacket(SetPlayerDreamPacket.BuildPacket(Id, 0x16, GetInnCode())); } return subpackets; @@ -578,39 +578,39 @@ namespace Meteor.Map.Actors public void SendSeamlessZoneInPackets() { - QueuePacket(SetMusicPacket.BuildPacket(actorId, CurrentArea.bgmDay, SetMusicPacket.EFFECT_FADEIN)); - QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1)); + QueuePacket(SetMusicPacket.BuildPacket(Id, CurrentArea.bgmDay, SetMusicPacket.EFFECT_FADEIN)); + QueuePacket(SetWeatherPacket.BuildPacket(Id, SetWeatherPacket.WEATHER_CLEAR, 1)); } public void SendZoneInPackets(WorldManager world, ushort spawnType) { - QueuePacket(SetActorIsZoningPacket.BuildPacket(actorId, false)); - QueuePacket(SetDalamudPacket.BuildPacket(actorId, 0)); + QueuePacket(SetActorIsZoningPacket.BuildPacket(Id, false)); + QueuePacket(SetDalamudPacket.BuildPacket(Id, 0)); //Music Packets if (currentMainState == SetActorStatePacket.MAIN_STATE_MOUNTED) { if (rentalExpireTime != 0) - QueuePacket(SetMusicPacket.BuildPacket(actorId, 64, 0x01)); //Rental + QueuePacket(SetMusicPacket.BuildPacket(Id, 64, 0x01)); //Rental else { if (mountState == 1) - QueuePacket(SetMusicPacket.BuildPacket(actorId, 83, 0x01)); //Mount + QueuePacket(SetMusicPacket.BuildPacket(Id, 83, 0x01)); //Mount else - QueuePacket(SetMusicPacket.BuildPacket(actorId, 98, 0x01)); //Goobbue + QueuePacket(SetMusicPacket.BuildPacket(Id, 98, 0x01)); //Goobbue } } else - QueuePacket(SetMusicPacket.BuildPacket(actorId, CurrentArea.bgmDay, 0x01)); //Zone + QueuePacket(SetMusicPacket.BuildPacket(Id, CurrentArea.bgmDay, 0x01)); //Zone - QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1)); + QueuePacket(SetWeatherPacket.BuildPacket(Id, SetWeatherPacket.WEATHER_CLEAR, 1)); - QueuePacket(SetMapPacket.BuildPacket(actorId, CurrentArea.RegionId, CurrentArea.ZoneId)); + QueuePacket(SetMapPacket.BuildPacket(Id, CurrentArea.RegionId, CurrentArea.ZoneId)); QueuePackets(GetSpawnPackets(this, spawnType)); #region Inventory & Equipment - QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true)); + QueuePacket(InventoryBeginChangePacket.BuildPacket(Id, true)); itemPackages[ItemPackage.NORMAL].SendFullPackage(this); itemPackages[ItemPackage.CURRENCY_CRYSTALS].SendFullPackage(this); itemPackages[ItemPackage.KEYITEMS].SendFullPackage(this); @@ -618,7 +618,7 @@ namespace Meteor.Map.Actors itemPackages[ItemPackage.MELDREQUEST].SendFullPackage(this); itemPackages[ItemPackage.LOOT].SendFullPackage(this); equipment.SendUpdate(this); - playerSession.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId)); + playerSession.QueuePacket(InventoryEndChangePacket.BuildPacket(Id)); #endregion playerSession.QueuePacket(GetInitPackets()); @@ -658,15 +658,15 @@ namespace Meteor.Map.Actors while (true) { if (slots.Count - currentIndex >= 64) - QueuePacket(InventoryRemoveX64Packet.BuildPacket(actorId, slots, ref currentIndex)); + QueuePacket(InventoryRemoveX64Packet.BuildPacket(Id, slots, ref currentIndex)); else if (slots.Count - currentIndex >= 32) - QueuePacket(InventoryRemoveX32Packet.BuildPacket(actorId, slots, ref currentIndex)); + QueuePacket(InventoryRemoveX32Packet.BuildPacket(Id, slots, ref currentIndex)); else if (slots.Count - currentIndex >= 16) - QueuePacket(InventoryRemoveX16Packet.BuildPacket(actorId, slots, ref currentIndex)); + QueuePacket(InventoryRemoveX16Packet.BuildPacket(Id, slots, ref currentIndex)); else if (slots.Count - currentIndex >= 8) - QueuePacket(InventoryRemoveX08Packet.BuildPacket(actorId, slots, ref currentIndex)); + QueuePacket(InventoryRemoveX08Packet.BuildPacket(Id, slots, ref currentIndex)); else if (slots.Count - currentIndex == 1) - QueuePacket(InventoryRemoveX01Packet.BuildPacket(actorId, slots[currentIndex])); + QueuePacket(InventoryRemoveX01Packet.BuildPacket(Id, slots[currentIndex])); else break; } @@ -675,7 +675,7 @@ namespace Meteor.Map.Actors public bool IsMyPlayer(uint otherActorId) { - return actorId == otherActorId; + return Id == otherActorId; } public void QueuePacket(SubPacket packet) @@ -695,7 +695,7 @@ namespace Meteor.Map.Actors { BasePacket packet = new BasePacket(path); - packet.ReplaceActorID(actorId); + packet.ReplaceActorID(Id); var packets = packet.GetSubpackets(); QueuePackets(packets); } @@ -713,7 +713,7 @@ namespace Meteor.Map.Actors if (sendToSelf) { - SubPacket clonedPacket = new SubPacket(packet, actorId); + SubPacket clonedPacket = new SubPacket(packet, Id); QueuePacket(clonedPacket); } @@ -726,7 +726,7 @@ namespace Meteor.Map.Actors if (p.Equals(this)) continue; - SubPacket clonedPacket = new SubPacket(packet, a.actorId); + SubPacket clonedPacket = new SubPacket(packet, a.Id); p.QueuePacket(clonedPacket); } } @@ -737,7 +737,7 @@ namespace Meteor.Map.Actors { if (sendToSelf) { - SubPacket clonedPacket = new SubPacket(packet, actorId); + SubPacket clonedPacket = new SubPacket(packet, Id); QueuePacket(clonedPacket); } @@ -750,7 +750,7 @@ namespace Meteor.Map.Actors if (p.Equals(this)) continue; - SubPacket clonedPacket = new SubPacket(packet, a.actorId); + SubPacket clonedPacket = new SubPacket(packet, a.Id); p.QueuePacket(clonedPacket); } } @@ -767,14 +767,14 @@ namespace Meteor.Map.Actors { if (flag) { - BroadcastPacket(SetActorIconPacket.BuildPacket(actorId, SetActorIconPacket.DISCONNECTING), true); + BroadcastPacket(SetActorIconPacket.BuildPacket(Id, SetActorIconPacket.DISCONNECTING), true); } else { if (isGM) - BroadcastPacket(SetActorIconPacket.BuildPacket(actorId, SetActorIconPacket.ISGM), true); + BroadcastPacket(SetActorIconPacket.BuildPacket(Id, SetActorIconPacket.ISGM), true); else - BroadcastPacket(SetActorIconPacket.BuildPacket(actorId, 0), true); + BroadcastPacket(SetActorIconPacket.BuildPacket(Id, 0), true); } } @@ -833,7 +833,7 @@ namespace Meteor.Map.Actors public void SendMessage(uint logType, string sender, string message) { - QueuePacket(SendMessagePacket.BuildPacket(actorId, logType, sender, message)); + QueuePacket(SendMessagePacket.BuildPacket(Id, logType, sender, message)); } //Only use at logout since it's intensive @@ -881,14 +881,14 @@ namespace Meteor.Map.Actors public void Logout() { // todo: really this should be in CleanupAndSave but we might want logout/disconnect handled separately for some effects - QueuePacket(LogoutPacket.BuildPacket(actorId)); + QueuePacket(LogoutPacket.BuildPacket(Id)); statusEffects.RemoveStatusEffectsByFlags((uint)StatusEffectFlags.LoseOnLogout); CleanupAndSave(); } public void QuitGame() { - QueuePacket(QuitPacket.BuildPacket(actorId)); + QueuePacket(QuitPacket.BuildPacket(Id)); statusEffects.RemoveStatusEffectsByFlags((uint)StatusEffectFlags.LoseOnLogout); CleanupAndSave(); } @@ -912,15 +912,15 @@ namespace Meteor.Map.Actors public void ChangeMusic(ushort musicId) { - QueuePacket(SetMusicPacket.BuildPacket(actorId, musicId, 1)); + QueuePacket(SetMusicPacket.BuildPacket(Id, musicId, 1)); } public void SendMountAppearance() { if (mountState == 1) - BroadcastPacket(SetCurrentMountChocoboPacket.BuildPacket(actorId, chocoboAppearance, rentalExpireTime, rentalMinLeft), true); + BroadcastPacket(SetCurrentMountChocoboPacket.BuildPacket(Id, chocoboAppearance, rentalExpireTime, rentalMinLeft), true); else if (mountState == 2) - BroadcastPacket(SetCurrentMountGoobbuePacket.BuildPacket(actorId, 1), true); + BroadcastPacket(SetCurrentMountGoobbuePacket.BuildPacket(Id, 1), true); } public void SetMountState(byte mountState) @@ -936,41 +936,41 @@ namespace Meteor.Map.Actors public void DoEmote(uint targettedActor, uint animId, uint descId) { - BroadcastPacket(ActorDoEmotePacket.BuildPacket(actorId, targettedActor, animId, descId), true); + BroadcastPacket(ActorDoEmotePacket.BuildPacket(Id, targettedActor, animId, descId), true); } public void SendGameMessage(Actor sourceActor, Actor textIdOwner, ushort textId, byte log, params object[] msgParams) { if (msgParams == null || msgParams.Length == 0) { - QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, sourceActor.actorId, textIdOwner.actorId, textId, log)); + QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().Id, sourceActor.Id, textIdOwner.Id, textId, log)); } else - QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, sourceActor.actorId, textIdOwner.actorId, textId, log, LuaUtils.CreateLuaParamList(msgParams))); + QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().Id, sourceActor.Id, textIdOwner.Id, textId, log, LuaUtils.CreateLuaParamList(msgParams))); } public void SendGameMessage(Actor textIdOwner, ushort textId, byte log, params object[] msgParams) { if (msgParams == null || msgParams.Length == 0) - QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, log)); + QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().Id, textIdOwner.Id, textId, log)); else - QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, log, LuaUtils.CreateLuaParamList(msgParams))); + QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().Id, textIdOwner.Id, textId, log, LuaUtils.CreateLuaParamList(msgParams))); } public void SendGameMessageCustomSender(Actor textIdOwner, ushort textId, byte log, string customSender, params object[] msgParams) { if (msgParams == null || msgParams.Length == 0) - QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, customSender, log)); + QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().Id, textIdOwner.Id, textId, customSender, log)); else - QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, customSender, log, LuaUtils.CreateLuaParamList(msgParams))); + QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().Id, textIdOwner.Id, textId, customSender, log, LuaUtils.CreateLuaParamList(msgParams))); } public void SendGameMessageDisplayIDSender(Actor textIdOwner, ushort textId, byte log, uint displayId, params object[] msgParams) { if (msgParams == null || msgParams.Length == 0) - QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, displayId, log)); + QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().Id, textIdOwner.Id, textId, displayId, log)); else - QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, displayId, log, LuaUtils.CreateLuaParamList(msgParams))); + QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().Id, textIdOwner.Id, textId, displayId, log, LuaUtils.CreateLuaParamList(msgParams))); } public void BroadcastWorldMessage(ushort worldMasterId, params object[] msgParams) @@ -1097,7 +1097,7 @@ namespace Meteor.Map.Actors charaInfo1.AddTarget(); - QueuePacket(charaInfo1.BuildPacket(actorId)); + QueuePacket(charaInfo1.BuildPacket(Id)); } else if (lastStep == 1) { @@ -1128,7 +1128,7 @@ namespace Meteor.Map.Actors charaInfo1.AddTarget(); - QueuePacket(charaInfo1.BuildPacket(actorId)); + QueuePacket(charaInfo1.BuildPacket(Id)); } } @@ -1316,7 +1316,7 @@ namespace Meteor.Map.Actors { foreach (Actor a in playerSession.actorInstanceList) { - if (a.actorId == actorId) + if (a.Id == actorId) return a; } @@ -1471,7 +1471,7 @@ namespace Meteor.Map.Actors public void AddQuest(uint id, bool isSilent = false) { Actor actor = Server.GetStaticActors((0xA0F00000 | id)); - AddQuest(actor.actorName, isSilent); + AddQuest(actor.Name, isSilent); } public void AddQuest(string name, bool isSilent = false) @@ -1486,7 +1486,7 @@ namespace Meteor.Map.Actors if (freeSlot == -1) return; - playerWork.questScenario[freeSlot] = baseQuest.actorId; + playerWork.questScenario[freeSlot] = baseQuest.Id; questScenario[freeSlot] = new Quest(this, baseQuest); Database.SaveQuest(this, questScenario[freeSlot]); SendQuestClientUpdate(freeSlot); @@ -1500,7 +1500,7 @@ namespace Meteor.Map.Actors public void CompleteQuest(uint id) { Actor actor = Server.GetStaticActors((0xA0F00000 | id)); - CompleteQuest(actor.actorName); + CompleteQuest(actor.Name); } public void CompleteQuest(string name) @@ -1510,7 +1510,7 @@ namespace Meteor.Map.Actors if (actor == null) return; - uint id = actor.actorId; + uint id = actor.Id; if (HasQuest(id)) { Database.CompleteQuest(playerSession.GetActor(), id); @@ -1538,9 +1538,9 @@ namespace Meteor.Map.Actors { for (int i = 0; i < questScenario.Length; i++) { - if (questScenario[i] != null && questScenario[i].actorId == id) + if (questScenario[i] != null && questScenario[i].Id == id) { - Database.RemoveQuest(this, questScenario[i].actorId); + Database.RemoveQuest(this, questScenario[i].Id); questScenario[i] = null; playerWork.questScenario[i] = 0; SendQuestClientUpdate(i); @@ -1580,13 +1580,13 @@ namespace Meteor.Map.Actors public bool CanAcceptQuest(uint id) { Actor actor = Server.GetStaticActors((0xA0F00000 | id)); - return CanAcceptQuest(actor.actorName); + return CanAcceptQuest(actor.Name); } public bool IsQuestCompleted(string questName) { Actor actor = Server.GetStaticActors(questName); - return IsQuestCompleted(actor.actorId); + return IsQuestCompleted(actor.Id); } public bool IsQuestCompleted(uint questId) @@ -1598,7 +1598,7 @@ namespace Meteor.Map.Actors { for (int i = 0; i < questScenario.Length; i++) { - if (questScenario[i] != null && questScenario[i].actorId == (0xA0F00000 | id)) + if (questScenario[i] != null && questScenario[i].Id == (0xA0F00000 | id)) return questScenario[i]; } @@ -1609,7 +1609,7 @@ namespace Meteor.Map.Actors { for (int i = 0; i < questScenario.Length; i++) { - if (questScenario[i] != null && questScenario[i].actorName.ToLower().Equals(name.ToLower())) + if (questScenario[i] != null && questScenario[i].Name.ToLower().Equals(name.ToLower())) return questScenario[i]; } @@ -1620,7 +1620,7 @@ namespace Meteor.Map.Actors { for (int i = 0; i < questScenario.Length; i++) { - if (questScenario[i] != null && questScenario[i].actorName.ToLower().Equals(name.ToLower())) + if (questScenario[i] != null && questScenario[i].Name.ToLower().Equals(name.ToLower())) return true; } @@ -1631,7 +1631,7 @@ namespace Meteor.Map.Actors { for (int i = 0; i < questScenario.Length; i++) { - if (questScenario[i] != null && questScenario[i].actorId == (0xA0F00000 | id)) + if (questScenario[i] != null && questScenario[i].Id == (0xA0F00000 | id)) return true; } @@ -1653,7 +1653,7 @@ namespace Meteor.Map.Actors { for (int i = 0; i < questScenario.Length; i++) { - if (questScenario[i] != null && questScenario[i].actorId == (0xA0F00000 | id)) + if (questScenario[i] != null && questScenario[i].Id == (0xA0F00000 | id)) return i; } @@ -1826,7 +1826,7 @@ namespace Meteor.Map.Actors { if (ownedDirectors.Contains(director)) { - QueuePacket(RemoveActorPacket.BuildPacket(director.actorId)); + QueuePacket(RemoveActorPacket.BuildPacket(director.Id)); ownedDirectors.Remove(director); director.RemoveMember(this); } @@ -1858,7 +1858,7 @@ namespace Meteor.Map.Actors { foreach (Director d in ownedDirectors) { - if (d.actorId == id) + if (d.Id == id) return d; } @@ -1873,15 +1873,15 @@ namespace Meteor.Map.Actors else return; - QueuePacket(InventoryBeginChangePacket.BuildPacket(toBeExamined.actorId, true)); + QueuePacket(InventoryBeginChangePacket.BuildPacket(toBeExamined.Id, true)); toBeExamined.GetEquipment().SendUpdateAsItemPackage(this, ItemPackage.MAXSIZE_EQUIPMENT_OTHERPLAYER, ItemPackage.EQUIPMENT_OTHERPLAYER); - QueuePacket(InventoryEndChangePacket.BuildPacket(toBeExamined.actorId)); + QueuePacket(InventoryEndChangePacket.BuildPacket(toBeExamined.Id)); } public void SendDataPacket(params object[] parameters) { List lParams = LuaUtils.CreateLuaParamList(parameters); - SubPacket spacket = GenericDataPacket.BuildPacket(actorId, lParams); + SubPacket spacket = GenericDataPacket.BuildPacket(Id, lParams); spacket.DebugPrintSubPacket(); QueuePacket(spacket); } @@ -1905,7 +1905,7 @@ namespace Meteor.Map.Actors return; List lParams = LuaUtils.CreateLuaParamList(parameters); - SubPacket spacket = KickEventPacket.BuildPacket(actorId, actor.actorId, eventName, 5, lParams); + SubPacket spacket = KickEventPacket.BuildPacket(Id, actor.Id, eventName, 5, lParams); spacket.DebugPrintSubPacket(); QueuePacket(spacket); } @@ -1916,27 +1916,27 @@ namespace Meteor.Map.Actors return; List lParams = LuaUtils.CreateLuaParamList(parameters); - SubPacket spacket = KickEventPacket.BuildPacket(actorId, actor.actorId, eventName, 0, lParams); + SubPacket spacket = KickEventPacket.BuildPacket(Id, actor.Id, eventName, 0, lParams); spacket.DebugPrintSubPacket(); QueuePacket(spacket); } public void SetEventStatus(Actor actor, string conditionName, bool enabled, byte type) { - QueuePacket(SetEventStatusPacket.BuildPacket(actor.actorId, enabled, type, conditionName)); + QueuePacket(SetEventStatusPacket.BuildPacket(actor.Id, enabled, type, conditionName)); } public void RunEventFunction(string functionName, params object[] parameters) { List lParams = LuaUtils.CreateLuaParamList(parameters); - SubPacket spacket = RunEventFunctionPacket.BuildPacket(actorId, currentEventOwner, currentEventName, currentEventType, functionName, lParams); + SubPacket spacket = RunEventFunctionPacket.BuildPacket(Id, currentEventOwner, currentEventName, currentEventType, functionName, lParams); spacket.DebugPrintSubPacket(); QueuePacket(spacket); } public void EndEvent() { - SubPacket p = EndEventPacket.BuildPacket(actorId, currentEventOwner, currentEventName, currentEventType); + SubPacket p = EndEventPacket.BuildPacket(Id, currentEventOwner, currentEventName, currentEventType); p.DebugPrintSubPacket(); QueuePacket(p); @@ -1948,7 +1948,7 @@ namespace Meteor.Map.Actors public void BroadcastCountdown(byte countdownLength, ulong syncTime) { - BroadcastPacket(StartCountdownPacket.BuildPacket(actorId, countdownLength, syncTime, "Go!"), true); + BroadcastPacket(StartCountdownPacket.BuildPacket(Id, countdownLength, syncTime, "Go!"), true); } public void SendInstanceUpdate(bool force = false) @@ -1975,7 +1975,7 @@ namespace Meteor.Map.Actors if (IsInParty()) { Party party = (Party)currentParty; - return party.GetLeader() == actorId; + return party.GetLeader() == Id; } else return false; @@ -2037,7 +2037,7 @@ namespace Meteor.Map.Actors for (int i = 0; i < partyGroup.members.Count; i++) { - if (partyGroup.members[i] == actorId) + if (partyGroup.members[i] == Id) { partyGroup.members.RemoveAt(i); break; @@ -2058,8 +2058,8 @@ namespace Meteor.Map.Actors chocoboAppearance = appearanceId; chocoboName = nameResponse; - QueuePacket(SetChocoboNamePacket.BuildPacket(actorId, chocoboName)); - QueuePacket(SetHasChocoboPacket.BuildPacket(actorId, hasChocobo)); + QueuePacket(SetChocoboNamePacket.BuildPacket(Id, chocoboName)); + QueuePacket(SetHasChocoboPacket.BuildPacket(Id, hasChocobo)); } public void ChangeChocoboAppearance(byte appearanceId) @@ -2463,7 +2463,7 @@ namespace Meteor.Map.Actors if (target is BattleNpc) { var helpingActorId = ((BattleNpc)target).GetMobMod((uint)MobModifier.CallForHelp); - partyEngaged = this.actorId == helpingActorId || (((BattleNpc)target).GetMobMod((uint)MobModifier.FreeForAll) != 0); + partyEngaged = this.Id == helpingActorId || (((BattleNpc)target).GetMobMod((uint)MobModifier.FreeForAll) != 0); } if (!partyEngaged) @@ -2478,7 +2478,7 @@ namespace Meteor.Map.Actors } } } - else if (target.currentLockedTarget == actorId) + else if (target.currentLockedTarget == Id) { partyEngaged = true; } @@ -2650,7 +2650,7 @@ namespace Meteor.Map.Actors //You earn [exp] (+[bonusPercent]%) experience points. //In non-english languages there are unique messages for each language, hence the use of ClassExperienceTextIds - actionList.Add(new CommandResult(actorId, BattleUtils.ClassExperienceTextIds[classId], 0, (ushort)exp, bonusPercent)); + actionList.Add(new CommandResult(Id, BattleUtils.ClassExperienceTextIds[classId], 0, (ushort)exp, bonusPercent)); bool leveled = false; int diff = MAXEXP[GetLevel() - 1] - charaWork.battleSave.skillPoint[classId - 1]; @@ -2706,7 +2706,7 @@ namespace Meteor.Map.Actors if (actionList != null) { if (classId == GetCurrentClassOrJob() || jobId == GetCurrentClassOrJob()) - actionList.Add(new CommandResult(actorId, 33926, 0, commandId)); + actionList.Add(new CommandResult(Id, 33926, 0, commandId)); } } } @@ -2722,7 +2722,7 @@ namespace Meteor.Map.Actors //33909: You attain level [level]. if (actionList != null) - actionList.Add(new CommandResult(actorId, 33909, 0, (ushort)charaWork.battleSave.skillLevel[classId - 1])); + actionList.Add(new CommandResult(Id, 33909, 0, (ushort)charaWork.battleSave.skillLevel[classId - 1])); EquipAbilitiesAtLevel(classId, GetLevel(), actionList); } @@ -2755,7 +2755,7 @@ namespace Meteor.Map.Actors public void SetCurrentJob(byte jobId) { currentJob = jobId; - BroadcastPacket(SetCurrentJobPacket.BuildPacket(actorId, jobId), true); + BroadcastPacket(SetCurrentJobPacket.BuildPacket(Id, jobId), true); Database.LoadHotbar(this); SendCharaExpInfo(); } @@ -2966,14 +2966,14 @@ namespace Meteor.Map.Actors private void SendTradePackets() { //Send to self - QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true)); + QueuePacket(InventoryBeginChangePacket.BuildPacket(Id, true)); myOfferings.SendUpdate(this); - QueuePacket(InventoryEndChangePacket.BuildPacket(actorId)); + QueuePacket(InventoryEndChangePacket.BuildPacket(Id)); //Send to other trader - otherTrader.QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true)); + otherTrader.QueuePacket(InventoryBeginChangePacket.BuildPacket(Id, true)); myOfferings.SendUpdateAsItemPackage(otherTrader); - otherTrader.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId)); + otherTrader.QueuePacket(InventoryEndChangePacket.BuildPacket(Id)); } public void AcceptTrade(bool accepted) @@ -2995,9 +2995,9 @@ namespace Meteor.Map.Actors offeredItem.SetNormal(); } - QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true)); + QueuePacket(InventoryBeginChangePacket.BuildPacket(Id, true)); myOfferings.SendUpdate(this); - QueuePacket(InventoryEndChangePacket.BuildPacket(actorId)); + QueuePacket(InventoryEndChangePacket.BuildPacket(Id)); } isTradeAccepted = false; diff --git a/Map Server/Actors/Chara/ReferencedItemPackage.cs b/Map Server/Actors/Chara/ReferencedItemPackage.cs index 89d4c899..4e37b0de 100644 --- a/Map Server/Actors/Chara/ReferencedItemPackage.cs +++ b/Map Server/Actors/Chara/ReferencedItemPackage.cs @@ -77,9 +77,9 @@ namespace Meteor.Map.actors.chara referenceList[positions[i]] = item; } - owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); SendUpdate(); - owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } public void Set(ushort position, ushort itemPackagePosition, ushort itemPackageCode) @@ -114,12 +114,12 @@ namespace Meteor.Map.actors.chara referenceList[position] = item; - owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); if (oldPackage != null) oldPackage.SendUpdate(); newPackage.SendUpdate(); SendSingleUpdate(position); - owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } public void Clear(ushort position) @@ -135,10 +135,10 @@ namespace Meteor.Map.actors.chara oldItemPackage.MarkDirty(referenceList[position]); referenceList[position] = null; - owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); oldItemPackage.SendUpdate(); SendSingleUpdate(position); - owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } public void ClearAll() @@ -160,20 +160,20 @@ namespace Meteor.Map.actors.chara referenceList[i] = null; } - owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); + owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.Id)); for (int i = 0; i < packagesToRefresh.Count; i++) packagesToRefresh[i].SendUpdate(); SendUpdate(); - owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); + owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.Id)); } #endregion #region Send Update Functions public void SendSingleUpdate(ushort position) { - owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, itemPackageCapacity, itemPackageCode)); + owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.Id, itemPackageCapacity, itemPackageCode)); SendSingleLinkedItemPacket(owner, position); - owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); + owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.Id)); } public void SendUpdate() @@ -191,9 +191,9 @@ namespace Meteor.Map.actors.chara slotsToUpdate.Add(i); } - targetPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, itemPackageCapacity, itemPackageCode)); + targetPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.Id, itemPackageCapacity, itemPackageCode)); SendLinkedItemPackets(targetPlayer, slotsToUpdate); - targetPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); + targetPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.Id)); } public void SendUpdateAsItemPackage(Player targetPlayer) @@ -215,9 +215,9 @@ namespace Meteor.Map.actors.chara items.Add(referenceList[i]); } - targetPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, destinationCapacity, destinationCode)); + targetPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.Id, destinationCapacity, destinationCode)); SendItemPackets(targetPlayer, items); - targetPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); + targetPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.Id)); //Clean Up linkSlots for (ushort i = 0; i < referenceList.Length; i++) @@ -234,9 +234,9 @@ namespace Meteor.Map.actors.chara private void SendSingleLinkedItemPacket(Player targetPlayer, ushort position) { if (referenceList[position] == null) - targetPlayer.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, position)); + targetPlayer.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.Id, position)); else - targetPlayer.QueuePacket(LinkedItemListX01Packet.BuildPacket(owner.actorId, position, referenceList[position])); + targetPlayer.QueuePacket(LinkedItemListX01Packet.BuildPacket(owner.Id, position, referenceList[position])); } private void SendLinkedItemPackets(Player targetPlayer, List slotsToUpdate) @@ -246,16 +246,16 @@ namespace Meteor.Map.actors.chara while (true) { if (slotsToUpdate.Count - currentIndex >= 64) - targetPlayer.QueuePacket(LinkedItemListX64Packet.BuildPacket(owner.actorId, referenceList, slotsToUpdate, ref currentIndex)); + targetPlayer.QueuePacket(LinkedItemListX64Packet.BuildPacket(owner.Id, referenceList, slotsToUpdate, ref currentIndex)); else if (slotsToUpdate.Count - currentIndex >= 32) - targetPlayer.QueuePacket(LinkedItemListX32Packet.BuildPacket(owner.actorId, referenceList, slotsToUpdate, ref currentIndex)); + targetPlayer.QueuePacket(LinkedItemListX32Packet.BuildPacket(owner.Id, referenceList, slotsToUpdate, ref currentIndex)); else if (slotsToUpdate.Count - currentIndex >= 16) - targetPlayer.QueuePacket(LinkedItemListX16Packet.BuildPacket(owner.actorId, referenceList, slotsToUpdate, ref currentIndex)); + targetPlayer.QueuePacket(LinkedItemListX16Packet.BuildPacket(owner.Id, referenceList, slotsToUpdate, ref currentIndex)); else if (slotsToUpdate.Count - currentIndex > 1) - targetPlayer.QueuePacket(LinkedItemListX08Packet.BuildPacket(owner.actorId, referenceList, slotsToUpdate, ref currentIndex)); + targetPlayer.QueuePacket(LinkedItemListX08Packet.BuildPacket(owner.Id, referenceList, slotsToUpdate, ref currentIndex)); else if (slotsToUpdate.Count - currentIndex == 1) { - targetPlayer.QueuePacket(LinkedItemListX01Packet.BuildPacket(owner.actorId, slotsToUpdate[currentIndex], referenceList[slotsToUpdate[currentIndex]])); + targetPlayer.QueuePacket(LinkedItemListX01Packet.BuildPacket(owner.Id, slotsToUpdate[currentIndex], referenceList[slotsToUpdate[currentIndex]])); currentIndex++; } else @@ -270,16 +270,16 @@ namespace Meteor.Map.actors.chara while (true) { if (items.Count - currentIndex >= 64) - player.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + player.QueuePacket(InventoryListX64Packet.BuildPacket(owner.Id, items, ref currentIndex)); else if (items.Count - currentIndex >= 32) - player.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + player.QueuePacket(InventoryListX32Packet.BuildPacket(owner.Id, items, ref currentIndex)); else if (items.Count - currentIndex >= 16) - player.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + player.QueuePacket(InventoryListX16Packet.BuildPacket(owner.Id, items, ref currentIndex)); else if (items.Count - currentIndex > 1) - player.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex)); + player.QueuePacket(InventoryListX08Packet.BuildPacket(owner.Id, items, ref currentIndex)); else if (items.Count - currentIndex == 1) { - player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex])); + player.QueuePacket(InventoryListX01Packet.BuildPacket(owner.Id, items[currentIndex])); currentIndex++; } else diff --git a/Map Server/Actors/Command/Command.cs b/Map Server/Actors/Command/Command.cs index 23f6948d..9179213c 100644 --- a/Map Server/Actors/Command/Command.cs +++ b/Map Server/Actors/Command/Command.cs @@ -26,7 +26,7 @@ namespace Meteor.Map.Actors public Command(uint actorID, string name) : base(actorID) { - actorName = name; + Name = name; } } diff --git a/Map Server/Actors/Debug/Debug.cs b/Map Server/Actors/Debug/Debug.cs index 36b22110..dcab52f0 100644 --- a/Map Server/Actors/Debug/Debug.cs +++ b/Map Server/Actors/Debug/Debug.cs @@ -32,10 +32,10 @@ namespace Meteor.Map.Actors public DebugProg() : base(0x5FF80002) { - this.displayNameId = 0; - this.customDisplayName = "debug"; + this.LocalizedDisplayName = 0; + this.DisplayName = "debug"; - this.actorName = "debug"; + this.Name = "debug"; this.className = "Debug"; } @@ -43,7 +43,7 @@ namespace Meteor.Map.Actors { List lParams; lParams = LuaUtils.CreateLuaParamList("/System/Debug.prog", false, false, false, false, true, 0xC51F, true, true); - return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams); + return ActorInstantiatePacket.BuildPacket(Id, Name, className, lParams); } public override List GetSpawnPackets() diff --git a/Map Server/Actors/Director/Director.cs b/Map Server/Actors/Director/Director.cs index 1bd9e068..dca44ee6 100644 --- a/Map Server/Actors/Director/Director.cs +++ b/Map Server/Actors/Director/Director.cs @@ -78,7 +78,7 @@ namespace Meteor.Map.actors.director for (int i = 1; i < lparams.Count; i++) actualLParams.Add(lparams[i]); - return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, actualLParams); + return ActorInstantiatePacket.BuildPacket(Id, Name, className, actualLParams); } public override List GetSpawnPackets(ushort spawnType = 1) @@ -100,7 +100,7 @@ namespace Meteor.Map.actors.director List subpackets = new List(); SetActorPropetyPacket initProperties = new SetActorPropetyPacket("/_init"); initProperties.AddTarget(); - subpackets.Add(initProperties.BuildPacket(actorId)); + subpackets.Add(initProperties.BuildPacket(Id)); return subpackets; } @@ -171,7 +171,7 @@ namespace Meteor.Map.actors.director ((Player)player).RemoveDirector(this); members.Clear(); isDeleted = true; - Server.GetWorldManager().GetArea(CurrentArea.ZoneId).DeleteDirector(actorId); + Server.GetWorldManager().GetArea(CurrentArea.ZoneId).DeleteDirector(Id); } public void AddMember(Actor actor) @@ -193,7 +193,7 @@ namespace Meteor.Map.actors.director if (members.Contains(actor)) members.Remove(actor); if (contentGroup != null) - contentGroup.RemoveMember(actor.actorId); + contentGroup.RemoveMember(actor.Id); if (GetPlayerMembers().Count == 0 && !isDeleting) EndDirector(); } @@ -270,7 +270,7 @@ namespace Meteor.Map.actors.director uint zoneId = CurrentArea.ZoneId; int privLevel = CurrentArea.GetPrivateAreaType(); - actorName = String.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel); + Name = String.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel); } public string GetScriptPath() diff --git a/Map Server/Actors/Director/GuildleveDirector.cs b/Map Server/Actors/Director/GuildleveDirector.cs index 1162d09d..55b29063 100644 --- a/Map Server/Actors/Director/GuildleveDirector.cs +++ b/Map Server/Actors/Director/GuildleveDirector.cs @@ -137,7 +137,7 @@ namespace Meteor.Map.actors.director if (wasCompleted) { - Npc aetheryteNode = CurrentArea.SpawnActor(1200040, String.Format("{0}:warpExit", guildleveOwner.actorName), guildleveOwner.positionX, guildleveOwner.positionY, guildleveOwner.positionZ); + Npc aetheryteNode = CurrentArea.SpawnActor(1200040, String.Format("{0}:warpExit", guildleveOwner.Name), guildleveOwner.positionX, guildleveOwner.positionY, guildleveOwner.positionZ); AddMember(aetheryteNode); foreach (Actor a in GetPlayerMembers()) diff --git a/Map Server/Actors/Group/ContentGroup.cs b/Map Server/Actors/Group/ContentGroup.cs index 3cf8e6aa..d1588725 100644 --- a/Map Server/Actors/Group/ContentGroup.cs +++ b/Map Server/Actors/Group/ContentGroup.cs @@ -52,7 +52,7 @@ namespace Meteor.Map.actors.group } this.director = director; - contentGroupWork._globalTemp.director = (ulong)director.actorId << 32; + contentGroupWork._globalTemp.director = (ulong)director.Id << 32; } public void Start() @@ -67,8 +67,8 @@ namespace Meteor.Map.actors.group if (actor == null) return; - if(!members.Contains(actor.actorId)) - members.Add(actor.actorId); + if(!members.Contains(actor.Id)) + members.Add(actor.Id); if (actor is Character) ((Character)actor).SetCurrentContentGroup(this); diff --git a/Map Server/Actors/Group/MonsterParty.cs b/Map Server/Actors/Group/MonsterParty.cs index 9a4ea6f4..fc91b31a 100644 --- a/Map Server/Actors/Group/MonsterParty.cs +++ b/Map Server/Actors/Group/MonsterParty.cs @@ -54,11 +54,11 @@ namespace Meteor.Map.actors.group public override List BuildMemberList(uint id) { List groupMembers = new List(); - groupMembers.Add(new GroupMember(id, -1, 0, false, true, Server.GetWorldManager().GetActorInWorld(id).customDisplayName)); + groupMembers.Add(new GroupMember(id, -1, 0, false, true, Server.GetWorldManager().GetActorInWorld(id).DisplayName)); foreach (uint charaId in monsterMembers) { if (charaId != id) - groupMembers.Add(new GroupMember(charaId, -1, 0, false, true, Server.GetWorldManager().GetActorInWorld(charaId).customDisplayName)); + groupMembers.Add(new GroupMember(charaId, -1, 0, false, true, Server.GetWorldManager().GetActorInWorld(charaId).DisplayName)); } return groupMembers; } diff --git a/Map Server/Actors/Group/Party.cs b/Map Server/Actors/Group/Party.cs index b8bbd8b6..0b7e2206 100644 --- a/Map Server/Actors/Group/Party.cs +++ b/Map Server/Actors/Group/Party.cs @@ -50,7 +50,7 @@ namespace Meteor.Map.actors.group { for (int i = 0; i < members.Count; i++) { - if (Server.GetWorldManager().GetActorInWorld(members[i]).customDisplayName.Equals(name)) + if (Server.GetWorldManager().GetActorInWorld(members[i]).DisplayName.Equals(name)) { return members[i]; } @@ -76,12 +76,12 @@ namespace Meteor.Map.actors.group public override List BuildMemberList(uint id) { List groupMembers = new List(); - groupMembers.Add(new GroupMember(id, -1, 0, false, true, Server.GetWorldManager().GetActorInWorld(id).customDisplayName)); + groupMembers.Add(new GroupMember(id, -1, 0, false, true, Server.GetWorldManager().GetActorInWorld(id).DisplayName)); foreach (uint charaId in members) { var chara = Server.GetWorldManager().GetActorInWorld(charaId); if (charaId != id && chara != null) - groupMembers.Add(new GroupMember(charaId, -1, 0, false, true, chara.customDisplayName)); + groupMembers.Add(new GroupMember(charaId, -1, 0, false, true, chara.DisplayName)); } return groupMembers; } diff --git a/Map Server/Actors/Group/RelationGroup.cs b/Map Server/Actors/Group/RelationGroup.cs index 0ed6b127..c8e154a8 100644 --- a/Map Server/Actors/Group/RelationGroup.cs +++ b/Map Server/Actors/Group/RelationGroup.cs @@ -73,8 +73,8 @@ namespace Meteor.Map.actors.group uint hostId = (uint)((work._globalTemp.host >> 32) & 0xFFFFFFFF); - groupMembers.Add(new GroupMember(hostId, -1, 0, false, Server.GetServer().GetSession(hostId) != null, Server.GetWorldManager().GetActorInWorld(hostId).customDisplayName)); - groupMembers.Add(new GroupMember(charaOther, -1, 0, false, Server.GetServer().GetSession(charaOther) != null, Server.GetWorldManager().GetActorInWorld(charaOther).customDisplayName)); + groupMembers.Add(new GroupMember(hostId, -1, 0, false, Server.GetServer().GetSession(hostId) != null, Server.GetWorldManager().GetActorInWorld(hostId).DisplayName)); + groupMembers.Add(new GroupMember(charaOther, -1, 0, false, Server.GetServer().GetSession(charaOther) != null, Server.GetWorldManager().GetActorInWorld(charaOther).DisplayName)); return groupMembers; } diff --git a/Map Server/Actors/Group/RetainerMeetingRelationGroup.cs b/Map Server/Actors/Group/RetainerMeetingRelationGroup.cs index fd8a333e..047a3bc0 100644 --- a/Map Server/Actors/Group/RetainerMeetingRelationGroup.cs +++ b/Map Server/Actors/Group/RetainerMeetingRelationGroup.cs @@ -50,8 +50,8 @@ namespace Meteor.Map.actors.group { List groupMembers = new List(); - groupMembers.Add(new GroupMember(player.actorId, -1, 0x83, false, true, player.customDisplayName)); - groupMembers.Add(new GroupMember(retainer.actorId, -1, 0x83, false, true, retainer.customDisplayName)); + groupMembers.Add(new GroupMember(player.Id, -1, 0x83, false, true, player.DisplayName)); + groupMembers.Add(new GroupMember(retainer.Id, -1, 0x83, false, true, retainer.DisplayName)); return groupMembers; } diff --git a/Map Server/Actors/Group/TradeGroup.cs b/Map Server/Actors/Group/TradeGroup.cs index e5cd9601..941b99ed 100644 --- a/Map Server/Actors/Group/TradeGroup.cs +++ b/Map Server/Actors/Group/TradeGroup.cs @@ -73,8 +73,8 @@ namespace Meteor.Map.actors.group uint hostId = (uint)((work._globalTemp.host >> 32) & 0xFFFFFFFF); - groupMembers.Add(new GroupMember(hostId, -1, 0, false, Server.GetServer().GetSession(hostId) != null, Server.GetWorldManager().GetActorInWorld(hostId).customDisplayName)); - groupMembers.Add(new GroupMember(charaOther, -1, 0, false, Server.GetServer().GetSession(charaOther) != null, Server.GetWorldManager().GetActorInWorld(charaOther).customDisplayName)); + groupMembers.Add(new GroupMember(hostId, -1, 0, false, Server.GetServer().GetSession(hostId) != null, Server.GetWorldManager().GetActorInWorld(hostId).DisplayName)); + groupMembers.Add(new GroupMember(charaOther, -1, 0, false, Server.GetServer().GetSession(charaOther) != null, Server.GetWorldManager().GetActorInWorld(charaOther).DisplayName)); return groupMembers; } diff --git a/Map Server/Actors/Judge/Judge.cs b/Map Server/Actors/Judge/Judge.cs index eeb5e337..043f741a 100644 --- a/Map Server/Actors/Judge/Judge.cs +++ b/Map Server/Actors/Judge/Judge.cs @@ -25,7 +25,7 @@ namespace Meteor.Map.Actors { public Judge(uint actorID, string name) : base(actorID) { - actorName = name; + Name = name; } } } diff --git a/Map Server/Actors/Quest/Quest.cs b/Map Server/Actors/Quest/Quest.cs index 90a00bbe..2a2740fa 100644 --- a/Map Server/Actors/Quest/Quest.cs +++ b/Map Server/Actors/Quest/Quest.cs @@ -309,17 +309,17 @@ namespace Meteor.Map.Actors public Quest(uint actorID, string name) : base(actorID) { - actorName = name; + Name = name; } public Quest(Player owner, Quest baseQuest): this(owner, baseQuest, SEQ_NOT_STARTED, 0, 0, 0, 0) {} public Quest(Player owner, Quest baseQuest, ushort sequence, uint flags, ushort counter1, ushort counter2, ushort counter3) - : base(baseQuest.actorId) + : base(baseQuest.Id) { Owner = owner; - actorName = baseQuest.actorName; + Name = baseQuest.Name; className = baseQuest.className; classPath = baseQuest.classPath; currentSequence = sequence; @@ -333,7 +333,7 @@ namespace Meteor.Map.Actors public uint GetQuestId() { - return actorId & 0xFFFFF; + return Id & 0xFFFFF; } public void DoComplete() diff --git a/Map Server/Actors/StaticActors.cs b/Map Server/Actors/StaticActors.cs index 78274c55..73082cf8 100644 --- a/Map Server/Actors/StaticActors.cs +++ b/Map Server/Actors/StaticActors.cs @@ -133,7 +133,7 @@ namespace Meteor.Map.Actors { foreach (Actor a in mStaticActors.Values) { - if (a.actorName.Equals(name)) + if (a.Name.Equals(name)) return a; } diff --git a/Map Server/Actors/World/WorldMaster.cs b/Map Server/Actors/World/WorldMaster.cs index 9460263c..b5995b60 100644 --- a/Map Server/Actors/World/WorldMaster.cs +++ b/Map Server/Actors/World/WorldMaster.cs @@ -31,10 +31,10 @@ namespace Meteor.Map.Actors { public WorldMaster() : base(0x5FF80001) { - this.displayNameId = 0; - this.customDisplayName = "worldMaster"; + this.LocalizedDisplayName = 0; + this.DisplayName = "worldMaster"; - this.actorName = "worldMaster"; + this.Name = "worldMaster"; this.className = "WorldMaster"; } @@ -42,7 +42,7 @@ namespace Meteor.Map.Actors { List lParams; lParams = LuaUtils.CreateLuaParamList("/World/WorldMaster_event", false, false, false, false, false, null); - return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams); + return ActorInstantiatePacket.BuildPacket(Id, Name, className, lParams); } public override List GetSpawnPackets() diff --git a/Map Server/DataObjects/Session.cs b/Map Server/DataObjects/Session.cs index 0d7b4bc6..1c93f276 100644 --- a/Map Server/DataObjects/Session.cs +++ b/Map Server/DataObjects/Session.cs @@ -119,12 +119,12 @@ namespace Meteor.Map.dataobjects //Retainer Instance if (actorInstanceList[i] is Retainer && playerActor.currentSpawnedRetainer == null) { - QueuePacket(RemoveActorPacket.BuildPacket(actorInstanceList[i].actorId)); + QueuePacket(RemoveActorPacket.BuildPacket(actorInstanceList[i].Id)); actorInstanceList.RemoveAt(i); } else if (!list.Contains(actorInstanceList[i]) && !(actorInstanceList[i] is Retainer)) { - QueuePacket(RemoveActorPacket.BuildPacket(actorInstanceList[i].actorId)); + QueuePacket(RemoveActorPacket.BuildPacket(actorInstanceList[i].Id)); actorInstanceList.RemoveAt(i); } } @@ -146,7 +146,7 @@ namespace Meteor.Map.dataobjects { Actor actor = list[i]; - if (actor.actorId == playerActor.actorId) + if (actor.Id == playerActor.Id) continue; if (actorInstanceList.Contains(actor)) @@ -169,7 +169,7 @@ namespace Meteor.Map.dataobjects { ENpcQuestInstance questInstance = quests[0].GetENpcInstance(npc.GetActorClassId()); QueuePacket(npc.GetSetEventStatusPackets()); - QueuePacket(SetActorQuestGraphicPacket.BuildPacket(npc.actorId, questInstance.questFlagType)); + QueuePacket(SetActorQuestGraphicPacket.BuildPacket(npc.Id, questInstance.questFlagType)); } } @@ -188,12 +188,12 @@ namespace Meteor.Map.dataobjects if (!clearInstance) { QueuePacket(actor.GetSetEventStatusPackets(questInstance.isTalkEnabled, questInstance.isEmoteEnabled, questInstance.isPushEnabled)); - QueuePacket(SetActorQuestGraphicPacket.BuildPacket(actor.actorId, questInstance.questFlagType)); + QueuePacket(SetActorQuestGraphicPacket.BuildPacket(actor.Id, questInstance.questFlagType)); } else { QueuePacket(actor.GetSetEventStatusPackets()); - QueuePacket(SetActorQuestGraphicPacket.BuildPacket(actor.actorId, 0)); + QueuePacket(SetActorQuestGraphicPacket.BuildPacket(actor.Id, 0)); } } LockUpdates(false); diff --git a/Map Server/Database.cs b/Map Server/Database.cs index 27337cb4..ecf7eec0 100644 --- a/Map Server/Database.cs +++ b/Map Server/Database.cs @@ -293,7 +293,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@mainHand", player.appearanceIds[Character.MAINHAND]); cmd.Parameters.AddWithValue("@offHand", player.appearanceIds[Character.OFFHAND]); cmd.Parameters.AddWithValue("@head", player.appearanceIds[Character.HEADGEAR]); @@ -340,7 +340,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@classId", player.charaWork.parameterSave.state_mainSkill[0]); cmd.Parameters.AddWithValue("@classLevel", player.charaWork.parameterSave.state_mainSkillLevel); @@ -383,7 +383,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@x", player.positionX); cmd.Parameters.AddWithValue("@y", player.positionY); cmd.Parameters.AddWithValue("@z", player.positionZ); @@ -425,7 +425,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@playtime", player.GetPlayTime(true)); cmd.ExecuteNonQuery(); @@ -460,7 +460,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@homepoint", player.homepoint); cmd.Parameters.AddWithValue("@homepointInn", player.homepointInn); @@ -479,10 +479,10 @@ namespace Meteor.Map public static void SaveQuest(Player player, Quest quest) { - int slot = player.GetQuestSlot(quest.actorId); + int slot = player.GetQuestSlot(quest.Id); if (slot == -1) { - Program.Log.Error("Tried saving quest player didn't have: Player: {0:x}, QuestId: {0:x}", player.actorId, quest.actorId); + Program.Log.Error("Tried saving quest player didn't have: Player: {0:x}, QuestId: {0:x}", player.Id, quest.Id); return; } else @@ -510,9 +510,9 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@slot", slot); - cmd.Parameters.AddWithValue("@questId", 0xFFFFF & quest.actorId); + cmd.Parameters.AddWithValue("@questId", 0xFFFFF & quest.Id); cmd.Parameters.AddWithValue("@sequence", quest.GetSequence()); cmd.Parameters.AddWithValue("@flags", quest.GetFlags()); cmd.Parameters.AddWithValue("@counter1", quest.GetCounter(1)); @@ -550,7 +550,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@guildleveId", glId); cmd.Parameters.AddWithValue("@abandoned", isAbandoned); cmd.Parameters.AddWithValue("@completed", isCompleted); @@ -589,7 +589,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@slot", slot); cmd.Parameters.AddWithValue("@guildleveId", glId); cmd.Parameters.AddWithValue("@abandoned", 0); @@ -625,7 +625,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@guildleveId", glId); cmd.ExecuteNonQuery(); @@ -658,7 +658,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@questId", 0xFFFFF & questId); cmd.ExecuteNonQuery(); @@ -694,7 +694,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@questId", 0xFFFFF & questId); cmd.ExecuteNonQuery(); @@ -719,7 +719,7 @@ namespace Meteor.Map { conn.Open(); MySqlCommand cmd = new MySqlCommand("SELECT * FROM characters_quest_completed WHERE characterId = @charaId and questId = @questId", conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@questId", questId); isCompleted = cmd.ExecuteScalar() != null; } @@ -778,7 +778,7 @@ namespace Meteor.Map FROM characters WHERE id = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) @@ -788,8 +788,8 @@ namespace Meteor.Map int privateAreaType; - player.displayNameId = -1; - player.customDisplayName = reader.GetString(0); + player.LocalizedDisplayName = -1; + player.DisplayName = reader.GetString(0); player.oldPositionX = player.positionX = reader.GetFloat(1); player.oldPositionY = player.positionY = reader.GetFloat(2); player.oldPositionZ = player.positionZ = reader.GetFloat(3); @@ -852,7 +852,7 @@ namespace Meteor.Map FROM characters_class_levels WHERE characterId = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) @@ -908,7 +908,7 @@ namespace Meteor.Map FROM characters_class_exp WHERE characterId = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) @@ -948,7 +948,7 @@ namespace Meteor.Map FROM characters_parametersave WHERE characterId = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) @@ -1001,7 +1001,7 @@ namespace Meteor.Map FROM characters_appearance WHERE characterId = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) @@ -1055,7 +1055,7 @@ namespace Meteor.Map FROM characters_statuseffect WHERE characterId = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) @@ -1092,7 +1092,7 @@ namespace Meteor.Map FROM characters_chocobo WHERE characterId = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) @@ -1130,7 +1130,7 @@ namespace Meteor.Map FROM characters_timers WHERE characterId = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) @@ -1156,7 +1156,7 @@ namespace Meteor.Map FROM characters_quest_scenario WHERE characterId = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) @@ -1186,7 +1186,7 @@ namespace Meteor.Map FROM characters_quest_guildleve_local WHERE characterId = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) @@ -1206,7 +1206,7 @@ namespace Meteor.Map FROM characters_quest_guildleve_regional WHERE characterId = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) @@ -1227,7 +1227,7 @@ namespace Meteor.Map FROM characters_npclinkshell WHERE characterId = @charId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) @@ -1277,7 +1277,7 @@ namespace Meteor.Map WHERE characterId = @charId AND (classId = @classId OR classId = 0) ORDER BY equipSlot"; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); cmd.Parameters.AddWithValue("@classId", classId); using (MySqlDataReader reader = cmd.ExecuteReader()) @@ -1322,7 +1322,7 @@ namespace Meteor.Map "; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@characterId", player.actorId); + cmd.Parameters.AddWithValue("@characterId", player.Id); cmd.Parameters.AddWithValue("@classId", (equipSlot == Player.SLOT_UNDERSHIRT || equipSlot == Player.SLOT_UNDERGARMENT) ? 0 : player.charaWork.parameterSave.state_mainSkill[0]); cmd.Parameters.AddWithValue("@equipSlot", equipSlot); cmd.Parameters.AddWithValue("@uniqueItemId", uniqueItemId); @@ -1356,7 +1356,7 @@ namespace Meteor.Map "; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@characterId", player.actorId); + cmd.Parameters.AddWithValue("@characterId", player.Id); cmd.Parameters.AddWithValue("@classId", player.charaWork.parameterSave.state_mainSkill[0]); cmd.Parameters.AddWithValue("@equipSlot", equipSlot); @@ -1399,7 +1399,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); cmd.Parameters.AddWithValue("@classId", classId); cmd.Parameters.AddWithValue("@commandId", commandId); cmd.Parameters.AddWithValue("@hotbarSlot", hotbarSlot); @@ -1442,7 +1442,7 @@ namespace Meteor.Map WHERE characterId = @charId AND classId = @classId AND hotbarSlot = @hotbarSlot "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); cmd.Parameters.AddWithValue("@classId", player.charaWork.parameterSave.state_mainSkill[0]); cmd.Parameters.AddWithValue("@hotbarSlot", hotbarSlot); cmd.ExecuteNonQuery(); @@ -1479,7 +1479,7 @@ namespace Meteor.Map ORDER BY hotbarSlot"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); cmd.Parameters.AddWithValue("@classId", player.GetCurrentClassOrJob()); player.charaWork.commandBorder = 32; @@ -1537,7 +1537,7 @@ namespace Meteor.Map ORDER BY hotbarSlot "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); cmd.Parameters.AddWithValue("@classId", classId); using (MySqlDataReader reader = cmd.ExecuteReader()) @@ -1612,7 +1612,7 @@ namespace Meteor.Map ORDER BY slot ASC"; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", owner.actorId); + cmd.Parameters.AddWithValue("@charId", owner.Id); cmd.Parameters.AddWithValue("@type", type); ushort slot = 0; @@ -1716,7 +1716,7 @@ namespace Meteor.Map MySqlCommand cmd = new MySqlCommand(query, conn); cmd.Parameters.AddWithValue("@serverItemId", addedItem.uniqueId); - cmd.Parameters.AddWithValue("@charId", owner.actorId); + cmd.Parameters.AddWithValue("@charId", owner.Id); cmd.Parameters.AddWithValue("@itemPackage", itemPackage); cmd.Parameters.AddWithValue("@slot", slot); @@ -1747,7 +1747,7 @@ namespace Meteor.Map "; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", owner.actorId); + cmd.Parameters.AddWithValue("@charId", owner.Id); cmd.Parameters.AddWithValue("@serverItemId", serverItemId); cmd.ExecuteNonQuery(); @@ -1912,7 +1912,7 @@ namespace Meteor.Map WHERE characterId = @charId AND rewardPoints <> 0 AND timeDone IS NOT NULL ORDER BY timeDone LIMIT 5"; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { int count = 0; @@ -1933,7 +1933,7 @@ namespace Meteor.Map } } - return SetLatestAchievementsPacket.BuildPacket(player.actorId, latestAchievements); + return SetLatestAchievementsPacket.BuildPacket(player.Id, latestAchievements); } public static SubPacket GetAchievementsPacket(Player player) @@ -1953,7 +1953,7 @@ namespace Meteor.Map WHERE characterId = @charId AND timeDone IS NOT NULL"; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); using (MySqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) @@ -1979,7 +1979,7 @@ namespace Meteor.Map } } - return cheevosPacket.BuildPacket(player.actorId); + return cheevosPacket.BuildPacket(player.Id); } public static SubPacket GetAchievementProgress(Player player, uint achievementId) @@ -1997,7 +1997,7 @@ namespace Meteor.Map WHERE characterId = @charId AND achievementId = @achievementId"; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charId", player.actorId); + cmd.Parameters.AddWithValue("@charId", player.Id); cmd.Parameters.AddWithValue("@achievementId", achievementId); using (MySqlDataReader reader = cmd.ExecuteReader()) { @@ -2017,7 +2017,7 @@ namespace Meteor.Map conn.Dispose(); } } - return SendAchievementRatePacket.BuildPacket(player.actorId, achievementId, progress, progressFlags); + return SendAchievementRatePacket.BuildPacket(player.Id, achievementId, progress, progressFlags); } public static bool CreateLinkshell(Player player, string lsName, ushort lsCrest) @@ -2039,7 +2039,7 @@ namespace Meteor.Map MySqlCommand cmd = new MySqlCommand(query, conn); cmd.Parameters.AddWithValue("@lsName", lsName); - cmd.Parameters.AddWithValue("@master", player.actorId); + cmd.Parameters.AddWithValue("@master", player.Id); cmd.Parameters.AddWithValue("@crest", lsCrest); cmd.ExecuteNonQuery(); @@ -2079,7 +2079,7 @@ namespace Meteor.Map "; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@lsId", npcLSId); cmd.Parameters.AddWithValue("@calling", isCalling ? 1 : 0); cmd.Parameters.AddWithValue("@extra", isExtra ? 1 : 0); @@ -2352,7 +2352,7 @@ namespace Meteor.Map hasChocobo=@hasChocobo, chocoboAppearance=@chocoboAppearance, chocoboName=@chocoboName"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@characterId", player.actorId); + cmd.Parameters.AddWithValue("@characterId", player.Id); cmd.Parameters.AddWithValue("@hasChocobo", 1); cmd.Parameters.AddWithValue("@chocoboAppearance", appearanceId); cmd.Parameters.AddWithValue("@chocoboName", name); @@ -2389,7 +2389,7 @@ namespace Meteor.Map characterId = @characterId"; cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@characterId", player.actorId); + cmd.Parameters.AddWithValue("@characterId", player.Id); cmd.Parameters.AddWithValue("@chocoboAppearance", appearanceId); cmd.ExecuteNonQuery(); @@ -2477,7 +2477,7 @@ namespace Meteor.Map { var duration = Utils.UnixTimeStampUTC(effect.GetEndTime()) - Utils.UnixTimeStampUTC(); - cmd.Parameters.AddWithValue("@actorId", player.actorId); + cmd.Parameters.AddWithValue("@actorId", player.Id); cmd.Parameters.AddWithValue("@statusId", effect.GetStatusEffectId()); cmd.Parameters.AddWithValue("@magnitude", effect.GetMagnitude()); cmd.Parameters.AddWithValue("@duration", duration); @@ -2689,7 +2689,7 @@ namespace Meteor.Map cmd.Prepare(); cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@characterId", player.actorId); + cmd.Parameters.AddWithValue("@characterId", player.Id); cmd.Parameters.AddWithValue("@exp", exp); cmd.ExecuteNonQuery(); } @@ -2722,7 +2722,7 @@ namespace Meteor.Map cmd.Prepare(); cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@characterId", player.actorId); + cmd.Parameters.AddWithValue("@characterId", player.Id); cmd.Parameters.AddWithValue("@lvl", level); cmd.ExecuteNonQuery(); } @@ -2756,7 +2756,7 @@ namespace Meteor.Map "; MySqlCommand cmd = new MySqlCommand(query, conn); - cmd.Parameters.AddWithValue("@charaId", player.actorId); + cmd.Parameters.AddWithValue("@charaId", player.Id); cmd.Parameters.AddWithValue("@retainerIndex", retainerIndex - 1); using (MySqlDataReader reader = cmd.ExecuteReader()) @@ -2770,7 +2770,7 @@ namespace Meteor.Map ActorClass actorClass = Server.GetWorldManager().GetActorClass(actorClassId); retainer = new Retainer(retainerId, actorClass, player, 0, 0, 0, 0); - retainer.customDisplayName = name; + retainer.DisplayName = name; retainer.LoadEventConditions(actorClass.eventConditions); } } @@ -2854,7 +2854,7 @@ namespace Meteor.Map cmd = new MySqlCommand(query, conn); cmd.Parameters.AddWithValue("@level", level); - cmd.Parameters.AddWithValue("@characterId", player.actorId); + cmd.Parameters.AddWithValue("@characterId", player.Id); cmd.ExecuteNonQuery(); } diff --git a/Map Server/Lua/LuaEngine.cs b/Map Server/Lua/LuaEngine.cs index 45042a77..d3d252ae 100644 --- a/Map Server/Lua/LuaEngine.cs +++ b/Map Server/Lua/LuaEngine.cs @@ -107,8 +107,8 @@ namespace Meteor.Map.lua public void AddWaitEventCoroutine(Player player, Coroutine coroutine) { - if (!mSleepingOnPlayerEvent.ContainsKey(player.actorId)) - mSleepingOnPlayerEvent.Add(player.actorId, coroutine); + if (!mSleepingOnPlayerEvent.ContainsKey(player.Id)) + mSleepingOnPlayerEvent.Add(player.Id, coroutine); } public void PulseSleepingOnTime(object state) @@ -149,12 +149,12 @@ namespace Meteor.Map.lua public void OnEventUpdate(Player player, List args) { - if (mSleepingOnPlayerEvent.ContainsKey(player.actorId)) + if (mSleepingOnPlayerEvent.ContainsKey(player.Id)) { try { - Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId]; - mSleepingOnPlayerEvent.Remove(player.actorId); + Coroutine coroutine = mSleepingOnPlayerEvent[player.Id]; + mSleepingOnPlayerEvent.Remove(player.Id); DynValue value = coroutine.Resume(LuaUtils.CreateLuaParamObjectList(args)); ResolveResume(player, coroutine, value); } @@ -400,8 +400,8 @@ namespace Meteor.Map.lua } else if (target is Quest) { - string initial = ((Quest)target).actorName.Substring(0, 3); - string questName = ((Quest)target).actorName; + string initial = ((Quest)target).Name.Substring(0, 3); + string questName = ((Quest)target).Name; return root + String.Format(FILEPATH_QUEST, initial, questName); } else @@ -640,10 +640,10 @@ namespace Meteor.Map.lua lparams.AddRange(eventStart.luaParams); lparams.Insert(0, new LuaParam(0, eventStart.eventType)); lparams.Insert(1, new LuaParam(2, eventStart.eventName)); - if (mSleepingOnPlayerEvent.ContainsKey(player.actorId)) + if (mSleepingOnPlayerEvent.ContainsKey(player.Id)) { - Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId]; - mSleepingOnPlayerEvent.Remove(player.actorId); + Coroutine coroutine = mSleepingOnPlayerEvent[player.Id]; + mSleepingOnPlayerEvent.Remove(player.Id); try { @@ -777,7 +777,7 @@ namespace Meteor.Map.lua { if (permissions > 0 && !player.isGM) { - Program.Log.Info("LuaEngine.RunGMCommand: {0}'s GM level is too low to use command {1}.", player.actorName, cmd); + Program.Log.Info("LuaEngine.RunGMCommand: {0}'s GM level is too low to use command {1}.", player.Name, cmd); return; } // i hate to do this, but cant think of a better way to keep !help @@ -902,7 +902,7 @@ namespace Meteor.Map.lua return; List SendError = new List(); player.SendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "", message); - player.QueuePacket(EndEventPacket.BuildPacket(player.actorId, player.currentEventOwner, player.currentEventName, 0)); + player.QueuePacket(EndEventPacket.BuildPacket(player.Id, player.currentEventOwner, player.currentEventName, 0)); } } diff --git a/Map Server/Lua/LuaUtils.cs b/Map Server/Lua/LuaUtils.cs index c63dbc32..4c58f520 100644 --- a/Map Server/Lua/LuaUtils.cs +++ b/Map Server/Lua/LuaUtils.cs @@ -439,7 +439,7 @@ namespace Meteor.Map } else if (o is Actor) { - luaParams.Add(new LuaParam(0x6, ((Actor)o).actorId)); + luaParams.Add(new LuaParam(0x6, ((Actor)o).Id)); } else if (o is ItemRefParam) { diff --git a/Map Server/PacketProcessor.cs b/Map Server/PacketProcessor.cs index 99fa197a..6e6619d5 100644 --- a/Map Server/PacketProcessor.cs +++ b/Map Server/PacketProcessor.cs @@ -82,7 +82,7 @@ namespace Meteor.Map if (!beginSessionPacket.isLogin) Server.GetWorldManager().DoZoneIn(session.GetActor(), false, session.GetActor().destinationSpawnType); - Program.Log.Info("{0} has been added to the session list.", session.GetActor().customDisplayName); + Program.Log.Info("{0} has been added to the session list.", session.GetActor().DisplayName); client.FlushQueuedSendPackets(); break; @@ -96,7 +96,7 @@ namespace Meteor.Map session.GetActor().CleanupAndSave(endSessionPacket.destinationZoneId, endSessionPacket.destinationSpawnType, endSessionPacket.destinationX, endSessionPacket.destinationY, endSessionPacket.destinationZ, endSessionPacket.destinationRot); Server.GetServer().RemoveSession(session.id); - Program.Log.Info("{0} has been removed from the session list.", session.GetActor().customDisplayName); + Program.Log.Info("{0} has been removed from the session list.", session.GetActor().DisplayName); session.QueuePacket(SessionEndConfirmPacket.BuildPacket(session, endSessionPacket.destinationZoneId)); client.FlushQueuedSendPackets(); @@ -138,7 +138,7 @@ namespace Meteor.Map } if (chatMessage.logType == SendMessagePacket.MESSAGE_TYPE_SAY || chatMessage.logType == SendMessagePacket.MESSAGE_TYPE_SHOUT) - session.GetActor().BroadcastPacket(SendMessagePacket.BuildPacket(session.id, chatMessage.logType, session.GetActor().customDisplayName, chatMessage.message), false); + session.GetActor().BroadcastPacket(SendMessagePacket.BuildPacket(session.id, chatMessage.logType, session.GetActor().DisplayName, chatMessage.message), false); break; //Langauge Code (Client safe to send packets to now) @@ -202,7 +202,7 @@ namespace Meteor.Map if (ownerActor == null) { //Is it your retainer? - if (session.GetActor().currentSpawnedRetainer != null && session.GetActor().currentSpawnedRetainer.actorId == eventStart.ownerActorID) + if (session.GetActor().currentSpawnedRetainer != null && session.GetActor().currentSpawnedRetainer.Id == eventStart.ownerActorID) ownerActor = session.GetActor().currentSpawnedRetainer; //Is it a instance actor? if (ownerActor == null) @@ -272,7 +272,7 @@ namespace Meteor.Map ((Character)Server.GetWorldManager().GetActorInWorld(packageRequest.actorID)).SendItemPackage(session.GetActor(), packageRequest.packageId); break; } - if (session.GetActor().GetSpawnedRetainer() != null && session.GetActor().GetSpawnedRetainer().actorId == packageRequest.actorID) + if (session.GetActor().GetSpawnedRetainer() != null && session.GetActor().GetSpawnedRetainer().Id == packageRequest.actorID) session.GetActor().GetSpawnedRetainer().SendItemPackage(session.GetActor(), packageRequest.packageId); break; //Group Created Confirm diff --git a/Map Server/Server.cs b/Map Server/Server.cs index 6feba4fd..45910540 100644 --- a/Map Server/Server.cs +++ b/Map Server/Server.cs @@ -153,7 +153,7 @@ namespace Meteor.Map { foreach (Session s in mSessionList.Values) { - if (s.GetActor().customDisplayName.ToLower().Equals(name.ToLower())) + if (s.GetActor().DisplayName.ToLower().Equals(name.ToLower())) return s; } return null; diff --git a/Map Server/Utils/ActorPropertyPacketUtil.cs b/Map Server/Utils/ActorPropertyPacketUtil.cs index 68666727..b4d190a0 100644 --- a/Map Server/Utils/ActorPropertyPacketUtil.cs +++ b/Map Server/Utils/ActorPropertyPacketUtil.cs @@ -47,7 +47,7 @@ namespace Meteor.Map.utils { currentActorPropertyPacket.SetIsMore(true); currentActorPropertyPacket.AddTarget(); - subPackets.Add(currentActorPropertyPacket.BuildPacket(forActor.actorId)); + subPackets.Add(currentActorPropertyPacket.BuildPacket(forActor.Id)); currentActorPropertyPacket = new SetActorPropetyPacket(currentTarget); currentActorPropertyPacket.AddProperty(forActor, property); } @@ -64,7 +64,7 @@ namespace Meteor.Map.utils { currentActorPropertyPacket.AddTarget(); currentActorPropertyPacket.SetIsMore(false); - subPackets.Add(currentActorPropertyPacket.BuildPacket(forActor.actorId)); + subPackets.Add(currentActorPropertyPacket.BuildPacket(forActor.Id)); return subPackets; } diff --git a/Map Server/WorldManager.cs b/Map Server/WorldManager.cs index 3bbb1923..ca6da014 100644 --- a/Map Server/WorldManager.cs +++ b/Map Server/WorldManager.cs @@ -838,7 +838,7 @@ namespace Meteor.Map //This server does not contain that zoneId if (newArea == null) { - Program.Log.Debug("Request to change to zone not on this server by: {0}.", player.customDisplayName); + Program.Log.Debug("Request to change to zone not on this server by: {0}.", player.DisplayName); RequestWorldServerZoneChange(player, destinationZoneId, spawnType, spawnX, spawnY, spawnZ, spawnRotation); return; } @@ -868,7 +868,7 @@ namespace Meteor.Map //Delete content if have if (player.currentContentGroup != null) { - player.currentContentGroup.RemoveMember(player.actorId); + player.currentContentGroup.RemoveMember(player.Id); player.SetCurrentContentGroup(null); if (oldArea is PrivateAreaContent) @@ -876,8 +876,8 @@ namespace Meteor.Map } //Send packets - player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.actorId)); - player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x2)); + player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.Id)); + player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.Id, 0x2)); player.SendZoneInPackets(this, spawnType); player.playerSession.ClearInstance(); player.SendInstanceUpdate(); @@ -908,7 +908,7 @@ namespace Meteor.Map player.rotation = spawnRotation; //Send packets - player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x10)); + player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.Id, 0x10)); player.playerSession.QueuePacket(player.CreateSpawnTeleportPacket(spawnType)); player.playerSession.LockUpdates(false); @@ -922,7 +922,7 @@ namespace Meteor.Map //Content area was null if (contentArea == null) { - Program.Log.Debug("Request to change to content area not on this server by: {0}.", player.customDisplayName); + Program.Log.Debug("Request to change to content area not on this server by: {0}.", player.DisplayName); return; } @@ -948,8 +948,8 @@ namespace Meteor.Map player.SendGameMessage(GetActor(), 34108, 0x20); //Send packets - player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.actorId)); - player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x10)); + player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.Id)); + player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.Id, 0x10)); player.SendZoneInPackets(this, spawnType); player.playerSession.ClearInstance(); player.SendInstanceUpdate(true); @@ -977,8 +977,8 @@ namespace Meteor.Map //Send packets if (!isLogin) { - player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.actorId)); - player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x2)); + player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.Id)); + player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.Id, 0x2)); } player.SendZoneInPackets(this, spawnType); @@ -1021,7 +1021,7 @@ namespace Meteor.Map { initialMembers = new uint[actors.Length]; for (int i = 0; i < actors.Length; i++) - initialMembers[i] = actors[i].actorId; + initialMembers[i] = actors[i].Id; } groupIndexId = groupIndexId | 0x3000000000000000; @@ -1049,7 +1049,7 @@ namespace Meteor.Map { initialMembers = new uint[actors.Count]; for (int i = 0; i < actors.Count; i++) - initialMembers[i] = actors[i].actorId; + initialMembers[i] = actors[i].Id; } groupIndexId = groupIndexId | 0x3000000000000000; @@ -1077,7 +1077,7 @@ namespace Meteor.Map { initialMembers = new uint[actors.Count]; for (int i = 0; i < actors.Count; i++) - initialMembers[i] = actors[i].actorId; + initialMembers[i] = actors[i].Id; } groupIndexId = groupIndexId | 0x2000000000000000; @@ -1110,11 +1110,11 @@ namespace Meteor.Map { groupIndexId = groupIndexId | 0x0000000000000000; - RelationGroup group = new RelationGroup(groupIndexId, inviter.actorId, invitee.actorId, 0, groupType); + RelationGroup group = new RelationGroup(groupIndexId, inviter.Id, invitee.Id, 0, groupType); mRelationGroups.Add(groupIndexId, group); groupIndexId++; - group.SendGroupPacketsAll(inviter.actorId, invitee.actorId); + group.SendGroupPacketsAll(inviter.Id, invitee.Id); return group; } @@ -1150,12 +1150,12 @@ namespace Meteor.Map inviter.SendGameMessage(GetActor(), 25043, 0x20, (object)invitee); //You cannot trade with yourself. return null; } - else if (GetTradeGroup(inviter.actorId) != null) + else if (GetTradeGroup(inviter.Id) != null) { inviter.SendGameMessage(GetActor(), 25045, 0x20, (object)invitee); //You may only trade with one person at a time. return null; } - else if (GetTradeGroup(invitee.actorId) != null) + else if (GetTradeGroup(invitee.Id) != null) { inviter.SendGameMessage(GetActor(), 25044, 0x20, (object)invitee); //Your target is unable to trade. return null; @@ -1166,11 +1166,11 @@ namespace Meteor.Map { groupIndexId = groupIndexId | 0x0000000000000000; - TradeGroup group = new TradeGroup(groupIndexId, inviter.actorId, invitee.actorId); + TradeGroup group = new TradeGroup(groupIndexId, inviter.Id, invitee.Id); mTradeGroups.Add(groupIndexId, group); groupIndexId++; - group.SendGroupPacketsAll(inviter.actorId, invitee.actorId); + group.SendGroupPacketsAll(inviter.Id, invitee.Id); inviter.SendGameMessage(GetActor(), 25101, 0x20, (object)invitee); //You request to trade with X invitee.SendGameMessage(GetActor(), 25037, 0x20, (object)inviter); //X wishes to trade with you @@ -1212,7 +1212,7 @@ namespace Meteor.Map public void AcceptTrade(Player invitee) { - TradeGroup group = GetTradeGroup(invitee.actorId); + TradeGroup group = GetTradeGroup(invitee.Id); if (group == null) { @@ -1233,7 +1233,7 @@ namespace Meteor.Map public void CancelTradeTooFar(Player inviter) { - TradeGroup group = GetTradeGroup(inviter.actorId); + TradeGroup group = GetTradeGroup(inviter.Id); if (group == null) { @@ -1252,7 +1252,7 @@ namespace Meteor.Map public void CancelTrade(Player inviter) { - TradeGroup group = GetTradeGroup(inviter.actorId); + TradeGroup group = GetTradeGroup(inviter.Id); if (group == null) { @@ -1271,7 +1271,7 @@ namespace Meteor.Map public void RefuseTrade(Player invitee) { - TradeGroup group = GetTradeGroup(invitee.actorId); + TradeGroup group = GetTradeGroup(invitee.Id); if (group == null) { @@ -1292,7 +1292,7 @@ namespace Meteor.Map if (!p1.IsTradeAccepted() || !p2.IsTradeAccepted()) return; - TradeGroup group = GetTradeGroup(p1.actorId); + TradeGroup group = GetTradeGroup(p1.Id); if (group == null) { @@ -1467,9 +1467,9 @@ namespace Meteor.Map } //TODO: Refactor so that it's not a mess like V - player.QueuePacket(InventoryBeginChangePacket.BuildPacket(player.actorId)); + player.QueuePacket(InventoryBeginChangePacket.BuildPacket(player.Id)); originalPackage.SendUpdate(); - player.QueuePacket(InventoryEndChangePacket.BuildPacket(player.actorId)); + player.QueuePacket(InventoryEndChangePacket.BuildPacket(player.Id)); } } else if (bazaarMode == InventoryItem.MODE_SELL_FSTACK) @@ -1506,9 +1506,9 @@ namespace Meteor.Map reward.ChangeQuantity(-rewardAmount); finalReward = splitItem; - player.QueuePacket(InventoryBeginChangePacket.BuildPacket(player.actorId)); + player.QueuePacket(InventoryBeginChangePacket.BuildPacket(player.Id)); originalRewardPackage.SendUpdate(); - player.QueuePacket(InventoryEndChangePacket.BuildPacket(player.actorId)); + player.QueuePacket(InventoryEndChangePacket.BuildPacket(player.Id)); } else return ItemPackage.ERROR_SYSTEM; @@ -1531,9 +1531,9 @@ namespace Meteor.Map seek.ChangeQuantity(-seekAmount); finalSeek = splitItem; - player.QueuePacket(InventoryBeginChangePacket.BuildPacket(player.actorId)); + player.QueuePacket(InventoryBeginChangePacket.BuildPacket(player.Id)); originalSeekPackage.SendUpdate(); - player.QueuePacket(InventoryEndChangePacket.BuildPacket(player.actorId)); + player.QueuePacket(InventoryEndChangePacket.BuildPacket(player.Id)); } else return ItemPackage.ERROR_SYSTEM; @@ -1545,9 +1545,9 @@ namespace Meteor.Map bazaarPackage.AddItem(finalSeek); finalReward.SetAsOfferTo(bazaarMode, finalSeek); - player.QueuePacket(InventoryBeginChangePacket.BuildPacket(player.actorId)); + player.QueuePacket(InventoryBeginChangePacket.BuildPacket(player.Id)); bazaarPackage.SendUpdate(); - player.QueuePacket(InventoryEndChangePacket.BuildPacket(player.actorId)); + player.QueuePacket(InventoryEndChangePacket.BuildPacket(player.Id)); } player.CheckBazaarFlags(); @@ -1603,7 +1603,7 @@ namespace Meteor.Map public void RequestWorldLinkshellCreate(Player player, string name, ushort crest) { - SubPacket packet = CreateLinkshellPacket.BuildPacket(player.playerSession, name, crest, player.actorId); + SubPacket packet = CreateLinkshellPacket.BuildPacket(player.playerSession, name, crest, player.Id); player.QueuePacket(packet); } From 68e55a1c76a4bfd64539159db406a674a03b2ac9 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Sat, 5 Feb 2022 18:00:09 -0500 Subject: [PATCH 2/6] Added changes to how zones/areas are accessed in the lua scripts too. --- .../chara/npc/object/aetheryte/AetheryteChild.lua | 2 +- .../npc/object/aetheryte/AetheryteParent.lua | 2 +- Data/scripts/battlenpc.lua | 6 +++--- Data/scripts/commands/BazaarCheckCommand.lua | 4 ++-- Data/scripts/commands/ChocoboRideCommand.lua | 2 +- Data/scripts/commands/TradeOfferCommand.lua | 4 ++-- Data/scripts/commands/gm/despawn.lua | 5 ++--- Data/scripts/commands/gm/reloadzone.lua | 6 +++--- Data/scripts/commands/gm/spawn.lua | 15 +++++++-------- Data/scripts/commands/gm/spawnnpc.lua | 2 +- Data/scripts/commands/gm/test.lua | 2 +- Data/scripts/commands/gm/testmapobj.lua | 2 +- Data/scripts/commands/gm/weather.lua | 4 ++-- Data/scripts/commands/gm/yolo.lua | 2 +- .../directors/Quest/QuestDirectorMan0g001.lua | 4 ++-- .../directors/Quest/QuestDirectorMan0l001.lua | 2 +- .../directors/Quest/QuestDirectorMan0u001.lua | 2 +- Data/scripts/quests/man/man0l0.lua | 2 +- 18 files changed, 33 insertions(+), 35 deletions(-) diff --git a/Data/scripts/base/chara/npc/object/aetheryte/AetheryteChild.lua b/Data/scripts/base/chara/npc/object/aetheryte/AetheryteChild.lua index ff1548ec..560b4aec 100644 --- a/Data/scripts/base/chara/npc/object/aetheryte/AetheryteChild.lua +++ b/Data/scripts/base/chara/npc/object/aetheryte/AetheryteChild.lua @@ -107,7 +107,7 @@ function doLevequestInit(player, aetheryte) player:SendGameMessage(worldMaster, 50036, 0x20, glId, player); player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true)); - director = player:GetZone():CreateGuildleveDirector(glId, difficulty, player); + director = player.CurrentArea:CreateGuildleveDirector(glId, difficulty, player); player:AddDirector(director); director:StartDirector(true, glId) diff --git a/Data/scripts/base/chara/npc/object/aetheryte/AetheryteParent.lua b/Data/scripts/base/chara/npc/object/aetheryte/AetheryteParent.lua index 63fee49d..544f1ff8 100644 --- a/Data/scripts/base/chara/npc/object/aetheryte/AetheryteParent.lua +++ b/Data/scripts/base/chara/npc/object/aetheryte/AetheryteParent.lua @@ -142,7 +142,7 @@ function doLevequestInit(player, aetheryte) player:SendGameMessage(worldMaster, 50036, 0x20, glId, player); player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, true)); - director = player:GetZone():CreateGuildleveDirector(glId, difficulty, player); + director = player.CurrentArea:CreateGuildleveDirector(glId, difficulty, player); player:AddDirector(director); director:StartDirector(true, glId); diff --git a/Data/scripts/battlenpc.lua b/Data/scripts/battlenpc.lua index ee4b526c..aade63ba 100644 --- a/Data/scripts/battlenpc.lua +++ b/Data/scripts/battlenpc.lua @@ -19,7 +19,7 @@ function onBeginLogin(player) end --For Opening. Set Director and reset position incase d/c - if (player:HasQuest(110001) == true and player:GetZoneID() == 193) then + if (player:HasQuest(110001) == true and player.CurrentArea.ZoneId == 193) then director = player:GetZone():CreateDirector("OpeningDirector", false); player:AddDirector(director); director:StartDirector(true); @@ -32,7 +32,7 @@ function onBeginLogin(player) player.rotation = 0.025; player:GetQuest(110001):ClearQuestData(); player:GetQuest(110001):ClearQuestFlags(); - elseif (player:HasQuest(110005) == true and player:GetZoneID() == 166) then + elseif (player:HasQuest(110005) == true and player.CurrentArea.ZoneId == 166) then director = player:GetZone():CreateDirector("OpeningDirector", false); player:AddDirector(director); director:StartDirector(false); @@ -45,7 +45,7 @@ function onBeginLogin(player) player.rotation = -1.26721; player:GetQuest(110005):ClearQuestData(); player:GetQuest(110005):ClearQuestFlags(); - elseif (player:HasQuest(110009) == true and player:GetZoneID() == 184) then + elseif (player:HasQuest(110009) == true and player.CurrentArea.ZoneId == 184) then --director = player:GetZone():CreateDirector("OpeningDirector", false); --player:AddDirector(director); --director:StartDirector(false); diff --git a/Data/scripts/commands/BazaarCheckCommand.lua b/Data/scripts/commands/BazaarCheckCommand.lua index 1dd99b5e..14ca7a84 100644 --- a/Data/scripts/commands/BazaarCheckCommand.lua +++ b/Data/scripts/commands/BazaarCheckCommand.lua @@ -13,9 +13,9 @@ function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, baza local bazaarActor = nil; if (name ~= nil) then - bazaarActor = player:GetZone():FindPCInZone(name); + bazaarActor = player.CurrentArea:FindPCInZone(name); elseif (bazaarActorId ~= nil) then - bazaarActor = player:GetZone():FindActorInArea(bazaarActorId); + bazaarActor = player.CurrentArea:FindActorInArea(bazaarActorId); end if (bazaarActor ~= nil) then diff --git a/Data/scripts/commands/ChocoboRideCommand.lua b/Data/scripts/commands/ChocoboRideCommand.lua index 59bb989d..c43dc830 100644 --- a/Data/scripts/commands/ChocoboRideCommand.lua +++ b/Data/scripts/commands/ChocoboRideCommand.lua @@ -25,7 +25,7 @@ function onEventStarted(player, actor, triggerName, isGoobbue) player:ChangeSpeed(0.0, 5.0, 10.0, 10.0); player:ChangeState(15); else - player:ChangeMusic(player:GetZone().bgmDay); + player:ChangeMusic(player.CurrentArea.bgmDay); worldMaster = GetWorldMaster(); diff --git a/Data/scripts/commands/TradeOfferCommand.lua b/Data/scripts/commands/TradeOfferCommand.lua index 75eaedff..3661de0c 100644 --- a/Data/scripts/commands/TradeOfferCommand.lua +++ b/Data/scripts/commands/TradeOfferCommand.lua @@ -12,10 +12,10 @@ function onEventStarted(player, actor, triggerName, name, arg1, arg2, arg3, acto --ActorID Search if (actorId ~= nil) then - otherActor = player:GetZone():FindActorInArea(actorId); + otherActor = player.CurrentArea):FindActorInArea(actorId); --Name Search elseif (name ~= nil) then - otherActor = player:GetZone():FindPCInZone(name); + otherActor = player.CurrentArea:FindPCInZone(name); end if (otherActor ~= nil) then diff --git a/Data/scripts/commands/gm/despawn.lua b/Data/scripts/commands/gm/despawn.lua index 0d502ffd..b0736922 100644 --- a/Data/scripts/commands/gm/despawn.lua +++ b/Data/scripts/commands/gm/despawn.lua @@ -8,9 +8,8 @@ properties = { function onTrigger(player, argc, actorName) - if (actorName ~= nil) then - zone = player:GetZone(); - actor = zone:DespawnActor(actorName); + if (actorName ~= nil) then + actor = player.CurrentArea:DespawnActor(actorName); end end; \ No newline at end of file diff --git a/Data/scripts/commands/gm/reloadzone.lua b/Data/scripts/commands/gm/reloadzone.lua index 3c233c7b..ae222a25 100644 --- a/Data/scripts/commands/gm/reloadzone.lua +++ b/Data/scripts/commands/gm/reloadzone.lua @@ -18,11 +18,11 @@ function onTrigger(player, argc, zone) if player then local messageID = MESSAGE_TYPE_SYSTEM_ERROR; - zone = zone or player:GetZoneID(); + zone = zone or player.CurrentArea.ZoneId; player:SendMessage(messageID, "[reloadzones] ", string.format("Reloading zone: %u", zone)); --[[ todo: get this working legit - player:GetZone():Clear(); - player:GetZone():AddActorToZone(player); + player.CurrentArea:Clear(); + player.CurrentArea:AddActorToZone(player); player:SendInstanceUpdate(); ]] end; diff --git a/Data/scripts/commands/gm/spawn.lua b/Data/scripts/commands/gm/spawn.lua index 1f3f1852..716faffe 100644 --- a/Data/scripts/commands/gm/spawn.lua +++ b/Data/scripts/commands/gm/spawn.lua @@ -14,23 +14,22 @@ function onTrigger(player, argc, actorClassId, width, height) end local pos = player:GetPos(); - local x = pos[0]; - local y = pos[1]; - local z = pos[2]; - local rot = pos[3]; - local zone = pos[4]; + local x = pos[1]; + local y = pos[2]; + local z = pos[3]; + local rot = pos[4]; + local zone = pos[5]; actorClassId = tonumber(actorClassId); - if (actorClassId ~= nil) then - zone = player:GetZone(); + if (actorClassId ~= nil) then local w = tonumber(width) or 0; local h = tonumber(height) or 0; printf("%f %f %f", x, y, z); --local x, y, z = player.GetPos(); for i = 0, w do for j = 0, h do - actor = zone:SpawnActor(actorClassId, "test", pos[0] + (i - (w / 2) * 3), pos[1], pos[2] + (j - (h / 2) * 3), pos[3]); + actor = player.CurrentArea:SpawnActor(actorClassId, "test", pos[0] + (i - (w / 2) * 3), pos[1], pos[2] + (j - (h / 2) * 3), pos[3]); actor.SetAppearance(1001149) end end diff --git a/Data/scripts/commands/gm/spawnnpc.lua b/Data/scripts/commands/gm/spawnnpc.lua index e17295fc..19f73cc9 100644 --- a/Data/scripts/commands/gm/spawnnpc.lua +++ b/Data/scripts/commands/gm/spawnnpc.lua @@ -108,7 +108,7 @@ function onTrigger(player, argc, name, width, height, blockCount) for b = 0, blocks do for i = 0, w do for j = 0, h do - local actor = player.GetZone().SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true); + local actor = player.CurrentArea:SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true); actor.ChangeNpcAppearance(modelIds[name]); actor.SetMaxHP(5000); actor.SetHP(5000); diff --git a/Data/scripts/commands/gm/test.lua b/Data/scripts/commands/gm/test.lua index 8416f432..d4332143 100644 --- a/Data/scripts/commands/gm/test.lua +++ b/Data/scripts/commands/gm/test.lua @@ -18,7 +18,7 @@ function onTrigger(player, argc) player:SendGameMessage(player, worldMaster, 34108, 0x20); player:SendGameMessage(player, worldMaster, 50011, 0x20); - director = player:GetZone():CreateDirector("Quest/QuestDirectorMan0l001"); + director = player.CurrentArea:CreateDirector("Quest/QuestDirectorMan0l001"); player:AddDirector(director); player:SetLoginDirector(director); diff --git a/Data/scripts/commands/gm/testmapobj.lua b/Data/scripts/commands/gm/testmapobj.lua index cdc74c3d..d8f6f2f9 100644 --- a/Data/scripts/commands/gm/testmapobj.lua +++ b/Data/scripts/commands/gm/testmapobj.lua @@ -31,7 +31,7 @@ function onTrigger(player, argc, animation, regionId, layoutId, maxLayoutId) actorClassId = tonumber(actorClassId); if (actorClassId ~= nil) then - zone = player:GetZone(); + zone = player.CurrentArea; actor = zone:SpawnActor(actorClassId, "mapobj", pos[1], pos[2], pos[3], tonumber(regionId), tonumber(layoutId)); print("test"); diff --git a/Data/scripts/commands/gm/weather.lua b/Data/scripts/commands/gm/weather.lua index 7ae5656d..5bfae4da 100644 --- a/Data/scripts/commands/gm/weather.lua +++ b/Data/scripts/commands/gm/weather.lua @@ -24,13 +24,13 @@ function onTrigger(player, argc, weather, updateTime, zonewide) message = string.format("changed weather to %u ", weather); if zonewide ~= 0 then - message = string.format(message.."for zone %u", player:GetZoneID()); + message = string.format(message.."for zone %u", player.CurrentArea.ZoneId); else message = message..player:GetName(); end; -- weatherid, updateTime - player:GetZone():ChangeWeather(weather, updateTime, player, zonewide ~= 0); + player.CurrentArea:ChangeWeather(weather, updateTime, player, zonewide ~= 0); player:SendMessage(messageID, sender, message); end; print(sender..message); diff --git a/Data/scripts/commands/gm/yolo.lua b/Data/scripts/commands/gm/yolo.lua index 22b13f56..24f9b2a4 100644 --- a/Data/scripts/commands/gm/yolo.lua +++ b/Data/scripts/commands/gm/yolo.lua @@ -159,7 +159,7 @@ function onTrigger(player, argc, width, height, blockCount) for b = 0, blocks do for i = 0, w do for j = 0, h do - local actor = player.GetZone().SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true); + local actor = player.CurrentArea.SpawnActor(2104001, 'ass', x + (i * 1), y, z + (j * 1), rot, 0, 0, true); --actor.ChangeNpcAppearance(2200905); actor.SetMaxHP(500); actor.SetHP(500); diff --git a/Data/scripts/directors/Quest/QuestDirectorMan0g001.lua b/Data/scripts/directors/Quest/QuestDirectorMan0g001.lua index 934e48be..79f765cb 100644 --- a/Data/scripts/directors/Quest/QuestDirectorMan0g001.lua +++ b/Data/scripts/directors/Quest/QuestDirectorMan0g001.lua @@ -88,7 +88,7 @@ function onEventStarted(player, actor, triggerName) wait(5); player:SendMessage(0x20, "", "ContentFinished"); - player:GetZone():ContentFinished(); + player.CurrentArea:ContentFinished(); wait(5); player:SendMessage(0x20, "", "Remove from party"); player:RemoveFromCurrentPartyAndCleanup(); @@ -136,5 +136,5 @@ function onCommand(player, command) end function main(director, contentGroup) - onCreateContentArea(director:GetPlayerMembers(), director, director:GetZone(), contentGroup); + onCreateContentArea(director:GetPlayerMembers(), director, director.CurrentArea, contentGroup); end; \ No newline at end of file diff --git a/Data/scripts/directors/Quest/QuestDirectorMan0l001.lua b/Data/scripts/directors/Quest/QuestDirectorMan0l001.lua index 11522b72..a149a048 100644 --- a/Data/scripts/directors/Quest/QuestDirectorMan0l001.lua +++ b/Data/scripts/directors/Quest/QuestDirectorMan0l001.lua @@ -73,7 +73,7 @@ function onEventStarted(player, director, triggerName) ]] man0l0Quest:StartSequence(10); - player:GetZone():ContentFinished(); + player.CurrentArea:ContentFinished(); GetWorldManager():DoZoneChange(player, 230, "PrivateAreaMasterPast", 1, 15, -826.868469, 6, 193.745865, -0.008368492); player:EndEvent(); end diff --git a/Data/scripts/directors/Quest/QuestDirectorMan0u001.lua b/Data/scripts/directors/Quest/QuestDirectorMan0u001.lua index 04b4c864..c5c71b7c 100644 --- a/Data/scripts/directors/Quest/QuestDirectorMan0u001.lua +++ b/Data/scripts/directors/Quest/QuestDirectorMan0u001.lua @@ -59,6 +59,6 @@ function onEventStarted(player, actor, triggerName) man0u0Quest:NextPhase(10); player:EndEvent(); - player:GetZone():ContentFinished(); + player.CurrentArea:ContentFinished(); GetWorldManager():DoZoneChange(player, 175, "PrivateAreaMasterPast", 3, 15, -22.81, 196, 87.82, 2.98); end diff --git a/Data/scripts/quests/man/man0l0.lua b/Data/scripts/quests/man/man0l0.lua index 8f7d9515..daa6669d 100644 --- a/Data/scripts/quests/man/man0l0.lua +++ b/Data/scripts/quests/man/man0l0.lua @@ -263,7 +263,7 @@ function doExitDoor(player, quest, npc) quest:StartSequence(SEQ_005); - contentArea = player:GetZone():CreateContentArea(player, "/Area/PrivateArea/Content/PrivateAreaMasterSimpleContent", "man0l01", "SimpleContent30002", "Quest/QuestDirectorMan0l001"); + contentArea = player.CurrentArea:CreateContentArea(player, "/Area/PrivateArea/Content/PrivateAreaMasterSimpleContent", "man0l01", "SimpleContent30002", "Quest/QuestDirectorMan0l001"); if (contentArea == nil) then return; From 37d04344aef06c65ea2fff55cb13e6a7aae470ad Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Sat, 5 Feb 2022 18:01:16 -0500 Subject: [PATCH 3/6] Forgot file --- Data/scripts/commands/BazaarTradeCommand.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/scripts/commands/BazaarTradeCommand.lua b/Data/scripts/commands/BazaarTradeCommand.lua index 7a934abc..60c6b719 100644 --- a/Data/scripts/commands/BazaarTradeCommand.lua +++ b/Data/scripts/commands/BazaarTradeCommand.lua @@ -18,7 +18,7 @@ function onEventStarted(player, actor, triggerName, rewardItem, seekItemOrCost, --Get the bazaar actor if (bazaarActorId ~= nil) then - bazaarActor = player:GetZone():FindActorInArea(bazaarActorId); + bazaarActor = player.CurrentArea:FindActorInArea(bazaarActorId); end --Abort if no actor From f374ee3be938c2f15b0a97d771fdf55750e9cdb4 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Sat, 5 Feb 2022 18:14:23 -0500 Subject: [PATCH 4/6] More changes --- Data/scripts/commands/Ability.lua | 2 +- Data/scripts/commands/AttackAbility.lua | 2 +- Data/scripts/commands/AttackMagic.lua | 2 +- Data/scripts/commands/AttackWeaponSkill.lua | 2 +- Data/scripts/commands/CmnAttackWeaponSkill.lua | 4 ++-- Data/scripts/commands/CureMagic.lua | 2 +- Data/scripts/commands/CuregaMagic.lua | 2 +- Data/scripts/commands/DevideAttackWeaponSkill.lua | 2 +- Data/scripts/commands/EffectMagic.lua | 2 +- Data/scripts/commands/EsunaMagic.lua | 2 +- Data/scripts/commands/PointSearchAbility.lua | 2 +- Data/scripts/commands/RaiseMagic.lua | 2 +- Data/scripts/commands/ShotCommand.lua | 2 +- Data/scripts/commands/SongMagic.lua | 2 +- Data/scripts/commands/ability/blissful_mind.lua | 2 +- Data/scripts/commands/gm/addtoparty.lua | 2 +- Data/scripts/commands/gm/getinfo.lua | 2 +- Data/scripts/commands/gm/quest.lua | 4 ++-- Data/scripts/commands/gm/vdragon.lua | 2 +- Data/scripts/commands/magic/holy_succor.lua | 2 +- Data/scripts/commands/weaponskill/sucker_punch.lua | 2 +- Data/scripts/content/SimpleContent30010.lua | 4 ++-- Data/scripts/effects/aegis_boon.lua | 2 +- Data/scripts/effects/bloodbath.lua | 2 +- Data/scripts/effects/dread_spike.lua | 2 +- Data/scripts/effects/featherfoot.lua | 2 +- Data/scripts/effects/life_surge_I.lua | 2 +- Data/scripts/effects/life_surge_II.lua | 2 +- Data/scripts/effects/life_surge_III.lua | 2 +- Data/scripts/effects/necrogenesis.lua | 2 +- Data/scripts/effects/outmaneuver2.lua | 2 +- Data/scripts/effects/rampage2.lua | 2 +- Data/scripts/effects/sanguine_rite2.lua | 2 +- Data/scripts/effects/sanguine_rite3.lua | 2 +- Data/scripts/effects/vengeance.lua | 2 +- 35 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Data/scripts/commands/Ability.lua b/Data/scripts/commands/Ability.lua index a9429e93..8a3055c2 100644 --- a/Data/scripts/commands/Ability.lua +++ b/Data/scripts/commands/Ability.lua @@ -14,6 +14,6 @@ local attackMagicHandlers = { } function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) - player.Ability(command.actorId, targetActor); + player.Ability(command.Id, targetActor); player:endEvent(); end \ No newline at end of file diff --git a/Data/scripts/commands/AttackAbility.lua b/Data/scripts/commands/AttackAbility.lua index 47b04053..8eb5f7aa 100644 --- a/Data/scripts/commands/AttackAbility.lua +++ b/Data/scripts/commands/AttackAbility.lua @@ -14,7 +14,7 @@ local attackMagicHandlers = { } function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) - player.Ability(command.actorId, targetActor); + player.Ability(command.Id, targetActor); player:endEvent(); end \ No newline at end of file diff --git a/Data/scripts/commands/AttackMagic.lua b/Data/scripts/commands/AttackMagic.lua index b5538141..5bb5d1ff 100644 --- a/Data/scripts/commands/AttackMagic.lua +++ b/Data/scripts/commands/AttackMagic.lua @@ -14,6 +14,6 @@ local attackMagicHandlers = { } function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) - player.Cast(command.actorId, targetActor); + player.Cast(command.Id, targetActor); player:endEvent(); end; \ No newline at end of file diff --git a/Data/scripts/commands/AttackWeaponSkill.lua b/Data/scripts/commands/AttackWeaponSkill.lua index 3a0e8ff2..1d0bd191 100644 --- a/Data/scripts/commands/AttackWeaponSkill.lua +++ b/Data/scripts/commands/AttackWeaponSkill.lua @@ -21,6 +21,6 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, ta if not player.aiContainer.IsEngaged() then player.Engage(targetActor); end; - player.WeaponSkill(command.actorId, targetActor); + player.WeaponSkill(command.Id, targetActor); player:endEvent(); end; \ No newline at end of file diff --git a/Data/scripts/commands/CmnAttackWeaponSkill.lua b/Data/scripts/commands/CmnAttackWeaponSkill.lua index dc86ebc4..2bac2cdb 100644 --- a/Data/scripts/commands/CmnAttackWeaponSkill.lua +++ b/Data/scripts/commands/CmnAttackWeaponSkill.lua @@ -133,8 +133,8 @@ function onEventStarted(player, command, triggerName) return; end - if (weaponskillHandlers[command.actorId] ~= nil) then - weaponskillHandlers[command.actorId](player); + if (weaponskillHandlers[command.Id] ~= nil) then + weaponskillHandlers[command.Id](player); else player:SendMessage(0x20, "", "That weaponskill is not implemented yet."); end diff --git a/Data/scripts/commands/CureMagic.lua b/Data/scripts/commands/CureMagic.lua index a349c17a..8875bd92 100644 --- a/Data/scripts/commands/CureMagic.lua +++ b/Data/scripts/commands/CureMagic.lua @@ -1,5 +1,5 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) - player.Cast(command.actorId, targetActor); + player.Cast(command.Id, targetActor); player:endEvent(); end \ No newline at end of file diff --git a/Data/scripts/commands/CuregaMagic.lua b/Data/scripts/commands/CuregaMagic.lua index a349c17a..8875bd92 100644 --- a/Data/scripts/commands/CuregaMagic.lua +++ b/Data/scripts/commands/CuregaMagic.lua @@ -1,5 +1,5 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) - player.Cast(command.actorId, targetActor); + player.Cast(command.Id, targetActor); player:endEvent(); end \ No newline at end of file diff --git a/Data/scripts/commands/DevideAttackWeaponSkill.lua b/Data/scripts/commands/DevideAttackWeaponSkill.lua index 3a0e8ff2..1d0bd191 100644 --- a/Data/scripts/commands/DevideAttackWeaponSkill.lua +++ b/Data/scripts/commands/DevideAttackWeaponSkill.lua @@ -21,6 +21,6 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, ta if not player.aiContainer.IsEngaged() then player.Engage(targetActor); end; - player.WeaponSkill(command.actorId, targetActor); + player.WeaponSkill(command.Id, targetActor); player:endEvent(); end; \ No newline at end of file diff --git a/Data/scripts/commands/EffectMagic.lua b/Data/scripts/commands/EffectMagic.lua index a349c17a..8875bd92 100644 --- a/Data/scripts/commands/EffectMagic.lua +++ b/Data/scripts/commands/EffectMagic.lua @@ -1,5 +1,5 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) - player.Cast(command.actorId, targetActor); + player.Cast(command.Id, targetActor); player:endEvent(); end \ No newline at end of file diff --git a/Data/scripts/commands/EsunaMagic.lua b/Data/scripts/commands/EsunaMagic.lua index a349c17a..8875bd92 100644 --- a/Data/scripts/commands/EsunaMagic.lua +++ b/Data/scripts/commands/EsunaMagic.lua @@ -1,5 +1,5 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) - player.Cast(command.actorId, targetActor); + player.Cast(command.Id, targetActor); player:endEvent(); end \ No newline at end of file diff --git a/Data/scripts/commands/PointSearchAbility.lua b/Data/scripts/commands/PointSearchAbility.lua index ee05e8c4..c0441ca7 100644 --- a/Data/scripts/commands/PointSearchAbility.lua +++ b/Data/scripts/commands/PointSearchAbility.lua @@ -2,6 +2,6 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) - player.Cast(command.actorId, targetActor); + player.Cast(command.Id, targetActor); player:endEvent(); end \ No newline at end of file diff --git a/Data/scripts/commands/RaiseMagic.lua b/Data/scripts/commands/RaiseMagic.lua index a349c17a..8875bd92 100644 --- a/Data/scripts/commands/RaiseMagic.lua +++ b/Data/scripts/commands/RaiseMagic.lua @@ -1,5 +1,5 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) - player.Cast(command.actorId, targetActor); + player.Cast(command.Id, targetActor); player:endEvent(); end \ No newline at end of file diff --git a/Data/scripts/commands/ShotCommand.lua b/Data/scripts/commands/ShotCommand.lua index 8397d8c9..98f945e9 100644 --- a/Data/scripts/commands/ShotCommand.lua +++ b/Data/scripts/commands/ShotCommand.lua @@ -10,6 +10,6 @@ Finds the correct weaponskill subscript to fire when a weaponskill actor is acti --]] function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) - player.Ability(command.actorId, targetActor); + player.Ability(command.Id, targetActor); player:endEvent(); end; \ No newline at end of file diff --git a/Data/scripts/commands/SongMagic.lua b/Data/scripts/commands/SongMagic.lua index b5538141..5bb5d1ff 100644 --- a/Data/scripts/commands/SongMagic.lua +++ b/Data/scripts/commands/SongMagic.lua @@ -14,6 +14,6 @@ local attackMagicHandlers = { } function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8) - player.Cast(command.actorId, targetActor); + player.Cast(command.Id, targetActor); player:endEvent(); end; \ No newline at end of file diff --git a/Data/scripts/commands/ability/blissful_mind.lua b/Data/scripts/commands/ability/blissful_mind.lua index 7c60d12e..9b566718 100644 --- a/Data/scripts/commands/ability/blissful_mind.lua +++ b/Data/scripts/commands/ability/blissful_mind.lua @@ -24,7 +24,7 @@ function onSkillFinish(caster, target, skill, action, actionContainer) local amount = buff.GetExtra(); caster.AddMP(amount); - actionContainer.AddMPAction(caster.actorId, 33007, amount); + actionContainer.AddMPAction(caster.Id, 33007, amount); caster.statusEffects.RemoveStatusEffect(buff, actionContainer, 30329); else --Blissful mind takes 25% of CURRENT HP and begins storing MP up to that point, at which point the buff changes to indicate its full diff --git a/Data/scripts/commands/gm/addtoparty.lua b/Data/scripts/commands/gm/addtoparty.lua index fe01fb46..0a0ba8bf 100644 --- a/Data/scripts/commands/gm/addtoparty.lua +++ b/Data/scripts/commands/gm/addtoparty.lua @@ -15,7 +15,7 @@ function onTrigger(player, argc) if player then if player.target then print("hi") - local id = player.target.actorId + local id = player.target.Id print("hi") player.currentParty:AddMember(id); player.target.currentParty = player.currentParty; diff --git a/Data/scripts/commands/gm/getinfo.lua b/Data/scripts/commands/gm/getinfo.lua index 30c2ebe1..a31f9c68 100644 --- a/Data/scripts/commands/gm/getinfo.lua +++ b/Data/scripts/commands/gm/getinfo.lua @@ -23,7 +23,7 @@ function onTrigger(player) player:SendMessage(messageID, sender, string.format("Position (XYZ-O): %.3f, %.3f, %.3f - %.3f", targetActor.positionX, targetActor.positionY, targetActor.positionZ, targetActor.rotation)); - player:SendMessage(messageID, sender, string.format("Actor ID: 0x%X", targetActor.actorId)); + player:SendMessage(messageID, sender, string.format("Actor ID: 0x%X", targetActor.Id)); player:SendMessage(messageID, sender, string.format("Class ID: %d", targetActor:GetActorClassId())); player:SendMessage(messageID, sender, string.format("Class Name: %s", targetActor.className)); end \ No newline at end of file diff --git a/Data/scripts/commands/gm/quest.lua b/Data/scripts/commands/gm/quest.lua index 6814338e..f4055c39 100644 --- a/Data/scripts/commands/gm/quest.lua +++ b/Data/scripts/commands/gm/quest.lua @@ -46,13 +46,13 @@ function onTrigger(player, argc, command, var1, var2, var3) q2 = GetStaticActor(var1); if q2 ~= nil then - q3 = q2.actorId; + q3 = q2.Id; message = ("removing quest "..var1); printf(q3); q4 = bit32.band(q3, 0xA0F00000); printf(q4); - --player:RemoveQuest(quest.actorName); + --player:RemoveQuest(quest.Name); end else message = ("remove error: either incorrect ID or quest "..var1.." isn't active on character"); diff --git a/Data/scripts/commands/gm/vdragon.lua b/Data/scripts/commands/gm/vdragon.lua index 52cade43..27ce7b24 100644 --- a/Data/scripts/commands/gm/vdragon.lua +++ b/Data/scripts/commands/gm/vdragon.lua @@ -16,7 +16,7 @@ function onTrigger(player, argc) if player and player.currentTarget then local actor = GetWorldManager():GetActorInWorld(player.currentTarget) or nil; - actor.Ability(23459, actor.actorId); + actor.Ability(23459, actor.Id); else print(sender.."unable to add experience, ensure player name is valid."); diff --git a/Data/scripts/commands/magic/holy_succor.lua b/Data/scripts/commands/magic/holy_succor.lua index b10a7c56..617b097a 100644 --- a/Data/scripts/commands/magic/holy_succor.lua +++ b/Data/scripts/commands/magic/holy_succor.lua @@ -24,6 +24,6 @@ function onSkillFinish(caster, target, skill, action, actionContainer) if caster != target then caster.AddHP(action.amount / 2) --33012: You recover [amount] HP. - actionContainer.AddHPAbsorbAction(caster.actorId, 33012, (action.amount / 2)); + actionContainer.AddHPAbsorbAction(caster.Id, 33012, (action.amount / 2)); end end; \ No newline at end of file diff --git a/Data/scripts/commands/weaponskill/sucker_punch.lua b/Data/scripts/commands/weaponskill/sucker_punch.lua index b408a139..22169ac7 100644 --- a/Data/scripts/commands/weaponskill/sucker_punch.lua +++ b/Data/scripts/commands/weaponskill/sucker_punch.lua @@ -39,6 +39,6 @@ function onSkillFinish(caster, target, skill, action, actionContainer) caster.AddMP(mpToReturn); --30452: You recover x MP. - actionContainer.AddMPAbsorbAction(caster.actorId, 30452, mpToReturn); + actionContainer.AddMPAbsorbAction(caster.Id, 30452, mpToReturn); end end; \ No newline at end of file diff --git a/Data/scripts/content/SimpleContent30010.lua b/Data/scripts/content/SimpleContent30010.lua index f510c173..12cfc50b 100644 --- a/Data/scripts/content/SimpleContent30010.lua +++ b/Data/scripts/content/SimpleContent30010.lua @@ -14,8 +14,8 @@ function onCreate(starterPlayer, contentArea, director) mob1 = GetWorldManager().SpawnBattleNpcById(3, contentArea); mob2 = GetWorldManager().SpawnBattleNpcById(4, contentArea); mob3 = GetWorldManager().SpawnBattleNpcById(5, contentArea); - starterPlayer.currentParty:AddMember(papalymo.actorId); - starterPlayer.currentParty:AddMember(yda.actorId); + starterPlayer.currentParty:AddMember(papalymo.Id); + starterPlayer.currentParty:AddMember(yda.Id); starterPlayer:SetMod(modifiersGlobal.MinimumHpLock, 1); diff --git a/Data/scripts/effects/aegis_boon.lua b/Data/scripts/effects/aegis_boon.lua index 72286396..d0815ad9 100644 --- a/Data/scripts/effects/aegis_boon.lua +++ b/Data/scripts/effects/aegis_boon.lua @@ -14,6 +14,6 @@ function onBlock(effect, attacker, defender, skill, action, actionContainer) --33008: You recover x HP from Aegis Boon defender.AddHP(absorbAmount); - actionContainer.AddHPAction(defender.actorId, 33008, absorbAmount); + actionContainer.AddHPAction(defender.Id, 33008, absorbAmount); defender.statusEffects.RemoveStatusEffect(effect, actionContainer); end; \ No newline at end of file diff --git a/Data/scripts/effects/bloodbath.lua b/Data/scripts/effects/bloodbath.lua index cd6775d6..db5e4433 100644 --- a/Data/scripts/effects/bloodbath.lua +++ b/Data/scripts/effects/bloodbath.lua @@ -18,7 +18,7 @@ function onHit(effect, attacker, defender, skill, action, actionContainer) attacker.AddHP(absorbAmount); --30332: You absorb hp from target - actionContainer.AddHPAbsorbAction(defender.actorId, 30332, absorbAmount) + actionContainer.AddHPAbsorbAction(defender.Id, 30332, absorbAmount) --Bloodbath is lost after absorbing hp defender.statusEffects.RemoveStatusEffect(effect,actionContainer, 30331, false); end diff --git a/Data/scripts/effects/dread_spike.lua b/Data/scripts/effects/dread_spike.lua index 83592924..09b603a5 100644 --- a/Data/scripts/effects/dread_spike.lua +++ b/Data/scripts/effects/dread_spike.lua @@ -22,7 +22,7 @@ function onDamageTaken(effect, attacker, defender, skill, action, actionContaine defender.AddHP(absorbAmount); --30451: You recover [absorbAmount] HP. - actionContainer.AddHPAction(defender.actorId, 30451, absorbAmount) + actionContainer.AddHPAction(defender.Id, 30451, absorbAmount) --Dread Spike is lost after absorbing hp defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end diff --git a/Data/scripts/effects/featherfoot.lua b/Data/scripts/effects/featherfoot.lua index 97cd67c0..c3a3aae9 100644 --- a/Data/scripts/effects/featherfoot.lua +++ b/Data/scripts/effects/featherfoot.lua @@ -20,7 +20,7 @@ function onEvade(effect, attacker, defender, skill, action, actionContainer) local mpToReturn = percent * action.amountMitigated; defender.AddMP(math.ceil(mpToReturn)); --33010: You recover x MP from Featherfoot - actionContainer.AddMPAction(defender.actorId, 33010, mpToReturn); + actionContainer.AddMPAction(defender.Id, 33010, mpToReturn); --Featherfoot is lost after evading defender.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end; \ No newline at end of file diff --git a/Data/scripts/effects/life_surge_I.lua b/Data/scripts/effects/life_surge_I.lua index 864fff62..ed0b3a06 100644 --- a/Data/scripts/effects/life_surge_I.lua +++ b/Data/scripts/effects/life_surge_I.lua @@ -14,6 +14,6 @@ function onHit(effect, attacker, defender, skill, action, actionContainer) local amount = math.floor((healPercent * action.amount) + 1); attacker.AddHP(amount); - actionContainer.AddHPAbsorbAction(defender.actorId, 30332, amount); + actionContainer.AddHPAbsorbAction(defender.Id, 30332, amount); end end; \ No newline at end of file diff --git a/Data/scripts/effects/life_surge_II.lua b/Data/scripts/effects/life_surge_II.lua index 944dcafb..402f92d3 100644 --- a/Data/scripts/effects/life_surge_II.lua +++ b/Data/scripts/effects/life_surge_II.lua @@ -10,6 +10,6 @@ function onHit(effect, attacker, defender, skill, action, actionContainer) local amount = math.floor((healPercent * action.amount) + 1); attacker.AddHP(amount); - actionContainer.AddHPAbsorbAction(defender.actorId, 30332, amount); + actionContainer.AddHPAbsorbAction(defender.Id, 30332, amount); end end; \ No newline at end of file diff --git a/Data/scripts/effects/life_surge_III.lua b/Data/scripts/effects/life_surge_III.lua index 9307829f..d4dede32 100644 --- a/Data/scripts/effects/life_surge_III.lua +++ b/Data/scripts/effects/life_surge_III.lua @@ -14,6 +14,6 @@ function onHit(effect, attacker, defender, skill, action, actionContainer) local amount = math.floor((healPercent * action.amount) + 1); attacker.AddHP(amount); - actionContainer.AddHPAbsorbAction(defender.actorId, 30332, amount); + actionContainer.AddHPAbsorbAction(defender.Id, 30332, amount); end end; \ No newline at end of file diff --git a/Data/scripts/effects/necrogenesis.lua b/Data/scripts/effects/necrogenesis.lua index 76c281e7..0bfc240e 100644 --- a/Data/scripts/effects/necrogenesis.lua +++ b/Data/scripts/effects/necrogenesis.lua @@ -6,7 +6,7 @@ function onHit(effect, attacker, defender, skill, action, actionContainer) --Necrogenesis returns 75% of damage done rounded up(?) as MP. local hpToReturn = math.ceil(0.75 * action.amount); attacker.AddHP(hpToReturn); - actionContainer.AddHPAbsorbAction(defender.actorId, 33012, hpToReturn); + actionContainer.AddHPAbsorbAction(defender.Id, 33012, hpToReturn); attacker.statusEffects.RemoveStatusEffect(effect, actionContainer, 30331, false); end end \ No newline at end of file diff --git a/Data/scripts/effects/outmaneuver2.lua b/Data/scripts/effects/outmaneuver2.lua index e44f58be..457a2268 100644 --- a/Data/scripts/effects/outmaneuver2.lua +++ b/Data/scripts/effects/outmaneuver2.lua @@ -19,6 +19,6 @@ function onBlock(effect, attacker, defender, skill, action, actionContainer) local mpToReturn = math.ceil(0.10 * action.amount); defender.AddMP(math.ceil(mpToReturn)); --33009: You recover x MP from Outmaneuver - actionContainer.AddMPAction(defender.actorId, 33009, mpToReturn); + actionContainer.AddMPAction(defender.Id, 33009, mpToReturn); end end; \ No newline at end of file diff --git a/Data/scripts/effects/rampage2.lua b/Data/scripts/effects/rampage2.lua index 169b65e7..36c496e0 100644 --- a/Data/scripts/effects/rampage2.lua +++ b/Data/scripts/effects/rampage2.lua @@ -27,7 +27,7 @@ function onCrit(effect, attacker, defender, skill, action, actionContainer) healAmount = math.Clamp(healAmount, 0, attacker.GetMaxHP() - attacker.GetHP()); attacker.AddHP(healAmount); --33012: You recover [healAmount] HP. - actionContainer.AddHPAbsorbAction(defender.actorId, 33008, healAmount); + actionContainer.AddHPAbsorbAction(defender.Id, 33008, healAmount); end; --"Effect fades over time" diff --git a/Data/scripts/effects/sanguine_rite2.lua b/Data/scripts/effects/sanguine_rite2.lua index 87820d59..dcdbc51e 100644 --- a/Data/scripts/effects/sanguine_rite2.lua +++ b/Data/scripts/effects/sanguine_rite2.lua @@ -4,5 +4,5 @@ require("modifiers") function onDamageTaken(effect, attacker, defender, skill, action, actionContainer) local mpToRestore = action.amount * 0.30; defender.AddMP(mpToRestore); - actionContainer.AddMPAction(defender.actorId, 33011, mpToRestore); + actionContainer.AddMPAction(defender.Id, 33011, mpToRestore); end \ No newline at end of file diff --git a/Data/scripts/effects/sanguine_rite3.lua b/Data/scripts/effects/sanguine_rite3.lua index 329dac74..000f11b8 100644 --- a/Data/scripts/effects/sanguine_rite3.lua +++ b/Data/scripts/effects/sanguine_rite3.lua @@ -18,5 +18,5 @@ end; function onDamageTaken(effect, attacker, defender, skill, action, actionContainer) local mpToRestore = action.amount * 0.30; defender.AddMP(mpToRestore); - actionContainer.AddMPAction(defender.actorId, 33011, mpToRestore); + actionContainer.AddMPAction(defender.Id, 33011, mpToRestore); end \ No newline at end of file diff --git a/Data/scripts/effects/vengeance.lua b/Data/scripts/effects/vengeance.lua index 6fbcc795..a37ec14f 100644 --- a/Data/scripts/effects/vengeance.lua +++ b/Data/scripts/effects/vengeance.lua @@ -10,6 +10,6 @@ function onDamageTaken(effect, attacker, defender, skill, action, actionContaine --30350: Counter! You hit target for x points of damage --There are counter messages for blocks, can Vengeance be blocked/parried? attacker.DelHP(amount, actionContainer); - actionContainer.AddHitAction(attacker.actorId, 30350, amount); + actionContainer.AddHitAction(attacker.Id, 30350, amount); end; end; \ No newline at end of file From 8d647ae6b0ed31bd720f7f65dded651e4db69c27 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Sat, 5 Feb 2022 18:17:14 -0500 Subject: [PATCH 5/6] This script was missing for some reason --- .../populace/PopulaceSpecialEventCryer.lua | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Data/scripts/base/chara/npc/populace/PopulaceSpecialEventCryer.lua diff --git a/Data/scripts/base/chara/npc/populace/PopulaceSpecialEventCryer.lua b/Data/scripts/base/chara/npc/populace/PopulaceSpecialEventCryer.lua new file mode 100644 index 00000000..0205247e --- /dev/null +++ b/Data/scripts/base/chara/npc/populace/PopulaceSpecialEventCryer.lua @@ -0,0 +1,83 @@ +--[[ + +PopulaceSpecialEventCryer Script + +Actor Class script to handle the 6 NPCs (technically 3, the actors were duped) involved in the Foundation Day 2011 & 2012 events. +In 2011 they appear to be used for recruitment information for their respective Grand Company. +In 2012, they were used for exchanging Over-aspected Crystals/Clusters for GC seals as part of the ongoing Atomos event. + +Functions: + +For 2011. +eventTalkStep0(joined) - NPC dialog about joining their cause to fight back Imperials. joined = 0 or 1. Function has hardcoded actor IDs, won't work with 2012 versions +eventTalkNotGCmenber(npcGC) - NPC dialog when you're not part of their grand company. + +For 2012. +eventTalkCrystalExchange(player, npcGC, hasCrystal) - NPC dialog explaining they want over-aspected crystals. Brings up crystal exchange prompt if hasCrystal = 1. +eventTalkCsOverflow(player, npcGC) - Error message that you can't hold the seals being offered. +eventTalkCrystalExchange2(player, npcGC) - NPC dialog for accepting exchange of crystals for seals + +--]] + +require ("global") + +function init(npc) + return false, false, 0, 0; +end + + +local gcRep = { + [1001619] = 1, -- Maelstrom Representative 2011 + [1002105] = 1, -- Maelstrom Representative 2012 + [1001623] = 2, -- Adder Representative 2011 + [1002109] = 2, -- Adder Representative 2012 + [1001627] = 3, -- Flame Representative 2011 + [1002113] = 3, -- Flame Representative 2012 +} + + +function onEventStarted(player, npc, triggerName) + local playerGC = player.gcCurrent; + local npcId = npc:GetActorClassId(); + local npcGC = gcRep[npcId]; + local npcGCSeal = 1000200 + npcGC; + local hasCrystal = 1; + local crystal = 3020537; + local cluster = 3020413; + local eventMode = 2012; + + if eventMode == 2011 then + if playerGC == 0 then + callClientFunction(player, "eventTalkStep0", 0); + elseif playerGC == npcGC then + callClientFunction(player, "eventTalkStep0", 1); + else + callClientFunction(player, "eventTalkNotGCmenber", npcGC); + end + + elseif eventMode == 2012 then + choice = callClientFunction(player, "eventTalkCrystalExchange", player, npcGC, hasCrystal); + + if choice == 1 then + --callClientFunction(player, "eventTalkCsOverflow", player, npcGC); + player:SendMessage(0x20, "", "You pretend to hand over four over-aspected crystals."); + callClientFunction(player, "eventTalkCrystalExchange2", player, npcGC); + + local invCheck = player:GetItemPackage(INVENTORY_CURRENCY):AddItem(npcGCSeal, 1000, 1); + if invCheck == INV_ERROR_SUCCESS then + player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, crystal, 1, npcGCSeal, 1, 4, 1000); + end + elseif choice == 2 then + player:SendMessage(0x20, "", "You pretend to hand over an over-aspected cluster."); + --callClientFunction(player, "eventTalkCsOverflow", player, npcGC); + callClientFunction(player, "eventTalkCrystalExchange2", player, npcGC); + + local invCheck = player:GetItemPackage(INVENTORY_CURRENCY):AddItem(npcGCSeal, 3000, 1); + if invCheck == INV_ERROR_SUCCESS then + player:SendGameMessage(player, GetWorldMaster(), 25071, MESSAGE_TYPE_SYSTEM, cluster, 1, npcGCSeal, 1, 1, 3000); + end + end + end + + player:EndEvent(); +end \ No newline at end of file From f574f5b103d6b16ed0a07c9078125b238fed08db Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Sat, 5 Feb 2022 18:19:40 -0500 Subject: [PATCH 6/6] Revert lua engine UserData policy --- Map Server/Lua/LuaEngine.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Map Server/Lua/LuaEngine.cs b/Map Server/Lua/LuaEngine.cs index d3d252ae..25648c98 100644 --- a/Map Server/Lua/LuaEngine.cs +++ b/Map Server/Lua/LuaEngine.cs @@ -65,9 +65,8 @@ namespace Meteor.Map.lua luaTimer = new Timer(new TimerCallback(PulseSleepingOnTime), null, TimeSpan.Zero, TimeSpan.FromMilliseconds(50)); - UserData.RegistrationPolicy = InteropRegistrationPolicy.Automatic; - - /* + //UserData.RegistrationPolicy = InteropRegistrationPolicy.Automatic; + UserData.RegisterType(); UserData.RegisterType(); UserData.RegisterType(); @@ -80,8 +79,7 @@ namespace Meteor.Map.lua UserData.RegisterType(); UserData.RegisterType(); UserData.RegisterType(); - UserData.RegisterType(); - */ + UserData.RegisterType(); } public static LuaEngine GetInstance()