[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. (cherry picked from commit e2a1ccd118d129b96e09ff1a15ed0adb1d4a3897)
This commit is contained in:
@@ -843,7 +843,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 (%s)", target->GetName().c_str(), target->GetGUID().ToString().c_str());
|
||||
|
||||
@@ -161,7 +161,7 @@ class boss_alizabal : public CreatureScript
|
||||
case 0:
|
||||
if (!_skewer)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXTHREAT, 0))
|
||||
{
|
||||
DoCast(target, SPELL_SKEWER, true);
|
||||
Talk(SAY_SKEWER);
|
||||
@@ -203,7 +203,7 @@ class boss_alizabal : public CreatureScript
|
||||
}
|
||||
else if (!_skewer)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXTHREAT, 0))
|
||||
{
|
||||
DoCast(target, SPELL_SKEWER, true);
|
||||
Talk(SAY_SKEWER);
|
||||
|
||||
@@ -212,7 +212,7 @@ class FocusedFireTargetSelector : public std::unary_function<Unit *, bool>
|
||||
|
||||
bool operator() (WorldObject* target)
|
||||
{
|
||||
if (target == _victim && _me->getThreatManager().getThreatList().size() > 1)
|
||||
if (target == _victim && _me->GetThreatManager().getThreatList().size() > 1)
|
||||
return true;
|
||||
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
|
||||
+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
@@ -374,7 +374,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
@@ -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;
|
||||
|
||||
@@ -95,7 +95,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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -213,11 +213,7 @@ public:
|
||||
continue;
|
||||
|
||||
if (player->IsAlive())
|
||||
{
|
||||
temp->SetInCombatWith(player);
|
||||
player->SetInCombatWith(temp);
|
||||
temp->AddThreat(player, 0.0f);
|
||||
}
|
||||
AddThreat(player, 0.0f, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,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);
|
||||
|
||||
|
||||
@@ -299,14 +299,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;
|
||||
}
|
||||
|
||||
@@ -226,7 +226,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -326,7 +326,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);
|
||||
|
||||
@@ -315,19 +315,18 @@ public:
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
ThreatContainer::StorageType const& t_list = me->getThreatManager().getThreatList();
|
||||
Unit* tank = me->GetThreatManager().GetCurrentVictim();
|
||||
std::vector<Unit*> targets;
|
||||
|
||||
if (t_list.empty())
|
||||
return;
|
||||
for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
{
|
||||
Unit* target = ref->GetVictim();
|
||||
if (target != tank && target->IsAlive() && target->GetTypeId() == TYPEID_PLAYER)
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
//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);
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
//cut down to size if we have more than 5 targets
|
||||
while (targets.size() > 5)
|
||||
@@ -454,9 +453,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -492,11 +489,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,18 +205,12 @@ public:
|
||||
void FlameWreathEffect()
|
||||
{
|
||||
std::vector<Unit*> targets;
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
|
||||
if (t_list.empty())
|
||||
return;
|
||||
|
||||
//store the threat list in a different container
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
for (auto* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
//only on alive players
|
||||
if (target && target->IsAlive() && target->GetTypeId() == TYPEID_PLAYER)
|
||||
targets.push_back(target);
|
||||
Unit* target = ref->GetVictim();
|
||||
if (ref->GetVictim()->GetTypeId() == TYPEID_PLAYER && ref->GetVictim()->IsAlive())
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
//cut down to size if we have more than 3 targets
|
||||
|
||||
@@ -128,7 +128,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;
|
||||
|
||||
@@ -923,11 +923,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;
|
||||
}
|
||||
@@ -939,9 +939,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;
|
||||
}
|
||||
|
||||
@@ -1256,7 +1256,7 @@ public:
|
||||
Julianne->GetMotionMaster()->Clear();
|
||||
Julianne->setDeathState(JUST_DIED);
|
||||
Julianne->CombatStop(true);
|
||||
Julianne->DeleteThreatList();
|
||||
Julianne->GetThreatManager().ClearAllThreat();
|
||||
Julianne->SetDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
return;
|
||||
@@ -1284,7 +1284,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());
|
||||
}
|
||||
}
|
||||
@@ -1526,7 +1526,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->SetDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -200,15 +200,15 @@ public:
|
||||
if (!summonedUnit)
|
||||
return;
|
||||
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& threatlist = me->GetThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && unit->IsAlive())
|
||||
{
|
||||
float threat = me->getThreatManager().getThreat(unit);
|
||||
summonedUnit->AddThreat(unit, threat);
|
||||
float threat = me->GetThreatManager().getThreat(unit);
|
||||
AddThreat(unit, threat, summonedUnit);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
float x = KaelLocations[0][0];
|
||||
float y = KaelLocations[0][1];
|
||||
me->UpdatePosition(x, y, LOCATION_Z, 0.0f);
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatlist = me->GetThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
@@ -231,7 +231,7 @@ public:
|
||||
|
||||
void CastGravityLapseKnockUp()
|
||||
{
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatlist = me->GetThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
@@ -244,7 +244,7 @@ public:
|
||||
|
||||
void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air...
|
||||
{
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatlist = me->GetThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
@@ -260,7 +260,7 @@ public:
|
||||
|
||||
void RemoveGravityLapse()
|
||||
{
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatlist = me->GetThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
@@ -400,7 +400,7 @@ public:
|
||||
if (Orb && target)
|
||||
{
|
||||
Orb->SetSpeedRate(MOVE_RUN, 0.5f);
|
||||
Orb->AddThreat(target, 1000000.0f);
|
||||
AddThreat(target, 1000000.0f, Orb);
|
||||
Orb->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
@@ -680,7 +680,7 @@ public:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
me->AddThreat(target, 1.0f);
|
||||
AddThreat(target, 1.0f);
|
||||
me->TauntApply(target);
|
||||
AttackStart(target);
|
||||
}
|
||||
|
||||
@@ -168,16 +168,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_DELRISSA, IN_PROGRESS);
|
||||
}
|
||||
@@ -398,25 +391,13 @@ 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* pDelrissa = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_DELRISSA)))
|
||||
{
|
||||
if (pDelrissa->IsAlive() && !pDelrissa->GetVictim())
|
||||
{
|
||||
who->SetInCombatWith(pDelrissa);
|
||||
pDelrissa->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
if (pDelrissa->IsAlive() && !pDelrissa->IsEngaged())
|
||||
AddThreat(who, 0.0f, pDelrissa);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
@@ -472,7 +453,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
|
||||
if (ResetThreatTimer <= diff)
|
||||
{
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
ResetThreatTimer = urand(5000, 20000);
|
||||
} else ResetThreatTimer -= diff;
|
||||
}
|
||||
@@ -544,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;
|
||||
@@ -869,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()))
|
||||
@@ -963,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()))
|
||||
|
||||
@@ -430,7 +430,7 @@ public:
|
||||
|
||||
if (me->Attack(who, true))
|
||||
{
|
||||
me->AddThreat(who, 0.0f);
|
||||
AddThreat(who, 0.0f);
|
||||
me->SetInCombatWith(who);
|
||||
who->SetInCombatWith(me);
|
||||
DoStartMovement(who);
|
||||
@@ -1384,7 +1384,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);
|
||||
@@ -1405,7 +1405,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());
|
||||
@@ -1416,7 +1416,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());
|
||||
@@ -1427,7 +1427,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());
|
||||
@@ -1439,7 +1439,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());
|
||||
@@ -1454,7 +1454,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());
|
||||
@@ -1484,15 +1484,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1550,7 +1546,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();
|
||||
}
|
||||
}
|
||||
@@ -1561,7 +1557,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();
|
||||
}
|
||||
}
|
||||
@@ -1570,7 +1566,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);
|
||||
@@ -1578,7 +1574,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);
|
||||
@@ -1586,7 +1582,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);
|
||||
@@ -1594,7 +1590,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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -604,14 +604,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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -861,7 +853,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
@@ -119,7 +119,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;
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
DoCast(SPELL_ILLUSION);
|
||||
me->AddUnitFlag(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;
|
||||
|
||||
@@ -321,14 +321,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 = instance->GetCreature(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;
|
||||
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
me->AddUnitFlag(UnitFlags(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE));
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop();
|
||||
++TalkSequence;
|
||||
}
|
||||
@@ -302,7 +302,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)
|
||||
{
|
||||
@@ -649,7 +649,7 @@ public:
|
||||
{
|
||||
KalecGUID = Kalec->GetGUID();
|
||||
me->CombatStart(Kalec);
|
||||
me->AddThreat(Kalec, 100.0f);
|
||||
AddThreat(Kalec, 100.0f);
|
||||
Kalec->setActive(true);
|
||||
}
|
||||
Talk(SAY_SATH_AGGRO);
|
||||
@@ -776,12 +776,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;
|
||||
|
||||
@@ -470,7 +470,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);
|
||||
@@ -671,7 +671,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);
|
||||
@@ -956,7 +956,7 @@ public:
|
||||
{
|
||||
instance->SetBossState(DATA_KILJAEDEN, IN_PROGRESS);
|
||||
if (Creature* pControl = instance->GetCreature(DATA_KILJAEDEN_CONTROLLER))
|
||||
pControl->AddThreat(who, 1.0f);
|
||||
AddThreat(who, 1.0f, pControl);
|
||||
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
}
|
||||
@@ -992,15 +992,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;
|
||||
|
||||
@@ -1060,7 +1053,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;
|
||||
}
|
||||
@@ -1113,7 +1106,7 @@ public:
|
||||
|
||||
if (!bLockedTarget)
|
||||
{
|
||||
me->AddThreat(me->GetVictim(), 10000000.0f);
|
||||
AddThreat(me->GetVictim(), 10000000.0f);
|
||||
bLockedTarget = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,18 +74,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;
|
||||
|
||||
@@ -92,13 +92,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;
|
||||
|
||||
|
||||
@@ -553,7 +553,7 @@ class DevastatingSlamTargetSelector : public std::unary_function<Unit *, bool>
|
||||
|
||||
bool operator() (WorldObject* target)
|
||||
{
|
||||
if (target == _victim && _me->getThreatManager().getThreatList().size() > 1)
|
||||
if (target == _victim && _me->GetThreatManager().getThreatList().size() > 1)
|
||||
return true;
|
||||
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
@@ -680,8 +680,8 @@ class spell_mandokir_ohgan_orders_trigger : public SpellScriptLoader
|
||||
// HACK: research better way
|
||||
caster->ClearUnitState(UNIT_STATE_CASTING);
|
||||
caster->GetMotionMaster()->Clear();
|
||||
caster->DeleteThreatList();
|
||||
caster->AddThreat(target, 50000000.0f);
|
||||
caster->GetThreatManager().ClearAllThreat();
|
||||
caster->GetThreatManager().AddThreat(target, 50000000.0f);
|
||||
caster->TauntApply(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
if (Creature* Myrmidon = me->FindNearestCreature(NPC_DARKSPINE_MYRIDON, 70))
|
||||
{
|
||||
me->AddThreat(Myrmidon, 100000.0f);
|
||||
AddThreat(Myrmidon, 100000.0f);
|
||||
AttackStart(Myrmidon);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,9 +83,9 @@ public:
|
||||
if (player->GetQuestStatus(QUEST_SAVING_YENNIKU) == QUEST_STATUS_INCOMPLETE) // Yenniku's Release
|
||||
{
|
||||
me->SetEmoteState(EMOTE_STATE_STUN);
|
||||
me->CombatStop(); // stop combat
|
||||
me->DeleteThreatList(); // unsure of this
|
||||
me->SetFaction(FACTION_HORDE_GENERIC); // horde generic
|
||||
me->CombatStop(); //stop combat
|
||||
me->GetThreatManager().ClearAllThreat(); //unsure of this
|
||||
me->SetFaction(FACTION_HORDE_GENERIC);
|
||||
|
||||
bReset = true;
|
||||
Reset_Timer = 60000;
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
if (player->GetTeam() == HORDE)
|
||||
{
|
||||
me->CombatStop();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
|
||||
me->RestoreFaction();
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(true);
|
||||
|
||||
SetRun(false);
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JAINAPROUDMOORE));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -421,7 +421,7 @@ void hyjalAI::EnterEvadeMode(EvadeReason /*why*/)
|
||||
{
|
||||
if (me->GetEntry() != JAINA)
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(true);
|
||||
me->LoadCreaturesAddon();
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ public:
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -487,7 +487,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
|
||||
}
|
||||
@@ -564,13 +564,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)
|
||||
@@ -662,13 +662,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)
|
||||
@@ -772,13 +772,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -885,13 +885,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -981,13 +981,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1067,13 +1067,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1160,7 +1160,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);
|
||||
}
|
||||
}
|
||||
@@ -1281,7 +1281,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
@@ -304,10 +304,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,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()
|
||||
|
||||
@@ -227,7 +227,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;
|
||||
@@ -330,7 +330,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:
|
||||
@@ -635,8 +635,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())));
|
||||
}
|
||||
|
||||
void UpdateThreat()
|
||||
|
||||
@@ -464,11 +464,7 @@ class spell_baleroc_countdown_aoe_dummy : public SpellScript
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
Creature* caster = GetCaster()->ToCreature();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
if (WorldObject* tank = caster->AI()->SelectTarget(SELECT_TARGET_TOPAGGRO))
|
||||
if (WorldObject* tank = GetCaster()->GetVictim())
|
||||
targets.remove(tank);
|
||||
|
||||
if (targets.size() < 2)
|
||||
@@ -583,11 +579,8 @@ class spell_baleroc_shards_of_torment_target_search : public SpellScript
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* caster = GetCaster()->ToCreature();
|
||||
if (!caster || !caster->IsAIEnabled)
|
||||
return;
|
||||
|
||||
if (WorldObject* tank = caster->AI()->SelectTarget(SELECT_TARGET_TOPAGGRO))
|
||||
Unit* caster = GetCaster();
|
||||
if (WorldObject* tank = caster->GetVictim())
|
||||
targets.remove(tank);
|
||||
|
||||
std::list<WorldObject*> melee, ranged;
|
||||
|
||||
@@ -232,7 +232,7 @@ struct npc_firelands_magmakin : public ScriptedAI
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
me->AddThreat(target, 50000000.0f);
|
||||
AddThreat(target, 50000000.0f);
|
||||
me->TauntApply(target);
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +237,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);
|
||||
|
||||
@@ -219,8 +219,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;
|
||||
|
||||
@@ -307,7 +307,7 @@ public:
|
||||
if (Fear_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FEAR);
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
Fear_Timer = 20000;
|
||||
} else Fear_Timer -= diff;
|
||||
|
||||
|
||||
@@ -649,8 +649,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;
|
||||
|
||||
@@ -150,8 +150,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))
|
||||
|
||||
@@ -118,8 +118,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);
|
||||
@@ -146,8 +145,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;
|
||||
@@ -261,8 +259,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);
|
||||
}
|
||||
|
||||
@@ -282,8 +279,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;
|
||||
}
|
||||
@@ -428,7 +428,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();
|
||||
}
|
||||
@@ -559,7 +559,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;
|
||||
@@ -594,7 +594,7 @@ public:
|
||||
if (me->Attack(who, false))
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0);
|
||||
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(),
|
||||
|
||||
@@ -662,7 +662,7 @@ public:
|
||||
if (!target)
|
||||
target = me;
|
||||
|
||||
target->AddThreat(sironas, 0.001f);
|
||||
AddThreat(sironas, 0.001f, target);
|
||||
sironas->Attack(target, true);
|
||||
sironas->GetMotionMaster()->MoveChase(target);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
|
||||
me->UpdateEntry(NPC_TAMED_KODO);
|
||||
me->CombatStop();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->SetSpeedRate(MOVE_RUN, 0.6f);
|
||||
me->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, me->GetFollowAngle());
|
||||
me->setActive(true);
|
||||
|
||||
@@ -1234,8 +1234,7 @@ class go_wind_stone : public GameObjectScript
|
||||
break;
|
||||
}
|
||||
summons->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
summons->SendMeleeAttackStart(player);
|
||||
summons->CombatStart(player);
|
||||
summons->EngageWithTarget(player);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@@ -214,7 +214,7 @@ public:
|
||||
void DoFriend()
|
||||
{
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(true);
|
||||
|
||||
me->StopMoving();
|
||||
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
|
||||
if (Unit* target = me->SelectNearestPlayer(200.0f))
|
||||
{
|
||||
me->AddThreat(target, 0.0f);
|
||||
AddThreat(target, 0.0f);
|
||||
me->SetInCombatWith(target);
|
||||
target->SetInCombatWith(me);
|
||||
DoStartMovement(target);
|
||||
|
||||
@@ -173,7 +173,7 @@ class npc_sc_millhouse_manastorm : public CreatureScript
|
||||
|
||||
me->RemoveAllAuras();
|
||||
me->CombatStop(true);
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
|
||||
switch (pointId)
|
||||
{
|
||||
|
||||
@@ -192,7 +192,7 @@ public:
|
||||
else
|
||||
{
|
||||
who->SetInCombatWith(me);
|
||||
me->AddThreat(who, 0.0f);
|
||||
AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
|
||||
bool IsInCombatWithPlayer() const
|
||||
{
|
||||
std::list<HostileReference*> const& refs = me->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*> const& refs = me->GetThreatManager().getThreatList();
|
||||
for (HostileReference const* hostileRef : refs)
|
||||
{
|
||||
if (Unit const* target = hostileRef->getTarget())
|
||||
|
||||
@@ -219,7 +219,7 @@ struct dummy_dragonAI : public ScriptedAI
|
||||
me->SetInCombatWithZone();
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
|
||||
{
|
||||
me->AddThreat(target, 1.0f);
|
||||
me->GetThreatManager().AddThreat(target, 1.0f);
|
||||
me->Attack(target, true);
|
||||
me->GetMotionMaster()->MoveChase(target);
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ class boss_halion : public CreatureScript
|
||||
break;
|
||||
case EVENT_METEOR_STRIKE:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_TWILIGHT_REALM))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, true, -SPELL_TWILIGHT_REALM))
|
||||
{
|
||||
_meteorStrikePos = target->GetPosition();
|
||||
me->CastSpell(_meteorStrikePos.GetPositionX(), _meteorStrikePos.GetPositionY(), _meteorStrikePos.GetPositionZ(), SPELL_METEOR_STRIKE, true, nullptr, nullptr, me->GetGUID());
|
||||
@@ -357,7 +357,7 @@ class boss_halion : public CreatureScript
|
||||
}
|
||||
case EVENT_FIERY_COMBUSTION:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_TWILIGHT_REALM))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, true, -SPELL_TWILIGHT_REALM))
|
||||
me->CastSpell(target, SPELL_FIERY_COMBUSTION, TRIGGERED_IGNORE_SET_FACING);
|
||||
events.ScheduleEvent(EVENT_FIERY_COMBUSTION, Seconds(25));
|
||||
break;
|
||||
@@ -528,7 +528,7 @@ class boss_twilight_halion : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_BREATH, randtime(Seconds(10), Seconds(14)));
|
||||
break;
|
||||
case EVENT_SOUL_CONSUMPTION:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, SPELL_TWILIGHT_REALM))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, true, SPELL_TWILIGHT_REALM))
|
||||
me->CastSpell(target, SPELL_SOUL_CONSUMPTION, TRIGGERED_IGNORE_SET_FACING);
|
||||
events.ScheduleEvent(EVENT_SOUL_CONSUMPTION, Seconds(20));
|
||||
break;
|
||||
|
||||
+6
-6
@@ -114,7 +114,7 @@ void AggroAllPlayers(Creature* temp)
|
||||
temp->SetReactState(REACT_AGGRESSIVE);
|
||||
temp->SetInCombatWith(player);
|
||||
player->SetInCombatWith(temp);
|
||||
temp->AddThreat(player, 0.0f);
|
||||
temp->GetThreatManager().AddThreat(player, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -262,8 +262,8 @@ public:
|
||||
Player* player = itr->GetSource();
|
||||
if (player && !player->IsGameMaster() && me->IsInRange(player, 8.0f, 25.0f, false))
|
||||
{
|
||||
DoResetThreat();
|
||||
me->AddThreat(player, 1.0f);
|
||||
ResetThreatList();
|
||||
me->GetThreatManager().AddThreat(player, 1.0f);
|
||||
DoCast(player, SPELL_CHARGE);
|
||||
break;
|
||||
}
|
||||
@@ -408,8 +408,8 @@ public:
|
||||
Player* player = itr->GetSource();
|
||||
if (player && !player->IsGameMaster() && me->IsInRange(player, 8.0f, 25.0f, false))
|
||||
{
|
||||
DoResetThreat();
|
||||
me->AddThreat(player, 5.0f);
|
||||
ResetThreatList();
|
||||
me->GetThreatManager().AddThreat(player, 5.0f);
|
||||
DoCast(player, SPELL_INTERCEPT);
|
||||
break;
|
||||
}
|
||||
@@ -846,7 +846,7 @@ public:
|
||||
|
||||
if (uiShootTimer <= uiDiff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 30.0f))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXDISTANCE, 0, 30.0f))
|
||||
{
|
||||
uiTargetGUID = target->GetGUID();
|
||||
DoCast(target, SPELL_SHOOT);
|
||||
|
||||
+1
-3
@@ -385,9 +385,7 @@ public:
|
||||
temp->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
temp->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
temp->SetReactState(REACT_AGGRESSIVE);
|
||||
temp->SetInCombatWith(player);
|
||||
player->SetInCombatWith(temp);
|
||||
temp->AddThreat(player, 0.0f);
|
||||
AddThreat(player, 0.0f, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-4
@@ -259,7 +259,7 @@ class boss_anubarak_trial : public CreatureScript
|
||||
summoned->SetDisplayFromModel(0);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
{
|
||||
summoned->CombatStart(target);
|
||||
summoned->EngageWithTarget(target);
|
||||
Talk(EMOTE_SPIKE, target);
|
||||
}
|
||||
break;
|
||||
@@ -812,12 +812,11 @@ class npc_anubarak_spike : public CreatureScript
|
||||
DoCast(who, SPELL_MARK);
|
||||
me->SetSpeedRate(MOVE_RUN, 0.5f);
|
||||
// make sure the Spine will really follow the one he should
|
||||
me->getThreatManager().clearReferences();
|
||||
ResetThreatList();
|
||||
me->SetInCombatWithZone();
|
||||
me->getThreatManager().addThreat(who, std::numeric_limits<float>::max());
|
||||
AddThreat(who, 1000000.0f);
|
||||
me->GetMotionMaster()->Clear(true);
|
||||
me->GetMotionMaster()->MoveChase(who);
|
||||
me->TauntApply(who);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
+8
-26
@@ -610,20 +610,9 @@ struct boss_faction_championsAI : public BossAI
|
||||
|
||||
void UpdateThreat()
|
||||
{
|
||||
std::list<HostileReference*> const& tList = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = tList.begin(); itr != tList.end(); ++itr)
|
||||
{
|
||||
Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (unit && me->getThreatManager().getThreat(unit))
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
float threat = CalculateThreat(me->GetDistance2d(unit), (float)unit->GetArmor(), unit->GetHealth());
|
||||
me->getThreatManager().modifyThreatPercent(unit, -100);
|
||||
me->AddThreat(unit, 1000000.0f * threat);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
if (Player* victim = ref->GetVictim()->ToPlayer())
|
||||
ref->SetThreat(1000000.0f * CalculateThreat(me->GetDistance2d(victim), victim->GetArmor(), victim->GetHealth()));
|
||||
}
|
||||
|
||||
void UpdatePower()
|
||||
@@ -692,7 +681,7 @@ struct boss_faction_championsAI : public BossAI
|
||||
|
||||
Unit* SelectEnemyCaster(bool /*casting*/)
|
||||
{
|
||||
std::list<HostileReference*> const& tList = me->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*> const& tList = me->GetThreatManager().getThreatList();
|
||||
std::list<HostileReference*>::const_iterator iter;
|
||||
for (iter = tList.begin(); iter!=tList.end(); ++iter)
|
||||
{
|
||||
@@ -705,15 +694,10 @@ struct boss_faction_championsAI : public BossAI
|
||||
|
||||
uint32 EnemiesInRange(float distance)
|
||||
{
|
||||
std::list<HostileReference*> const& tList = me->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*>::const_iterator iter;
|
||||
uint32 count = 0;
|
||||
for (iter = tList.begin(); iter != tList.end(); ++iter)
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, (*iter)->getUnitGuid());
|
||||
if (target && me->GetDistance2d(target) < distance)
|
||||
++count;
|
||||
}
|
||||
for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
if (me->GetDistance2d(ref->GetVictim()) < distance)
|
||||
++count;
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -724,9 +708,7 @@ struct boss_faction_championsAI : public BossAI
|
||||
|
||||
if (me->Attack(who, true))
|
||||
{
|
||||
me->AddThreat(who, 10.0f);
|
||||
me->SetInCombatWith(who);
|
||||
who->SetInCombatWith(me);
|
||||
AddThreat(who, 10.0f);
|
||||
|
||||
if (_aiType == AI_MELEE || _aiType == AI_PET)
|
||||
DoStartMovement(who);
|
||||
|
||||
+3
-3
@@ -158,12 +158,12 @@ class boss_jaraxxus : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_FEL_FIREBALL, urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS));
|
||||
return;
|
||||
case EVENT_FEL_LIGHTNING:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_LORD_HITTIN))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, true, -SPELL_LORD_HITTIN))
|
||||
DoCast(target, SPELL_FEL_LIGHTING);
|
||||
events.ScheduleEvent(EVENT_FEL_LIGHTNING, urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS));
|
||||
return;
|
||||
case EVENT_INCINERATE_FLESH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_LORD_HITTIN))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, true, -SPELL_LORD_HITTIN))
|
||||
{
|
||||
Talk(EMOTE_INCINERATE, target);
|
||||
Talk(SAY_INCINERATE);
|
||||
@@ -176,7 +176,7 @@ class boss_jaraxxus : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_NETHER_POWER, 40*IN_MILLISECONDS);
|
||||
return;
|
||||
case EVENT_LEGION_FLAME:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_LORD_HITTIN))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, true, -SPELL_LORD_HITTIN))
|
||||
{
|
||||
Talk(EMOTE_LEGION_FLAME, target);
|
||||
DoCast(target, SPELL_LEGION_FLAME);
|
||||
|
||||
+1
-1
@@ -310,7 +310,7 @@ struct boss_twin_baseAI : public BossAI
|
||||
events.ScheduleEvent(EVENT_TWIN_SPIKE, 20 * IN_MILLISECONDS);
|
||||
break;
|
||||
case EVENT_TOUCH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true, OtherEssenceSpellId))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true, true, OtherEssenceSpellId))
|
||||
me->CastCustomSpell(TouchSpellId, SPELLVALUE_MAX_TARGETS, 1, target, false);
|
||||
events.ScheduleEvent(EVENT_TOUCH, urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS));
|
||||
break;
|
||||
|
||||
+2
-3
@@ -554,8 +554,7 @@ class npc_fizzlebang_toc : public CreatureScript
|
||||
{
|
||||
//1-shot Fizzlebang
|
||||
jaraxxus->CastSpell(me, 67888, false); // 67888 - Fel Lightning
|
||||
me->SetInCombatWith(jaraxxus);
|
||||
jaraxxus->AddThreat(me, 1000.0f);
|
||||
AddThreat(me, 1000.0f, jaraxxus);
|
||||
jaraxxus->AI()->AttackStart(me);
|
||||
}
|
||||
_instance->SetData(TYPE_EVENT, 1160);
|
||||
@@ -682,7 +681,7 @@ class npc_tirion_toc : public CreatureScript
|
||||
break;
|
||||
case 400:
|
||||
Talk(SAY_STAGE_0_06);
|
||||
me->getThreatManager().clearReferences();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
_updateTimer = 5*IN_MILLISECONDS;
|
||||
_instance->SetData(TYPE_EVENT, 0);
|
||||
break;
|
||||
|
||||
+10
-12
@@ -960,14 +960,12 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript
|
||||
|
||||
void DeleteAllFromThreatList(Unit* target, ObjectGuid except)
|
||||
{
|
||||
ThreatContainer::StorageType threatlist = target->getThreatManager().getThreatList();
|
||||
for (auto i : threatlist)
|
||||
{
|
||||
if (i->getUnitGuid() == except)
|
||||
continue;
|
||||
|
||||
i->removeReference();
|
||||
}
|
||||
std::vector<ThreatReference*> toClear;
|
||||
for (ThreatReference* ref : target->GetThreatManager().GetUnsortedThreatList())
|
||||
if (ref->GetVictim()->GetGUID() != except)
|
||||
toClear.push_back(ref);
|
||||
for (ThreatReference* ref : toClear)
|
||||
ref->ClearThreat();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -1346,7 +1344,7 @@ class npc_the_lich_king_escape_hor : public CreatureScript
|
||||
AttackStart(victim);
|
||||
return me->GetVictim() != nullptr;
|
||||
}
|
||||
else if (me->getThreatManager().getThreatList().size() < 2 && me->HasAura(SPELL_REMORSELESS_WINTER))
|
||||
else if (me->GetThreatManager().GetThreatListSize() < 2 && me->HasAura(SPELL_REMORSELESS_WINTER))
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return false;
|
||||
@@ -1929,7 +1927,7 @@ class npc_frostsworn_general : public CreatureScript
|
||||
void SummonClones()
|
||||
{
|
||||
std::list<Unit*> playerList;
|
||||
SelectTargetList(playerList, 5, SELECT_TARGET_TOPAGGRO, 0.0f, true);
|
||||
SelectTargetList(playerList, 5, SELECT_TARGET_MAXTHREAT, 0, 0.0f, true);
|
||||
for (Unit* target : playerList)
|
||||
{
|
||||
if (Creature* reflection = me->SummonCreature(NPC_REFLECTION, *target, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000))
|
||||
@@ -2172,7 +2170,7 @@ struct npc_escape_event_trash : public ScriptedAI
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->SetInCombatWith(leader);
|
||||
leader->SetInCombatWith(me);
|
||||
me->AddThreat(leader, 0.0f);
|
||||
AddThreat(leader, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2292,7 +2290,7 @@ class npc_risen_witch_doctor : public CreatureScript
|
||||
_events.ScheduleEvent(EVENT_RISEN_WITCH_DOCTOR_CURSE, urand(10000, 15000));
|
||||
break;
|
||||
case EVENT_RISEN_WITCH_DOCTOR_SHADOW_BOLT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 20.0f, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MAXTHREAT, 0, 20.0f, true))
|
||||
DoCast(target, SPELL_SHADOW_BOLT);
|
||||
_events.ScheduleEvent(EVENT_RISEN_WITCH_DOCTOR_SHADOW_BOLT, urand(2000, 3000));
|
||||
break;
|
||||
|
||||
@@ -197,16 +197,16 @@ class boss_ick : public CreatureScript
|
||||
|
||||
void _ResetThreat(Unit* target)
|
||||
{
|
||||
DoModifyThreatPercent(target, -100);
|
||||
me->AddThreat(target, _tempThreat);
|
||||
ModifyThreatByPercent(target, -100);
|
||||
AddThreat(target, _tempThreat);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!me->IsInCombat())
|
||||
if (!me->IsEngaged())
|
||||
return;
|
||||
|
||||
if (!me->GetVictim() && me->getThreatManager().isThreatListEmpty())
|
||||
if (!me->GetVictim() && me->GetThreatManager().IsThreatListEmpty())
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
|
||||
return;
|
||||
@@ -638,9 +638,9 @@ class spell_krick_pursuit : public SpellScriptLoader
|
||||
{
|
||||
ick->AI()->Talk(SAY_ICK_CHASE_1, target);
|
||||
ick->AddAura(GetSpellInfo()->Id, target);
|
||||
ENSURE_AI(boss_ick::boss_ickAI, ick->AI())->SetTempThreat(ick->getThreatManager().getThreat(target));
|
||||
ick->AddThreat(target, float(GetEffectValue()));
|
||||
target->AddThreat(ick, float(GetEffectValue()));
|
||||
ENSURE_AI(boss_ick::boss_ickAI, ick->AI())->SetTempThreat(ick->GetThreatManager().GetThreat(target));
|
||||
ick->GetThreatManager().AddThreat(target, float(GetEffectValue()), GetSpellInfo(), true, true);
|
||||
target->GetThreatManager().AddThreat(ick, float(GetEffectValue()), GetSpellInfo(), true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ struct BloodPrincesBossAI : public BossAI
|
||||
{
|
||||
if (!_isEmpowered)
|
||||
{
|
||||
me->AddThreat(attacker, float(damage));
|
||||
AddThreat(attacker, float(damage));
|
||||
damage = 0;
|
||||
}
|
||||
}
|
||||
@@ -1150,8 +1150,8 @@ class npc_dark_nucleus : public CreatureScript
|
||||
if (attacker == me)
|
||||
return;
|
||||
|
||||
me->DeleteThreatList();
|
||||
me->AddThreat(attacker, 500000000.0f);
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
AddThreat(attacker, 500000000.0f);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
@@ -485,15 +485,14 @@ class boss_blood_queen_lana_thel : public CreatureScript
|
||||
// offtank for this encounter is the player standing closest to main tank
|
||||
Player* SelectRandomTarget(bool includeOfftank, std::list<Player*>* targetList = NULL)
|
||||
{
|
||||
std::list<HostileReference*> const& threatlist = me->getThreatManager().getThreatList();
|
||||
std::list<Player*> tempTargets;
|
||||
|
||||
if (threatlist.empty())
|
||||
if (me->GetThreatManager().IsThreatListEmpty(true))
|
||||
return NULL;
|
||||
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
if (Unit* refTarget = (*itr)->getTarget())
|
||||
if (refTarget != me->GetVictim() && refTarget->GetTypeId() == TYPEID_PLAYER && (includeOfftank || (refTarget->GetGUID() != _offtankGUID)))
|
||||
std::list<Player*> tempTargets;
|
||||
Unit* maintank = me->GetThreatManager().GetCurrentVictim();
|
||||
for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
if (Player* refTarget = ref->GetVictim()->ToPlayer())
|
||||
if (refTarget != maintank && (includeOfftank || (refTarget->GetGUID() != _offtankGUID)))
|
||||
tempTargets.push_back(refTarget->ToPlayer());
|
||||
|
||||
if (tempTargets.empty())
|
||||
|
||||
@@ -579,7 +579,7 @@ class boss_deathbringer_saurfang : public CreatureScript
|
||||
}
|
||||
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(SELECT_TARGET_RANDOM, 1, 0.0f, true, true, -SPELL_MARK_OF_THE_FALLEN_CHAMPION))
|
||||
{
|
||||
++_fallenChampionCastCount;
|
||||
DoCast(target, SPELL_MARK_OF_THE_FALLEN_CHAMPION);
|
||||
|
||||
@@ -209,8 +209,8 @@ class boss_festergut : public CreatureScript
|
||||
{
|
||||
std::list<Unit*> ranged, melee;
|
||||
uint32 minTargets = RAID_MODE<uint32>(3, 8, 3, 8);
|
||||
SelectTargetList(ranged, 25, SELECT_TARGET_RANDOM, -5.0f, true);
|
||||
SelectTargetList(melee, 25, SELECT_TARGET_RANDOM, 5.0f, true);
|
||||
SelectTargetList(ranged, 25, SELECT_TARGET_RANDOM, 0, -5.0f, true);
|
||||
SelectTargetList(melee, 25, SELECT_TARGET_RANDOM, 0, 5.0f, true);
|
||||
while (ranged.size() < minTargets)
|
||||
{
|
||||
if (melee.empty())
|
||||
|
||||
@@ -584,7 +584,7 @@ struct gunship_npc_AI : public ScriptedAI
|
||||
if (!me->IsAlive() || !me->IsInCombat())
|
||||
return;
|
||||
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(true);
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
@@ -640,7 +640,7 @@ protected:
|
||||
|
||||
return me->GetVictim() != nullptr;
|
||||
}
|
||||
else if (me->getThreatManager().isThreatListEmpty())
|
||||
else if (me->GetThreatManager().IsThreatListEmpty())
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_OTHER);
|
||||
return false;
|
||||
@@ -729,7 +729,7 @@ class npc_gunship : public CreatureScript
|
||||
{
|
||||
Creature* stalker = *itr;
|
||||
stalker->RemoveAllAuras();
|
||||
stalker->DeleteThreatList();
|
||||
stalker->GetThreatManager().ClearAllThreat();
|
||||
stalker->CombatStop(true);
|
||||
}
|
||||
|
||||
@@ -882,7 +882,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
|
||||
if (!me->IsAlive())
|
||||
return;
|
||||
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(true);
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
@@ -1151,7 +1151,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
|
||||
if (!me->IsAlive())
|
||||
return;
|
||||
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(true);
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
@@ -1487,7 +1487,7 @@ struct npc_gunship_boarding_addAI : public gunship_npc_AI
|
||||
{
|
||||
players.sort(Trinity::ObjectDistanceOrderPred(me));
|
||||
for (std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
me->AddThreat(*itr, 1.0f);
|
||||
AddThreat(*itr, 1.0f);
|
||||
|
||||
AttackStart(players.front());
|
||||
}
|
||||
|
||||
@@ -316,9 +316,10 @@ class boss_lady_deathwhisper : public CreatureScript
|
||||
scheduler.Schedule(Seconds(27), [this](TaskContext dominate_mind)
|
||||
{
|
||||
Talk(SAY_DOMINATE_MIND);
|
||||
for (uint8 i = 0; i < _dominateMindCount; i++)
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_DOMINATE_MIND))
|
||||
DoCast(target, SPELL_DOMINATE_MIND);
|
||||
std::list<Unit*> targets;
|
||||
SelectTargetList(targets, _dominateMindCount, SELECT_TARGET_RANDOM, 0, 0.0f, true, false, -SPELL_DOMINATE_MIND);
|
||||
for (Unit* target : targets)
|
||||
DoCast(target, SPELL_DOMINATE_MIND);
|
||||
dominate_mind.Repeat(Seconds(40), Seconds(45));
|
||||
});
|
||||
// phase one only
|
||||
@@ -414,7 +415,7 @@ class boss_lady_deathwhisper : public CreatureScript
|
||||
Talk(SAY_PHASE_2);
|
||||
Talk(EMOTE_PHASE_2);
|
||||
DoStartMovement(me->GetVictim());
|
||||
DoResetThreat();
|
||||
ResetThreatList();
|
||||
damage -= me->GetPower(POWER_MANA);
|
||||
me->SetPower(POWER_MANA, 0);
|
||||
me->RemoveAurasDueToSpell(SPELL_MANA_BARRIER);
|
||||
|
||||
@@ -517,8 +517,8 @@ class spell_marrowgar_coldflame : public SpellScriptLoader
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.clear();
|
||||
// select any unit but not the tank (by owners threatlist)
|
||||
Unit* target = GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 1, -GetCaster()->GetCombatReach(), true, -SPELL_IMPALED);
|
||||
// select any unit but not the tank
|
||||
Unit* target = GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 0, -GetCaster()->GetCombatReach(), true, false, -SPELL_IMPALED);
|
||||
if (!target)
|
||||
target = GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true); // or the tank if its solo
|
||||
if (!target)
|
||||
@@ -645,7 +645,7 @@ class spell_marrowgar_bone_spike_graveyard : public SpellScriptLoader
|
||||
uint8 boneSpikeCount = uint8(GetCaster()->GetMap()->Is25ManRaid() ? 3 : 1);
|
||||
|
||||
std::list<Unit*> targets;
|
||||
marrowgarAI->SelectTargetList(targets, BoneSpikeTargetSelector(marrowgarAI), boneSpikeCount, SELECT_TARGET_RANDOM);
|
||||
marrowgarAI->SelectTargetList(targets, boneSpikeCount, SELECT_TARGET_RANDOM, 1, BoneSpikeTargetSelector(marrowgarAI));
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
|
||||
@@ -505,10 +505,9 @@ class boss_professor_putricide : 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)
|
||||
targetList.push_back((*itr)->getTarget());
|
||||
for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList())
|
||||
if (Player* target = ref->GetVictim()->ToPlayer())
|
||||
targetList.push_back(target);
|
||||
}
|
||||
|
||||
size_t half = targetList.size()/2;
|
||||
@@ -607,7 +606,7 @@ class boss_professor_putricide : public CreatureScript
|
||||
case EVENT_SLIME_PUDDLE:
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
SelectTargetList(targets, 2, SELECT_TARGET_RANDOM, 0.0f, true);
|
||||
SelectTargetList(targets, 2, SELECT_TARGET_RANDOM, 0, 0.0f, true);
|
||||
if (!targets.empty())
|
||||
for (std::list<Unit*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
DoCast(*itr, SPELL_SLIME_PUDDLE_TRIGGER);
|
||||
@@ -637,7 +636,7 @@ class boss_professor_putricide : public CreatureScript
|
||||
if (Is25ManRaid())
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
SelectTargetList(targets, 2, SELECT_TARGET_RANDOM, -7.0f, true);
|
||||
SelectTargetList(targets, 2, SELECT_TARGET_RANDOM, 0, -7.0f, true);
|
||||
if (!targets.empty())
|
||||
{
|
||||
Talk(EMOTE_MALLEABLE_GOO);
|
||||
@@ -934,9 +933,9 @@ class spell_putricide_ooze_channel : public SpellScriptLoader
|
||||
void StartAttack()
|
||||
{
|
||||
GetCaster()->ClearUnitState(UNIT_STATE_CASTING);
|
||||
GetCaster()->DeleteThreatList();
|
||||
GetCaster()->GetThreatManager().ClearAllThreat();
|
||||
GetCaster()->ToCreature()->AI()->AttackStart(GetHitUnit());
|
||||
GetCaster()->AddThreat(GetHitUnit(), 500000000.0f); // value seen in sniff
|
||||
GetCaster()->GetThreatManager().AddThreat(GetHitUnit(), 500000000.0f, nullptr, true, true); // value seen in sniff
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -259,7 +259,7 @@ class npc_little_ooze : public CreatureScript
|
||||
DoCast(me, SPELL_WEAK_RADIATING_OOZE, true);
|
||||
DoCast(me, SPELL_GREEN_ABOMINATION_HITTIN__YA_PROC, true);
|
||||
events.ScheduleEvent(EVENT_STICKY_OOZE, 5000);
|
||||
me->AddThreat(summoner, 500000.0f);
|
||||
AddThreat(summoner, 500000.0f);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
|
||||
@@ -1542,7 +1542,7 @@ class spell_frostwarden_handler_focus_fire : public SpellScriptLoader
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
GetCaster()->AddThreat(GetHitUnit(), float(GetEffectValue()));
|
||||
GetCaster()->GetThreatManager().AddThreat(GetHitUnit(), float(GetEffectValue()));
|
||||
GetCaster()->GetAI()->SetData(DATA_WHELP_MARKER, 1);
|
||||
}
|
||||
|
||||
@@ -1562,7 +1562,7 @@ class spell_frostwarden_handler_focus_fire : public SpellScriptLoader
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (SpellEffectInfo const* effect = GetSpellInfo()->GetEffect(EFFECT_1))
|
||||
caster->AddThreat(GetTarget(), -float(effect->CalcValue()));
|
||||
caster->GetThreatManager().AddThreat(GetTarget(), -float(effect->CalcValue()));
|
||||
caster->GetAI()->SetData(DATA_WHELP_MARKER, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -952,7 +952,7 @@ class boss_the_lich_king : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_SOUL_REAPER, urand(33000, 35000), 0, PHASE_TWO_THREE);
|
||||
break;
|
||||
case EVENT_DEFILE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_HARVEST_SOUL_VALKYR))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, true, -SPELL_HARVEST_SOUL_VALKYR))
|
||||
{
|
||||
Talk(EMOTE_DEFILE_WARNING);
|
||||
DoCast(target, SPELL_DEFILE);
|
||||
@@ -1770,7 +1770,7 @@ class npc_terenas_menethil : public CreatureScript
|
||||
if (!me->IsAlive())
|
||||
return;
|
||||
|
||||
me->DeleteThreatList();
|
||||
me->GetThreatManager().ClearAllThreat();
|
||||
me->CombatStop(false);
|
||||
}
|
||||
|
||||
@@ -2772,7 +2772,7 @@ class spell_the_lich_king_vile_spirit_move_target_search : public SpellScriptLoa
|
||||
return;
|
||||
|
||||
GetCaster()->ToCreature()->AI()->AttackStart(GetHitUnit());
|
||||
GetCaster()->AddThreat(GetHitUnit(), 100000.0f);
|
||||
GetCaster()->GetThreatManager().AddThreat(GetHitUnit(), 100000.0f);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -562,7 +562,7 @@ class npc_green_dragon_combat_trigger : public CreatureScript
|
||||
|
||||
// @TODO check out of bounds on all encounter creatures, evade if matched
|
||||
|
||||
std::list<HostileReference*> const& threatList = me->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*> const& threatList = me->GetThreatManager().getThreatList();
|
||||
if (threatList.empty())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
|
||||
@@ -926,7 +926,7 @@ class boss_sister_svalna : public CreatureScript
|
||||
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(SELECT_TARGET_RANDOM, 1, 0.0f, true, true, -SPELL_IMPALING_SPEAR))
|
||||
{
|
||||
DoCast(me, SPELL_AETHER_SHIELD);
|
||||
DoCast(target, SPELL_IMPALING_SPEAR);
|
||||
|
||||
@@ -1459,7 +1459,7 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
if (Creature* warden = instance->SummonCreature(NPC_SPIRIT_WARDEN, SpiritWardenSpawn, NULL, 63000))
|
||||
{
|
||||
terenas->AI()->AttackStart(warden);
|
||||
warden->AddThreat(terenas, 300000.0f);
|
||||
warden->GetThreatManager().AddThreat(terenas, 300000.0f, nullptr, true, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -247,11 +247,7 @@ struct boss_four_horsemen_baseAI : public BossAI
|
||||
continue;
|
||||
|
||||
if (player->IsAlive())
|
||||
{
|
||||
cBoss->AddThreat(player, 0.0f);
|
||||
cBoss->SetInCombatWith(player);
|
||||
player->SetInCombatWith(cBoss);
|
||||
}
|
||||
AddThreat(player, 0.0f, cBoss);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,19 +406,19 @@ class boss_four_horsemen_baron : public CreatureScript
|
||||
{
|
||||
SetCombatMovement(true);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
ThreatManager& threat = me->getThreatManager();
|
||||
if (threat.isThreatListEmpty())
|
||||
ThreatManager& threat = me->GetThreatManager();
|
||||
if (threat.IsThreatListEmpty())
|
||||
{
|
||||
if (Unit* nearest = me->SelectNearestPlayer(5000.0f))
|
||||
{
|
||||
me->AddThreat(nearest, 1.0f);
|
||||
AddThreat(nearest, 1.0f);
|
||||
AttackStart(nearest);
|
||||
}
|
||||
else
|
||||
ResetEncounter();
|
||||
}
|
||||
else
|
||||
AttackStart(threat.getHostilTarget());
|
||||
AttackStart(threat.GetCurrentVictim());
|
||||
|
||||
events.ScheduleEvent(EVENT_BERSERK, Minutes(10));
|
||||
events.ScheduleEvent(EVENT_MARK, Seconds(24));
|
||||
@@ -483,19 +479,19 @@ class boss_four_horsemen_thane : public CreatureScript
|
||||
{
|
||||
SetCombatMovement(true);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
ThreatManager& threat = me->getThreatManager();
|
||||
if (threat.isThreatListEmpty())
|
||||
ThreatManager& threat = me->GetThreatManager();
|
||||
if (threat.IsThreatListEmpty())
|
||||
{
|
||||
if (Unit* nearest = me->SelectNearestPlayer(5000.0f))
|
||||
{
|
||||
me->AddThreat(nearest, 1.0f);
|
||||
AddThreat(nearest, 1.0f);
|
||||
AttackStart(nearest);
|
||||
}
|
||||
else
|
||||
ResetEncounter();
|
||||
}
|
||||
else
|
||||
AttackStart(threat.getHostilTarget());
|
||||
AttackStart(threat.GetCurrentVictim());
|
||||
|
||||
events.ScheduleEvent(EVENT_BERSERK, Minutes(10));
|
||||
events.ScheduleEvent(EVENT_MARK, Seconds(24));
|
||||
@@ -574,7 +570,7 @@ class boss_four_horsemen_lady : public CreatureScript
|
||||
return;
|
||||
if (!_ourMovementFinished)
|
||||
return;
|
||||
if (me->getThreatManager().isThreatListEmpty())
|
||||
if (me->GetThreatManager().IsThreatListEmpty())
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
|
||||
return;
|
||||
@@ -607,7 +603,7 @@ class boss_four_horsemen_lady : public CreatureScript
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 45.0f, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MINDISTANCE, 0, 45.0f, true))
|
||||
DoCast(target, SPELL_HELPER_SHADOW_BOLT);
|
||||
else
|
||||
{
|
||||
@@ -644,7 +640,7 @@ class boss_four_horsemen_sir : public CreatureScript
|
||||
return;
|
||||
if (!_ourMovementFinished)
|
||||
return;
|
||||
if (me->getThreatManager().isThreatListEmpty())
|
||||
if (me->GetThreatManager().IsThreatListEmpty())
|
||||
{
|
||||
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
|
||||
return;
|
||||
@@ -664,7 +660,7 @@ class boss_four_horsemen_sir : public CreatureScript
|
||||
events.Repeat(Seconds(15));
|
||||
break;
|
||||
case EVENT_HOLYWRATH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 45.0f, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MINDISTANCE, 0, 45.0f, true))
|
||||
{
|
||||
DoCast(target, SPELL_HELPER_HOLY_WRATH, true);
|
||||
_shouldSay = true;
|
||||
@@ -677,7 +673,7 @@ class boss_four_horsemen_sir : public CreatureScript
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 45.0f, true))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_MINDISTANCE, 0, 45.0f, true))
|
||||
DoCast(target, SPELL_HELPER_HOLY_BOLT);
|
||||
else
|
||||
{
|
||||
|
||||
@@ -393,7 +393,7 @@ class boss_gothik : public CreatureScript
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_MINION_EVADE:
|
||||
if (_gateIsOpen || me->getThreatManager().isThreatListEmpty())
|
||||
if (_gateIsOpen || me->GetThreatManager().IsThreatListEmpty())
|
||||
return EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
|
||||
if (_gateCanOpen)
|
||||
OpenGate();
|
||||
@@ -419,8 +419,8 @@ class boss_gothik : public CreatureScript
|
||||
// thus we only do a cursory check to make sure (edge cases?)
|
||||
if (Player* newTarget = FindEligibleTarget(me, _gateIsOpen))
|
||||
{
|
||||
me->getThreatManager().resetAllAggro();
|
||||
me->AddThreat(newTarget, 1.0f);
|
||||
ResetThreatList();
|
||||
AddThreat(newTarget, 1.0f);
|
||||
AttackStart(newTarget);
|
||||
}
|
||||
else
|
||||
@@ -502,7 +502,7 @@ class boss_gothik : public CreatureScript
|
||||
Talk(SAY_PHASE_TWO);
|
||||
Talk(EMOTE_PHASE_TWO);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->getThreatManager().resetAllAggro();
|
||||
ResetThreatList();
|
||||
DoCastAOE(SPELL_TELEPORT_LIVE);
|
||||
break;
|
||||
case EVENT_TELEPORT:
|
||||
@@ -512,7 +512,7 @@ class boss_gothik : public CreatureScript
|
||||
me->AttackStop();
|
||||
me->StopMoving();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->getThreatManager().resetAllAggro();
|
||||
ResetThreatList();
|
||||
DoCastAOE(_lastTeleportDead ? SPELL_TELEPORT_LIVE : SPELL_TELEPORT_DEAD);
|
||||
_lastTeleportDead = !_lastTeleportDead;
|
||||
|
||||
@@ -593,7 +593,7 @@ struct npc_gothik_minion_baseAI : public ScriptedAI
|
||||
case ACTION_ACQUIRE_TARGET:
|
||||
if (Player* target = FindEligibleTarget(me, _gateIsOpen))
|
||||
{
|
||||
me->AddThreat(target, 1.0f);
|
||||
AddThreat(target, 1.0f);
|
||||
AttackStart(target);
|
||||
}
|
||||
else
|
||||
@@ -621,8 +621,8 @@ struct npc_gothik_minion_baseAI : public ScriptedAI
|
||||
if (Player* newTarget = FindEligibleTarget(me, _gateIsOpen))
|
||||
{
|
||||
me->RemoveAurasByType(SPELL_AURA_MOD_TAUNT);
|
||||
me->getThreatManager().resetAllAggro();
|
||||
me->AddThreat(newTarget, 1.0f);
|
||||
ResetThreatList();
|
||||
AddThreat(newTarget, 1.0f);
|
||||
AttackStart(newTarget);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -94,7 +94,7 @@ class boss_grobbulus : public CreatureScript
|
||||
events.Repeat(randtime(Seconds(15), Seconds(30)));
|
||||
return;
|
||||
case EVENT_INJECT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_MUTATING_INJECTION))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, true, -SPELL_MUTATING_INJECTION))
|
||||
DoCast(target, SPELL_MUTATING_INJECTION);
|
||||
events.Repeat(Seconds(8) + Milliseconds(uint32(std::round(120 * me->GetHealthPct()))));
|
||||
return;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user