diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-05 14:51:42 +0200 | 
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-05 14:51:42 +0200 | 
| commit | 341dabb4234f0cf7911c9d1f3365d0537642967f (patch) | |
| tree | 0d400e4bd2d25ac9128356dfcfef0e2f0f8c6d83 /src/server/scripts | |
| parent | c00c59c0f54ae7b2e9dc86e3e8a537983e19e7d8 (diff) | |
Core/Commands: Add .npc info more infos for unit_flags
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Commands/cs_npc.cpp | 53 | 
1 files changed, 52 insertions, 1 deletions
| 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()); | 
