diff options
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r-- | src/server/scripts/Commands/cs_npc.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index df1e28ffada..ed6e2014ead 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -43,6 +43,7 @@ EndScriptData */ #include "Player.h" #include "RBAC.h" #include "SmartEnum.h" +#include "SpellMgr.h" #include "Transport.h" #include "World.h" #include "WorldSession.h" @@ -482,7 +483,9 @@ public: uint32 faction = target->GetFaction(); uint64 npcflags; memcpy(&npcflags, target->m_unitData->NpcFlags.begin(), sizeof(npcflags)); - uint32 mechanicImmuneMask = cInfo->MechanicImmuneMask; + uint64 mechanicImmuneMask = 0; + if (CreatureImmunities const* immunities = SpellMgr::GetCreatureImmunities(cInfo->CreatureImmunitiesId)) + mechanicImmuneMask = immunities->Mechanic.to_ullong(); uint32 displayid = target->GetDisplayId(); uint32 nativeid = target->GetNativeDisplayId(); uint32 entry = target->GetEntry(); @@ -557,9 +560,9 @@ public: if (target->HasNpcFlag2(flag)) handler->PSendSysMessage("* %s (0x%X)", EnumUtils::ToTitle(flag), flag); - handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, mechanicImmuneMask); + handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, Trinity::StringFormat("0x{:X}", mechanicImmuneMask).c_str()); for (Mechanics m : EnumUtils::Iterate<Mechanics>()) - if (m && (mechanicImmuneMask & (1 << (m - 1)))) + if (m && (mechanicImmuneMask & (UI64LIT(1) << m))) handler->PSendSysMessage("%s (0x%X)", EnumUtils::ToTitle(m), m); return true; |