aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchesD <majklprofik@seznam.cz>2015-11-20 20:28:21 +0100
committerMitchesD <majklprofik@seznam.cz>2015-11-20 20:28:21 +0100
commit8dfc753770cb82f0080f9ca548d95ad8648b987f (patch)
tree01c6702c096903cd3ffd1d8a888529fc06d95d05
parent9cc3a0e6da543a4d7bf96e858f734901732f51a5 (diff)
Scripts/Commands: updated .npc info to show correct PhaseIDs and PhaseGroups
-rw-r--r--sql/updates/world/2015_11_20_00_world.sql5
-rw-r--r--src/server/game/Miscellaneous/Language.h4
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp18
3 files changed, 24 insertions, 3 deletions
diff --git a/sql/updates/world/2015_11_20_00_world.sql b/sql/updates/world/2015_11_20_00_world.sql
new file mode 100644
index 00000000000..8b2dba55f7c
--- /dev/null
+++ b/sql/updates/world/2015_11_20_00_world.sql
@@ -0,0 +1,5 @@
+UPDATE `trinity_string` SET `content_default`='PhaseID: %u, PhaseGroup: %u' WHERE `entry`=5020;
+
+DELETE FROM `trinity_string` WHERE `entry`=5018;
+INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES
+(5018,'It consist of PhaseIDs:');
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 71d0c056028..a30a286ed5d 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -1080,9 +1080,9 @@ enum TrinityStrings
LANG_BATTLEGROUND = 5015,
LANG_ARENA = 5016,
LANG_RAID = 5017,
- //= 5018,
+ LANG_NPCINFO_PHASE_IDS = 5018,
LANG_COMMAND_TEMP_FROZEN_PLAYER = 5019,
- LANG_NPCINFO_PHASEMASK = 5020,
+ LANG_NPCINFO_PHASES = 5020,
LANG_NPCINFO_ARMOR = 5021,
LANG_CHANNEL_ENABLE_OWNERSHIP = 5022,
LANG_CHANNEL_DISABLE_OWNERSHIP = 5023,
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index e30bf1f162b..7f1a6de6ecc 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -718,7 +718,23 @@ public:
handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str());
handler->PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid, cInfo->pickpocketLootId, cInfo->SkinLootId);
handler->PSendSysMessage(LANG_NPCINFO_DUNGEON_ID, target->GetInstanceId());
- handler->PSendSysMessage(LANG_NPCINFO_PHASEMASK, target->GetPhaseMask());
+
+ if (CreatureData const* data = sObjectMgr->GetCreatureData(target->GetSpawnId()))
+ {
+ handler->PSendSysMessage(LANG_NPCINFO_PHASES, data->phaseid, data->phaseGroup);
+ if (data->phaseGroup)
+ {
+ std::set<uint32> _phases = target->GetPhases();
+
+ if (!_phases.empty())
+ {
+ handler->PSendSysMessage(LANG_NPCINFO_PHASE_IDS);
+ for (uint32 phaseId : _phases)
+ handler->PSendSysMessage("%u", phaseId);
+ }
+ }
+ }
+
handler->PSendSysMessage(LANG_NPCINFO_ARMOR, target->GetArmor());
handler->PSendSysMessage(LANG_NPCINFO_POSITION, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
handler->PSendSysMessage(LANG_NPCINFO_AIINFO, target->GetAIName().c_str(), target->GetScriptName().c_str());