From fb1d22d7312d43accc7e2ff7e97e61e2debd8aef Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Tue, 10 Jan 2017 16:43:03 -0500 Subject: [PATCH] Push command loading implemented. --- FFXIVClassic Map Server/WorldManager.cs | 20 +++++++++++++++++-- .../actors/chara/npc/ActorClass.cs | 10 +++++++++- .../actors/chara/npc/Npc.cs | 5 +++-- .../actors/chara/npc/NpcWork.cs | 2 +- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/FFXIVClassic Map Server/WorldManager.cs b/FFXIVClassic Map Server/WorldManager.cs index 897a0ab1..5bc2627d 100644 --- a/FFXIVClassic Map Server/WorldManager.cs +++ b/FFXIVClassic Map Server/WorldManager.cs @@ -271,8 +271,13 @@ namespace FFXIVClassic_Map_Server classPath, displayNameId, propertyFlags, - eventConditions + eventConditions, + pushCommand, + pushCommandSub, + pushCommandPriority FROM gamedata_actor_class + LEFT JOIN gamedata_actor_pushcommand + ON gamedata_actor_class.id = gamedata_actor_pushcommand.id WHERE classPath <> '' "; @@ -294,7 +299,18 @@ namespace FFXIVClassic_Map_Server else eventConditions = "{}"; - ActorClass actorClass = new ActorClass(id, classPath, nameId, propertyFlags, eventConditions); + ushort pushCommand = 0; + ushort pushCommandSub = 0; + byte pushCommandPriority = 0; + + if (!reader.IsDBNull(reader.GetOrdinal("pushCommand"))) + { + pushCommand = reader.GetUInt16("pushCommand"); + pushCommandSub = reader.GetUInt16("pushCommandSub"); + pushCommandPriority = reader.GetByte("pushCommandPriority"); + } + + ActorClass actorClass = new ActorClass(id, classPath, nameId, propertyFlags, eventConditions, pushCommand, pushCommandSub, pushCommandPriority); actorClasses.Add(id, actorClass); count++; } diff --git a/FFXIVClassic Map Server/actors/chara/npc/ActorClass.cs b/FFXIVClassic Map Server/actors/chara/npc/ActorClass.cs index d1cf2108..730f9cac 100644 --- a/FFXIVClassic Map Server/actors/chara/npc/ActorClass.cs +++ b/FFXIVClassic Map Server/actors/chara/npc/ActorClass.cs @@ -14,13 +14,21 @@ namespace FFXIVClassic_Map_Server.actors.chara.npc public readonly uint propertyFlags; public readonly string eventConditions; - public ActorClass(uint id, string classPath, uint nameId, uint propertyFlags, string eventConditions) + public readonly ushort pushCommand; + public readonly ushort pushCommandSub; + public readonly byte pushCommandPriority; + + public ActorClass(uint id, string classPath, uint nameId, uint propertyFlags, string eventConditions, ushort pushCommand, ushort pushCommandSub, byte pushCommandPriority) { this.actorClassId = id; this.classPath = classPath; this.displayNameId = nameId; this.propertyFlags = propertyFlags; this.eventConditions = eventConditions; + + this.pushCommand = pushCommand; + this.pushCommandSub = pushCommandSub; + this.pushCommandPriority = pushCommandPriority; } } } diff --git a/FFXIVClassic Map Server/actors/chara/npc/Npc.cs b/FFXIVClassic Map Server/actors/chara/npc/Npc.cs index 5ecdac30..22338a0a 100644 --- a/FFXIVClassic Map Server/actors/chara/npc/Npc.cs +++ b/FFXIVClassic Map Server/actors/chara/npc/Npc.cs @@ -69,8 +69,9 @@ namespace FFXIVClassic_Map_Server.Actors npcWork.hateType = 1; } - npcWork.pushCommand = 0x271D; - npcWork.pushCommandPriority = 1; + npcWork.pushCommand = actorClass.pushCommand; + npcWork.pushCommandSub = actorClass.pushCommandSub; + npcWork.pushCommandPriority = actorClass.pushCommandPriority; GenerateActorName((int)actorNumber); } diff --git a/FFXIVClassic Map Server/actors/chara/npc/NpcWork.cs b/FFXIVClassic Map Server/actors/chara/npc/NpcWork.cs index 92189450..7b70d017 100644 --- a/FFXIVClassic Map Server/actors/chara/npc/NpcWork.cs +++ b/FFXIVClassic Map Server/actors/chara/npc/NpcWork.cs @@ -2,7 +2,7 @@ { class NpcWork { - public short pushCommand; + public ushort pushCommand; public int pushCommandSub; public byte pushCommandPriority; public byte hateType;