mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 00:53:46 +00:00
refactor(Core/ScriptedAI): few improvements with threat methods (#13146)
improve threat scripts Co-authored-by: Maelthyrr <lynethris@protonmail.ch>
This commit is contained in:
@@ -305,7 +305,7 @@ public:
|
||||
Unit* unit = ObjectAccessor::GetUnit((*me), (*itr)->getUnitGuid());
|
||||
|
||||
if (unit && DoGetThreat(unit))
|
||||
DoModifyThreatPercent(unit, -100);
|
||||
DoModifyThreatByPercent(unit, -100);
|
||||
}
|
||||
|
||||
Talk(SAY_PHASE_2);
|
||||
|
||||
@@ -383,7 +383,7 @@ public:
|
||||
me->CastSpell(me, SPELL_WEAK_RADIATING_OOZE, true);
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_STICKY_OOZE, 5000);
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
me->SetInCombatWithZone();
|
||||
if (TempSummon* ts = me->ToTempSummon())
|
||||
if (Unit* summoner = ts->GetSummonerUnit())
|
||||
@@ -468,7 +468,7 @@ public:
|
||||
me->CastSpell(me, SPELL_GREEN_ABOMINATION_HITTIN__YA_PROC, true);
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_STICKY_OOZE, 5000);
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
me->SetInCombatWithZone();
|
||||
if (Player* p = me->SelectNearestPlayer(100.0f))
|
||||
AttackStart(p);
|
||||
|
||||
@@ -1777,7 +1777,7 @@ public:
|
||||
c->NearTeleportTo(myPos.GetPositionX(), myPos.GetPositionY(), myPos.GetPositionZ(), myPos.GetOrientation());
|
||||
const ThreatContainer::StorageType me_tl = me->GetThreatMgr().GetThreatList();
|
||||
const ThreatContainer::StorageType target_tl = c->GetThreatMgr().GetThreatList();
|
||||
DoResetThreat();
|
||||
DoResetThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator iter = target_tl.begin(); iter != target_tl.end(); ++iter)
|
||||
me->GetThreatMgr().AddThreat((*iter)->getTarget(), (*iter)->GetThreat());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user