aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2013_08_05_01_world_trinity_string.sql8
-rw-r--r--src/server/game/Miscellaneous/Language.h3
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp53
3 files changed, 62 insertions, 2 deletions
diff --git a/sql/updates/world/2013_08_05_01_world_trinity_string.sql b/sql/updates/world/2013_08_05_01_world_trinity_string.sql
new file mode 100644
index 00000000000..7e9a465d49a
--- /dev/null
+++ b/sql/updates/world/2013_08_05_01_world_trinity_string.sql
@@ -0,0 +1,8 @@
+DELETE FROM `trinity_string` WHERE `entry`=5038;
+INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
+(5038, 'Unit Flags: %u', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+UPDATE `trinity_string` SET `content_default`=
+'Unit Flags 2: %u.
+Dynamic Flags: %u.
+Faction Template: %u.' WHERE `entry`=542;
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 55956934268..772d5bcfb75 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -1084,7 +1084,8 @@ enum TrinityStrings
LANG_CALL_FOR_HELP = 5035,
LANG_NPCINFO_EQUIPMENT = 5036,
LANG_NPCINFO_MECHANIC_IMMUNE = 5037,
- // Room for more Trinity strings 5037-9999
+ LANG_NPCINFO_UNIT_FIELD_FLAGS = 5038,
+ // Room for more Trinity strings 5039-9999
// Level requirement notifications
LANG_SAY_REQ = 6604,
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index e0238c62a34..82abd85f1d1 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -114,6 +114,51 @@ MechanicImmune const mechanicImmunes[MECHANIC_MAX] =
{ MECHANIC_WOUNDED , "MECHANIC_WOUNDED" }
};
+
+struct UnitFlag
+{
+ uint32 flag;
+ char const* text;
+};
+
+#define UNIT_FLAGS_MAX 33
+
+UnitFlag const unitFlags[MECHANIC_MAX] =
+{
+ { UNIT_FLAG_SERVER_CONTROLLED , "UNIT_FLAG_SERVER_CONTROLLED" },
+ { UNIT_FLAG_NON_ATTACKABLE , "UNIT_FLAG_NON_ATTACKABLE" },
+ { UNIT_FLAG_DISABLE_MOVE , "UNIT_FLAG_DISABLE_MOVE" },
+ { UNIT_FLAG_PVP_ATTACKABLE , "UNIT_FLAG_PVP_ATTACKABLE" },
+ { UNIT_FLAG_RENAME , "UNIT_FLAG_RENAME" },
+ { UNIT_FLAG_PREPARATION , "UNIT_FLAG_PREPARATION" },
+ { UNIT_FLAG_UNK_6 , "UNIT_FLAG_UNK_6" },
+ { UNIT_FLAG_NOT_ATTACKABLE_1 , "UNIT_FLAG_NOT_ATTACKABLE_1" },
+ { UNIT_FLAG_IMMUNE_TO_PC , "UNIT_FLAG_IMMUNE_TO_PC" },
+ { UNIT_FLAG_IMMUNE_TO_NPC , "UNIT_FLAG_IMMUNE_TO_NPC" },
+ { UNIT_FLAG_LOOTING , "UNIT_FLAG_LOOTING" },
+ { UNIT_FLAG_PET_IN_COMBAT , "UNIT_FLAG_PET_IN_COMBAT" },
+ { UNIT_FLAG_PVP , "UNIT_FLAG_PVP" },
+ { UNIT_FLAG_SILENCED , "UNIT_FLAG_SILENCED" },
+ { UNIT_FLAG_UNK_14 , "UNIT_FLAG_UNK_14" },
+ { UNIT_FLAG_UNK_15 , "UNIT_FLAG_UNK_15" },
+ { UNIT_FLAG_UNK_16 , "UNIT_FLAG_UNK_16" },
+ { UNIT_FLAG_PACIFIED , "UNIT_FLAG_PACIFIED" },
+ { UNIT_FLAG_STUNNED , "UNIT_FLAG_STUNNED" },
+ { UNIT_FLAG_IN_COMBAT , "UNIT_FLAG_IN_COMBAT" },
+ { UNIT_FLAG_TAXI_FLIGHT , "UNIT_FLAG_TAXI_FLIGHT" },
+ { UNIT_FLAG_DISARMED , "UNIT_FLAG_DISARMED" },
+ { UNIT_FLAG_CONFUSED , "UNIT_FLAG_CONFUSED" },
+ { UNIT_FLAG_FLEEING , "UNIT_FLAG_FLEEING" },
+ { UNIT_FLAG_PLAYER_CONTROLLED , "UNIT_FLAG_PLAYER_CONTROLLED" },
+ { UNIT_FLAG_NOT_SELECTABLE , "UNIT_FLAG_NOT_SELECTABLE" },
+ { UNIT_FLAG_SKINNABLE , "UNIT_FLAG_SKINNABLE" },
+ { UNIT_FLAG_MOUNT , "UNIT_FLAG_MOUNT" },
+ { UNIT_FLAG_UNK_28 , "UNIT_FLAG_UNK_28" },
+ { UNIT_FLAG_UNK_29 , "UNIT_FLAG_UNK_29" },
+ { UNIT_FLAG_SHEATHE , "UNIT_FLAG_SHEATHE" },
+ { UNIT_FLAG_UNK_31 , "UNIT_FLAG_UNK_31" }
+};
+
class npc_commandscript : public CommandScript
{
public:
@@ -694,7 +739,13 @@ public:
handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel());
handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId());
handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth());
- handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS), target->GetUInt32Value(UNIT_FIELD_FLAGS_2), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->getFaction());
+
+ handler->PSendSysMessage(LANG_NPCINFO_UNIT_FIELD_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS));
+ for (uint8 i = 0; i < UNIT_FLAGS_MAX; ++i)
+ if (target->GetUInt32Value(UNIT_FIELD_FLAGS) & unitFlags[i].flag)
+ handler->PSendSysMessage(unitFlags[i].text, unitFlags[i].flag);
+
+ handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS_2), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->getFaction());
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());