aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2013-08-05 14:51:42 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2013-08-05 14:51:42 +0200
commit341dabb4234f0cf7911c9d1f3365d0537642967f (patch)
tree0d400e4bd2d25ac9128356dfcfef0e2f0f8c6d83 /src
parentc00c59c0f54ae7b2e9dc86e3e8a537983e19e7d8 (diff)
Core/Commands: Add .npc info more infos for unit_flags
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Miscellaneous/Language.h3
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp53
2 files changed, 54 insertions, 2 deletions
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index bac0eb4cda9..efc6423bb5c 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -1092,7 +1092,8 @@ enum TrinityStrings
LANG_CALL_FOR_HELP = 5035,
LANG_NPCINFO_EQUIPMENT = 5036,
LANG_NPCINFO_MECHANIC_IMMUNE = 5037,
- // Room for more Trinity strings 5038-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 012a8fff1c4..91ae6eefbd9 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:
@@ -698,7 +743,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());