This commit is contained in:
Jelle Meeus
2025-07-13 10:34:30 +02:00
parent 6f81c49570
commit c22ba2b1cf

View File

@@ -15,10 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "CreatureScript.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "naxxramas.h"
enum Says
@@ -36,9 +34,10 @@ enum Says
enum Spells
{
SPELL_CURSE_OF_THE_PLAGUEBRINGER = 29213,
SPELL_REVENGE_OF_THE_PLAGUEBRINGER = 29214,
SPELL_CRIPPLE = 29212,
SPELL_CURSE_OF_THE_PLAGUEBRINGER_10 = 29213,
SPELL_CURSE_OF_THE_PLAGUEBRINGER_25 = 54835,
SPELL_CRIPPLE_10 = 29212,
SPELL_CRIPPLE_25 = 54814,
SPELL_SUMMON_PLAGUED_WARRIORS = 29237,
SPELL_TELEPORT = 29216,
SPELL_TELEPORT_BACK = 29231,
@@ -61,9 +60,9 @@ enum Events
enum Misc
{
NPC_PLAGUED_WARRIOR = 351087,
NPC_PLAGUED_CHAMPION = 351086,
NPC_PLAGUED_GUARDIAN = 351085
// NPC_PLAGUED_WARRIOR = 16984,
// NPC_PLAGUED_CHAMPION = 16983,
// NPC_PLAGUED_GUARDIAN = 16981
};
const Position summoningPosition[5] =
@@ -90,11 +89,8 @@ public:
struct boss_noth_40AI : public BossAI
{
explicit boss_noth_40AI(Creature* c) : BossAI(c, BOSS_NOTH), summons(me)
{
pInstance = me->GetInstanceScript();
}
{}
InstanceScript* pInstance;
uint8 timesInBalcony;
EventMap events;
SummonList summons;
@@ -105,12 +101,12 @@ public:
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_DISABLE_MOVE);
me->SetControlled(false, UNIT_STATE_ROOT);
events.Reset();
events.ScheduleEvent(EVENT_MOVE_TO_BALCONY, 110000);
//events.ScheduleEvent(EVENT_CURSE, urand(50000, 60000)); // more curses, down from 150s to 50-60s
events.ScheduleEvent(EVENT_SUMMON_PLAGUED_WARRIOR_ANNOUNCE, 10000);
events.ScheduleEvent(EVENT_MOVE_TO_BALCONY, 110s);
events.ScheduleEvent(EVENT_CURSE, 15s);
events.ScheduleEvent(EVENT_SUMMON_PLAGUED_WARRIOR_ANNOUNCE, 10s);
if (Is25ManRaid())
{
events.ScheduleEvent(EVENT_BLINK, 26000);
events.ScheduleEvent(EVENT_BLINK, 26s);
}
}
@@ -121,8 +117,8 @@ public:
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_DISABLE_MOVE);
me->SetControlled(true, UNIT_STATE_ROOT);
events.Reset();
events.ScheduleEvent(EVENT_BALCONY_SUMMON_ANNOUNCE, 4000);
events.ScheduleEvent(EVENT_MOVE_TO_GROUND, 70000);
events.ScheduleEvent(EVENT_BALCONY_SUMMON_ANNOUNCE, 4s);
events.ScheduleEvent(EVENT_MOVE_TO_GROUND, 70s);
}
void SummonHelper(uint32 entry, uint32 count)
@@ -152,13 +148,6 @@ public:
me->SetControlled(false, UNIT_STATE_ROOT);
me->SetReactState(REACT_AGGRESSIVE);
timesInBalcony = 0;
if (pInstance)
{
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetGuidData(DATA_NOTH_ENTRY_GATE)))
{
go->SetGoState(GO_STATE_ACTIVE);
}
}
}
void EnterEvadeMode(EvadeReason why) override
@@ -172,13 +161,6 @@ public:
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
StartGroundPhase();
if (pInstance)
{
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetGuidData(DATA_NOTH_ENTRY_GATE)))
{
go->SetGoState(GO_STATE_READY);
}
}
}
void JustSummoned(Creature* summon) override
@@ -196,25 +178,15 @@ public:
}
BossAI::JustDied(killer);
Talk(SAY_DEATH);
if (pInstance)
{
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetGuidData(DATA_NOTH_ENTRY_GATE)))
{
go->SetGoState(GO_STATE_ACTIVE);
}
}
}
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() != TYPEID_PLAYER)
if (!who->IsPlayer())
return;
Talk(SAY_SLAY);
if (pInstance)
{
pInstance->SetData(DATA_IMMORTAL_FAIL, 0);
}
instance->StorePersistentData(PERSISTENT_DATA_IMMORTAL_FAIL, 1);
}
void UpdateAI(uint32 diff) override
@@ -235,19 +207,19 @@ public:
case EVENT_CURSE:
if (events.GetPhaseMask() == 0)
{
me->CastCustomSpell(SPELL_CURSE_OF_THE_PLAGUEBRINGER, SPELLVALUE_MAX_TARGETS, 10, me, false); // TODO: Increase to 20 on 40man
me->CastCustomSpell(SPELL_CURSE_OF_THE_PLAGUEBRINGER_10, SPELLVALUE_MAX_TARGETS, 10, me, false); // TODO: Increase to 20 on 40man
}
events.RepeatEvent(25000); // 50-60 seconds in 40man
events.Repeat(25s); // 50-60 seconds in 40man
break;
case EVENT_SUMMON_PLAGUED_WARRIOR_ANNOUNCE:
Talk(SAY_SUMMON);
Talk(EMOTE_SUMMON);
events.RepeatEvent(30000);
events.ScheduleEvent(EVENT_SUMMON_PLAGUED_WARRIOR_REAL, 4000);
events.Repeat(30s);
events.ScheduleEvent(EVENT_SUMMON_PLAGUED_WARRIOR_REAL, 4s);
break;
case EVENT_SUMMON_PLAGUED_WARRIOR_REAL:
me->CastSpell(me, SPELL_SUMMON_PLAGUED_WARRIORS, true);
SummonHelper(NPC_PLAGUED_WARRIOR, 3);
SummonHelper(NPC_PLAGUED_WARRIOR, RAID_MODE(2, 3, 3, 3));
break;
case EVENT_MOVE_TO_BALCONY:
Talk(EMOTE_TELEPORT_BALCONY);
@@ -256,30 +228,30 @@ public:
break;
case EVENT_BLINK:
DoResetThreatList();
me->CastSpell(me, SPELL_CRIPPLE, false);
me->CastSpell(me, RAID_MODE(SPELL_CRIPPLE_10, SPELL_CRIPPLE_25, SPELL_CRIPPLE_10, SPELL_CRIPPLE_25), false);
me->CastSpell(me, SPELL_BLINK, true);
Talk(EMOTE_BLINK);
events.RepeatEvent(30000);
events.Repeat(30s);
break;
// BALCONY
case EVENT_BALCONY_SUMMON_ANNOUNCE:
Talk(EMOTE_SUMMON_WAVE);
events.RepeatEvent(30000);
events.ScheduleEvent(EVENT_BALCONY_SUMMON_REAL, 4000);
events.Repeat(30s);
events.ScheduleEvent(EVENT_BALCONY_SUMMON_REAL, 4s);
break;
case EVENT_BALCONY_SUMMON_REAL:
me->CastSpell(me, SPELL_SUMMON_PLAGUED_WARRIORS, true); // visual
switch (timesInBalcony)
{
case 0:
SummonHelper(NPC_PLAGUED_CHAMPION, 4);
SummonHelper(NPC_PLAGUED_CHAMPION, RAID_MODE(2, 4, 4, 4));
break;
case 1:
SummonHelper(NPC_PLAGUED_CHAMPION, 2);
SummonHelper(NPC_PLAGUED_GUARDIAN, 2);
SummonHelper(NPC_PLAGUED_CHAMPION, RAID_MODE(1, 2, 2, 2));
SummonHelper(NPC_PLAGUED_GUARDIAN, RAID_MODE(1, 2, 2, 2));
break;
default:
SummonHelper(NPC_PLAGUED_GUARDIAN, 4);
SummonHelper(NPC_PLAGUED_GUARDIAN, RAID_MODE(2, 4, 4, 4));
break;
}
break;