[3.3.5] Combat/Threat rewrite - prep & refactor (#19966)
* Combat/Threat rewrite (PR #19930) prep work. Mostly refactors, and a compatibility layer on ThreatManager/HostileReference that allows scripts to be changed already.
This commit is contained in:
1 parent
f21877e00f
commit
ec04d3b2cd
218 files changed
+1021
-1105
No files matched your search
@@ -852,7 +852,7 @@ public:
|
||||
if (!target || target->IsTotem() || target->IsPet())
|
||||
return false;
|
||||
|
||||
ThreatContainer::StorageType const& threatList = target->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& threatList = target->GetThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator itr;
|
||||
uint32 count = 0;
|
||||
handler->PSendSysMessage("Threat list of %s (guid %u)", target->GetName().c_str(), target->GetGUID().GetCounter());
|
||||
|
||||
@@ -212,7 +212,7 @@ class FocusedFireTargetSelector
|
||||
|
||||
bool operator() (WorldObject* target)
|
||||
{
|
||||
if (target == _victim && _me->getThreatManager().getThreatList().size() > 1)
|
||||
if (target == _victim && !_me->GetThreatManager().IsThreatListEmpty())
|
||||
return true;
|
||||
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
|
||||
@@ -687,7 +687,7 @@ class npc_feludius : public CreatureScript
|
||||
me->GetMotionMaster()->MovePoint(POINT_NONE, feludiusMiddlePosition, true);
|
||||
break;
|
||||
case EVENT_FROZEN_ORB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
DoCast(target, SPELL_FROZEN_ORB);
|
||||
_events.Repeat(20s);
|
||||
break;
|
||||
@@ -909,7 +909,7 @@ class npc_ignacious : public CreatureScript
|
||||
break;
|
||||
}
|
||||
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 60.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXDISTANCE, 0, 60.0f, true))
|
||||
{
|
||||
if (Unit* victim = me->GetVictim())
|
||||
_lastVictimGuid = victim->GetGUID();
|
||||
@@ -1268,7 +1268,7 @@ class npc_terrastra : public CreatureScript
|
||||
DoZoneInCombat();
|
||||
break;
|
||||
case EVENT_GRAVITY_WELL:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
DoCast(target, SPELL_GRAVITY_WELL);
|
||||
_events.Repeat(17s);
|
||||
break;
|
||||
|
||||
@@ -647,7 +647,7 @@ struct npc_chogall_corrupting_adherent : public ScriptedAI
|
||||
AttackStart(target);
|
||||
break;
|
||||
case EVENT_CORRUPTING_CRASH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
DoCast(target, SPELL_CORRUPTING_CRASH);
|
||||
_events.Repeat(6s);
|
||||
break;
|
||||
@@ -706,9 +706,9 @@ struct npc_chogall_blood_of_the_old_god : public ScriptedAI
|
||||
{
|
||||
case EVENT_ENGAGE_PLAYERS:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
{
|
||||
me->AddThreat(target, 100000000.0f); // sniffed value
|
||||
AddThreat(target, 100000000.0f); // sniffed value
|
||||
AttackStart(target);
|
||||
}
|
||||
break;
|
||||
@@ -893,7 +893,7 @@ struct npc_chogall_darkened_creation : public ScriptedAI
|
||||
_events.ScheduleEvent(EVENT_DEBILITATING_BEAM, 1s + 300ms);
|
||||
break;
|
||||
case EVENT_DEBILITATING_BEAM:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_DEBILITATING_BEAM))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, true, -SPELL_DEBILITATING_BEAM))
|
||||
{
|
||||
me->SetFacingToObject(target);
|
||||
DoCast(target, SPELL_DEBILITATING_BEAM);
|
||||
|
||||
@@ -400,7 +400,7 @@ class boss_theralion : public CreatureScript
|
||||
me->GetMotionMaster()->MovePoint(POINT_TAKEOFF_DESTINATION, stalker->GetPosition(), false);
|
||||
break;
|
||||
case EVENT_TWILIGHT_BLAST:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
DoCast(target, SPELL_TWILIGHT_BLAST);
|
||||
events.Repeat(Seconds(2) + Milliseconds(400));
|
||||
break;
|
||||
|
||||
+3
-3
@@ -217,7 +217,7 @@ struct boss_ascendant_lord_obsidius : public BossAI
|
||||
events.Repeat(12s);
|
||||
break;
|
||||
case EVENT_TWILIGHT_CORRUPTION:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_TWILIGHT_CORRUPTION))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, true, -SPELL_TWILIGHT_CORRUPTION))
|
||||
DoCast(target, SPELL_TWILIGHT_CORRUPTION);
|
||||
events.Repeat(12s);
|
||||
break;
|
||||
@@ -252,8 +252,8 @@ class spell_obsidius_twitchy : public AuraScript
|
||||
if (Unit* attacker = damage->GetAttacker())
|
||||
{
|
||||
target->SendPlaySpellVisualKit(SPELL_VISUAL_SPOTTED, 0, 0);
|
||||
target->getThreatManager().resetAllAggro();
|
||||
target->AddThreat(attacker, 100000000.0f);
|
||||
target->GetThreatManager().resetAllAggro();
|
||||
target->GetThreatManager().AddThreat(attacker, 100000000.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -138,12 +138,12 @@ struct boss_beauty : public BossAI
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_MAGMA_SPIT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_MAGMA_SPIT))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, true, -SPELL_MAGMA_SPIT))
|
||||
DoCast(target, SPELL_MAGMA_SPIT);
|
||||
events.Repeat(7s, 9s);
|
||||
break;
|
||||
case EVENT_BERSERKER_CHARGE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 100.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXDISTANCE, 0, 100.0f, true, true, 0))
|
||||
DoCast(target, SPELL_BERSERKER_CHARGE);
|
||||
events.Repeat(15s, 21s);
|
||||
break;
|
||||
|
||||
+1
-1
@@ -309,7 +309,7 @@ struct npc_corla_twilight_zealot : public ScriptedAI
|
||||
DoCastAOE(SPELL_INVISIBILITY_AND_STEALTH_DETECTION, true);
|
||||
break;
|
||||
case EVENT_FORCE_BLAST:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, true, 0))
|
||||
DoCast(target, SPELL_FORCE_BLAST);
|
||||
_events.Repeat(14s, 17s);
|
||||
break;
|
||||
|
||||
+1
-1
@@ -321,7 +321,7 @@ public:
|
||||
})
|
||||
.Schedule(Seconds(2), [this](TaskContext mugChuck)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, false, -SPELL_HAS_DARK_BREWMAIDENS_BREW))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, false, true, -SPELL_HAS_DARK_BREWMAIDENS_BREW))
|
||||
DoCast(target, SPELL_CHUCK_MUG);
|
||||
mugChuck.Repeat(Seconds(4));
|
||||
});
|
||||
|
||||
+1
-1
@@ -375,7 +375,7 @@ public:
|
||||
{//do not call EnterEvadeMode(), it will create infinit loops
|
||||
boss->Respawn();
|
||||
boss->RemoveAllAuras();
|
||||
boss->DeleteThreatList();
|
||||
boss->GetThreatManager().ClearAllThreat();
|
||||
boss->CombatStop(true);
|
||||
boss->LoadCreaturesAddon();
|
||||
boss->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
+2
-2
@@ -668,8 +668,8 @@ struct npc_atramedes_obnoxious_fiend : public ScriptedAI
|
||||
Talk(SAY_INTRO);
|
||||
break;
|
||||
case EVENT_FOCUS_PLAYER:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_PESTERED))
|
||||
me->AddThreat(target, 50000000.0f);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, true, -SPELL_PESTERED))
|
||||
AddThreat(target, 50000000.0f);
|
||||
_events.ScheduleEvent(EVENT_CHASE_PLAYER, 1s);
|
||||
break;
|
||||
case EVENT_CHASE_PLAYER:
|
||||
|
||||
+3
-3
@@ -385,7 +385,7 @@ struct boss_nefarians_end : public BossAI
|
||||
// Attacking Nefarian while Onyxia is not engaged is not suposed to trigger anything
|
||||
if (instance->GetBossState(DATA_NEFARIANS_END) != IN_PROGRESS)
|
||||
{
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop();
|
||||
return;
|
||||
}
|
||||
@@ -1212,7 +1212,7 @@ struct npc_nefarians_end_chromatic_prototype : public PassiveAI
|
||||
case ACTION_DISENGAGE_PLAYERS:
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
me->SetHomePosition(me->GetPosition());
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop();
|
||||
_events.Reset();
|
||||
_events.ScheduleEvent(EVENT_DISENGAGE_PLAYERS, 3s + 700ms);
|
||||
@@ -1578,7 +1578,7 @@ class spell_nefarians_end_animate_bones_dummy : public SpellScript
|
||||
target->RemoveAurasDueToSpell(sSpellMgr->GetSpellIdForDifficulty(SPELL_EMPOWER, target));
|
||||
target->CastSpell(target, SPELL_CLEAR_ALL_DEBUFFS, true);
|
||||
target->AttackStop();
|
||||
target->DeleteThreatList();
|
||||
target->GetThreatManager().ClearAllThreat();
|
||||
target->SetReactState(REACT_PASSIVE);
|
||||
target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
target->CastSpell(target, SPELL_PERMANENT_FEIGN_DEATH_2);
|
||||
|
||||
+5
-5
@@ -527,7 +527,7 @@ struct npc_omnotron_electron : public ScriptedAI
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_LIGHTNING_CONDUCTOR:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
|
||||
{
|
||||
Talk(SAY_ANNOUNCE_ABILITY_1, target);
|
||||
DoCast(target, SPELL_LIGHTNING_CONDUCTOR);
|
||||
@@ -827,7 +827,7 @@ struct npc_omnotron_toxitron : public ScriptedAI
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_CHEMICAL_BOMB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
|
||||
DoCast(target, SPELL_CHEMICAL_BOMB);
|
||||
_events.Repeat(30s);
|
||||
break;
|
||||
@@ -981,7 +981,7 @@ struct npc_omnotron_arcanotron : public ScriptedAI
|
||||
me->MakeInterruptable(true);
|
||||
if (!Is25ManRaid())
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
DoCast(target, SPELL_ARCANE_ANNIHILATION);
|
||||
}
|
||||
else
|
||||
@@ -1161,7 +1161,7 @@ struct npc_omnotron_poison_bomb : public ScriptedAI
|
||||
|
||||
// Blizzard has a AOE target spell for this but for some reason they doesn't use it so we wont do so as well.
|
||||
std::list<Unit*> targets;
|
||||
SelectTargetList(targets, 25, SELECT_TARGET_RANDOM, 100.0f, true);
|
||||
SelectTargetList(targets, 25, SELECT_TARGET_RANDOM, 0, 100.0f, true);
|
||||
|
||||
if (targets.empty())
|
||||
return;
|
||||
@@ -1178,7 +1178,7 @@ struct npc_omnotron_poison_bomb : public ScriptedAI
|
||||
{
|
||||
DoCast(target, SPELL_FIXATE_DUMMY, true);
|
||||
me->ClearUnitState(UNIT_STATE_CASTING);
|
||||
me->AddThreat(target, 500000.0f);
|
||||
AddThreat(target, 500000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -88,8 +88,8 @@ public:
|
||||
break;
|
||||
case EVENT_KNOCKBACK:
|
||||
DoCastVictim(SPELL_KNOCKBACK);
|
||||
if (DoGetThreat(me->GetVictim()))
|
||||
DoModifyThreatPercent(me->GetVictim(), -50);
|
||||
if (GetThreat(me->GetVictim()))
|
||||
ModifyThreatByPercent(me->GetVictim(), -50);
|
||||
events.ScheduleEvent(EVENT_KNOCKBACK, urand(15000, 30000));
|
||||
break;
|
||||
case EVENT_CHECK:
|
||||
|
||||
@@ -71,8 +71,8 @@ public:
|
||||
break;
|
||||
case EVENT_WINGBUFFET:
|
||||
DoCastVictim(SPELL_WINGBUFFET);
|
||||
if (DoGetThreat(me->GetVictim()))
|
||||
DoModifyThreatPercent(me->GetVictim(), -75);
|
||||
if (GetThreat(me->GetVictim()))
|
||||
ModifyThreatByPercent(me->GetVictim(), -75);
|
||||
events.ScheduleEvent(EVENT_WINGBUFFET, 30000);
|
||||
break;
|
||||
case EVENT_FLAMEBUFFET:
|
||||
|
||||
+2
-2
@@ -76,8 +76,8 @@ public:
|
||||
break;
|
||||
case EVENT_WINGBUFFET:
|
||||
DoCastVictim(SPELL_WINGBUFFET);
|
||||
if (DoGetThreat(me->GetVictim()))
|
||||
DoModifyThreatPercent(me->GetVictim(), -75);
|
||||
if (GetThreat(me->GetVictim()))
|
||||
ModifyThreatByPercent(me->GetVictim(), -75);
|
||||
events.ScheduleEvent(EVENT_WINGBUFFET, 30000);
|
||||
break;
|
||||
case EVENT_FRENZY:
|
||||
|
||||
+1
-1
@@ -319,7 +319,7 @@ public:
|
||||
DoCast(target, SPELL_SHADOWBOLT);
|
||||
break;
|
||||
}
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT, urand(3000, 10000));
|
||||
break;
|
||||
case EVENT_FEAR:
|
||||
|
||||
@@ -150,10 +150,6 @@ public:
|
||||
break;
|
||||
case EVENT_CONFLAGRATION:
|
||||
DoCastVictim(SPELL_CONFLAGRATION);
|
||||
// @todo is this even necessary? pretty sure AI ignores targets with disorient by default
|
||||
if (me->GetVictim() && me->EnsureVictim()->HasAura(SPELL_CONFLAGRATION))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
|
||||
me->TauntApply(target);
|
||||
events.ScheduleEvent(EVENT_CONFLAGRATION, 30000);
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ class boss_baron_geddon : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_INFERNO, 45000);
|
||||
break;
|
||||
case EVENT_IGNITE_MANA:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_IGNITE_MANA))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, true, -SPELL_IGNITE_MANA))
|
||||
DoCast(target, SPELL_IGNITE_MANA);
|
||||
events.ScheduleEvent(EVENT_IGNITE_MANA, 30000);
|
||||
break;
|
||||
|
||||
@@ -96,7 +96,7 @@ class boss_magmadar : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_PANIC, 35000);
|
||||
break;
|
||||
case EVENT_LAVA_BOMB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_LAVA_BOMB))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, true, -SPELL_LAVA_BOMB))
|
||||
DoCast(target, SPELL_LAVA_BOMB);
|
||||
events.ScheduleEvent(EVENT_LAVA_BOMB, 12000);
|
||||
break;
|
||||
|
||||
+1
-1
@@ -151,7 +151,7 @@ class boss_majordomo : public CreatureScript
|
||||
me->AttackStop();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(true);
|
||||
events.ScheduleEvent(EVENT_OUTRO_1, 32000);
|
||||
return;
|
||||
|
||||
@@ -248,7 +248,7 @@ class boss_ragnaros : public CreatureScript
|
||||
//is not very well supported in the core //no it really isnt
|
||||
//so added normaly spawning and banish workaround and attack again after 90 secs.
|
||||
me->AttackStop();
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
//Root self
|
||||
|
||||
@@ -82,7 +82,7 @@ class boss_shazzrah : public CreatureScript
|
||||
DoCastVictim(SPELL_ARCANE_EXPLOSION);
|
||||
break;
|
||||
case EVENT_SHAZZRAH_CURSE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_SHAZZRAH_CURSE))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, true, -SPELL_SHAZZRAH_CURSE))
|
||||
DoCast(target, SPELL_SHAZZRAH_CURSE);
|
||||
events.ScheduleEvent(EVENT_SHAZZRAH_CURSE, urand(25000, 30000));
|
||||
break;
|
||||
@@ -95,7 +95,7 @@ class boss_shazzrah : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_COUNTERSPELL, urand(16000, 20000));
|
||||
break;
|
||||
case EVENT_SHAZZRAH_GATE:
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
DoCastAOE(SPELL_SHAZZRAH_GATE_DUMMY);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION_TRIGGERED, 2000);
|
||||
events.RescheduleEvent(EVENT_ARCANE_EXPLOSION, urand(3000, 6000));
|
||||
|
||||
+2
-2
@@ -184,12 +184,12 @@ class npc_flamewaker_priest : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_HEAL, urand(15000, 20000));
|
||||
break;
|
||||
case EVENT_SHADOW_WORD_PAIN:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_SHADOWWORDPAIN))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, true, -SPELL_SHADOWWORDPAIN))
|
||||
DoCast(target, SPELL_SHADOWWORDPAIN);
|
||||
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(18000, 26000));
|
||||
break;
|
||||
case EVENT_IMMOLATE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_IMMOLATE))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, true, -SPELL_IMMOLATE))
|
||||
DoCast(target, SPELL_IMMOLATE);
|
||||
events.ScheduleEvent(EVENT_IMMOLATE, urand(15000, 25000));
|
||||
break;
|
||||
|
||||
@@ -241,11 +241,11 @@ struct boss_glubtok : public BossAI
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_BLINK:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, true))
|
||||
{
|
||||
DoCast(target, SPELL_BLINK);
|
||||
if (IsHeroic())
|
||||
me->getThreatManager().resetAllAggro();
|
||||
me->GetThreatManager().resetAllAggro();
|
||||
|
||||
events.ScheduleEvent(EVENT_ELEMENTAL_FISTS, 800ms, 0, PHASE_1);
|
||||
events.Repeat(13s, 14s);
|
||||
|
||||
@@ -760,7 +760,7 @@ class spell_helix_ride_face_targeting : public SpellScript
|
||||
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
caster->getThreatManager().resetAllAggro();
|
||||
caster->GetThreatManager().ResetAllThreat();
|
||||
caster->CastSpell(caster, SPELL_HELIX_RIDE_FACE_TIMER_AURA);
|
||||
caster->CastSpell(target, GetSpellInfo()->Effects[effIndex].BasePoints, true);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ struct npc_deadmines_defias_watcher : public ScriptedAI
|
||||
{
|
||||
if (!_isOnFire && me->HealthBelowPctDamaged(30, damage))
|
||||
{
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop();
|
||||
me->SetFaction(FACTION_CONTROLLABLE);
|
||||
DoCastSelf(SPELL_ON_FIRE);
|
||||
|
||||
@@ -212,11 +212,7 @@ public:
|
||||
continue;
|
||||
|
||||
if (player->IsAlive())
|
||||
{
|
||||
temp->SetInCombatWith(player);
|
||||
player->SetInCombatWith(temp);
|
||||
temp->AddThreat(player, 0.0f);
|
||||
}
|
||||
AddThreat(player, 0.0f, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ class npc_drahga_valiona : public CreatureScript
|
||||
DoCast(SPELL_DEVOURING_FLAMES_AOE);
|
||||
_events.ScheduleEvent(EVENT_DEVOURING_FLAMES_CAST, Milliseconds(400));
|
||||
}
|
||||
else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0))
|
||||
else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
DoCast(target, SPELL_VALIONAS_FLAME);
|
||||
|
||||
_events.Repeat(Seconds(25));
|
||||
@@ -503,11 +503,11 @@ class npc_drahga_invoked_flaming_spirit : public CreatureScript
|
||||
{
|
||||
case EVENT_CHASE_PLAYER:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
{
|
||||
DoCast(target, SPELL_FLAMING_FIXATE, true);
|
||||
AttackStart(target);
|
||||
me->AddThreat(target, 1500500.0f);
|
||||
AddThreat(target, 1500500.0f);
|
||||
me->ClearUnitState(UNIT_STATE_CASTING);
|
||||
me->GetMotionMaster()->MovePoint(0, target->GetPosition(), true);
|
||||
_events.ScheduleEvent(EVENT_REPEAT_MOVEMENT, Seconds(1));
|
||||
|
||||
@@ -226,7 +226,7 @@ class boss_erudax : public CreatureScript
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_BINDING_SHADOWS:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, true, 0, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.f, true))
|
||||
DoCast(target, SPELL_BINDING_SHADOWS);
|
||||
break;
|
||||
case EVENT_ENFEEBLING_BLOW:
|
||||
@@ -375,7 +375,7 @@ class npc_erudax_faceless_corruptor : public CreatureScript
|
||||
me->AI()->AttackStart(player);
|
||||
break;
|
||||
case EVENT_SIPHON_ESSENCE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
DoCast(target, SPELL_SIPHON_ESSENCE);
|
||||
_events.Repeat(Seconds(11));
|
||||
break;
|
||||
|
||||
@@ -116,7 +116,7 @@ struct npc_grim_batol_twilight_beguiler : public ScriptedAI
|
||||
}
|
||||
break;
|
||||
case EVENT_DECEITFUL_BLAST:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 25.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 25.0f, true))
|
||||
DoCast(target, SPELL_DECEITFUL_BLAST);
|
||||
|
||||
if (_events.GetTimeUntilEvent(EVENT_CHAINED_MIND) > 4 * IN_MILLISECONDS)
|
||||
@@ -125,7 +125,7 @@ struct npc_grim_batol_twilight_beguiler : public ScriptedAI
|
||||
_events.Repeat(11s, 12s);
|
||||
break;
|
||||
case EVENT_CHAINED_MIND:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 25.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 25.0f, true))
|
||||
DoCast(target, SPELL_CHAINED_MIND);
|
||||
_events.Repeat(18s, 27s);
|
||||
break;
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_HATEFUL_BOLT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXTHREAT, 1))
|
||||
DoCast(target, SPELL_HATEFUL_BOLT);
|
||||
events.Repeat(Seconds(7), Seconds(15));
|
||||
break;
|
||||
|
||||
@@ -172,12 +172,11 @@ public:
|
||||
scheduler.Schedule(Seconds(10), Seconds(25), [this](TaskContext task)
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
std::vector<Unit*> target_list;
|
||||
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr != t_list.end(); ++itr)
|
||||
for (auto* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
{
|
||||
target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
target = ref->GetVictim();
|
||||
if (target && !target->IsWithinDist(me, 8.00f, false) && target->IsWithinDist(me, 25.0f, false))
|
||||
target_list.push_back(target);
|
||||
|
||||
|
||||
@@ -294,14 +294,8 @@ public:
|
||||
|
||||
if (Blind_Timer <= diff)
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
SelectTargetList(targets, 5, SELECT_TARGET_RANDOM, me->GetCombatReach()*5, true);
|
||||
for (std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
|
||||
if (!me->IsWithinMeleeRange(*i))
|
||||
{
|
||||
DoCast(*i, SPELL_BLIND);
|
||||
break;
|
||||
}
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MINDISTANCE, 0, 0.0f, true, false))
|
||||
DoCast(target, SPELL_BLIND);
|
||||
Blind_Timer = 40000;
|
||||
} else Blind_Timer -= diff;
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
}
|
||||
// aggro target if Red Beam
|
||||
if (j == RED_PORTAL && me->GetVictim() != target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
me->getThreatManager().addThreat(target, 100000.0f+DoGetThreat(me->GetVictim()));
|
||||
AddThreat(target, 100000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ public:
|
||||
me->GetMotionMaster()->MoveAlongSplineChain(POINT_INTRO_END, SPLINE_CHAIN_INTRO_END, false);
|
||||
break;
|
||||
case EVENT_RAIN_OF_BONES:
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
{
|
||||
me->SetFacingToObject(target);
|
||||
|
||||
@@ -310,18 +310,18 @@ public:
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
ThreatContainer::StorageType const& t_list = me->getThreatManager().getThreatList();
|
||||
if (t_list.empty())
|
||||
return;
|
||||
|
||||
Unit* tank = me->GetThreatManager().GetCurrentVictim();
|
||||
std::vector<Unit*> targets;
|
||||
//begin + 1, so we don't target the one with the highest threat
|
||||
ThreatContainer::StorageType::const_iterator itr = t_list.begin();
|
||||
std::advance(itr, 1);
|
||||
for (; itr != t_list.end(); ++itr) //store the threat list in a different container
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
if (target->IsAlive() && target->GetTypeId() == TYPEID_PLAYER)
|
||||
targets.push_back(target);
|
||||
|
||||
for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
{
|
||||
Unit* target = ref->GetVictim();
|
||||
if (target != tank && target->IsAlive() && target->GetTypeId() == TYPEID_PLAYER)
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
//cut down to size if we have more than 5 targets
|
||||
while (targets.size() > 5)
|
||||
@@ -447,9 +447,7 @@ public:
|
||||
if (target)
|
||||
{
|
||||
axe->AI()->AttackStart(target);
|
||||
//axe->getThreatManager().tauntApply(target); //Taunt Apply and fade out does not work properly
|
||||
// So we'll use a hack to add a lot of threat to our target
|
||||
axe->AddThreat(target, 10000000.0f);
|
||||
AddThreat(target, 10000000.0f, axe);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -485,11 +483,9 @@ public:
|
||||
if (Unit* axe = ObjectAccessor::GetUnit(*me, axes[i]))
|
||||
{
|
||||
if (axe->GetVictim())
|
||||
DoModifyThreatPercent(axe->GetVictim(), -100);
|
||||
ResetThreat(axe->GetVictim(), axe);
|
||||
if (target)
|
||||
axe->AddThreat(target, 1000000.0f);
|
||||
//axe->getThreatManager().tauntFadeOut(axe->GetVictim());
|
||||
//axe->getThreatManager().tauntApply(target);
|
||||
AddThreat(target, 1000000.0f, axe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,19 +178,12 @@ public:
|
||||
|
||||
void FlameWreathEffect()
|
||||
{
|
||||
ThreatContainer::StorageType const& t_list = me->getThreatManager().getThreatList();
|
||||
if (t_list.empty())
|
||||
return;
|
||||
|
||||
std::vector<Unit*> targets;
|
||||
//store the threat list in a different container
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
//only on alive players
|
||||
if (target && target->IsAlive() && target->GetTypeId() == TYPEID_PLAYER)
|
||||
targets.push_back(target);
|
||||
}
|
||||
for (auto* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
if (Player* target = ref->GetVictim()->ToPlayer())
|
||||
if (target->IsAlive())
|
||||
targets.push_back(target);
|
||||
|
||||
//cut down to size if we have more than 3 targets
|
||||
while (targets.size() > 3)
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
events.Repeat(Seconds(42));
|
||||
break;
|
||||
case EVENT_SHADOWBOLT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXTHREAT, 0))
|
||||
DoCast(target, SPELL_SHADOW_BOLT);
|
||||
events.Repeat(Seconds(4), Seconds(10));
|
||||
break;
|
||||
|
||||
@@ -919,11 +919,11 @@ public:
|
||||
{
|
||||
Talk(SAY_WOLF_HOOD);
|
||||
DoCast(target, SPELL_LITTLE_RED_RIDING_HOOD, true);
|
||||
TempThreat = DoGetThreat(target);
|
||||
TempThreat = GetThreat(target);
|
||||
if (TempThreat)
|
||||
DoModifyThreatPercent(target, -100);
|
||||
ModifyThreatByPercent(target, -100);
|
||||
HoodGUID = target->GetGUID();
|
||||
me->AddThreat(target, 1000000.0f);
|
||||
AddThreat(target, 1000000.0f);
|
||||
ChaseTimer = 20000;
|
||||
IsChasing = true;
|
||||
}
|
||||
@@ -935,9 +935,9 @@ public:
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, HoodGUID))
|
||||
{
|
||||
HoodGUID.Clear();
|
||||
if (DoGetThreat(target))
|
||||
DoModifyThreatPercent(target, -100);
|
||||
me->AddThreat(target, TempThreat);
|
||||
if (GetThreat(target))
|
||||
ModifyThreatByPercent(target, -100);
|
||||
AddThreat(target, TempThreat);
|
||||
TempThreat = 0;
|
||||
}
|
||||
|
||||
@@ -1252,7 +1252,7 @@ public:
|
||||
Julianne->GetMotionMaster()->Clear();
|
||||
Julianne->setDeathState(JUST_DIED);
|
||||
Julianne->CombatStop(true);
|
||||
Julianne->DeleteThreatList();
|
||||
Julianne->GetThreatManager().ClearAllThreat();
|
||||
Julianne->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
return;
|
||||
@@ -1280,7 +1280,7 @@ public:
|
||||
Creature* Julianne = (ObjectAccessor::GetCreature((*me), JulianneGUID));
|
||||
if (Julianne && Julianne->GetVictim())
|
||||
{
|
||||
me->AddThreat(Julianne->GetVictim(), 1.0f);
|
||||
AddThreat(Julianne->GetVictim(), 1.0f);
|
||||
AttackStart(Julianne->GetVictim());
|
||||
}
|
||||
}
|
||||
@@ -1527,7 +1527,7 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &dama
|
||||
Romulo->GetMotionMaster()->Clear();
|
||||
Romulo->setDeathState(JUST_DIED);
|
||||
Romulo->CombatStop(true);
|
||||
Romulo->DeleteThreatList();
|
||||
Romulo->GetThreatManager().ClearAllThreat();
|
||||
Romulo->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ struct boss_felblood_kaelthas : public BossAI
|
||||
switch (summon->GetEntry())
|
||||
{
|
||||
case NPC_ARCANE_SPHERE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70.0f, true, true, 0))
|
||||
summon->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f);
|
||||
break;
|
||||
case NPC_FLAME_STRIKE:
|
||||
@@ -300,7 +300,7 @@ struct boss_felblood_kaelthas : public BossAI
|
||||
break;
|
||||
case EVENT_FLAME_STRIKE:
|
||||
Talk(SAY_FLAME_STRIKE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true, true, 0))
|
||||
DoCast(target, SPELL_FLAME_STRIKE);
|
||||
events.Repeat(44s);
|
||||
break;
|
||||
@@ -312,7 +312,7 @@ struct boss_felblood_kaelthas : public BossAI
|
||||
events.Repeat(1min);
|
||||
break;
|
||||
case EVENT_PYROBLAST:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true, true, 0))
|
||||
DoCast(target, SPELL_PYROBLAST);
|
||||
break;
|
||||
case EVENT_PHOENIX:
|
||||
|
||||
@@ -163,16 +163,9 @@ public:
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
{
|
||||
if (Unit* pAdd = ObjectAccessor::GetUnit(*me, m_auiLackeyGUID[i]))
|
||||
{
|
||||
if (!pAdd->GetVictim())
|
||||
{
|
||||
who->SetInCombatWith(pAdd);
|
||||
pAdd->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!pAdd->IsEngaged())
|
||||
AddThreat(who, 0.0f, pAdd);
|
||||
|
||||
instance->SetBossState(DATA_PRIESTESS_DELRISSA, IN_PROGRESS);
|
||||
}
|
||||
@@ -401,25 +394,14 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
return;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
{
|
||||
if (Unit* pAdd = ObjectAccessor::GetUnit(*me, m_auiLackeyGUIDs[i]))
|
||||
{
|
||||
if (!pAdd->GetVictim() && pAdd != me)
|
||||
{
|
||||
who->SetInCombatWith(pAdd);
|
||||
pAdd->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!pAdd->IsEngaged() && pAdd != me)
|
||||
AddThreat(who, 0.0f, pAdd);
|
||||
|
||||
if (Creature* delrissa = instance->GetCreature(DATA_PRIESTESS_DELRISSA))
|
||||
{
|
||||
if (delrissa->IsAlive() && !delrissa->GetVictim())
|
||||
{
|
||||
who->SetInCombatWith(delrissa);
|
||||
delrissa->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
if (Creature* pDelrissa = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_PRIESTESS_DELRISSA)))
|
||||
if (pDelrissa->IsAlive() && !pDelrissa->IsEngaged())
|
||||
AddThreat(who, 0.0f, pDelrissa);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
@@ -476,7 +458,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
|
||||
if (ResetThreatTimer <= diff)
|
||||
{
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
ResetThreatTimer = urand(5000, 20000);
|
||||
} else ResetThreatTimer -= diff;
|
||||
}
|
||||
@@ -543,10 +525,10 @@ public:
|
||||
|
||||
Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
|
||||
if (unit)
|
||||
me->AddThreat(unit, 1000.0f);
|
||||
AddThreat(unit, 1000.0f);
|
||||
|
||||
InVanish = true;
|
||||
Vanish_Timer = 30000;
|
||||
@@ -868,7 +850,7 @@ public:
|
||||
if (Blink_Timer <= diff)
|
||||
{
|
||||
bool InMeleeRange = false;
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const &t_list = me->GetThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
@@ -962,7 +944,7 @@ public:
|
||||
if (Intercept_Stun_Timer <= diff)
|
||||
{
|
||||
bool InMeleeRange = false;
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const &t_list = me->GetThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
|
||||
+17
-21
@@ -434,7 +434,7 @@ public:
|
||||
|
||||
if (me->Attack(who, true))
|
||||
{
|
||||
me->AddThreat(who, 0.0f);
|
||||
AddThreat(who, 0.0f);
|
||||
me->SetInCombatWith(who);
|
||||
who->SetInCombatWith(me);
|
||||
DoStartMovement(who);
|
||||
@@ -1388,7 +1388,7 @@ public:
|
||||
if (me->HasAura(SPELL_THE_MIGHT_OF_MOGRAINE))
|
||||
me->RemoveAurasDueToSpell(SPELL_THE_MIGHT_OF_MOGRAINE);
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(true);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
me->SetWalk(false);
|
||||
@@ -1409,7 +1409,7 @@ public:
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKorfaxGUID))
|
||||
{
|
||||
temp->RemoveAllAuras();
|
||||
temp->DeleteThreatList();
|
||||
temp->GetThreatManager().ClearAllThreat();
|
||||
temp->CombatStop(true);
|
||||
temp->AttackStop();
|
||||
temp->SetFaction(me->GetFaction());
|
||||
@@ -1420,7 +1420,7 @@ public:
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiMaxwellGUID))
|
||||
{
|
||||
temp->RemoveAllAuras();
|
||||
temp->DeleteThreatList();
|
||||
temp->GetThreatManager().ClearAllThreat();
|
||||
temp->CombatStop(true);
|
||||
temp->AttackStop();
|
||||
temp->SetFaction(me->GetFaction());
|
||||
@@ -1431,7 +1431,7 @@ public:
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiEligorGUID))
|
||||
{
|
||||
temp->RemoveAllAuras();
|
||||
temp->DeleteThreatList();
|
||||
temp->GetThreatManager().ClearAllThreat();
|
||||
temp->CombatStop(true);
|
||||
temp->AttackStop();
|
||||
temp->SetFaction(me->GetFaction());
|
||||
@@ -1443,7 +1443,7 @@ public:
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKoltiraGUID))
|
||||
{
|
||||
temp->RemoveAllAuras();
|
||||
temp->DeleteThreatList();
|
||||
temp->GetThreatManager().ClearAllThreat();
|
||||
temp->CombatStop(true);
|
||||
temp->AttackStop();
|
||||
temp->SetFaction(me->GetFaction());
|
||||
@@ -1458,7 +1458,7 @@ public:
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiThassarianGUID))
|
||||
{
|
||||
temp->RemoveAllAuras();
|
||||
temp->DeleteThreatList();
|
||||
temp->GetThreatManager().ClearAllThreat();
|
||||
temp->CombatStop(true);
|
||||
temp->AttackStop();
|
||||
temp->SetFaction(me->GetFaction());
|
||||
@@ -1488,15 +1488,11 @@ public:
|
||||
{
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, ui_GUID))
|
||||
if (temp->IsAlive())
|
||||
if (Unit* pTarger = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (pTarger->IsAlive())
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (pTarget->IsAlive())
|
||||
{
|
||||
// temp->DeleteThreatList();
|
||||
temp->AddThreat(pTarger, 0.0f);
|
||||
temp->AI()->AttackStart(pTarger);
|
||||
temp->SetInCombatWith(pTarger);
|
||||
pTarger->SetInCombatWith(temp);
|
||||
// temp->GetMotionMaster()->MoveChase(pTarger, 20.0f);
|
||||
AddThreat(pTarget, 0.0f, temp);
|
||||
temp->AI()->AttackStart(pTarget);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1554,7 +1550,7 @@ public:
|
||||
{
|
||||
temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->SetFaction(FACTION_SCARLET_CRUSADE);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
AddThreat(temp, 0.0f);
|
||||
uiDefenderGUID[i] = temp->GetGUID();
|
||||
}
|
||||
}
|
||||
@@ -1565,7 +1561,7 @@ public:
|
||||
{
|
||||
temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->SetFaction(FACTION_SCARLET_CRUSADE);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
AddThreat(temp, 0.0f);
|
||||
uiEarthshatterGUID[i] = temp->GetGUID();
|
||||
}
|
||||
}
|
||||
@@ -1574,7 +1570,7 @@ public:
|
||||
{
|
||||
temp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
|
||||
temp->SetFaction(FACTION_SCARLET_CRUSADE);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
AddThreat(temp, 0.0f);
|
||||
uiKorfaxGUID = temp->GetGUID();
|
||||
}
|
||||
temp = ObjectAccessor::GetCreature(*me, uiMaxwellGUID);
|
||||
@@ -1582,7 +1578,7 @@ public:
|
||||
{
|
||||
temp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
|
||||
temp->SetFaction(FACTION_SCARLET_CRUSADE);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
AddThreat(temp, 0.0f);
|
||||
uiMaxwellGUID = temp->GetGUID();
|
||||
}
|
||||
temp = ObjectAccessor::GetCreature(*me, uiEligorGUID);
|
||||
@@ -1590,7 +1586,7 @@ public:
|
||||
{
|
||||
temp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
|
||||
temp->SetFaction(FACTION_SCARLET_CRUSADE);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
AddThreat(temp, 0.0f);
|
||||
uiEligorGUID = temp->GetGUID();
|
||||
}
|
||||
temp = ObjectAccessor::GetCreature(*me, uiRayneGUID);
|
||||
@@ -1598,7 +1594,7 @@ public:
|
||||
{
|
||||
temp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000);
|
||||
temp->SetFaction(FACTION_SCARLET_CRUSADE);
|
||||
me->AddThreat(temp, 0.0f);
|
||||
AddThreat(temp, 0.0f);
|
||||
uiRayneGUID = temp->GetGUID();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ struct boss_bloodmage_thalnos : public BossAI
|
||||
ScheduleNextEvent();
|
||||
break;
|
||||
case EVENT_FLAME_SHOCK:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.f, true, -SPELL_FLAME_SHOCK))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.f, true, true, -SPELL_FLAME_SHOCK))
|
||||
DoCast(target, SPELL_FLAME_SHOCK);
|
||||
else
|
||||
DoCastVictim(SPELL_FLAME_SHOCK);
|
||||
|
||||
@@ -600,14 +600,6 @@ public:
|
||||
DoCast(me, SPELL_HEAD);
|
||||
caster->GetMotionMaster()->Clear(false);
|
||||
caster->GetMotionMaster()->MoveFollow(me, 6, float(urand(0, 5)));
|
||||
//DoResetThreat();//not sure if need
|
||||
ThreatContainer::StorageType threatlist = caster->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (unit && unit->IsAlive() && unit != caster)
|
||||
me->AddThreat(unit, caster->getThreatManager().getThreat(unit));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -857,7 +849,7 @@ public:
|
||||
if (!who || !me->IsValidAttackTarget(who) || me->GetVictim())
|
||||
return;
|
||||
|
||||
me->AddThreat(who, 0.0f);
|
||||
AddThreat(who, 0.0f);
|
||||
if (sprouted)
|
||||
DoStartMovement(who);
|
||||
}
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ public:
|
||||
//Sleep_Timer
|
||||
if (Sleep_Timer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXTHREAT, 0))
|
||||
DoCast(target, SPELL_SLEEP);
|
||||
|
||||
Sleep_Timer = 30000;
|
||||
|
||||
@@ -90,7 +90,7 @@ struct boss_interrogator_vishas : public BossAI
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SHADOW_WORD_PAIN:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.f, true, -SPELL_SHADOW_WORD_PAIN))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.f, true, true, -SPELL_SHADOW_WORD_PAIN))
|
||||
DoCast(target, SPELL_SHADOW_WORD_PAIN);
|
||||
events.Repeat(7s, 11s);
|
||||
break;
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
DoCast(SPELL_ILLUSION);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetDisplayId(11686); // Invisible Model
|
||||
DoModifyThreatPercent(me->GetVictim(), -99);
|
||||
ModifyThreatByPercent(me->GetVictim(), -99);
|
||||
events.ScheduleEvent(EVENT_SET_VISIBILITY, 3000);
|
||||
events.ScheduleEvent(EVENT_ILLUSION, 25000);
|
||||
break;
|
||||
|
||||
@@ -439,7 +439,7 @@ public:
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SPECTRAL_RUSH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 0.0f, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXDISTANCE, 0, 50.0f, true))
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_SPECTRAL_RAVAGING, Milliseconds(500));
|
||||
DoCast(target, SPELL_SPECTRAL_RUSH);
|
||||
@@ -519,7 +519,7 @@ public:
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SOUL_DRAIN:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
DoCast(target, SPELL_SOUL_DRAIN);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -265,7 +265,7 @@ public:
|
||||
case EVENT_WORD_OF_SHAME:
|
||||
me->RemoveAurasDueToSpell(SPELL_UNHOLY_POWER);
|
||||
me->RemoveAurasDueToSpell(SPELL_UNHOLY_POWER_HC);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_WORD_OF_SHAME))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, true, -SPELL_WORD_OF_SHAME))
|
||||
DoCast(target, SPELL_WORD_OF_SHAME, true);
|
||||
else
|
||||
events.ScheduleEvent(EVENT_SHIELD_OF_THE_PERFIDIOUS, Milliseconds(1));
|
||||
@@ -376,7 +376,7 @@ public:
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_FORSAKEN_ABILITY:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
DoCast(target, SPELL_FORSAKEN_ABILITY);
|
||||
break;
|
||||
case EVENT_UNHOLY_EMPOWERMENT:
|
||||
|
||||
@@ -197,7 +197,7 @@ struct boss_lord_godfrey : public BossAI
|
||||
{
|
||||
case EVENT_CURSED_BULLETS:
|
||||
me->MakeInterruptable(true);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
DoCast(target, SPELL_CURSED_BULLETS);
|
||||
events.Repeat(12s);
|
||||
break;
|
||||
|
||||
@@ -197,7 +197,7 @@ struct boss_lord_walden : public BossAI
|
||||
events.Repeat(45s);
|
||||
break;
|
||||
case EVENT_CONJURE_POISONOUS_MIXTURE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
DoCast(target, SPELL_CONJURE_POISONOUS_MIXTURE);
|
||||
events.Repeat(31s);
|
||||
break;
|
||||
@@ -270,7 +270,7 @@ class spell_walden_ice_shards : public AuraScript
|
||||
return;
|
||||
|
||||
if (caster->IsAIEnabled)
|
||||
if (Unit* target = caster->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
if (Unit* target = caster->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
caster->CastSpell(target, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -322,14 +322,8 @@ public:
|
||||
|
||||
if (BurnTimer <= diff)
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
SelectTargetList(targets, 10, SELECT_TARGET_RANDOM, 100, true);
|
||||
for (std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
|
||||
if (!(*i)->HasAura(SPELL_BURN))
|
||||
{
|
||||
(*i)->CastSpell((*i), SPELL_BURN, true);
|
||||
break;
|
||||
}
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, true, -SPELL_BURN))
|
||||
target->CastSpell(target, SPELL_BURN, true);
|
||||
BurnTimer = urand(60000, 180000);
|
||||
} else BurnTimer -= diff;
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
if (temp->isDead())
|
||||
temp->Respawn();
|
||||
else if (temp->GetVictim())
|
||||
me->getThreatManager().addThreat(temp->GetVictim(), 0.0f);
|
||||
AddThreat(temp->GetVictim(), 0.0f);
|
||||
}
|
||||
|
||||
if (!me->IsInCombat())
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
temp = DoSpawnCreature(NPC_SHADOW_IMAGE, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 10000);
|
||||
if (temp && target)
|
||||
{
|
||||
temp->AddThreat(target, 1000000); //don't change target(healers)
|
||||
AddThreat(target, 1000000.0f, temp); //don't change target(healers)
|
||||
temp->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
@@ -373,7 +373,7 @@ public:
|
||||
if (temp->isDead())
|
||||
temp->Respawn();
|
||||
else if (temp->GetVictim())
|
||||
me->getThreatManager().addThreat(temp->GetVictim(), 0.0f);
|
||||
AddThreat(temp->GetVictim(), 0.0f);
|
||||
}
|
||||
|
||||
if (!me->IsInCombat())
|
||||
@@ -551,7 +551,7 @@ public:
|
||||
Creature* sisiter = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_SACROLASH));
|
||||
if (sisiter && !sisiter->isDead() && sisiter->GetVictim())
|
||||
{
|
||||
me->AddThreat(sisiter->GetVictim(), 0.0f);
|
||||
AddThreat(sisiter->GetVictim(), 0.0f);
|
||||
DoStartNoMovement(sisiter->GetVictim());
|
||||
me->Attack(sisiter->GetVictim(), false);
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ public:
|
||||
uiFlightCount = 4;
|
||||
break;
|
||||
case 9:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXTHREAT))
|
||||
DoStartMovement(target);
|
||||
else
|
||||
{
|
||||
@@ -397,7 +397,7 @@ public:
|
||||
me->SetDisableGravity(false);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
|
||||
EnterPhase(PHASE_GROUND);
|
||||
AttackStart(SelectTarget(SELECT_TARGET_TOPAGGRO));
|
||||
AttackStart(SelectTarget(SELECT_TARGET_MAXTHREAT));
|
||||
break;
|
||||
}
|
||||
++uiFlightCount;
|
||||
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop();
|
||||
++TalkSequence;
|
||||
}
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
|
||||
if (SpectralBlastTimer <= diff)
|
||||
{
|
||||
ThreatContainer::StorageType const& m_threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& m_threatlist = me->GetThreatManager().getThreatList();
|
||||
std::list<Unit*> targetList;
|
||||
for (ThreatContainer::StorageType::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
|
||||
{
|
||||
@@ -640,7 +640,7 @@ public:
|
||||
{
|
||||
KalecGUID = Kalec->GetGUID();
|
||||
me->CombatStart(Kalec);
|
||||
me->AddThreat(Kalec, 100.0f);
|
||||
AddThreat(Kalec, 100.0f);
|
||||
Kalec->setActive(true);
|
||||
}
|
||||
Talk(SAY_SATH_AGGRO);
|
||||
@@ -767,12 +767,12 @@ public:
|
||||
|
||||
if (ResetThreat <= diff)
|
||||
{
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatlist = me->GetThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
if (Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
if (unit->GetPositionZ() > me->GetPositionZ() + 5)
|
||||
me->getThreatManager().modifyThreatPercent(unit, -100);
|
||||
me->GetThreatManager().ModifyThreatByPercent(unit, -100);
|
||||
}
|
||||
ResetThreat = 1000;
|
||||
} else ResetThreat -= diff;
|
||||
|
||||
@@ -468,7 +468,7 @@ public:
|
||||
break;
|
||||
case NPC_KILJAEDEN:
|
||||
summoned->CastSpell(summoned, SPELL_REBIRTH, false);
|
||||
summoned->AddThreat(me->GetVictim(), 1.0f);
|
||||
AddThreat(me->GetVictim(), 1.0f, summoned);
|
||||
break;
|
||||
}
|
||||
summons.Summon(summoned);
|
||||
@@ -674,7 +674,7 @@ public:
|
||||
Talk(SAY_KJ_REFLECTION);
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, -SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, true, -SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT))
|
||||
{
|
||||
float x, y, z;
|
||||
target->GetPosition(x, y, z);
|
||||
@@ -959,7 +959,7 @@ public:
|
||||
{
|
||||
instance->SetBossState(DATA_KILJAEDEN, IN_PROGRESS);
|
||||
if (Creature* pControl = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_KILJAEDEN_CONTROLLER)))
|
||||
pControl->AddThreat(who, 1.0f);
|
||||
AddThreat(who, 1.0f, pControl);
|
||||
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
}
|
||||
@@ -995,15 +995,8 @@ public:
|
||||
if (FelfirePortalTimer <= diff)
|
||||
{
|
||||
if (Creature* pPortal = DoSpawnCreature(NPC_FELFIRE_PORTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 20000))
|
||||
{
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (unit)
|
||||
pPortal->AddThreat(unit, 1.0f);
|
||||
}
|
||||
}
|
||||
for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
AddThreat(ref->GetVictim(), 1.0f, pPortal);
|
||||
FelfirePortalTimer = 20000;
|
||||
} else FelfirePortalTimer -= diff;
|
||||
|
||||
@@ -1058,7 +1051,7 @@ public:
|
||||
if (uiSpawnFiendTimer <= diff)
|
||||
{
|
||||
if (Creature* pFiend = DoSpawnCreature(NPC_VOLATILE_FELFIRE_FIEND, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000))
|
||||
pFiend->AddThreat(SelectTarget(SELECT_TARGET_RANDOM, 0), 100000.0f);
|
||||
AddThreat(SelectTarget(SELECT_TARGET_RANDOM, 0), 100000.0f, pFiend);
|
||||
uiSpawnFiendTimer = urand(4000, 8000);
|
||||
} else uiSpawnFiendTimer -= diff;
|
||||
}
|
||||
@@ -1111,7 +1104,7 @@ public:
|
||||
|
||||
if (!bLockedTarget)
|
||||
{
|
||||
me->AddThreat(me->GetVictim(), 10000000.0f);
|
||||
AddThreat(me->GetVictim(), 10000000.0f);
|
||||
bLockedTarget = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ struct boss_commander_ulthok : public BossAI
|
||||
events.Repeat(32s, 33s);
|
||||
break;
|
||||
case EVENT_CURSE_OF_FATIGUE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
DoCast(target, SPELL_CURSE_OF_FATIGUE);
|
||||
events.Repeat(18s, 23s);
|
||||
break;
|
||||
|
||||
@@ -306,12 +306,12 @@ struct boss_lady_nazjar : public BossAI
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SUMMON_GEYSER:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
DoCast(target, SPELL_SUMMON_GEYSER);
|
||||
events.Repeat(11s, 16s);
|
||||
break;
|
||||
case EVENT_FUNGAL_SPORES:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
DoCast(target, SPELL_FUNGAL_SPORES);
|
||||
events.Repeat(13s, 19s);
|
||||
break;
|
||||
@@ -440,7 +440,7 @@ struct npc_nazjar_nazjar_tempest_witch : public ScriptedAI
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_CHAIN_LIGHTNING:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
{
|
||||
me->MakeInterruptable(true);
|
||||
DoCast(target, SPELL_CHAIN_LIGHTNING);
|
||||
|
||||
@@ -626,7 +626,7 @@ struct npc_ozumat_vicious_mindlasher : public ScriptedAI
|
||||
DoCastAOE(SPELL_BRAIN_SPIKE);
|
||||
break;
|
||||
case EVENT_VEIL_OF_SHADOW:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
DoCast(target, SPELL_VEIL_OF_SHADOW);
|
||||
break;
|
||||
case EVENT_SHADOW_BOLT:
|
||||
|
||||
@@ -73,18 +73,10 @@ class boss_ironaya : public CreatureScript
|
||||
return;
|
||||
|
||||
//If we are <50% hp do knockaway ONCE
|
||||
if (!bHasCastKnockaway && HealthBelowPct(50))
|
||||
if (!bHasCastKnockaway && HealthBelowPct(50) && me->GetVictim())
|
||||
{
|
||||
DoCastVictim(SPELL_KNOCKAWAY, true);
|
||||
|
||||
// current aggro target is knocked away pick new target
|
||||
Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0);
|
||||
|
||||
if (!target || target == me->GetVictim())
|
||||
target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
|
||||
|
||||
if (target)
|
||||
me->TauntApply(target);
|
||||
me->GetThreatManager().ResetThreat(me->EnsureVictim());
|
||||
|
||||
//Shouldn't cast this agian
|
||||
bHasCastKnockaway = true;
|
||||
|
||||
@@ -89,13 +89,7 @@ class npc_jadespine_basilisk : public CreatureScript
|
||||
//Stop attacking target thast asleep and pick new target
|
||||
uiCslumberTimer = 28000;
|
||||
|
||||
Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0);
|
||||
|
||||
if (!target || target == me->GetVictim())
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
|
||||
if (target)
|
||||
me->TauntApply(target);
|
||||
me->GetThreatManager().ResetThreat(me->GetVictim());
|
||||
|
||||
} else uiCslumberTimer -= uiDiff;
|
||||
|
||||
|
||||
@@ -460,7 +460,7 @@ struct npc_akilzon_soaring_eagle : public PassiveAI
|
||||
_events.Repeat(3s + 500ms, 10s);
|
||||
break;
|
||||
case EVENT_EAGLE_SWOOP:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.f, true))
|
||||
DoCast(target, SPELL_EAGLE_SWOOP);
|
||||
_events.Repeat(5s, 6s);
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@ struct boss_high_priest_venoxis : public BossAI
|
||||
}
|
||||
break;
|
||||
case EVENT_WHISPERS_OF_HETHISS:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
{
|
||||
me->StopMoving();
|
||||
DoCast(target, SPELL_WHISPERS_OF_HETHISS);
|
||||
@@ -347,7 +347,7 @@ struct boss_high_priest_venoxis : public BossAI
|
||||
events.ScheduleEvent(EVENT_PREPARE_BLOODVENOM, 24s);
|
||||
break;
|
||||
case EVENT_POOL_OF_ACRID_TEARS:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 50.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXDISTANCE, 0, 50.0f, true))
|
||||
DoCast(target, SPELL_POOL_OF_ACRID_TEARS);
|
||||
events.Repeat(3s + 500ms);
|
||||
break;
|
||||
|
||||
@@ -284,7 +284,7 @@ struct boss_high_priestess_kilnara : public BossAI
|
||||
events.ScheduleEvent(EVENT_PREPARE_RAVAGE, 2s);
|
||||
break;
|
||||
case EVENT_PREPARE_RAVAGE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
AttackStart(target);
|
||||
events.ScheduleEvent(EVENT_RAVAGE_CAMOUFLAGE, 4s);
|
||||
break;
|
||||
|
||||
@@ -276,12 +276,12 @@ struct boss_zanzil : public BossAI
|
||||
{
|
||||
case EVENT_ZANZILI_FIRE:
|
||||
_zanziliFireCount = 0;
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
|
||||
DoCast(target, SPELL_ZANZILI_FIRE);
|
||||
events.Repeat(13s, 14s);
|
||||
break;
|
||||
case EVENT_TERRIBLE_TONIC:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
DoCast(target, SPELL_TERRIBLE_TONIC);
|
||||
events.Repeat(10s, 11s);
|
||||
break;
|
||||
@@ -433,8 +433,8 @@ struct npc_zanzil_zanzili_berserker : public ScriptedAI
|
||||
|
||||
if (spellInfo->Id == SPELL_PURSUIT)
|
||||
{
|
||||
me->getThreatManager().resetAllAggro();
|
||||
me->AddThreat(victim, spellInfo->Effects[EFFECT_1].BasePoints);
|
||||
me->GetThreatManager().resetAllAggro();
|
||||
AddThreat(victim, spellInfo->Effects[EFFECT_1].BasePoints);
|
||||
Talk(SAY_WHISPER_PURSUIT_PLAYER, victim);
|
||||
Talk(SAY_ANNOUNCE_PURSUIT_PLAYER, victim);
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ struct npc_zulgurub_venomguard_destroyer : public ScriptedAI
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
break;
|
||||
case EVENT_POOL_OF_ACRID_TEARS:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 50.0f, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXDISTANCE, 0, 50.0f, true))
|
||||
DoCast(target, SPELL_POOL_OF_ACRID_TEARS);
|
||||
_events.Repeat(13s, 14s);
|
||||
break;
|
||||
@@ -599,8 +599,8 @@ struct npc_zulgurub_gurubashi_berserker: public ScriptedAI
|
||||
|
||||
if (spellInfo->Id == SPELL_PURSUIT)
|
||||
{
|
||||
me->getThreatManager().resetAllAggro();
|
||||
me->AddThreat(victim, spellInfo->Effects[EFFECT_1].BasePoints);
|
||||
me->GetThreatManager().resetAllAggro();
|
||||
AddThreat(victim, spellInfo->Effects[EFFECT_1].BasePoints);
|
||||
Talk(SAY_WHISPER_PURSUIT_PLAYER, victim);
|
||||
Talk(SAY_ANNOUNCE_PURSUIT_PLAYER, victim);
|
||||
}
|
||||
@@ -619,7 +619,7 @@ struct npc_zulgurub_gurubashi_berserker: public ScriptedAI
|
||||
{
|
||||
case EVENT_PURSUIT:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true))
|
||||
DoCast(target, SPELL_PURSUIT);
|
||||
|
||||
_events.ScheduleEvent(EVENT_THUNDERCLAP, 7s);
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
|
||||
me->RestoreFaction();
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(true);
|
||||
|
||||
SetRun(false);
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
{
|
||||
me->SetInCombatWith(player);
|
||||
player->SetInCombatWith(me);
|
||||
me->AddThreat(player, 0.0f);
|
||||
AddThreat(player, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -422,7 +422,7 @@ void hyjalAI::EnterEvadeMode(EvadeReason /*why*/)
|
||||
{
|
||||
if (me->GetEntry() != JAINA)
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(true);
|
||||
me->LoadCreaturesAddon();
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -486,7 +486,7 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
} else if (instance->GetData(DATA_ALLIANCE_RETREAT) && instance->GetData(DATA_HORDE_RETREAT)){
|
||||
//do overrun
|
||||
}
|
||||
@@ -558,13 +558,13 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
if (waypointId == LastOverronPos && IsOverrun)
|
||||
@@ -656,13 +656,13 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
if (waypointId == LastOverronPos && IsOverrun)
|
||||
@@ -766,13 +766,13 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -878,13 +878,13 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -973,13 +973,13 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1058,13 +1058,13 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1150,7 +1150,7 @@ public:
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
{
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
DoCast(target, SPELL_FROST_BREATH, true);
|
||||
}
|
||||
}
|
||||
@@ -1271,7 +1271,7 @@ public:
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
{
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
DoCast(target, SPELL_GARGOYLE_STRIKE, true);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -299,10 +299,10 @@ public:
|
||||
if (Creature* boss = SummonedPortalBoss(temp))
|
||||
{
|
||||
if (boss->GetEntry() == NPC_AEONUS)
|
||||
boss->AddThreat(medivh, 0.0f);
|
||||
boss->GetThreatManager().AddThreat(medivh, 0.0f);
|
||||
else
|
||||
{
|
||||
boss->AddThreat(temp, 0.0f);
|
||||
boss->GetThreatManager().AddThreat(temp, 0.0f);
|
||||
temp->CastSpell(boss, SPELL_RIFT_CHANNEL, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ public:
|
||||
|
||||
if (Unit* Summon = DoSummon(creature_entry, pos, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
|
||||
if (Unit* temp = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_MEDIVH)))
|
||||
Summon->AddThreat(temp, 0.0f);
|
||||
AddThreat(temp, 0.0f, Summon);
|
||||
}
|
||||
|
||||
void DoSelectSummon()
|
||||
|
||||
@@ -226,7 +226,7 @@ class npc_harbinger_of_flame : public CreatureScript
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_FIEROBLAST:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, false, -SPELL_RIDE_MONSTROSITY))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, false, true, -SPELL_RIDE_MONSTROSITY))
|
||||
DoCast(target, SPELL_FIEROBLAST_TRASH);
|
||||
_events.RescheduleEvent(EVENT_FIEROBLAST, 500); // cast time is longer, but thanks to UNIT_STATE_CASTING check it won't trigger more often (need this because this creature gets a stacking haste aura)
|
||||
break;
|
||||
@@ -329,7 +329,7 @@ class npc_blazing_monstrosity : public CreatureScript
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_START_SPITTING:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, false, -SPELL_RIDE_MONSTROSITY))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, false, true, -SPELL_RIDE_MONSTROSITY))
|
||||
DoCast(target, SPELL_MOLTEN_BARRAGE);
|
||||
break;
|
||||
case EVENT_CONTINUE_SPITTING:
|
||||
@@ -626,8 +626,8 @@ class spell_alysrazor_aggro_closest : public SpellScriptLoader
|
||||
void HandleEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
float curThreat = GetCaster()->getThreatManager().getThreat(GetHitUnit(), true);
|
||||
GetCaster()->getThreatManager().addThreat(GetHitUnit(), -curThreat + 50000.0f / std::min(1.0f, GetCaster()->GetDistance(GetHitUnit())));
|
||||
float curThreat = GetCaster()->GetThreatManager().GetThreat(GetHitUnit(), true);
|
||||
GetCaster()->GetThreatManager().AddThreat(GetHitUnit(), -curThreat + 50000.0f / std::min(1.0f, GetCaster()->GetDistance(GetHitUnit())), GetSpellInfo(), true, true);
|
||||
}
|
||||
|
||||
void UpdateThreat()
|
||||
|
||||
@@ -178,7 +178,7 @@ class boss_setesh : public CreatureScript
|
||||
switch (pointId)
|
||||
{
|
||||
case POINT_CHANNEL_CHAOS_PORTAL:
|
||||
if (Unit* npcChaosPortal = SelectTarget(SELECT_TARGET_NEAREST, 0, 0.0f, false, SPELL_DUMMY_AURA))
|
||||
if (Unit* npcChaosPortal = SelectTarget(SELECT_TARGET_MINDISTANCE, 0, 0.0f, false, true, SPELL_DUMMY_AURA))
|
||||
DoCast(npcChaosPortal, SPELL_CHANNEL_CHAOS_PORTAL);
|
||||
events.ScheduleEvent(EVENT_CONTINUE_FIGHT, Seconds(5));
|
||||
break;
|
||||
@@ -248,7 +248,7 @@ class boss_setesh : public CreatureScript
|
||||
private:
|
||||
void StartChaosPortalPhase()
|
||||
{
|
||||
Unit* npcChaosPortal = SelectTarget(SELECT_TARGET_FARTHEST, 0, NPCEntryPred(NPC_SETESH_CHAOS_PORTAL));
|
||||
Unit* npcChaosPortal = SelectTarget(SELECT_TARGET_MAXDISTANCE, 0, NPCEntryPred(NPC_SETESH_CHAOS_PORTAL));
|
||||
if (!npcChaosPortal)
|
||||
return;
|
||||
|
||||
|
||||
@@ -243,12 +243,12 @@ public:
|
||||
events.Repeat(Seconds(40));
|
||||
break;
|
||||
case EVENT_PLAGUE_OF_AGES:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.f, true))
|
||||
DoCast(target, SPELL_PLAGUE_OF_AGES);
|
||||
events.Repeat(Seconds(25));
|
||||
break;
|
||||
case EVENT_HEAVENS_FURY:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.f, true))
|
||||
DoCast(target, SPELL_HEAVENS_FURY);
|
||||
events.Repeat(Seconds(22));
|
||||
break;
|
||||
@@ -416,7 +416,7 @@ public:
|
||||
_events.Repeat(Seconds(2) + Milliseconds(500));
|
||||
break;
|
||||
case EVENT_SOUL_SEVER:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.f, true))
|
||||
DoCast(target, SPELL_SOUL_SEVER);
|
||||
_events.Repeat(Seconds(11));
|
||||
break;
|
||||
|
||||
@@ -421,7 +421,7 @@ class npc_lockmaw_frenzied_crocolisk : public CreatureScript
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, ScentOfBloodTargetSelector()))
|
||||
{
|
||||
DoCastSelf(SPELL_STEALTHED);
|
||||
me->AddThreat(target, 50000000.0f);
|
||||
AddThreat(target, 50000000.0f);
|
||||
AttackStart(target);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -236,7 +236,7 @@ public:
|
||||
// tank selection based on phase one. If tank is not there i take nearest one
|
||||
if (Unit* tank = ObjectAccessor::GetUnit(*me, tankGUID))
|
||||
me->GetMotionMaster()->MoveChase(tank);
|
||||
else if (Unit* newtarget = SelectTarget(SELECT_TARGET_NEAREST, 0))
|
||||
else if (Unit* newtarget = SelectTarget(SELECT_TARGET_MINDISTANCE, 0))
|
||||
me->GetMotionMaster()->MoveChase(newtarget);
|
||||
events.ScheduleEvent(EVENT_BELLOWING_ROAR, 5000);
|
||||
events.ScheduleEvent(EVENT_FLAME_BREATH, urand(10000, 20000));
|
||||
|
||||
@@ -169,7 +169,7 @@ class boss_ayamiss : public CreatureScript
|
||||
Position VictimPos = me->EnsureVictim()->GetPosition();
|
||||
me->GetMotionMaster()->MovePoint(POINT_GROUND, VictimPos);
|
||||
}
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
events.ScheduleEvent(EVENT_LASH, urand(5000, 8000));
|
||||
events.ScheduleEvent(EVENT_TRASH, urand(3000, 6000));
|
||||
events.CancelEvent(EVENT_POISON_STINGER);
|
||||
|
||||
@@ -122,7 +122,7 @@ class boss_buru : public CreatureScript
|
||||
|
||||
if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
{
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
AttackStart(victim);
|
||||
Talk(EMOTE_TARGET, victim);
|
||||
}
|
||||
|
||||
@@ -148,10 +148,9 @@ class boss_moam : public CreatureScript
|
||||
{
|
||||
std::list<Unit*> targetList;
|
||||
{
|
||||
const std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
if ((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && (*itr)->getTarget()->GetPowerType() == POWER_MANA)
|
||||
targetList.push_back((*itr)->getTarget());
|
||||
for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
if (ref->GetVictim()->GetTypeId() == TYPEID_PLAYER && ref->GetVictim()->GetPowerType() == POWER_MANA)
|
||||
targetList.push_back(ref->GetVictim());
|
||||
}
|
||||
|
||||
Trinity::Containers::RandomResize(targetList, 5);
|
||||
|
||||
@@ -211,8 +211,8 @@ public:
|
||||
if (KnockBack_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_KNOCKBACK);
|
||||
if (DoGetThreat(me->GetVictim()))
|
||||
DoModifyThreatPercent(me->GetVictim(), -80);
|
||||
if (GetThreat(me->GetVictim()))
|
||||
ModifyThreatByPercent(me->GetVictim(), -80);
|
||||
KnockBack_Timer = urand(15000, 25000);
|
||||
} else KnockBack_Timer -= diff;
|
||||
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
if (Fear_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FEAR);
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
Fear_Timer = 20000;
|
||||
} else Fear_Timer -= diff;
|
||||
|
||||
|
||||
@@ -643,8 +643,8 @@ public:
|
||||
//Place all units in threat list on outside of stomach
|
||||
Stomach_Map.clear();
|
||||
|
||||
for (std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); i != me->getThreatManager().getThreatList().end(); ++i)
|
||||
Stomach_Map[(*i)->getUnitGuid()] = false; //Outside stomach
|
||||
for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
Stomach_Map[ref->GetVictim()->GetGUID()] = false; //Outside stomach
|
||||
|
||||
//Spawn 2 flesh tentacles
|
||||
FleshTentaclesKilled = 0;
|
||||
|
||||
@@ -145,8 +145,8 @@ public:
|
||||
{
|
||||
DoCast(target, SPELL_ROOT);
|
||||
|
||||
if (DoGetThreat(target))
|
||||
DoModifyThreatPercent(target, -100);
|
||||
if (GetThreat(target))
|
||||
ModifyThreatByPercent(target, -100);
|
||||
|
||||
Creature* Hatchling = nullptr;
|
||||
switch (urand(0, 2))
|
||||
|
||||
@@ -117,8 +117,7 @@ public:
|
||||
//Attack random Gamers
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true))
|
||||
{
|
||||
me->AddThreat(target, 1.0f);
|
||||
me->TauntApply(target);
|
||||
AddThreat(target, 1.0f);
|
||||
AttackStart(target);
|
||||
}
|
||||
WhirlWindRandom_Timer = urand(3000, 7000);
|
||||
@@ -145,8 +144,7 @@ public:
|
||||
//Attack random Gamers
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true))
|
||||
{
|
||||
me->AddThreat(target, 1.0f);
|
||||
me->TauntApply(target);
|
||||
AddThreat(target, 1.0f);
|
||||
AttackStart(target);
|
||||
}
|
||||
AggroReset = true;
|
||||
@@ -260,8 +258,7 @@ public:
|
||||
//Attack random Gamers
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true))
|
||||
{
|
||||
me->AddThreat(target, 1.0f);
|
||||
me->TauntApply(target);
|
||||
AddThreat(target, 1.0f);
|
||||
AttackStart(target);
|
||||
}
|
||||
|
||||
@@ -281,8 +278,7 @@ public:
|
||||
//Attack random Gamers
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true))
|
||||
{
|
||||
me->AddThreat(target, 1.0f);
|
||||
me->TauntApply(target);
|
||||
AddThreat(target, 1.0f);
|
||||
AttackStart(target);
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ class boss_skeram : public CreatureScript
|
||||
break;
|
||||
case EVENT_BLINK:
|
||||
DoCast(me, BlinkSpells[urand(0, 2)]);
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
me->SetVisible(true);
|
||||
events.ScheduleEvent(EVENT_BLINK, urand(10000, 30000));
|
||||
break;
|
||||
|
||||
@@ -239,7 +239,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoStopAttack();
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
DoCast(me, SPELL_TWIN_TELEPORT_VISUAL);
|
||||
me->AddUnitState(UNIT_STATE_STUNNED);
|
||||
AfterTeleport = true;
|
||||
@@ -268,7 +268,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
{
|
||||
//DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
|
||||
AttackStart(nearu);
|
||||
me->AddThreat(nearu, 10000);
|
||||
AddThreat(nearu, 10000);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -423,7 +423,7 @@ public:
|
||||
void CastSpellOnBug(Creature* target) override
|
||||
{
|
||||
target->SetFaction(FACTION_MONSTER);
|
||||
target->AI()->AttackStart(me->getThreatManager().getHostilTarget());
|
||||
target->AI()->AttackStart(me->GetThreatManager().GetCurrentVictim());
|
||||
target->AddAura(SPELL_MUTATE_BUG, target);
|
||||
target->SetFullHealth();
|
||||
}
|
||||
@@ -551,7 +551,7 @@ public:
|
||||
|
||||
if (ArcaneBurst_Timer <= diff)
|
||||
{
|
||||
if (Unit* mvic = SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true))
|
||||
if (Unit* mvic = SelectTarget(SELECT_TARGET_MINDISTANCE, 0, NOMINAL_MELEE_RANGE, true))
|
||||
{
|
||||
DoCast(mvic, SPELL_ARCANEBURST);
|
||||
ArcaneBurst_Timer = 5000;
|
||||
@@ -586,7 +586,7 @@ public:
|
||||
if (me->Attack(who, false))
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(who, VEKLOR_DIST);
|
||||
me->AddThreat(who, 0.0f);
|
||||
AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ class boss_viscidus : public CreatureScript
|
||||
|
||||
if (_phase == PHASE_GLOB && summons.empty())
|
||||
{
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
me->NearTeleportTo(ViscidusCoord.GetPositionX(),
|
||||
ViscidusCoord.GetPositionY(),
|
||||
ViscidusCoord.GetPositionZ(),
|
||||
|
||||
@@ -558,7 +558,7 @@ struct boss_alakir : public BossAI
|
||||
events.Repeat(8s);
|
||||
break;
|
||||
case EVENT_ICE_STORM:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70.0f, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70.0f, true))
|
||||
DoCast(target, SPELL_ICE_STORM);
|
||||
events.Repeat(16s);
|
||||
break;
|
||||
|
||||
@@ -667,7 +667,7 @@ struct boss_nezir : public BossAI
|
||||
events.Repeat(12s);
|
||||
break;
|
||||
case EVENT_ICE_PATCH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, MAX_HOME_POSITION_DISTANCE, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, MAX_HOME_POSITION_DISTANCE, true))
|
||||
if (ConclaveHandler::IsTargetOnPlatform(me->GetHomePosition(), target))
|
||||
DoCast(target, SPELL_ICE_PATCH);
|
||||
events.Repeat(14s);
|
||||
@@ -910,7 +910,7 @@ struct boss_rohash : public BossAI
|
||||
events.Repeat(2s + 500ms);
|
||||
break;
|
||||
case EVENT_SLICING_GALE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, MAX_HOME_POSITION_DISTANCE, true, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, MAX_HOME_POSITION_DISTANCE, true))
|
||||
DoCast(target, SPELL_SLICING_GALE);
|
||||
events.Repeat(2s + 100ms);
|
||||
break;
|
||||
@@ -1035,7 +1035,7 @@ struct npc_conclave_of_wind_ravenous_creeper : public ScriptedAI
|
||||
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_AI_CLEAR_TARGET)
|
||||
DoModifyThreatPercent(target, -100);
|
||||
ModifyThreatByPercent(target, -100);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
|
||||
@@ -130,7 +130,7 @@ struct npc_vp_howling_gale : public NullCreatureAI
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(false);
|
||||
}
|
||||
};
|
||||
@@ -500,7 +500,7 @@ class spell_vp_lurk_search_periodic : public AuraScript
|
||||
else
|
||||
target->CastSpell(target, SPELL_LURK_SEARCH_DEATH_CHECK, true);
|
||||
|
||||
target->DeleteThreatList();
|
||||
target->GetThreatManager().ClearAllThreat();
|
||||
target->ClearInCombat();
|
||||
}
|
||||
|
||||
|
||||
@@ -681,7 +681,7 @@ public:
|
||||
if (!target)
|
||||
target = me;
|
||||
|
||||
target->AddThreat(sironas, 0.001f);
|
||||
AddThreat(sironas, 0.001f, target);
|
||||
sironas->Attack(target, true);
|
||||
sironas->GetMotionMaster()->MoveChase(target);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
|
||||
me->UpdateEntry(NPC_TAMED_KODO);
|
||||
me->CombatStop();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->SetSpeedRate(MOVE_RUN, 0.6f);
|
||||
me->FollowTarget(caster);
|
||||
me->setActive(true);
|
||||
|
||||
@@ -1367,8 +1367,7 @@ class go_wind_stone : public GameObjectScript
|
||||
break;
|
||||
}
|
||||
summons->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
summons->SendMeleeAttackStart(player);
|
||||
summons->CombatStart(player);
|
||||
summons->EngageWithTarget(player);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ public:
|
||||
void DoFriend()
|
||||
{
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(true);
|
||||
|
||||
me->StopMoving();
|
||||
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
else
|
||||
{
|
||||
who->SetInCombatWith(me);
|
||||
me->AddThreat(who, 0.0f);
|
||||
AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 218 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user