diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2017-07-01 20:18:02 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2020-08-13 22:46:44 +0200 |
| commit | 8be23fcbbdf26e8169defd761e61765f301bebe0 (patch) | |
| tree | 6309b79f7dd617a8ddc801624dbbd4ed7ac22174 /src/server/scripts/EasternKingdoms/ScarletEnclave | |
| parent | 2c99678118798279372f17d4bb5f5a88ac95c413 (diff) | |
[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)
Diffstat (limited to 'src/server/scripts/EasternKingdoms/ScarletEnclave')
| -rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 461d326dd3e..7c908b850b2 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -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(); } } |
