Core/Commands: Add .npc info more infos for unit_flags
This commit is contained in:
1 parent
38cddb42ae
commit
f37d0495e1
3 files changed
+62
-2
No files matched your search
@@ -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());
|
||||
|
||||
Reference in new issue
Block a user