feat(Core/AI): convert SelectAggroTarget to enum class (#9893)

This commit is contained in:
Kargatum
2021-12-29 05:13:12 +07:00
committed by GitHub
parent e928d8b67e
commit c81891fc11
236 changed files with 622 additions and 598 deletions
@@ -172,7 +172,7 @@ class boss_anub_arak : public CreatureScript
events.ScheduleEvent(EVENT_LEECHING_SWARM, 20000);
break;
case EVENT_POUND:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f))
{
me->CastSpell(me, SPELL_SELF_ROOT, true);
me->DisableRotate(true);
@@ -172,7 +172,7 @@ public:
events.ScheduleEvent(EVENT_HADRONOX_PIERCE, 8000);
break;
case EVENT_HADRONOX_ACID:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, false))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, false))
me->CastSpell(target, SPELL_ACID_CLOUD, false);
events.ScheduleEvent(EVENT_HADRONOX_ACID, 25000);
break;
@@ -209,7 +209,7 @@ public:
events.ScheduleEvent(EVENT_KRIK_MIND_FLAY, 15000);
break;
case EVENT_KRIK_CURSE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
me->CastSpell(target, SPELL_CURSE_OF_FATIGUE, true);
events.ScheduleEvent(EVENT_KRIK_CURSE, 10000);
break;
@@ -163,7 +163,7 @@ struct boss_amanitar : public BossAI
}
case EVENT_ROOTS:
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
{
DoCast(pTarget, SPELL_ENTANGLING_ROOTS, false);
}
@@ -179,7 +179,7 @@ struct boss_amanitar : public BossAI
}
case EVENT_BOLT:
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
{
DoCast(pTarget, SPELL_VENOM_BOLT_VOLLEY, false);
}
@@ -204,7 +204,7 @@ struct boss_amanitar : public BossAI
}
}
if (SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_MINI))
if (SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_MINI))
{
DoCastSelf(SPELL_REMOVE_MUSHROOM_POWER, true);
DoCastAOE(SPELL_MINI);
@@ -252,7 +252,7 @@ struct boss_volazj : public BossAI
}
case EVENT_HERALD_SHIVER:
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
{
DoCast(pTarget, SPELL_SHIVER, false);
}
@@ -463,7 +463,7 @@ struct boss_jedoga_shadowseeker : public BossAI
}
case EVENT_JEDOGA_LIGHTNING_BOLT:
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
{
DoCast(pTarget, DUNGEON_MODE(SPELL_LIGHTNING_BOLT, SPELL_LIGHTNING_BOLT_H), false);
}
@@ -472,7 +472,7 @@ struct boss_jedoga_shadowseeker : public BossAI
}
case EVENT_JEDOGA_THUNDERSHOCK:
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
{
DoCast(pTarget, DUNGEON_MODE(SPELL_THUNDERSHOCK, SPELL_THUNDERSHOCK_H), false);
}
@@ -430,7 +430,7 @@ struct boss_taldaram : public BossAI
{
Talk(SAY_VANISH);
DoCastSelf(SPELL_VANISH, false);
if (Unit* pEmbraceTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* pEmbraceTarget = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
{
vanishTarget_GUID = pEmbraceTarget->GetGUID();
}
@@ -849,7 +849,7 @@ struct boss_sartharion_dragonAI : public BossAI
if (isCalledBySartharion)
{
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1, 500, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 500, true))
{
AttackStart(target);
}
@@ -1088,7 +1088,7 @@ public:
}
case EVENT_MINIBOSS_SHADOW_FISSURE:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random))
{
DoCast(target, SPELL_SHADOW_FISSURE, false);
}
@@ -1272,7 +1272,7 @@ public:
}
case EVENT_MINIBOSS_SHADOW_FISSURE:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random))
{
DoCast(target, SPELL_SHADOW_FISSURE, false);
}
@@ -1388,7 +1388,7 @@ public:
}
case EVENT_MINIBOSS_SHADOW_FISSURE:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random))
{
DoCast(target, SPELL_SHADOW_FISSURE, false);
}
@@ -224,7 +224,7 @@ public:
break;
case EVENT_ENERVATING_BRAND:
for (uint8 i = 0; i < RAID_MODE<uint8>(2, 4, 2, 4); i++)
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true, -SPELL_ENERVATING_BRAND))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true, -SPELL_ENERVATING_BRAND))
me->CastSpell(target, SPELL_ENERVATING_BRAND, true);
events.ScheduleEvent(EVENT_ENERVATING_BRAND, 26000);
break;
@@ -311,7 +311,7 @@ public:
break;
case EVENT_ENERVATING_BRAND:
for (uint8 i = 0; i < RAID_MODE<uint8>(4, 10, 4, 10); i++)
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true, -SPELL_ENERVATING_BRAND))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true, -SPELL_ENERVATING_BRAND))
me->CastSpell(target, SPELL_ENERVATING_BRAND, true);
_events.ScheduleEvent(EVENT_ENERVATING_BRAND, 26000);
break;
@@ -399,7 +399,7 @@ public:
events.ScheduleEvent(EVENT_METEOR_STRIKE, 40000);
break;
case EVENT_FIERY_COMBUSTION:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true, -SPELL_TWILIGHT_REALM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true, -SPELL_TWILIGHT_REALM))
me->CastSpell(target, SPELL_FIERY_COMBUSTION, false);
events.ScheduleEvent(EVENT_FIERY_COMBUSTION, 25000);
break;
@@ -542,7 +542,7 @@ public:
_events.ScheduleEvent(EVENT_BREATH, urand(10000, 12000));
break;
case EVENT_SOUL_CONSUMPTION:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true, SPELL_TWILIGHT_REALM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true, SPELL_TWILIGHT_REALM))
me->CastSpell(target, SPELL_SOUL_CONSUMPTION, false);
_events.ScheduleEvent(EVENT_SOUL_CONSUMPTION, 20000);
break;
@@ -185,7 +185,7 @@ public:
events.RepeatEvent(16000);
break;
case EVENT_SPELL_HAMMER_RIGHTEOUS:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 55.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 55.0f, true) )
{
char buffer[100];
sprintf(buffer, "Eadric the Pure targets %s with the Hammer of the Righteous!", target->GetName().c_str());
@@ -358,12 +358,12 @@ public:
case 0:
break;
case EVENT_SPELL_SMITE:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
me->CastSpell(target, SPELL_SMITE, false);
events.RepeatEvent(urand(3000, 4000));
break;
case EVENT_SPELL_HOLY_FIRE:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
me->CastSpell(target, SPELL_HOLY_FIRE, false);
events.RepeatEvent(urand(9000, 12000));
break;
@@ -451,12 +451,12 @@ public:
events.ScheduleEvent(EVENT_SPELL_WAKING_NIGHTMARE, urand(20000, 30000));
break;
case EVENT_SPELL_OLD_WOUNDS:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true) )
me->CastSpell(target, SPELL_OLD_WOUNDS, true);
events.RepeatEvent(12000);
break;
case EVENT_SPELL_SHADOWS_PAST:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true) )
me->CastSpell(target, SPELL_SHADOWS_PAST, false);
events.RepeatEvent(urand(15000, 20000));
break;
@@ -695,7 +695,7 @@ public:
events.RepeatEvent(urand(35000, 45000));
break;
case EVENT_PRIESTESS_SPELL_MIND_CONTROL_H:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
me->CastSpell(target, SPELL_MIND_CONTROL_H, false);
events.RepeatEvent(urand(22000, 30000));
break;
@@ -263,7 +263,7 @@ public:
events.RepeatEvent(urand(5000, 6000));
break;
case EVENT_SPELL_DEATH_RESPITE:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
me->CastSpell(target, SPELL_DEATH_RESPITE, false);
events.RepeatEvent(urand(13000, 15000));
break;
@@ -273,7 +273,7 @@ public:
events.RepeatEvent(urand(15000, 17000));
break;
case EVENT_SPELL_DESECRATION:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
me->CastSpell(target, SPELL_DESECRATION, false);
events.RepeatEvent(urand(14000, 17000));
break;
@@ -282,7 +282,7 @@ public:
events.RepeatEvent(urand(2000, 4000));
break;
case EVENT_SPELL_MARKED_DEATH:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.000000f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.000000f, true) )
me->CastSpell(target, SPELL_MARKED_DEATH, false);
events.RepeatEvent(9000);
break;
@@ -426,7 +426,7 @@ public:
case SPELL_CLAW_N:
case SPELL_CLAW_H:
DoResetThreat();
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f))
{
me->AddThreat(target, 100.0f);
AttackStart(target);
@@ -802,7 +802,7 @@ public:
events.RepeatEvent(22000);
break;
case EVEMT_MAGE_SPELL_POLYMORPH:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
me->CastSpell(target, SPELL_POLYMORPH, false);
events.RepeatEvent(8000);
break;
@@ -810,7 +810,7 @@ public:
/****************** SHAMAN ******************/
case EVENT_SHAMAN_SPELL_CHAIN_LIGHTNING:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false);
events.RepeatEvent(16000);
break;
@@ -852,7 +852,7 @@ public:
{
if( !UnitTargetGUID )
{
if( Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 30.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 30.0f, true) )
{
me->CastSpell(target, SPELL_SHOOT, false);
UnitTargetGUID = target->GetGUID();
@@ -896,7 +896,7 @@ public:
events.RepeatEvent(14000);
break;
case EVENT_ROGUE_SPELL_POISON_BOTTLE:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
me->CastSpell(target, SPELL_POISON_BOTTLE, false);
events.RepeatEvent(19000);
break;
@@ -457,7 +457,7 @@ public:
{
AttackStart(target);
DoZoneInCombat();
if( Unit* t = SelectTarget(SELECT_TARGET_RANDOM, 0, 250.0f, true) )
if( Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true) )
{
me->AddThreat(t, 20000.0f);
AttackStart(t);
@@ -674,7 +674,7 @@ public:
case 0:
break;
case EVENT_SPELL_SHADOW_STRIKE:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 250.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true) )
me->CastSpell(target, SPELL_SHADOW_STRIKE, false);
events.RepeatEvent(urand(30000, 45000));
break;
@@ -768,7 +768,7 @@ public:
}
DoZoneInCombat();
DoResetThreat();
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 250.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true) )
{
if (!next)
{
@@ -466,7 +466,7 @@ public:
EventMapGCD(events, 1500);
break;
case EVENT_SPELL_HEX:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 20.0f, true) )
me->CastSpell(target, SPELL_HEX, false);
events.RepeatEvent(45000);
EventMapGCD(events, 1500);
@@ -613,7 +613,7 @@ public:
events.RepeatEvent(10000);
break;
case EVENT_SPELL_HAMMER_OF_JUSTICE:
if( Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 15.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 15.0f, true) )
{
me->CastSpell(target, SPELL_HAMMER_OF_JUSTICE, false);
events.RepeatEvent(40000);
@@ -714,7 +714,7 @@ public:
EventMapGCD(events, 1500);
break;
case EVENT_SPELL_DISPEL:
if( Unit* target = (urand(0, 1) ? SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 30.0f, true) : SelectTarget_MostHPLostFriendlyMissingBuff(SPELL_DISPEL, 40.0f)) )
if( Unit* target = (urand(0, 1) ? SelectTarget(SelectTargetMethod::MaxThreat, 0, 30.0f, true) : SelectTarget_MostHPLostFriendlyMissingBuff(SPELL_DISPEL, 40.0f)) )
me->CastSpell(target, SPELL_DISPEL, false);
events.RepeatEvent(urand(10000, 15000));
EventMapGCD(events, 1500);
@@ -874,7 +874,7 @@ public:
events.RepeatEvent(6000);
break;
case EVENT_SPELL_DISPEL:
if( Unit* target = (urand(0, 1) ? SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 30.0f, true) : SelectTarget_MostHPLostFriendlyMissingBuff(SPELL_DISPEL, 40.0f)) )
if( Unit* target = (urand(0, 1) ? SelectTarget(SelectTargetMethod::MaxThreat, 0, 30.0f, true) : SelectTarget_MostHPLostFriendlyMissingBuff(SPELL_DISPEL, 40.0f)) )
me->CastSpell(target, SPELL_DISPEL, false);
events.RepeatEvent(urand(10000, 15000));
EventMapGCD(events, 1500);
@@ -1011,7 +1011,7 @@ public:
EventMapGCD(events, 1500);
break;
case EVENT_SPELL_FEAR:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 20.0f, true) )
me->CastSpell(target, SPELL_FEAR, false);
events.RepeatEvent(urand(10000, 15000));
EventMapGCD(events, 1500);
@@ -1175,7 +1175,7 @@ public:
events.RepeatEvent(6000);
break;
case EVENT_SPELL_POLYMORPH:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
me->CastSpell(target, SPELL_POLYMORPH, false);
events.RepeatEvent(15000);
EventMapGCD(events, 1500);
@@ -1323,7 +1323,7 @@ public:
EventMapGCD(events, 1500);
break;
case EVENT_SPELL_WYVERN_STING:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 35.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 35.0f, true) )
{
me->CastSpell(target, SPELL_WYVERN_STING, false);
events.RepeatEvent(60000);
@@ -1457,7 +1457,7 @@ public:
EventMapGCD(events, 1500);
break;
case EVENT_SPELL_ENTANGLING_ROOTS:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true) )
me->CastSpell(target, SPELL_ENTANGLING_ROOTS, false);
events.RepeatEvent(urand(10000, 15000));
EventMapGCD(events, 1500);
@@ -1469,7 +1469,7 @@ public:
EventMapGCD(events, 1500);
break;
case EVENT_SPELL_CYCLONE:
if( Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 20.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 20.0f, true) )
me->CastSpell(target, SPELL_CYCLONE, false);
events.RepeatEvent(urand(25000, 40000));
EventMapGCD(events, 1500);
@@ -1926,7 +1926,7 @@ public:
events.RepeatEvent(5000);
break;
case EVENT_SPELL_BLIND:
if( Unit* target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0, 20.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::MinThreat, 0, 20.0f, true) )
{
me->CastSpell(target, SPELL_BLIND, false);
events.RepeatEvent(120000);
@@ -2074,7 +2074,7 @@ public:
events.RepeatEvent(5000);
break;
}
if( Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 25.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 25.0f, true) )
{
me->CastSpell(target, SPELL_EARTH_SHOCK_ENH, false);
events.RepeatEvent(urand(6000, 8000));
@@ -2089,7 +2089,7 @@ public:
events.RepeatEvent(5000);
break;
}
if( Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 5.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 5.0f, true) )
{
me->CastSpell(target, SPELL_LAVA_LASH, false);
events.RepeatEvent(urand(6000, 8000));
@@ -2104,7 +2104,7 @@ public:
events.RepeatEvent(5000);
break;
}
if( Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 5.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 5.0f, true) )
{
me->CastSpell(target, SPELL_STORMSTRIKE, false);
events.RepeatEvent(urand(8000, 9000));
@@ -2217,7 +2217,7 @@ public:
events.RepeatEvent(5000);
break;
}
if( Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 5.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 5.0f, true) )
{
me->CastSpell(target, SPELL_CRUSADER_STRIKE, false);
events.RepeatEvent(urand(6000, 8000));
@@ -2252,7 +2252,7 @@ public:
events.RepeatEvent(5000);
break;
case EVENT_SPELL_HAMMER_OF_JUSTICE_RET:
if( Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 15.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 15.0f, true) )
{
me->CastSpell(target, SPELL_HAMMER_OF_JUSTICE_RET, false);
events.RepeatEvent(40000);
@@ -2272,7 +2272,7 @@ public:
events.RepeatEvent(5000);
break;
case EVENT_SPELL_JUDGEMENT_OF_COMMAND:
if( Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 20.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 20.0f, true) )
{
me->CastSpell(target, SPELL_JUDGEMENT_OF_COMMAND, false);
events.RepeatEvent(urand(10000, 15000));
@@ -2282,7 +2282,7 @@ public:
events.RepeatEvent(5000);
break;
case EVENT_SPELL_REPENTANCE:
if( Unit* target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0, 20.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::MinThreat, 0, 20.0f, true) )
{
me->CastSpell(target, SPELL_REPENTANCE, false);
events.RepeatEvent(60000);
@@ -211,12 +211,12 @@ public:
events.RepeatEvent(urand(10000, 15000));
break;
case EVENT_SPELL_FEL_LIGHTNING:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true) )
me->CastSpell(target, SPELL_FEL_LIGHTNING, false);
events.RepeatEvent(urand(10000, 15000));
break;
case EVENT_SPELL_INCINERATE_FLESH:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true) )
{
Talk(EMOTE_INCINERATE, target);
Talk(SAY_INCINERATE);
@@ -230,7 +230,7 @@ public:
events.RepeatEvent(urand(25000, 45000));
break;
case EVENT_SPELL_LEGION_FLAME:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true) )
{
Talk(EMOTE_LEGION_FLAME, target);
me->CastSpell(target, SPELL_LEGION_FLAME, false);
@@ -238,7 +238,7 @@ public:
events.RepeatEvent(30000);
break;
case EVENT_SPELL_TOUCH_OF_JARAXXUS:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true) )
me->CastSpell(target, SPELL_TOUCH_OF_JARAXXUS, false);
events.RepeatEvent(urand(10000, 15000));
break;
@@ -334,7 +334,7 @@ public:
case 0:
break;
case EVENT_SPELL_FEL_STEAK:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 44.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 44.0f, true) )
{
DoResetThreat();
me->AddThreat(target, 50000.0f);
@@ -418,7 +418,7 @@ public:
events.RepeatEvent(urand(15000, 25000));
break;
case EVENT_SPELL_SPINNING_PAIN_SPIKE:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 140.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 140.0f, true) )
me->CastSpell(target, SPELL_SPINNING_PAIN_SPIKE, false);
events.RepeatEvent(urand(25000, 30000));
break;
@@ -623,7 +623,7 @@ struct boss_jormungarAI : public ScriptedAI
}
break;
case EVENT_SPELL_SPRAY:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true) )
me->CastSpell(target, _SPELL_SPRAY, false);
events.RepeatEvent(20000);
break;
@@ -884,7 +884,7 @@ public:
events.RepeatEvent(urand(15000, 20000));
break;
case EVENT_SPELL_ARCTIC_BREATH:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 90.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true) )
me->CastSpell(target, SPELL_ARCTIC_BREATH, false);
events.RepeatEvent(urand(20000, 30000));
break;
@@ -906,7 +906,7 @@ public:
events.RescheduleEvent(EVENT_GAZE, 2000);
break;
case EVENT_GAZE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 500.0f, true) )
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 500.0f, true) )
{
TargetGUID = target->GetGUID();
me->SetGuidValue(UNIT_FIELD_TARGET, TargetGUID);
@@ -383,7 +383,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
}
/*
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, essenceId) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, essenceId) )
me->CastSpell(target, me->GetEntry()==NPC_LIGHTBANE ? SPELL_LIGHT_TOUCH : SPELL_DARK_TOUCH, false);
events.RepeatEvent(urand(45000,50000));
*/
@@ -229,7 +229,7 @@ public:
break;
case EVENT_CAST_OFFENSIVE_SPELL:
if (!me->HasUnitState(UNIT_STATE_CASTING))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
me->CastSpell(target, RAND(SPELL_BLIZZARD, SPELL_FROSTBOLT, SPELL_TOUCH_OF_MISERY), false);
events.ScheduleEvent(EVENT_CAST_OFFENSIVE_SPELL, 500);
@@ -144,12 +144,12 @@ public:
switch (events.ExecuteEvent())
{
case EVENT_SPELL_CURSE_OF_LIFE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_CURSE_OF_LIFE, false);
events.ScheduleEvent(EVENT_SPELL_CURSE_OF_LIFE, 13000);
break;
case EVENT_SPELL_RAIN_OF_FIRE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_RAIN_OF_FIRE, false);
events.ScheduleEvent(EVENT_SPELL_RAIN_OF_FIRE, 16000);
break;
@@ -179,7 +179,7 @@ public:
events.ScheduleEvent(EVENT_SPELL_POISON_CLOUD, 6000);
break;
case EVENT_SPELL_EYE_BEAM:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 35.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 35.0f, true))
me->CastSpell(target, SPELL_EYE_BEAM, false);
break;
case EVENT_SPELL_LIGHTNING_BREATH:
@@ -187,7 +187,7 @@ public:
events.ScheduleEvent(EVENT_SPELL_LIGHTNING_BREATH, 8000);
break;
case EVENT_SPELL_POISON_CLOUD:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 35.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 35.0f, true))
me->CastSpell(target, SPELL_POISON_CLOUD, false);
events.ScheduleEvent(EVENT_SPELL_POISON_CLOUD, 10000);
break;
@@ -151,7 +151,7 @@ public:
events.RepeatEvent(2000);
break;
case EVENT_SPELL_FEAR:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true))
me->CastCustomSpell(SPELL_FEAR, SPELLVALUE_MAX_TARGETS, 1, target, false);
events.RepeatEvent(urand(8000, 12000));
break;
@@ -160,7 +160,7 @@ public:
events.RepeatEvent(urand(10000, 15000));
break;
case EVENT_SPELL_CORRUPT_SOUL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
{
Talk(SAY_CORRUPT_SOUL);
me->CastSpell(target, SPELL_CORRUPT_SOUL, false);
@@ -212,7 +212,7 @@ public:
events.RepeatEvent(5000);
break;
case EVENT_SPELL_MIRRORED_SOUL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 90.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true))
{
me->CastSpell(target, SPELL_MIRRORED_SOUL, false);
me->setAttackTimer(BASE_ATTACK, 2500);
@@ -221,7 +221,7 @@ public:
events.RepeatEvent(urand(20000, 30000));
break;
case EVENT_SPELL_WELL_OF_SOULS:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
me->CastSpell(target, SPELL_WELL_OF_SOULS, false);
events.RepeatEvent(urand(25000, 30000));
events.DelayEventsToMax(4000, 0);
@@ -237,7 +237,7 @@ public:
case EVENT_SPELL_WAILING_SOULS:
Talk(SAY_FACE_WAILING_SOUL);
Talk(EMOTE_WAILING_SOUL);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
me->CastCustomSpell(SPELL_WAILING_SOULS_TARGETING, SPELLVALUE_MAX_TARGETS, 1, target, false);
events.RepeatEvent(80000);
events.DelayEventsToMax(20000, 0);
@@ -685,7 +685,7 @@ public:
if (a == 1)
{
me->SetInCombatWithZone();
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0f, true))
AttackStart(target);
}
}
@@ -781,7 +781,7 @@ public:
if (a == 1)
{
me->SetInCombatWithZone();
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0f, true))
AttackStart(target);
}
}
@@ -925,7 +925,7 @@ public:
if (a == 1)
{
me->SetInCombatWithZone();
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0f, true))
AttackStart(target);
}
}
@@ -1020,7 +1020,7 @@ public:
if (a == 1)
{
me->SetInCombatWithZone();
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0f, true))
AttackStart(target);
}
}
@@ -1103,7 +1103,7 @@ public:
if (a == 1)
{
me->SetInCombatWithZone();
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0f, true))
AttackStart(target);
}
}
@@ -242,7 +242,7 @@ public:
break;
case EVENT_SPELL_THROW_SARONITE:
bCanSayBoulderHit = true;
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 140.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 140.0f, true))
{
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_BOSS_EMOTE, LANG_UNIVERSAL, me, nullptr, EMOTE_THROW_SARONITE);
@@ -264,7 +264,7 @@ public:
events.RepeatEvent(35000);
break;
case EVENT_SPELL_DEEP_FREEZE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
{
Talk(EMOTE_DEEP_FREEZE, target);
me->CastSpell(target, SPELL_DEEP_FREEZE, false);
@@ -188,7 +188,7 @@ public:
case EVENT_SPELL_TOXIC_WASTE:
if (Creature* k = GetKrick())
if (!k->HasUnitState(UNIT_STATE_CASTING))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
{
k->CastSpell(target, SPELL_TOXIC_WASTE);
events.RepeatEvent(urand(7000, 10000));
@@ -203,7 +203,7 @@ public:
case EVENT_SPELL_SHADOW_BOLT:
if (Creature* k = GetKrick())
if (!k->HasUnitState(UNIT_STATE_CASTING))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 35.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 35.0f, true))
{
k->CastSpell(target, SPELL_SHADOW_BOLT);
events.RepeatEvent(14000);
@@ -223,7 +223,7 @@ public:
case 0: // Pursuit
if (Creature* k = GetKrick())
k->AI()->Talk(RAND(SAY_TARGET_1, SAY_TARGET_2, SAY_TARGET_3));
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 70.0f, true))
me->CastSpell(target, SPELL_PURSUIT, false);
break;
case 1: // Poison Nova
@@ -173,18 +173,18 @@ public:
events.ScheduleEvent(EVENT_SPELL_FORCEFUL_SMASH, urand(40000, 48000));
break;
case EVENT_SPELL_OVERLORDS_BRAND:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 95.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 95.0f, true))
me->CastSpell(target, SPELL_OVERLORDS_BRAND, false);
events.RepeatEvent(urand(11000, 12000));
break;
case EVENT_RIMEFANG_SPELL_ICY_BLAST:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 190.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 190.0f, true))
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_RIMEFANG_GUID)))
c->CastSpell(target, RIMEFANG_SPELL_ICY_BLAST, false);
events.RepeatEvent(5000);
break;
case EVENT_SPELL_MARK_OF_RIMEFANG:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 190.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 190.0f, true))
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_RIMEFANG_GUID)))
{
Talk(SAY_MARK);
@@ -476,7 +476,7 @@ public:
events.RepeatEvent(4000);
break;
case 2: // Conversion Beam
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, 69578, false);
events.RepeatEvent(urand(20000, 25000));
break;
@@ -123,7 +123,7 @@ public:
events.ScheduleEvent(EVENT_ECK_SPIT, 10000);
break;
case EVENT_ECK_SPRING:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 30.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 30.0f, true))
{
me->getThreatMgr().resetAllAggro();
me->AddThreat(target, 500.0f);
@@ -124,7 +124,7 @@ public:
void JustSummoned(Creature* summon) override
{
uint32 despawnTime = 0;
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
{
summon->CastSpell(target, SPELL_STAMPEDE_DMG, true);
despawnTime = (summon->GetDistance(target) / 40.0f * 1000) + 500;
@@ -190,7 +190,7 @@ public:
events.ScheduleEvent(EVENT_ENRAGE, 20000);
break;
case EVENT_STOMP:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
me->CastSpell(target, SPELL_STOMP, false);
events.ScheduleEvent(EVENT_STOMP, 20000);
break;
@@ -204,7 +204,7 @@ public:
return;
}
events.ScheduleEvent(EVENT_IMPALING_CHARGE, 21000);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true))
{
me->CastSpell(target, SPELL_IMPALING_CHARGE, false);
impaledList.insert(target->GetGUID());
@@ -583,9 +583,9 @@ public:
{
summons.Summon(summon);
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, -10.0f, true);
Unit* target = SelectTarget(SelectTargetMethod::Random, 0, -10.0f, true);
if (!target)
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true);
target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true);
if (target)
{
if (summon->GetEntry() == NPC_BALL_OF_INFERNO_FLAME)
@@ -1015,7 +1015,7 @@ public:
Talk(SAY_VALANAR_BERSERK);
break;
case EVENT_KINETIC_BOMB:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
{
me->CastSpell(target, SPELL_KINETIC_BOMB_TARGET, false);
Talk(SAY_VALANAR_SPECIAL);
@@ -1031,7 +1031,7 @@ public:
}
else
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
me->CastSpell(target, SPELL_SHOCK_VORTEX, false);
events.ScheduleEvent(EVENT_SHOCK_VORTEX, urand(18000, 23000));
}
@@ -355,7 +355,7 @@ public:
void JustSummoned(Creature* summon) override
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
summon->AI()->AttackStart(target);
//if (IsHeroic())
@@ -465,7 +465,7 @@ public:
switch (action)
{
case ACTION_MARK_OF_THE_FALLEN_CHAMPION:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_MARK_OF_THE_FALLEN_CHAMPION))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true, -SPELL_MARK_OF_THE_FALLEN_CHAMPION))
{
++_fallenChampionCastCount;
me->CastSpell(target, SPELL_MARK_OF_THE_FALLEN_CHAMPION, false);
@@ -235,12 +235,12 @@ public:
{
std::list<Unit*> targets;
uint32 minTargets = RAID_MODE<uint32>(3, 8, 3, 8);
SelectTargetList(targets, minTargets, SELECT_TARGET_RANDOM, -5.0f, true);
SelectTargetList(targets, minTargets, SelectTargetMethod::Random, -5.0f, true);
float minDist = 0.0f;
if (targets.size() >= minTargets)
minDist = -5.0f;
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, minDist, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, minDist, true))
me->CastSpell(target, SPELL_VILE_GAS, false);
events.ScheduleEvent(EVENT_VILE_GAS, urand(28000, 35000), 1);
break;
@@ -250,7 +250,7 @@ public:
events.ScheduleEvent(EVENT_GASTRIC_BLOAT, urand(15000, 17500));
break;
case EVENT_FESTERGUT_GOO:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me)))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, NonTankTargetSelector(me)))
if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PROFESSOR_PUTRICIDE)))
professor->CastSpell(target, SPELL_MALLABLE_GOO_H, true);
events.ScheduleEvent(EVENT_FESTERGUT_GOO, urand(15000, 20000));
@@ -365,7 +365,7 @@ public:
Talk(SAY_BERSERK);
break;
case EVENT_SPELL_DEATH_AND_DECAY:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random))
me->CastSpell(target, SPELL_DEATH_AND_DECAY, false);
events.RepeatEvent(urand(22000, 30000));
break;
@@ -408,7 +408,7 @@ public:
}
break;
case EVENT_SPELL_SHADOW_BOLT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random))
me->CastSpell(target, SPELL_SHADOW_BOLT, false);
events.RepeatEvent(2100);
break;
@@ -445,7 +445,7 @@ public:
count = 3;
std::list<Unit*> targets;
SelectTargetList(targets, NonTankTargetSelector(me, true), count, SELECT_TARGET_RANDOM);
SelectTargetList(targets, NonTankTargetSelector(me, true), count, SelectTargetMethod::Random);
if (!targets.empty())
for (std::list<Unit*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
me->CastSpell(*itr, SPELL_SUMMON_SHADE, true);
@@ -484,7 +484,7 @@ public:
}
else
{
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true);
target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true);
}
summon->AI()->AttackStart(target);
@@ -855,7 +855,7 @@ public:
events.RepeatEvent(urand(9000, 13000));
break;
case EVENT_SPELL_ADHERENT_CURSE_OF_TORPOR:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1))
me->CastSpell(target, SPELL_CURSE_OF_TORPOR, false);
events.RepeatEvent(urand(9000, 13000));
break;
@@ -216,10 +216,10 @@ public:
break;
}
events.RepeatEvent(5000);
Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0, BoneStormMoveTargetSelector(me));
Unit* unit = SelectTarget(SelectTargetMethod::Random, 0, BoneStormMoveTargetSelector(me));
if (!unit)
{
if ((unit = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 175.0f, true)))
if ((unit = SelectTarget(SelectTargetMethod::MaxThreat, 0, 175.0f, true)))
if (unit->GetPositionX() > -337.0f)
{
EnterEvadeMode();
@@ -479,9 +479,9 @@ public:
void SelectTarget(std::list<WorldObject*>& targets)
{
targets.clear();
Unit* target = GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 1, -1.0f, true, -SPELL_IMPALED); // -1.0f as it takes into account object size
Unit* target = GetCaster()->GetAI()->SelectTarget(SelectTargetMethod::Random, 1, -1.0f, true, -SPELL_IMPALED); // -1.0f as it takes into account object size
if (!target)
target = GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true); // if only tank or noone outside of boss' model
target = GetCaster()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true); // if only tank or noone outside of boss' model
if (!target)
return;
@@ -548,7 +548,7 @@ public:
case EVENT_SLIME_PUDDLE:
{
std::list<Unit*> targets;
SelectTargetList(targets, 2, SELECT_TARGET_RANDOM, 0.0f, true);
SelectTargetList(targets, 2, SelectTargetMethod::Random, 0.0f, true);
if (!targets.empty())
for (std::list<Unit*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
me->CastSpell(*itr, SPELL_SLIME_PUDDLE_TRIGGER, true);
@@ -621,7 +621,7 @@ public:
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_OOZE_VARIABLE);
break;
case EVENT_UNBOUND_PLAGUE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, UnboundPlagueTargetSelector(me)))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, UnboundPlagueTargetSelector(me)))
{
me->CastSpell(target, SPELL_UNBOUND_PLAGUE, false);
me->CastSpell(target, SPELL_UNBOUND_PLAGUE_SEARCHER, false);
@@ -634,7 +634,7 @@ public:
if (Is25ManRaid())
{
std::list<Unit*> targets;
SelectTargetList(targets, MalleableGooSelector(me), (IsHeroic() ? 3 : 2), SELECT_TARGET_RANDOM);
SelectTargetList(targets, MalleableGooSelector(me), (IsHeroic() ? 3 : 2), SelectTargetMethod::Random);
if (!targets.empty())
{
@@ -645,7 +645,7 @@ public:
}
else
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, MalleableGooSelector(me)))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, MalleableGooSelector(me)))
{
Talk(EMOTE_MALLEABLE_GOO);
me->CastSpell(target, SPELL_MALLEABLE_GOO, true);
@@ -273,7 +273,7 @@ public:
me->DisableRotate(false);
break;
case EVENT_SLIME_SPRAY:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me)))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, NonTankTargetSelector(me)))
{
if (Creature* c = me->SummonCreature(NPC_OOZE_SPRAY_STALKER, *target, TEMPSUMMON_TIMED_DESPAWN, 8000))
{
@@ -315,12 +315,12 @@ public:
{
std::list<Unit*> targets;
uint32 minTargets = RAID_MODE<uint32>(3, 8, 3, 8);
SelectTargetList(targets, minTargets, SELECT_TARGET_RANDOM, -5.0f, true);
SelectTargetList(targets, minTargets, SelectTargetMethod::Random, -5.0f, true);
float minDist = 0.0f;
if (targets.size() >= minTargets)
minDist = -5.0f;
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, minDist, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, minDist, true))
if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PROFESSOR_PUTRICIDE)))
professor->CastSpell(target, SPELL_VILE_GAS_H, true); // triggered, to skip LoS check
}
@@ -897,7 +897,7 @@ public:
void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
summon->AI()->AttackStart(target);
}
@@ -671,7 +671,7 @@ public:
events.ScheduleEvent(EVENT_THIRD_PHASE_CHECK, 5000);
break;
case EVENT_ICE_TOMB:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, LastPhaseIceTombTargetSelector(me)))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, LastPhaseIceTombTargetSelector(me)))
{
Talk(EMOTE_WARN_FROZEN_ORB, target);
me->CastSpell(target, SPELL_ICE_TOMB_DUMMY, true);
@@ -1643,7 +1643,7 @@ public:
case EVENT_ICY_BLAST_CAST:
if (--_icyBlastCounter)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
{
me->SetFacingToObject(target);
me->CastSpell(target, SPELL_ICY_BLAST, false);
@@ -502,7 +502,7 @@ public:
if (Unit* target = _owner->SelectVictim())
_owner->AI()->AttackStart(target);
if (!_owner->GetVictim())
if (Unit* target = _summoner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankLKTargetSelector(_summoner)))
if (Unit* target = _summoner->AI()->SelectTarget(SelectTargetMethod::Random, 0, NonTankLKTargetSelector(_summoner)))
_owner->AI()->AttackStart(target);
_owner->AI()->DoZoneInCombat();
return true;
@@ -1055,7 +1055,7 @@ public:
events.ScheduleEvent(EVENT_INFEST, 22500, EVENT_GROUP_ABILITIES);
break;
case EVENT_NECROTIC_PLAGUE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, NecroticPlagueTargetCheck(me, NECROTIC_PLAGUE_LK, NECROTIC_PLAGUE_PLR)))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, NecroticPlagueTargetCheck(me, NECROTIC_PLAGUE_LK, NECROTIC_PLAGUE_PLR)))
{
Talk(EMOTE_NECROTIC_PLAGUE_WARNING, target);
me->CastSpell(target, SPELL_NECROTIC_PLAGUE, false);
@@ -1065,12 +1065,12 @@ public:
events.ScheduleEvent(EVENT_NECROTIC_PLAGUE, 5000, EVENT_GROUP_ABILITIES);
break;
case EVENT_SHADOW_TRAP:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, ShadowTrapLKTargetSelector(me, true, true, 100.0f)))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, ShadowTrapLKTargetSelector(me, true, true, 100.0f)))
me->CastSpell(target, SPELL_SHADOW_TRAP, false);
events.ScheduleEvent(EVENT_SHADOW_TRAP, 15500, EVENT_GROUP_ABILITIES);
break;
case EVENT_PAIN_AND_SUFFERING:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
{
//events.DelayEventsToMax(500, EVENT_GROUP_ABILITIES);
me->SetFacingTo(me->GetAngle(target));
@@ -1083,7 +1083,7 @@ public:
events.ScheduleEvent(EVENT_SUMMON_ICE_SPHERE, 7500, EVENT_GROUP_ABILITIES);
break;
case EVENT_SUMMON_RAGING_SPIRIT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
me->CastSpell(target, SPELL_RAGING_SPIRIT, false);
events.ScheduleEvent(EVENT_SUMMON_RAGING_SPIRIT, (!HealthAbovePct(40) ? 15000 : 20000), EVENT_GROUP_ABILITIES);
break;
@@ -1108,7 +1108,7 @@ public:
events.RescheduleEvent(EVENT_SUMMON_VALKYR, 5000, EVENT_GROUP_ABILITIES);
}
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, DefileTargetSelector(me)))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, DefileTargetSelector(me)))
{
Talk(EMOTE_DEFILE_WARNING);
me->CastSpell(target, SPELL_DEFILE, false);
@@ -1155,7 +1155,7 @@ public:
events.ScheduleEvent(EVENT_VILE_SPIRITS, 30000, EVENT_GROUP_VILE_SPIRITS);
break;
case EVENT_HARVEST_SOUL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankLKTargetSelector(me, true, true, 55.0f)))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, NonTankLKTargetSelector(me, true, true, 55.0f)))
{
Talk(SAY_LK_HARVEST_SOUL);
me->CastSpell(target, SPELL_HARVEST_SOUL, false);
@@ -2700,7 +2700,7 @@ public:
}
if (!target)
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_THE_LICH_KING)))
target = lichKing->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankLKTargetSelector(lichKing, true, false, 100.0f));
target = lichKing->AI()->SelectTarget(SelectTargetMethod::Random, 0, NonTankLKTargetSelector(lichKing, true, false, 100.0f));
if (target)
me->CastSpell(target, SPELL_LIFE_SIPHON, false);
_events.ScheduleEvent(EVENT_LIFE_SIPHON, 2500);
@@ -775,12 +775,12 @@ public:
_events.ScheduleEvent(EVENT_FROSTBOLT_VOLLEY, urand(8000, 15000));
break;
case EVENT_MANA_VOID:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, ManaVoidSelector(me)))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, ManaVoidSelector(me)))
me->CastSpell(target, SPELL_MANA_VOID, false);
_events.ScheduleEvent(EVENT_MANA_VOID, urand(20000, 25000));
break;
case EVENT_COLUMN_OF_FROST:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, -10.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, -10.0f, true))
me->CastSpell(target, SPELL_COLUMN_OF_FROST, false);
_events.ScheduleEvent(EVENT_COLUMN_OF_FROST, urand(15000, 25000));
break;
@@ -625,7 +625,7 @@ public:
switch (eventId)
{
case EVENT_DEATH_PLAGUE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_RECENTLY_INFECTED))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true, -SPELL_RECENTLY_INFECTED))
{
Talk(EMOTE_DEATH_PLAGUE_WARNING, target);
DoCast(target, SPELL_DEATH_PLAGUE);
@@ -1173,7 +1173,7 @@ public:
Talk(SAY_SVALNA_AGGRO);
break;
case EVENT_IMPALING_SPEAR:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_IMPALING_SPEAR))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true, -SPELL_IMPALING_SPEAR))
{
DoCast(me, SPELL_AETHER_SHIELD);
me->AddAura(70203, me);
@@ -1359,7 +1359,7 @@ public:
Events.ScheduleEvent(EVENT_ARNATH_SMITE, urand(4000, 7000));
break;
case EVENT_ARNATH_DOMINATE_MIND:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_DOMINATE_MIND))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true, -SPELL_DOMINATE_MIND))
DoCast(target, SPELL_DOMINATE_MIND);
Events.ScheduleEvent(EVENT_ARNATH_DOMINATE_MIND, urand(28000, 37000));
break;
@@ -1437,7 +1437,7 @@ public:
Events.ScheduleEvent(EVENT_BRANDON_JUDGEMENT_OF_COMMAND, urand(8000, 13000));
break;
case EVENT_BRANDON_HAMMER_OF_BETRAYAL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
DoCast(target, SPELL_HAMMER_OF_BETRAYAL);
Events.ScheduleEvent(EVENT_BRANDON_HAMMER_OF_BETRAYAL, urand(45000, 60000));
break;
@@ -1505,7 +1505,7 @@ public:
Events.ScheduleEvent(EVENT_GRONDEL_SUNDER_ARMOR, urand(5000, 17000));
break;
case EVENT_GRONDEL_CONFLAGRATION:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
DoCast(target, SPELL_CONFLAGRATION);
Events.ScheduleEvent(EVENT_GRONDEL_CONFLAGRATION, urand(10000, 15000));
break;
@@ -1559,17 +1559,17 @@ public:
switch (eventId)
{
case EVENT_RUPERT_FEL_IRON_BOMB:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
DoCast(target, SPELL_FEL_IRON_BOMB);
Events.ScheduleEvent(EVENT_RUPERT_FEL_IRON_BOMB, urand(15000, 20000));
break;
case EVENT_RUPERT_MACHINE_GUN:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1))
DoCast(target, SPELL_MACHINE_GUN);
Events.ScheduleEvent(EVENT_RUPERT_MACHINE_GUN, urand(25000, 30000));
break;
case EVENT_RUPERT_ROCKET_LAUNCH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1))
DoCast(target, SPELL_ROCKET_LAUNCH);
Events.ScheduleEvent(EVENT_RUPERT_ROCKET_LAUNCH, urand(10000, 15000));
break;
@@ -1711,7 +1711,7 @@ public:
break;
case 3: // Volley
{
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 35.0f, true);
Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 35.0f, true);
if (target && me->GetDistance(target) > 10.0f)
{
me->CastSpell(target, 71252, false);
@@ -1740,7 +1740,7 @@ public:
me->CastSpell(me, 71270, true);
break;
case 32: // Frozen Orb
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 30.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 30.0f, true))
me->CastSpell(target, 71274, false);
events.RepeatEvent(urand(40000, 50000));
break;
@@ -2901,7 +2901,7 @@ public:
uint8 count = me->GetMap()->Is25ManRaid() ? 4 : 2;
bool casted = false;
for (uint8 i = 0; i < count; ++i)
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 37.5f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 37.5f, true))
{
casted = true;
me->CastSpell(target, 71906, true); // Severed Essence
@@ -3114,7 +3114,7 @@ public:
switch (events.ExecuteEvent())
{
case 1:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
me->CastSpell(target, 70362, false);
events.RepeatEvent(urand(25000, 35000));
break;
@@ -3408,7 +3408,7 @@ public:
events.RepeatEvent(urand(20000, 30000));
break;
case 3:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
me->CastSpell(target, 70980, false);
events.RepeatEvent(urand(20000, 30000));
break;
@@ -219,7 +219,7 @@ public:
switch (events.ExecuteEvent())
{
case EVENT_IMPALE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
me->CastSpell(target, RAID_MODE(SPELL_IMPALE_10, SPELL_IMPALE_25), false);
}
@@ -203,7 +203,7 @@ public:
events.RepeatEvent(urand(7000, 15000));
break;
case EVENT_RAIN_OF_FIRE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
me->CastSpell(target, RAID_MODE(SPELL_RAIN_OF_FIRE_10, SPELL_RAIN_OF_FIRE_25), false);
}
@@ -346,7 +346,7 @@ public:
events.RepeatEvent(15000);
return;
case EVENT_PUNISH:
if (!SelectTarget(SELECT_TARGET_NEAREST, 0, 45.0f, true))
if (!SelectTarget(SelectTargetMethod::MaxDistance, 0, 45.0f, true))
{
me->CastSpell(me, TABLE_SPELL_PUNISH[horsemanId], false);
Talk(EMOTE_RAGECAST);
@@ -361,7 +361,7 @@ public:
if ((me->GetEntry() == NPC_LADY_BLAUMEUX || me->GetEntry() == NPC_SIR_ZELIEK))
{
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 45.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 45.0f, true))
{
me->CastSpell(target, RAID_MODE(TABLE_SPELL_PRIMARY_10[horsemanId], TABLE_SPELL_PRIMARY_25[horsemanId]), false);
}
@@ -453,7 +453,7 @@ public:
me->CastSpell(me, SPELL_TELEPORT_LIVE, false);
}
me->getThreatMgr().resetAggro(NotOnSameSide(me));
if (Unit* pTarget = SelectTarget(SELECT_TARGET_NEAREST, 0))
if (Unit* pTarget = SelectTarget(SelectTargetMethod::MaxDistance, 0))
{
me->getThreatMgr().addThreat(pTarget, 100.0f);
AttackStart(pTarget);
@@ -177,7 +177,7 @@ public:
events.RepeatEvent(20000);
break;
case EVENT_MUTATING_INJECTION:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true, -SPELL_MUTATING_INJECTION))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true, -SPELL_MUTATING_INJECTION))
{
me->CastSpell(target, SPELL_MUTATING_INJECTION, false);
}
@@ -410,14 +410,14 @@ public:
events.RepeatEvent(urand(15000, 30000));
break;
case EVENT_SHADOW_FISSURE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
{
me->CastSpell(target, SPELL_SHADOW_FISURE, false);
}
events.RepeatEvent(25000);
break;
case EVENT_FROST_BLAST:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, RAID_MODE(1, 0), 0, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, RAID_MODE(1, 0), 0, true))
{
me->CastSpell(target, SPELL_FROST_BLAST, false);
}
@@ -427,7 +427,7 @@ public:
case EVENT_CHAINS:
for (uint8 i = 0; i < 3; ++i)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true, -SPELL_CHAINS_OF_KELTHUZAD))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 200, true, -SPELL_CHAINS_OF_KELTHUZAD))
{
me->CastSpell(target, SPELL_CHAINS_OF_KELTHUZAD, true);
}
@@ -132,7 +132,7 @@ public:
if (cr->GetEntry() == NPC_MAEXXNA_SPIDERLING)
{
cr->SetInCombatWithZone();
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
cr->AI()->AttackStart(target);
}
@@ -201,7 +201,7 @@ public:
Talk(EMOTE_WEB_WRAP);
for (uint8 i = 0; i < RAID_MODE(1, 2); ++i)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true, -SPELL_WEB_WRAP))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0, true, -SPELL_WEB_WRAP))
{
target->RemoveAura(RAID_MODE(SPELL_WEB_SPRAY_10, SPELL_WEB_SPRAY_25));
uint8 pos = urand(0, 2);
@@ -162,7 +162,7 @@ public:
events.RepeatEvent(15000);
break;
case EVENT_JAGGED_KNIFE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f))
{
me->CastSpell(target, SPELL_JAGGED_KNIFE, false);
}
@@ -272,7 +272,7 @@ public:
case EVENT_BLIZZARD:
{
Creature* cr;
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
{
cr = me->SummonCreature(NPC_BLIZZARD, *target, TEMPSUMMON_TIMED_DESPAWN, 16000);
}
@@ -359,7 +359,7 @@ public:
}
else if (ballLightningEnabled)
{
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO))
if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat))
{
me->CastSpell(target, SPELL_BALL_LIGHTNING, false);
}
@@ -582,7 +582,7 @@ public:
me->RemoveAurasDueToSpell(me->GetEntry() == NPC_STALAGG ? SPELL_STALAGG_CHAIN : SPELL_FEUGEN_CHAIN);
cr->InterruptNonMeleeSpells(true);
}
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 1000.f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 1000.f, true))
{
cr->CastStop(SPELL_TESLA_SHOCK);
cr->CastSpell(target, SPELL_TESLA_SHOCK, true);
@@ -756,7 +756,7 @@ public:
events.RepeatEvent(3000);
break;
case EVENT_SPELL_STATIC_FIELD:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, false))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, false))
{
me->SetFacingToObject(target);
me->CastSpell(target, SPELL_STATIC_FIELD_MAIN, true);
@@ -1497,7 +1497,7 @@ public:
{
uint8 i = 0;
std::list<Unit*> drakes;
c->AI()->SelectTargetList(drakes, (c->GetMap()->GetSpawnMode() == 0 ? 1 : 3), SELECT_TARGET_RANDOM, 0.0f, false, 57403 /*only drakes have this aura*/);
c->AI()->SelectTargetList(drakes, (c->GetMap()->GetSpawnMode() == 0 ? 1 : 3), SelectTargetMethod::Random, 0.0f, false, 57403 /*only drakes have this aura*/);
for (std::list<Unit*>::iterator itr = drakes.begin(); itr != drakes.end() && i < 3; ++itr)
{
DrakeGUID[i++] = (*itr)->GetGUID();
@@ -167,7 +167,7 @@ public:
events.ScheduleEvent(EVENT_ANOMALUS_HEALTH, 1000);
break;
case EVENT_ANOMALUS_ARCANE_ATTRACTION:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
me->CastSpell(target, SPELL_ARCANE_ATTRACTION, false);
events.ScheduleEvent(EVENT_ANOMALUS_ARCANE_ATTRACTION, 15000);
break;
@@ -115,7 +115,7 @@ public:
events.ScheduleEvent(EVENT_WHIRLWIND, 16000);
break;
case EVENT_COMMANDER_CHARGE:
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 25.0f))
if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 25.0f))
me->CastSpell(target, SPELL_CHARGE, false);
events.ScheduleEvent(EVENT_COMMANDER_CHARGE, 20000);
break;
@@ -181,7 +181,7 @@ public:
Talk(SAY_CRYSTAL_NOVA);
if (IsHeroic())
me->CastSpell(me, SPELL_CRYSTALIZE, false);
else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
else if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
me->CastSpell(target, SPELL_CRYSTAL_CHAINS, false);
events.ScheduleEvent(EVENT_CRYSTAL_CHAINS, DUNGEON_MODE(20000, 11000));
break;
@@ -198,7 +198,7 @@ public:
events.ScheduleEvent(EVENT_MAGUS_HEALTH2, 1000);
break;
case EVENT_MAGUS_FIREBOMB:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_FIREBOMB, false);
events.ScheduleEvent(EVENT_MAGUS_FIREBOMB, 3000);
break;
@@ -146,7 +146,7 @@ public:
events.ScheduleEvent(EVENT_ORMOROK_SPELL_REFLECTION, 30000);
break;
case EVENT_ORMOROK_SUMMON:
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 50.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 50.0f, true))
me->CastSpell(target, SPELL_SUMMON_CRYSTALLINE_TANGLER, true);
events.ScheduleEvent(EVENT_ORMOROK_SUMMON, 17000);
break;
@@ -223,7 +223,7 @@ public:
Talk(SAY_SHIELD);
me->CastSpell(me, SPELL_PLANAR_SHIFT, false);
for( uint8 i = 0; i < 3; ++i )
if( Unit* t = SelectTarget(SELECT_TARGET_RANDOM, 0, 300.0f, false) )
if( Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 300.0f, false) )
if( Creature* pa = me->SummonCreature(NPC_PLANAR_ANOMALY, *me, TEMPSUMMON_TIMED_DESPAWN, 17000) )
{
pa->SetCanFly(true);
@@ -335,7 +335,7 @@ public:
events.RepeatEvent(urand(7000, 11000));
break;
case EVENT_TIME_BOMB:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true) )
DoCast(target, DUNGEON_MODE(SPELL_TIME_BOMB_N, SPELL_TIME_BOMB_H));
events.RepeatEvent(urand(20000, 25000));
break;
@@ -173,7 +173,7 @@ public:
break;
case EVENT_AMPLIFY_MAGIC:
{
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true) )
me->CastSpell(target, SPELL_AMPLIFY_MAGIC, false);
events.RepeatEvent(urand(17500, 22500));
}
@@ -204,7 +204,7 @@ public:
events.ScheduleEvent(EVENT_CALL_AZURE_RING_CAPTAIN_1, 16000);
break;
}
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true) )
{
if( Creature* trigger = me->SummonCreature(NPC_ARCANE_BEAM, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 13000) )
{
@@ -350,7 +350,7 @@ public:
///// BATTLE STANCE
///////////////////////////////////////////////////////
case EVENT_BJARNGRIM_INTERCEPT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random))
me->CastSpell(target, SPELL_INTERCEPT, true);
events.RepeatEvent(30000);
@@ -187,13 +187,13 @@ public:
switch (events.ExecuteEvent())
{
case EVENT_BALL_LIGHTNING:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random))
me->CastSpell(target, me->GetMap()->IsHeroic() ? SPELL_BALL_LIGHTNING_H : SPELL_BALL_LIGHTNING_N, false);
events.RepeatEvent(10000 + rand() % 1000);
break;
case EVENT_STATIC_OVERLOAD:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random))
me->CastSpell(target, me->GetMap()->IsHeroic() ? SPELL_STATIC_OVERLOAD_H : SPELL_STATIC_OVERLOAD_N, false);
events.RepeatEvent(5000 + rand() % 1000);
@@ -205,7 +205,7 @@ public:
{
summon->SetFaction(me->GetFaction());
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random))
summon->AI()->AttackStart(target);
}
}
@@ -557,11 +557,11 @@ public:
events.RepeatEvent(12000);
break;
case EVENT_THROW:
me->CastSpell(SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0), me->GetMap()->IsHeroic() ? SPELL_THROW_H : SPELL_THROW_N, true);
me->CastSpell(SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true, 0), me->GetMap()->IsHeroic() ? SPELL_THROW_H : SPELL_THROW_N, true);
events.RepeatEvent(10000 + rand() % 15000);
break;
case EVENT_DEADLY_THROW:
me->CastSpell(SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0), me->GetMap()->IsHeroic() ? SPELL_DEADLY_THROW_H : SPELL_DEADLY_THROW_N, true);
me->CastSpell(SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true, 0), me->GetMap()->IsHeroic() ? SPELL_DEADLY_THROW_H : SPELL_DEADLY_THROW_N, true);
events.RepeatEvent(15000 + rand() % 15000);
break;
case EVENT_DEFLECTION:
@@ -122,7 +122,7 @@ public:
{
case EVENT_BOULDER:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true, 0))
me->CastSpell(target, DUNGEON_MODE(BOULDER_TOSS, BOULDER_TOSS_H), false);
events.RepeatEvent(5000 + rand() % 2000);
@@ -121,7 +121,7 @@ public:
}
case EVENT_PILLAR:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true, 0))
me->CastSpell(target, DUNGEON_MODE(PILLAR_OF_WOE, PILLAR_OF_WOE_H), false);
events.RepeatEvent(12000 + rand() % 8000);
@@ -129,7 +129,7 @@ public:
}
case EVENT_PARTING:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true, 0))
me->CastSpell(target, PARTING_SORROW, false);
events.RepeatEvent(6000 + rand() % 10000);
@@ -251,7 +251,7 @@ public:
}
case EVENT_CHAIN_LIGHTNING:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true, 0))
me->CastSpell(target, DUNGEON_MODE(SPELL_CHAIN_LIGHTNING, SPELL_CHAIN_LIGHTNING_H), false);
events.RepeatEvent(6000 + rand() % 6000);
@@ -259,7 +259,7 @@ public:
}
case EVENT_STATIC_CHARGE:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true, 0))
me->CastSpell(target, DUNGEON_MODE(SPELL_STATIC_CHARGE, SPELL_STATIC_CHARGE_H), false);
events.RepeatEvent(20000);
@@ -734,7 +734,7 @@ public:
{
case EVENT_DRP_CHARGE:
{
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(tgt, SPELL_DRP_CHARGE, false);
events.RepeatEvent(10000);
@@ -567,7 +567,7 @@ public:
break;
}
case NPC_UNLEASHED_DARK_MATTER:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
if (summon->Attack(target, true))
summon->GetMotionMaster()->MoveChase(target);
break;
@@ -344,7 +344,7 @@ public:
events.RepeatEvent(urand(15000, 20000));
break;
case EVENT_STATIC_DISRUPTION:
if (Unit* pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0, 0, true))
if (Unit* pTarget = SelectTarget(SelectTargetMethod::MinDistance, 0, 0, true))
me->CastSpell(pTarget, SPELL_STATIC_DISRUPTION, false);
events.RepeatEvent(urand(20000, 40000));
@@ -523,7 +523,7 @@ public:
events.RescheduleEvent(EVENT_SHIELD_OF_RUNES, urand(27000, 34000));
break;
case EVENT_RUNE_OF_DEATH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random))
me->CastSpell(target, SPELL_RUNE_OF_DEATH, true);
Talk(SAY_MOLGEIM_RUNE_DEATH);
@@ -531,7 +531,7 @@ public:
break;
case EVENT_RUNE_OF_SUMMONING:
Talk(SAY_MOLGEIM_SUMMON);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_RUNE_OF_SUMMONING);
events.RepeatEvent(urand(30000, 45000));
break;
@@ -771,7 +771,7 @@ public:
switch (events.ExecuteEvent())
{
case EVENT_CHAIN_LIGHTNING:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false);
events.RepeatEvent(urand(9000, 17000));
@@ -610,7 +610,7 @@ public:
break;
}
case EVENT_FREYA_SUNBEAM:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* target = SelectTarget(SelectTargetMethod::Random))
me->CastSpell(target, SPELL_SUNBEAM, false);
events.RepeatEvent(15000 + urand(0, 5000));
break;
@@ -986,7 +986,7 @@ public:
events.RepeatEvent(20000);
break;
case EVENT_IRONBRANCH_THORN_SWARM:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SPELL_THORN_SWARM, false);
events.RepeatEvent(14000);
break;
@@ -1225,7 +1225,7 @@ public:
me->CastSpell(me, SPELL_TIDAL_WAVE_DAMAGE, false);
break;
case EVENT_STORM_LASHER_LIGHTNING_LASH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_LIGHTNING_LASH, false);
events.RepeatEvent(10000);
break;
@@ -477,7 +477,7 @@ public:
{
me->CastSpell(plr, SPELL_FREEZE, false);
}
else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
else if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
{
me->CastSpell(target, SPELL_FREEZE, false);
}
@@ -448,7 +448,7 @@ public:
{
events.ScheduleEvent(EVENT_FOCUSED_EYEBEAM, 20000);
if ((eyebeamTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0, 0, true)))
if ((eyebeamTarget = SelectTarget(SelectTargetMethod::MinDistance, 0, 0, true)))
{
me->CastSpell(eyebeamTarget, SPELL_FOCUSED_EYEBEAM_SUMMON, false);
}
@@ -1151,7 +1151,7 @@ public:
if (!pList.empty())
pTarget = pList[urand(0, pList.size() - 1)];
else
pTarget = (Player*)SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true);
pTarget = (Player*)SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true);
if( pTarget )
cannon->CastSpell(pTarget, SPELL_NAPALM_SHELL, false);
@@ -1806,7 +1806,7 @@ public:
}
else
{
if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0, 27.5f, true))
if (Unit* victim = SelectTarget(SelectTargetMethod::Random, 0, 27.5f, true))
{
me->SetFacingToObject(victim);
me->CastSpell(victim, SPELL_PLASMA_BALL, false);
@@ -365,12 +365,12 @@ public:
}
break;
case EVENT_SPELL_FIREBALL:
if( Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true) )
if( Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true) )
me->CastSpell(pTarget, SPELL_FIREBALL, false);
events.RepeatEvent(4000);
break;
case EVENT_SPELL_DEVOURING_FLAME:
if( Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true) )
if( Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true) )
me->CastSpell(pTarget, SPELL_DEVOURINGFLAME, false);
events.RepeatEvent(13000);
break;
@@ -488,7 +488,7 @@ public:
me->SetControlled(false, UNIT_STATE_ROOT);
me->DisableRotate(false);
DoResetThreat();
Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0, true);
Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0, true);
if (!target)
target = me->SelectNearestPlayer(200.0f);
if (target)
@@ -759,7 +759,7 @@ public:
me->CastSpell(me, SPELL_LIGHTNING_PILLAR_P2, true);
break;
case EVENT_THORIM_CHAIN_LIGHTNING:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false);
events.RepeatEvent(15000);
break;
@@ -1218,7 +1218,7 @@ public:
events.RepeatEvent(10000);
break;
case EVENT_DR_ACOLYTE_HS:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_HOLY_SMITE, false);
events.RepeatEvent(1600);
break;
@@ -1343,7 +1343,7 @@ public:
events.RepeatEvent(10000);
break;
case EVENT_DR_ACOLYTE_HS:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_HOLY_SMITE, false);
events.RepeatEvent(1600);
break;
@@ -1499,7 +1499,7 @@ public:
events.RepeatEvent(10000);
break;
case EVENT_RC_CHARGE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_CHARGE, false);
events.RepeatEvent(15000);
break;
@@ -1574,7 +1574,7 @@ public:
switch (events.ExecuteEvent())
{
case EVENT_ARG_RD:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_RUNE_DETONATION, false);
events.RepeatEvent(12000);
break;
@@ -1696,7 +1696,7 @@ public:
events.RepeatEvent(8000);
break;
case EVENT_DR_EVOKER_RL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_RUNIC_LIGHTNING, false);
events.RepeatEvent(2500);
break;
@@ -1712,7 +1712,7 @@ public:
events.RepeatEvent(10000);
break;
case EVENT_DR_CHAMPION_CH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_CHARGE, false);
events.RepeatEvent(12000);
break;
@@ -189,7 +189,7 @@ public:
else if (s->GetEntry() == NPC_THROW)
{
ThrowGUID = s->GetGUID();
if( Unit* t = SelectTarget(SELECT_TARGET_RANDOM, 0, 70.0f, true) )
if( Unit* t = SelectTarget(SelectTargetMethod::Random, 0, 70.0f, true) )
s->GetMotionMaster()->MovePoint(0, t->GetPositionX(), t->GetPositionY(), t->GetPositionZ());
}
}
@@ -197,7 +197,7 @@ public:
events.RepeatEvent(urand(4000, 5000));
break;
case EVENT_FROST_TOMB:
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true) )
if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true) )
if( !target->HasAura(SPELL_FROST_TOMB_AURA) )
{
Talk(SAY_FROST_TOMB_EMOTE, target);
@@ -196,7 +196,7 @@ public:
Talk(YELL_SKARVALD_DAL_DIEDFIRST);
break;
case EVENT_SHARVALD_CHARGE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, (IsHeroic() ? 100.0f : 30.0f), true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, (IsHeroic() ? 100.0f : 30.0f), true))
{
ScriptedAI::DoResetThreat();
me->AddThreat(target, 10000.0f);
@@ -372,14 +372,14 @@ public:
Talk(YELL_DALRONN_SKA_DIEDFIRST);
break;
case EVENT_SHADOW_BOLT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
{
me->CastSpell(target, DUNGEON_MODE(SPELL_SHADOW_BOLT_N, SPELL_SHADOW_BOLT_H), false);
}
events.RepeatEvent(2050);
break;
case EVENT_DEBILITATE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
{
me->CastSpell(target, SPELL_DEBILITATE, false);
events.RepeatEvent(urand(5000, 10000));
@@ -301,7 +301,7 @@ public:
}
case EVENT_PALEHOOF_IMPALE:
{
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(tgt, IsHeroic() ? SPELL_IMPALE_H : SPELL_IMPALE_N, false);
events.RepeatEvent(8000 + rand() % 4000);
@@ -415,7 +415,7 @@ public:
{
case EVENT_JORMUNGAR_ACID_SPIT:
{
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(tgt, SPELL_ACID_SPIT, false);
events.RepeatEvent(2000 + rand() % 2000);
@@ -441,7 +441,7 @@ public:
}
case EVENT_JORMUNGAR_POISON_BREATH:
{
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(tgt, IsHeroic() ? SPELL_POISON_BREATH_H : SPELL_POISON_BREATH_N, false);
events.RepeatEvent(8000 + rand() % 4000);
@@ -551,7 +551,7 @@ public:
}
case EVENT_RHINO_WOUND:
{
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(tgt, IsHeroic() ? SPELL_GRIEVOUS_WOUND_H : SPELL_GRIEVOUS_WOUND_N, false);
events.RepeatEvent(18000 + rand() % 4000);
@@ -226,7 +226,7 @@ public:
}
case EVENT_SKADI_SPEAR:
{
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(tgt, IsHeroic() ? SPELL_POISONED_SPEAR_H : SPELL_POISONED_SPEAR_N, false);
events.RepeatEvent(10000);
@@ -323,7 +323,7 @@ public:
break;
}
case EVENT_SORROWGRAVE_RITUAL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
Talk(SAY_SACRIFICE_PLAYER);
@@ -134,7 +134,7 @@ class boss_archavon : public CreatureScript
switch (events.ExecuteEvent())
{
case EVENT_ROCK_SHARDS:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
DoCast(target, SPELL_ROCK_SHARDS);
}
@@ -142,7 +142,7 @@ class boss_archavon : public CreatureScript
events.RepeatEvent(15000);
break;
case EVENT_CHOKING_CLOUD:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1))
{
DoCast(target, RAID_MODE(SPELL_CRUSHING_LEAP_10, SPELL_CRUSHING_LEAP_25), true); //10y ~ 80y, ignore range
}
@@ -169,7 +169,7 @@ public:
switch (events.ExecuteEvent())
{
case EVENT_CHAIN_LIGHTNING:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, RAID_MODE(SPELL_CHAIN_LIGHTNING_10, SPELL_CHAIN_LIGHTNING_25), false);
events.RepeatEvent(25000);
break;
@@ -131,7 +131,7 @@ public:
switch (events.ExecuteEvent())
{
case EVENT_FREEZING_GROUND:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
me->CastSpell(target, SPELL_FREEZING_GROUND, false);
events.RepeatEvent(20000);
break;
@@ -134,12 +134,12 @@ public:
break;
case EVENT_SPELL_BLIZZARD:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45.0f, true))
me->CastSpell(target, SPELL_BLIZZARD, false);
events.RepeatEvent(15000);
break;
case EVENT_SPELL_MANA_DESTRUCTION:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
me->CastSpell(target, SPELL_MANA_DESTRUCTION, false);
events.RepeatEvent(20000);
break;
@@ -154,7 +154,7 @@ public:
events.RepeatEvent(urand(8000, 13000));
break;
case EVENT_SPELL_LIGHTNING_BOLT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 35.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 35.0f, true))
me->CastSpell(target, SPELL_LIGHTNING_BOLT, false);
events.RepeatEvent(urand(15000, 25000));
break;
@@ -99,7 +99,7 @@ public:
events.RepeatEvent(urand(8000, 10000));
break;
case EVENT_SPELL_OPTIC_LINK:
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 40.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 40.0f, true))
{
me->CastSpell(target, SPELL_OPTIC_LINK, false);
events.RepeatEvent(urand(18000, 21000));
@@ -113,7 +113,7 @@ public:
events.RepeatEvent(20000);
break;
case EVENT_SPELL_VOID_SHIFT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
{
me->CastSpell(target, SPELL_VOID_SHIFT, false);
me->Whisper("Gaze... into the void.", LANG_UNIVERSAL, target->ToPlayer());
@@ -525,7 +525,7 @@ public:
if (uiImpaleTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 5.0f, true);
Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 5.0f, true);
if (pTarget)
DoCast(pTarget, SPELL_IMPALE);
uiImpaleTimer = 4000;
@@ -600,7 +600,7 @@ public:
if (uiArcainBarrageTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true);
Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true);
if (pTarget)
DoCast(pTarget, SPELL_ARCANE_BARRAGE);
uiArcainBarrageTimer = 6000;
@@ -619,7 +619,7 @@ public:
if (uiFrostboltTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true);
Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true);
if (pTarget)
DoCast(pTarget, SPELL_FROSTBOLT);
uiFrostboltTimer = 6000;
@@ -676,7 +676,7 @@ public:
{
if (uiSpellLockTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true);
Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true);
if (pTarget)
DoCast(pTarget, SPELL_SPELL_LOCK);
uiSpellLockTimer = 9000;
@@ -774,7 +774,7 @@ public:
{
if (uiTacticalBlinkTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true);
Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true);
if (pTarget)
DoCast(pTarget, SPELL_TACTICAL_BLINK);
uiTacticalBlinkTimer = 10000;
@@ -786,7 +786,7 @@ public:
{
if (uiBackstabTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_NEAREST, 0, 5.0f, true);
Unit* pTarget = SelectTarget(SelectTargetMethod::MaxDistance, 0, 5.0f, true);
if (pTarget && !pTarget->HasInArc(M_PI, me))
DoCast(pTarget, SPELL_BACKSTAB);
TacticalBlinkCasted = false;
@@ -838,7 +838,7 @@ public:
{
if (uiArcaneBlastTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true);
Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true);
if (pTarget)
DoCast(pTarget, SPELL_ARCANE_BLAST);
uiArcaneBlastTimer = 6000;
@@ -847,7 +847,7 @@ public:
if (uiSlowTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true);
Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true);
if (pTarget)
DoCast(pTarget, SPELL_SLOW);
uiSlowTimer = 5000;
@@ -859,7 +859,7 @@ public:
{
if (uiChainsOfIceTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true);
Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true);
if (pTarget)
DoCast(pTarget, SPELL_CHAINS_OF_ICE);
uiChainsOfIceTimer = 7000;
@@ -962,7 +962,7 @@ public:
if (uiArcaneStreamTimer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 35.0f, true);
Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 35.0f, true);
if (pTarget)
DoCast(pTarget, SPELL_ARCANE_STREAM);
uiArcaneStreamTimer = urand(0, 5000) + 5000;
@@ -285,7 +285,7 @@ public:
events.RepeatEvent(22000);
break;
case EVENT_DAGGER_THROW:
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM))
if (Unit* tgt = SelectTarget(SelectTargetMethod::Random))
me->CastSpell(tgt, SPELL_IOCBOSS_DAGGER_THROW, false);
events.RepeatEvent(10000);