diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 30f08c361..0d29775e0 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -384,11 +384,35 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec return apSpell[urand(0, spellCount - 1)]; } -void ScriptedAI::DoResetThreat() +void ScriptedAI::DoAddThreat(Unit* unit, float amount) +{ + if (!unit) + return; + + me->GetThreatMgr().AddThreat(unit, amount); +} + +void ScriptedAI::DoModifyThreatByPercent(Unit* unit, int32 pct) +{ + if (!unit) + return; + + me->GetThreatMgr().ModifyThreatByPercent(unit, pct); +} + +void ScriptedAI::DoResetThreat(Unit* unit) +{ + if (!unit) + return; + + me->GetThreatMgr().ResetThreat(unit); +} + +void ScriptedAI::DoResetThreatList() { if (!me->CanHaveThreatList() || me->GetThreatMgr().isThreatListEmpty()) { - LOG_ERROR("entities.unit.ai", "DoResetThreat called for creature that either cannot have threat list or has empty threat list (me entry = {})", me->GetEntry()); + LOG_ERROR("entities.unit.ai", "DoResetThreatList called for creature that either cannot have threat list or has empty threat list (me entry = {})", me->GetEntry()); return; } @@ -399,14 +423,8 @@ float ScriptedAI::DoGetThreat(Unit* unit) { if (!unit) return 0.0f; - return me->GetThreatMgr().GetThreat(unit); -} -void ScriptedAI::DoModifyThreatPercent(Unit* unit, int32 pct) -{ - if (!unit) - return; - me->GetThreatMgr().ModifyThreatByPercent(unit, pct); + return me->GetThreatMgr().GetThreat(unit); } void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 4f295a889..a96834d8c 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -304,11 +304,20 @@ struct ScriptedAI : public CreatureAI //Plays music for all players in the zone (zone = true) or the area (zone = false) void DoPlayMusic(uint32 soundId, bool zone); - //Drops all threat to 0%. Does not remove players from the threat list - void DoResetThreat(); + // Add specified amount of threat directly to victim (ignores redirection effects) - also puts victim in combat and engages them if necessary + void DoAddThreat(Unit* unit, float amount); + // Adds/removes the specified percentage from the specified victim's threat (to who, or me if not specified) + void DoModifyThreatByPercent(Unit* unit, int32 pct); + + //Drops all threat to 0%. Does not remove players from the threat list + void DoResetThreat(Unit* unit); + + // Resets the specified unit's threat list (me if not specified) - does not delete entries, just sets their threat to zero + void DoResetThreatList(); + + // Returns the threat level of victim towards who (or me if not specified) float DoGetThreat(Unit* unit); - void DoModifyThreatPercent(Unit* unit, int32 pct); //Teleports a player without dropping threat (only teleports to same map) void DoTeleportPlayer(Unit* unit, float x, float y, float z, float o); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp index d3f83d4a8..20ee519b7 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -115,7 +115,7 @@ public: case EVENT_KNOCKBACK: DoCastVictim(SPELL_KNOCKBACK); if (DoGetThreat(me->GetVictim())) - DoModifyThreatPercent(me->GetVictim(), -50); + DoModifyThreatByPercent(me->GetVictim(), -50); events.ScheduleEvent(EVENT_KNOCKBACK, 15000, 30000); break; case EVENT_CHECK: diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp index 628ff3252..adb0929aa 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_firemaw.cpp @@ -72,7 +72,7 @@ public: case EVENT_WINGBUFFET: DoCastVictim(SPELL_WINGBUFFET); if (DoGetThreat(me->GetVictim())) - DoModifyThreatPercent(me->GetVictim(), -75); + DoModifyThreatByPercent(me->GetVictim(), -75); events.ScheduleEvent(EVENT_WINGBUFFET, 30000); break; case EVENT_FLAMEBUFFET: diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp index e2da1d198..0ab8ad750 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_flamegor.cpp @@ -77,7 +77,7 @@ public: case EVENT_WINGBUFFET: DoCastVictim(SPELL_WINGBUFFET); if (DoGetThreat(me->GetVictim())) - DoModifyThreatPercent(me->GetVictim(), -75); + DoModifyThreatByPercent(me->GetVictim(), -75); events.ScheduleEvent(EVENT_WINGBUFFET, 30000); break; case EVENT_FRENZY: diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp index 733e1a6a3..ca654b883 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp @@ -411,7 +411,7 @@ public: me->SetReactState(REACT_PASSIVE); me->InterruptNonMeleeSpells(false); me->AttackStop(); - DoResetThreat(); + DoResetThreatList(); me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); DoCastSelf(SPELL_RAGNA_SUBMERGE_VISUAL, true); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 8ba3955a7..c0b508cfb 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -496,7 +496,7 @@ public: { if (me->GetVictim()) { - DoModifyThreatPercent(me->GetVictim(), -100); + DoModifyThreatByPercent(me->GetVictim(), -100); } me->AddThreat(target, 1000000.0f); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index 8de6e59ce..482a3b0c5 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -915,7 +915,7 @@ public: DoCast(target, SPELL_LITTLE_RED_RIDING_HOOD, true); TempThreat = DoGetThreat(target); if (TempThreat) - DoModifyThreatPercent(target, -100); + DoModifyThreatByPercent(target, -100); HoodGUID = target->GetGUID(); me->AddThreat(target, 1000000.0f); ChaseTimer = 20000; @@ -930,7 +930,7 @@ public: { HoodGUID.Clear(); if (DoGetThreat(target)) - DoModifyThreatPercent(target, -100); + DoModifyThreatByPercent(target, -100); me->AddThreat(target, TempThreat); TempThreat = 0; } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index 8d8bde598..f8b9ab0c2 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -462,7 +462,7 @@ public: { case EVENT_SPELL_VANISH: me->CastSpell(me, SPELL_VANISH, false); - DoResetThreat(); + DoResetThreatList(); if (Unit* unit = SelectTarget(SelectTargetMethod::Random, 0)) me->AddThreat(unit, 1000.0f); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index 5a8e61053..ffd84ba75 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -313,7 +313,7 @@ public: case 3: case 4: me->NearTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, me->GetOrientation()); - DoResetThreat(); + DoResetThreatList(); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); me->RemoveAurasDueToSpell(Transform[Phase].unaura); DoCast(me, Transform[Phase].spell); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 0b8af4541..f568b0411 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -232,7 +232,7 @@ public: me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(EQUIP_UNEQUIP)); me->AttackStop(); - DoResetThreat(); + DoResetThreatList(); me->SetReactState(REACT_PASSIVE); me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); DoCastSelf(SPELL_VANISH_VISUAL); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp index c50f5a75b..46b76001f 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -91,7 +91,7 @@ public: } DoCast(me, SPELL_AVATAR); me->SetReactState(REACT_PASSIVE); - DoResetThreat(); + DoResetThreatList(); events.ScheduleEvent(EVENT_START_PURSUIT, 2s); events.ScheduleEvent(EVENT_STOP_PURSUIT, 15s); events.ScheduleEvent(EVENT_AVATAR, 45s, 50s); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index 5b35f0ba4..8cfd657d5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -164,7 +164,7 @@ struct boss_jeklik : public BossAI if (events.IsInPhase(PHASE_ONE) && !HealthAbovePct(50)) { me->RemoveAurasDueToSpell(SPELL_BAT_FORM); - DoResetThreat(); + DoResetThreatList(); events.SetPhase(PHASE_TWO); events.CancelEventGroup(PHASE_ONE); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 1b7bd7064..fcdfb773a 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -163,7 +163,7 @@ public: me->SetReactState(REACT_PASSIVE); me->SetStandState(UNIT_STAND_STATE_SLEEP); me->AttackStop(); - DoResetThreat(); + DoResetThreatList(); WasDead = true; CheckPhaseTransition(); Talk(EMOTE_THEKAL_DIES); @@ -245,7 +245,7 @@ public: if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) { DoCast(target, SPELL_CHARGE); - DoResetThreat(); + DoResetThreatList(); AttackStart(target); } context.Repeat(15s, 22s); @@ -407,7 +407,7 @@ public: if (DoGetThreat(me->GetVictim())) { - DoModifyThreatPercent(me->GetVictim(), -100); + DoModifyThreatByPercent(me->GetVictim(), -100); } context.Repeat(17s, 27s); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index dd70460c0..03f42044d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -252,7 +252,7 @@ public: // shapeshift at 50% health DoCast(me, SPELL_VENOXIS_TRANSFORM); Talk(SAY_VENOXIS_TRANSFORM); - DoResetThreat(); + DoResetThreatList(); // phase two events (snakeform) events.ScheduleEvent(EVENT_VENOM_SPIT, 5000, 0, PHASE_TWO); diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 615bb0b91..c8f5bc090 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -354,7 +354,7 @@ public: me->AttackStop(); me->SetReactState(REACT_PASSIVE); me->StopMoving(); - DoResetThreat(); + DoResetThreatList(); me->GetMotionMaster()->MovePoint(10, OnyxiaMoveData[0].x, OnyxiaMoveData[0].y, OnyxiaMoveData[0].z); break; } @@ -404,7 +404,7 @@ public: Talk(SAY_PHASE_3_TRANS); me->SendMeleeAttackStop(me->GetVictim()); me->GetMotionMaster()->MoveLand(13, OnyxiaMoveData[0].x + 1.0f, OnyxiaMoveData[0].y, OnyxiaMoveData[0].z, 12.0f); - DoResetThreat(); + DoResetThreatList(); break; } case EVENT_SPELL_FIREBALL_FIRST: diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index 27fafe6d5..9d4bd1367 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -221,7 +221,7 @@ struct boss_ayamiss : public BossAI me->SetCanFly(false); me->SetDisableGravity(false); me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false); - DoResetThreat(); + DoResetThreatList(); _scheduler.CancelGroup(PHASE_AIR); } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp index ee9317513..b347b61c7 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp @@ -120,7 +120,7 @@ struct boss_buru : public BossAI events.ScheduleEvent(EVENT_GATHERING_SPEED, 2s); if (Unit* victim = SelectTarget(SelectTargetMethod::Random, 0, 0.f, true)) { - DoResetThreat(); + DoResetThreatList(); AttackStart(victim); me->AddThreat(victim, 1000000.f); Talk(EMOTE_TARGET, victim); @@ -143,7 +143,7 @@ struct boss_buru : public BossAI events.Reset(); _phase = PHASE_TRANSFORM; instance->SetData(DATA_BURU_PHASE, _phase); - DoResetThreat(); + DoResetThreatList(); events.ScheduleEvent(EVENT_CREEPING_PLAGUE, 2s); DoCastSelf(SPELL_BURU_TRANSFORM); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index 16354a9b9..d8d010bc0 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -166,7 +166,7 @@ public: me->SetSpeed(MOVE_RUN, 15.f/7.f); // From sniffs DoCastSelf(SPELL_FULL_HEAL, true); if (me->GetThreatMgr().GetThreatListSize()) - DoResetThreat(); + DoResetThreatList(); if (Creature* dying = instance->GetCreature(_creatureDying)) { dying->AI()->DoAction(ACTION_EXPLODE); @@ -419,7 +419,7 @@ struct boss_yauj : public boss_bug_trio .Schedule(12s, [this](TaskContext context) { DoCastAOE(SPELL_FEAR); - DoResetThreat(); + DoResetThreatList(); context.Repeat(20600ms); }) .Schedule(11s, 14500ms, [this](TaskContext context) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 85b20099a..2e56cb55b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -352,7 +352,7 @@ struct npc_dirt_mound : ScriptedAI void ChaseNewTarget() { - DoResetThreat(); + DoResetThreatList(); if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 200.f, true)) { me->AddThreat(target, 1000000.f); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 1d605ee86..e06e61c51 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -178,7 +178,7 @@ struct boss_skeram : public BossAI break; case EVENT_BLINK: DoCast(me, BlinkSpells[urand(0, 2)]); - DoResetThreat(); + DoResetThreatList(); events.ScheduleEvent(EVENT_BLINK, 10s, 30s); break; case EVENT_EARTH_SHOCK: @@ -196,7 +196,7 @@ struct boss_skeram : public BossAI DoTeleport(image); } } - DoResetThreat(); + DoResetThreatList(); events.RescheduleEvent(EVENT_BLINK, 10s, 30s); break; case EVENT_INIT_IMAGE: diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 57ec3bf65..99c1080bf 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -158,7 +158,7 @@ struct boss_twinemperorsAI : public BossAI if (action == ACTION_AFTER_TELEPORT) { - DoResetThreat(); + DoResetThreatList(); me->SetReactState(REACT_PASSIVE); DoCastSelf(SPELL_TWIN_TELEPORT_VISUAL, true); _scheduler.DelayAll(2300ms); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index 5e5825ede..60f2c7571 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -195,7 +195,7 @@ struct boss_viscidus : public BossAI me->SetAuraStack(SPELL_VISCIDUS_SHRINKS, me, 20); me->LowerPlayerDamageReq(me->GetMaxHealth()); me->SetHealth(me->GetMaxHealth() * 0.01f); // set 1% health - DoResetThreat(); + DoResetThreatList(); me->NearTeleportTo(roomCenter.GetPositionX(), roomCenter.GetPositionY(), roomCenter.GetPositionZ(), diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index 669b1f74a..eda077307 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -429,7 +429,7 @@ public: { case SPELL_CLAW_N: case SPELL_CLAW_H: - DoResetThreat(); + DoResetThreatList(); if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f)) { me->AddThreat(target, 100.0f); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index fa2c3f503..8b6b9bed3 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -927,7 +927,7 @@ public: Player* player = itr->GetSource(); if( player && me->IsInRange(player, 8.0f, 25.0f, false) ) { - DoResetThreat(); + DoResetThreatList(); me->AddThreat(player, 5.0f); me->CastSpell(player, SPELL_INTERCEPT, false); break; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 28149ab59..515116cc6 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -767,7 +767,7 @@ public: me->RemoveAllAuras(); } DoZoneInCombat(); - DoResetThreat(); + DoResetThreatList(); if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true) ) { if (!next) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index ebf54535a..24e77ff24 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -336,7 +336,7 @@ public: case EVENT_SPELL_FEL_STEAK: if( Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 44.0f, true) ) { - DoResetThreat(); + DoResetThreatList(); me->AddThreat(target, 50000.0f); me->CastSpell(target, SPELL_FEL_STEAK_MORPH, true); me->CastSpell(target, SPELL_FEL_STEAK, true); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index eb68e0dfd..bfbcf80c6 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -593,7 +593,7 @@ struct boss_jormungarAI : public ScriptedAI } me->UpdatePosition(Locs[LOC_CENTER].GetPositionX() + cos(angle)*dist, Locs[LOC_CENTER].GetPositionY() + std::sin(angle)*dist, me->GetPositionZ(), me->GetOrientation(), true); me->StopMovingOnCurrentPos(); - DoResetThreat(); + DoResetThreatList(); events.RescheduleEvent(EVENT_EMERGE, 6000); } diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 024f1033f..f513dc46d 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -971,7 +971,7 @@ public: case EVENT_SHADOW_STEP: if (Unit* target = SelectTargetFromPlayerList(100.0f, 0, true)) { - DoResetThreat(); + DoResetThreatList(); me->AddThreat(target, 5000.0f); AttackStart(target); me->CastSpell(target, SPELL_SHADOW_STEP, false); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index fdb3b37f4..0ccd5fd16 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -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); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index ddf8897f5..dceec2f43 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -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); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index b581decfc..88b8e27af 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -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()); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index fc2d7d29d..e4aa237d4 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -254,7 +254,7 @@ public: StartBalconyPhase(); break; case EVENT_BLINK: - DoResetThreat(); + DoResetThreatList(); me->CastSpell(me, RAID_MODE(SPELL_CRIPPLE_10, SPELL_CRIPPLE_25), false); me->CastSpell(me, SPELL_BLINK, true); Talk(EMOTE_BLINK); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index ab9689c13..30fb59018 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -835,7 +835,7 @@ public: _flyTargetGUID.Clear(); me->RemoveAura(SPELL_LIGHTNING_TENDRILS); me->RemoveAura(61883); - DoResetThreat(); + DoResetThreatList(); break; case EVENT_ENRAGE: Talk(SAY_BRUNDIR_BERSERK); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 17001fc61..1ccebe1a3 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -412,7 +412,7 @@ public: if (_feralRushTimer >= 6000) { - DoResetThreat(); + DoResetThreatList(); if (!UpdateVictim()) return; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 9b969e8c7..316f39a42 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -1184,7 +1184,7 @@ public: break; case EVENT_DETONATING_LASHER_FLAME_LASH: me->CastSpell(me->GetVictim(), SPELL_FLAME_LASH, false); - DoResetThreat(); + DoResetThreatList(); if (Unit* target = SelectTargetFromPlayerList(80)) AttackStart(target); else diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index d2ae3c9ae..2f153e123 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -1033,7 +1033,7 @@ public: break; case 4: me->SetReactState(REACT_AGGRESSIVE); - DoResetThreat(); + DoResetThreatList(); Phase = 4; me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); if (Unit* target = SelectTargetFromPlayerList(75.0f)) @@ -1613,7 +1613,7 @@ public: break; case 4: me->SetReactState(REACT_AGGRESSIVE); - DoResetThreat(); + DoResetThreatList(); Phase = 4; me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); if (Unit* target = SelectTargetFromPlayerList(75.0f)) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index cf14371f9..80d836218 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -518,7 +518,7 @@ public: Talk(EMOTE_PERMA_GROUND); me->SetControlled(false, UNIT_STATE_ROOT); me->DisableRotate(false); - DoResetThreat(); + DoResetThreatList(); Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 0.0, true); if (!target) target = me->SelectNearestPlayer(200.0f); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index 44dbcd34b..0538c4e75 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -552,7 +552,7 @@ public: summons.DoAction(ACTION_SIF_JOIN_FIGHT, pred); } - DoResetThreat(); + DoResetThreatList(); if (Player* player = GetArenaPlayer()) me->AddThreat(player, 1000.0f); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 21d21e3d7..2ab279cdd 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -1511,7 +1511,7 @@ public: { if (who && damagetype == DIRECT_DAMAGE) { - DoResetThreat(); + DoResetThreatList(); me->AddThreat(who, 100000); AttackStart(who); me->InterruptNonMeleeSpells(false); @@ -1539,7 +1539,7 @@ public: return; me->CastSpell(me, SPELL_DIMINISH_POWER, false); - DoResetThreat(); + DoResetThreatList(); } }; }; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp index d9d31d4bd..cd20acec9 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -198,7 +198,7 @@ public: case EVENT_SHARVALD_CHARGE: if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, (IsHeroic() ? 100.0f : 30.0f), true)) { - ScriptedAI::DoResetThreat(); + DoResetThreatList(); me->AddThreat(target, 10000.0f); me->CastSpell(target, SPELL_CHARGE, false); } diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp index e298fb3bd..69bd9bba2 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp @@ -123,7 +123,7 @@ public: break; case EVENT_SPELL_ARCANE_VACUUM: me->CastSpell((Unit*)nullptr, SPELL_ARCANE_VACUUM, false); - DoResetThreat(); + DoResetThreatList(); me->SetControlled(true, UNIT_STATE_ROOT); me->setAttackTimer(BASE_ATTACK, 3000); events.RepeatEvent(30000); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp index 8404dd047..d51a1a21a 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp @@ -124,7 +124,7 @@ public: me->CastSpell(target, SPELL_INCITE_CHAOS_B, true); } - DoResetThreat(); + DoResetThreatList(); InciteChaos = true; events.DelayEvents(15000); events.RepeatEvent(40000); diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 55c3c83b1..57d52608a 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -247,7 +247,7 @@ public: if (me->IsWithinMeleeRange(me->GetVictim())) { me->SetReactState(REACT_AGGRESSIVE); - DoResetThreat(); + DoResetThreatList(); me->GetVictim()->InterruptNonMeleeSpells(false); me->AddThreat(me->GetVictim(), 1000000.0f); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index 722db4cce..ed2bad609 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -80,7 +80,7 @@ public: { events.CancelEventGroup(EVENT_GROUP_ABILITIES); events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000); - DoResetThreat(); + DoResetThreatList(); if (!run) { @@ -167,7 +167,7 @@ public: case EVENT_SWITCH_TARGET: if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true)) { - DoResetThreat(); + DoResetThreatList(); me->AddThreat(target, 5000000.0f); Talk(EMOTE_NEW_TARGET); } diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 067539dd6..0ebafc214 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -553,7 +553,7 @@ public: me->CastSpell(me, SPELL_VANISH_OUT, false); break; case EVENT_SPELL_ENRAGE: - DoResetThreat(); + DoResetThreatList(); if (Creature* council = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_ILLIDARI_COUNCIL))) council->GetAI()->DoAction(ACTION_ENRAGE); break; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp index 9f4025652..84424b482 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp @@ -120,7 +120,7 @@ public: void SetForm(bool corrupt, bool initial) { events.CancelEventGroup(GROUP_ABILITIES); - DoResetThreat(); + DoResetThreatList(); if (corrupt) { diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index c5da506eb..e44902333 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -203,7 +203,7 @@ public: { if (me->GetDisplayId() != me->GetNativeDisplayId()) { - DoResetThreat(); + DoResetThreatList(); me->LoadEquipment(); me->RemoveAurasDueToSpell(SPELL_METAMORPHOSIS); events.ScheduleEvent(EVENT_SPELL_WHIRLWIND, 10000); @@ -223,7 +223,7 @@ public: events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000); break; case EVENT_SWITCH_TO_DEMON: - DoResetThreat(); + DoResetThreatList(); Talk(SAY_SWITCH_TO_DEMON); me->LoadEquipment(0, true); me->GetMotionMaster()->MoveChase(me->GetVictim(), 25.0f); @@ -234,7 +234,7 @@ public: events.ScheduleEvent(EVENT_SWITCH_TO_ELF, 60000); break; case EVENT_SWITCH_TO_ELF: - DoResetThreat(); + DoResetThreatList(); me->LoadEquipment(); me->GetMotionMaster()->MoveChase(me->GetVictim(), 0.0f); me->RemoveAurasDueToSpell(SPELL_METAMORPHOSIS); diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp index f7d0046b0..6209c20be 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp @@ -201,7 +201,7 @@ public: head->AI()->Talk(threatYell - 1); events.ScheduleEvent(threatYell, 3000); - DoResetThreat(); + DoResetThreatList(); me->AddThreat(target, 10.0f); } events.ScheduleEvent(EVENT_RESET_THREAT, 30000); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index eea9cda11..e96823f92 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -480,7 +480,7 @@ public: events2.CancelEvent(EVENT_PREFIGHT_PHASE71); Talk(SAY_PHASE4_INTRO2); phase = PHASE_FINAL; - DoResetThreat(); + DoResetThreatList(); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE); if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) AttackStart(target);