This commit is contained in:
Yehonal
2018-03-06 00:01:13 +00:00
3 changed files with 59 additions and 5 deletions

View File

@@ -122,7 +122,7 @@ ENDMACRO()
MACRO(CU_RUN_HOOK hook_name)
CU_GET_GLOBAL(${hook_name})
message("Running cmake hook: ${hook_name}")
message(STATUS "Running cmake hook: ${hook_name}")
if (${hook_name})
set(HOOK_ARRAY ${${hook_name}})
FOREACH (hook_file ${HOOK_ARRAY})
@@ -130,7 +130,7 @@ MACRO(CU_RUN_HOOK hook_name)
include("${hook_file}")
ENDFOREACH()
else()
message("No hooks registered for ${hook_name}")
message(STATUS "No hooks registered for ${hook_name}")
endif()
ENDMACRO()

View File

@@ -2699,6 +2699,10 @@ float Creature::GetAggroRange(Unit const* target) const
// Determines the aggro range for creatures
// 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 myLevel = getLevelForTarget(target);
int32 levelDiff = int32(targetLevel) - int32(myLevel);
@@ -2729,7 +2733,7 @@ float Creature::GetAggroRange(Unit const* target) const
if (aggroRadius < minRange)
aggroRadius = minRange;
return aggroRadius;
return (aggroRadius * aggroRate);
}
void Creature::SetObjectScale(float scale)

View File

@@ -30,7 +30,7 @@ struct NpcFlagText
#define NPCFLAG_COUNT 24
const NpcFlagText npcFlagTexts[NPCFLAG_COUNT] =
NpcFlagText const npcFlagTexts[NPCFLAG_COUNT] =
{
{ UNIT_NPC_FLAG_AUCTIONEER, LANG_NPCINFO_AUCTIONEER },
{ 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 }
};
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
{
public:
@@ -619,12 +663,13 @@ public:
return false;
}
CreatureTemplate const* cInfo = target->GetCreatureTemplate();
uint32 faction = target->getFaction();
uint32 npcflags = target->GetUInt32Value(UNIT_NPC_FLAGS);
uint32 mechanicImmuneMask = cInfo->MechanicImmuneMask;
uint32 displayid = target->GetDisplayId();
uint32 nativeid = target->GetNativeDisplayId();
uint32 Entry = target->GetEntry();
CreatureTemplate const* cInfo = target->GetCreatureTemplate();
int64 curRespawnDelay = target->GetRespawnTimeEx()-time(nullptr);
if (curRespawnDelay < 0)
@@ -648,6 +693,11 @@ public:
for (uint8 i = 0; i < NPCFLAG_COUNT; i++)
if (npcflags & 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;
}