mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
Merge branch 'master' of https://github.com/azerothcore/azerothcore-wotlk
This commit is contained in:
4
deps/drassil/cmake-utils/utils.cmake
vendored
4
deps/drassil/cmake-utils/utils.cmake
vendored
@@ -122,7 +122,7 @@ ENDMACRO()
|
|||||||
|
|
||||||
MACRO(CU_RUN_HOOK hook_name)
|
MACRO(CU_RUN_HOOK hook_name)
|
||||||
CU_GET_GLOBAL(${hook_name})
|
CU_GET_GLOBAL(${hook_name})
|
||||||
message("Running cmake hook: ${hook_name}")
|
message(STATUS "Running cmake hook: ${hook_name}")
|
||||||
if (${hook_name})
|
if (${hook_name})
|
||||||
set(HOOK_ARRAY ${${hook_name}})
|
set(HOOK_ARRAY ${${hook_name}})
|
||||||
FOREACH (hook_file ${HOOK_ARRAY})
|
FOREACH (hook_file ${HOOK_ARRAY})
|
||||||
@@ -130,7 +130,7 @@ MACRO(CU_RUN_HOOK hook_name)
|
|||||||
include("${hook_file}")
|
include("${hook_file}")
|
||||||
ENDFOREACH()
|
ENDFOREACH()
|
||||||
else()
|
else()
|
||||||
message("No hooks registered for ${hook_name}")
|
message(STATUS "No hooks registered for ${hook_name}")
|
||||||
endif()
|
endif()
|
||||||
ENDMACRO()
|
ENDMACRO()
|
||||||
|
|
||||||
|
|||||||
@@ -2699,6 +2699,10 @@ float Creature::GetAggroRange(Unit const* target) const
|
|||||||
// Determines the aggro range for creatures
|
// Determines the aggro range for creatures
|
||||||
// Based on data from wowwiki due to lack of 3.3.5a data
|
// Based on data from wowwiki due to lack of 3.3.5a data
|
||||||
|
|
||||||
|
float aggroRate = sWorld->getRate(RATE_CREATURE_AGGRO);
|
||||||
|
if (aggroRate == 0)
|
||||||
|
return 0.0f;
|
||||||
|
|
||||||
uint32 targetLevel = target->getLevelForTarget(this);
|
uint32 targetLevel = target->getLevelForTarget(this);
|
||||||
uint32 myLevel = getLevelForTarget(target);
|
uint32 myLevel = getLevelForTarget(target);
|
||||||
int32 levelDiff = int32(targetLevel) - int32(myLevel);
|
int32 levelDiff = int32(targetLevel) - int32(myLevel);
|
||||||
@@ -2729,7 +2733,7 @@ float Creature::GetAggroRange(Unit const* target) const
|
|||||||
if (aggroRadius < minRange)
|
if (aggroRadius < minRange)
|
||||||
aggroRadius = minRange;
|
aggroRadius = minRange;
|
||||||
|
|
||||||
return aggroRadius;
|
return (aggroRadius * aggroRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::SetObjectScale(float scale)
|
void Creature::SetObjectScale(float scale)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ struct NpcFlagText
|
|||||||
|
|
||||||
#define NPCFLAG_COUNT 24
|
#define NPCFLAG_COUNT 24
|
||||||
|
|
||||||
const NpcFlagText npcFlagTexts[NPCFLAG_COUNT] =
|
NpcFlagText const npcFlagTexts[NPCFLAG_COUNT] =
|
||||||
{
|
{
|
||||||
{ UNIT_NPC_FLAG_AUCTIONEER, LANG_NPCINFO_AUCTIONEER },
|
{ UNIT_NPC_FLAG_AUCTIONEER, LANG_NPCINFO_AUCTIONEER },
|
||||||
{ UNIT_NPC_FLAG_BANKER, LANG_NPCINFO_BANKER },
|
{ UNIT_NPC_FLAG_BANKER, LANG_NPCINFO_BANKER },
|
||||||
@@ -58,6 +58,50 @@ const NpcFlagText npcFlagTexts[NPCFLAG_COUNT] =
|
|||||||
{ UNIT_NPC_FLAG_VENDOR_REAGENT, LANG_NPCINFO_VENDOR_REAGENT }
|
{ UNIT_NPC_FLAG_VENDOR_REAGENT, LANG_NPCINFO_VENDOR_REAGENT }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct MechanicImmune
|
||||||
|
{
|
||||||
|
uint32 flag;
|
||||||
|
char const* text;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MAX_MECHANIC 32
|
||||||
|
|
||||||
|
MechanicImmune const mechanicImmunes[MAX_MECHANIC] =
|
||||||
|
{
|
||||||
|
{ MECHANIC_NONE , "MECHANIC_NONE" },
|
||||||
|
{ MECHANIC_CHARM , "MECHANIC_CHARM" },
|
||||||
|
{ MECHANIC_DISORIENTED , "MECHANIC_DISORIENTED" },
|
||||||
|
{ MECHANIC_DISARM , "MECHANIC_DISARM" },
|
||||||
|
{ MECHANIC_DISTRACT , "MECHANIC_DISTRACT" },
|
||||||
|
{ MECHANIC_FEAR , "MECHANIC_FEAR" },
|
||||||
|
{ MECHANIC_GRIP , "MECHANIC_GRIP" },
|
||||||
|
{ MECHANIC_ROOT , "MECHANIC_ROOT" },
|
||||||
|
{ MECHANIC_SLOW_ATTACK , "MECHANIC_SLOW_ATTACK" },
|
||||||
|
{ MECHANIC_SILENCE , "MECHANIC_SILENCE" },
|
||||||
|
{ MECHANIC_SLEEP , "MECHANIC_SLEEP" },
|
||||||
|
{ MECHANIC_SNARE , "MECHANIC_SNARE" },
|
||||||
|
{ MECHANIC_STUN , "MECHANIC_STUN" },
|
||||||
|
{ MECHANIC_FREEZE , "MECHANIC_FREEZE" },
|
||||||
|
{ MECHANIC_KNOCKOUT , "MECHANIC_KNOCKOUT" },
|
||||||
|
{ MECHANIC_BLEED , "MECHANIC_BLEED" },
|
||||||
|
{ MECHANIC_BANDAGE , "MECHANIC_BANDAGE" },
|
||||||
|
{ MECHANIC_POLYMORPH , "MECHANIC_POLYMORPH" },
|
||||||
|
{ MECHANIC_BANISH , "MECHANIC_BANISH" },
|
||||||
|
{ MECHANIC_SHIELD , "MECHANIC_SHIELD" },
|
||||||
|
{ MECHANIC_SHACKLE , "MECHANIC_SHACKLE" },
|
||||||
|
{ MECHANIC_MOUNT , "MECHANIC_MOUNT" },
|
||||||
|
{ MECHANIC_INFECTED , "MECHANIC_INFECTED" },
|
||||||
|
{ MECHANIC_TURN , "MECHANIC_TURN" },
|
||||||
|
{ MECHANIC_HORROR , "MECHANIC_HORROR" },
|
||||||
|
{ MECHANIC_INVULNERABILITY , "MECHANIC_INVULNERABILITY" },
|
||||||
|
{ MECHANIC_INTERRUPT , "MECHANIC_INTERRUPT" },
|
||||||
|
{ MECHANIC_DAZE , "MECHANIC_DAZE" },
|
||||||
|
{ MECHANIC_DISCOVERY , "MECHANIC_DISCOVERY" },
|
||||||
|
{ MECHANIC_IMMUNE_SHIELD , "MECHANIC_IMMUNE_SHIELD" },
|
||||||
|
{ MECHANIC_SAPPED , "MECHANIC_SAPPED" },
|
||||||
|
{ MECHANIC_ENRAGED , "MECHANIC_ENRAGED" },
|
||||||
|
};
|
||||||
|
|
||||||
class npc_commandscript : public CommandScript
|
class npc_commandscript : public CommandScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -619,12 +663,13 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CreatureTemplate const* cInfo = target->GetCreatureTemplate();
|
||||||
uint32 faction = target->getFaction();
|
uint32 faction = target->getFaction();
|
||||||
uint32 npcflags = target->GetUInt32Value(UNIT_NPC_FLAGS);
|
uint32 npcflags = target->GetUInt32Value(UNIT_NPC_FLAGS);
|
||||||
|
uint32 mechanicImmuneMask = cInfo->MechanicImmuneMask;
|
||||||
uint32 displayid = target->GetDisplayId();
|
uint32 displayid = target->GetDisplayId();
|
||||||
uint32 nativeid = target->GetNativeDisplayId();
|
uint32 nativeid = target->GetNativeDisplayId();
|
||||||
uint32 Entry = target->GetEntry();
|
uint32 Entry = target->GetEntry();
|
||||||
CreatureTemplate const* cInfo = target->GetCreatureTemplate();
|
|
||||||
|
|
||||||
int64 curRespawnDelay = target->GetRespawnTimeEx()-time(nullptr);
|
int64 curRespawnDelay = target->GetRespawnTimeEx()-time(nullptr);
|
||||||
if (curRespawnDelay < 0)
|
if (curRespawnDelay < 0)
|
||||||
@@ -649,6 +694,11 @@ public:
|
|||||||
if (npcflags & npcFlagTexts[i].flag)
|
if (npcflags & npcFlagTexts[i].flag)
|
||||||
handler->PSendSysMessage(npcFlagTexts[i].text, npcFlagTexts[i].flag);
|
handler->PSendSysMessage(npcFlagTexts[i].text, npcFlagTexts[i].flag);
|
||||||
|
|
||||||
|
handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, mechanicImmuneMask);
|
||||||
|
for (uint8 i = 1; i < MAX_MECHANIC; ++i)
|
||||||
|
if (mechanicImmuneMask & (1 << (mechanicImmunes[i].flag - 1)))
|
||||||
|
handler->PSendSysMessage(mechanicImmunes[i].text, mechanicImmunes[i].flag);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user