refactor(Core/ScriptedAI): few improvements with threat methods (#13146)

improve threat scripts

Co-authored-by: Maelthyrr <lynethris@protonmail.ch>
This commit is contained in:
Maelthyr
2022-11-12 13:29:28 +01:00
committed by GitHub
parent 758ed35db3
commit c1c9dc6105
50 changed files with 100 additions and 73 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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());