Skip to content

Commit

Permalink
horsemen: on death summon spirit that continues to cast marks
Browse files Browse the repository at this point in the history
  • Loading branch information
sogladev committed May 4, 2024
1 parent 06ac31a commit 64c82a1
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/Naxxramas/scripts/boss_four_horsemen_40.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ enum Misc
HORSEMAN_KORTHAZZ = 3
};

enum Spirits
{
// Spells
SPELL_SUMMON_SPIRIT_ZELIEK = 28934,
SPELL_SUMMON_SPIRIT_BLAUMEUX = 28931,
SPELL_SUMMON_SPIRIT_MOGRAINE = 28928,
SPELL_SUMMON_SPIRIT_KORTHAZZ = 28932,
// NPCs
NPC_SPIRIT_ZELIEK = 16777,
NPC_SPIRIT_BLAUMEUX = 16776,
NPC_SPIRIT_MOGRAINE = 16775,
NPC_SPIRIT_KORTHAZZ = 16778
};

enum FourHorsemen
{
SAY_AGGRO = 0,
Expand All @@ -75,6 +89,8 @@ enum FourHorsemen

// MARKS
const uint32 TABLE_SPELL_MARK[4] = {SPELL_MARK_OF_ZELIEK, SPELL_MARK_OF_BLAUMEUX, SPELL_MARK_OF_MOGRAINE, SPELL_MARK_OF_KORTHAZZ};
// SPIRITS
const uint32 TABLE_SPELL_SUMMON_SPIRIT[4] = {SPELL_SUMMON_SPIRIT_ZELIEK, SPELL_SUMMON_SPIRIT_BLAUMEUX, SPELL_SUMMON_SPIRIT_MOGRAINE, SPELL_SUMMON_SPIRIT_KORTHAZZ};

class boss_four_horsemen_40 : public CreatureScript
{
Expand Down Expand Up @@ -133,6 +149,7 @@ class boss_four_horsemen_40 : public CreatureScript
events.Reset();
events.RescheduleEvent(EVENT_MARK_CAST, 20000);
events.RescheduleEvent(EVENT_BERSERK, 600000);
summons.DespawnAll(); // despawn spirits
if ((me->GetEntry() != NPC_LADY_BLAUMEUX_40 && me->GetEntry() != NPC_SIR_ZELIEK_40))
{
events.RescheduleEvent(EVENT_PRIMARY_SPELL, 10000 + rand() % 5000);
Expand Down Expand Up @@ -172,6 +189,14 @@ class boss_four_horsemen_40 : public CreatureScript
{
if (pInstance->GetBossState(BOSS_HORSEMAN) == DONE)
{
if (Creature* spirit = GetClosestCreatureWithEntry(me, NPC_SPIRIT_ZELIEK, 200.0f))
spirit->DespawnOrUnsummon();
if (Creature* spirit = GetClosestCreatureWithEntry(me, NPC_SPIRIT_BLAUMEUX, 200.0f))
spirit->DespawnOrUnsummon();
if (Creature* spirit = GetClosestCreatureWithEntry(me, NPC_SPIRIT_MOGRAINE, 200.0f))
spirit->DespawnOrUnsummon();
if (Creature* spirit = GetClosestCreatureWithEntry(me, NPC_SPIRIT_KORTHAZZ, 200.0f))
spirit->DespawnOrUnsummon();
if (!me->GetMap()->GetPlayers().IsEmpty())
{
if (Player* player = me->GetMap()->GetPlayers().getFirst()->GetSource())
Expand All @@ -187,10 +212,22 @@ class boss_four_horsemen_40 : public CreatureScript
go->SetGoState(GO_STATE_ACTIVE);
}
}
else
{
// Prevent spawning if last horseman killed
DoCastSelf(TABLE_SPELL_SUMMON_SPIRIT[horsemanId], true);
}
}
Talk(SAY_DEATH);
}

void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
summons.DoZoneInCombat();
summon->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE);
}

void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
Expand Down
11 changes: 11 additions & 0 deletions src/Naxxramas/sql/world/naxx40_creatures.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5710,3 +5710,14 @@ UPDATE `creature_template_addon` SET `bytes2` = 1 WHERE (`entry` = 16452);
-- Restore blue sword
UPDATE `creature_template_addon` SET `bytes2` = 1 WHERE (`entry` = 16861);
UPDATE `creature_equip_template` SET `ItemID1` = 13623 WHERE (`CreatureID` = 16861);

-- Horsemen spirits cast Mark, initial 20s, repeat 12s
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` IN (16775, 16776, 16777, 16778);
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` IN (16775, 16776, 16777, 16778));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(16775, 0, 0, 0, 0, 0, 100, 0, 20000, 20000, 12000, 12000, 0, 0, 11, 28834, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Spirit of Mograine - In Combat - Cast \'Mark of Mograine\''),
(16776, 0, 0, 0, 0, 0, 100, 0, 20000, 20000, 12000, 12000, 0, 0, 11, 28833, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Spirit of Blaumeux - In Combat - Cast \'Mark of Blaumeux\''),
(16777, 0, 0, 0, 0, 0, 100, 0, 20000, 20000, 12000, 12000, 0, 0, 11, 28835, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Spirit of Zeliek - In Combat - Cast \'Mark of Zeliek\''),
(16778, 0, 0, 0, 0, 0, 100, 0, 20000, 20000, 12000, 12000, 0, 0, 11, 28832, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Spirit of Korthazz - In Combat - Cast \'Mark of Korthazz\'');
-- fix: Mograine spirit is 73? and attackable
UPDATE `creature_template` SET `minlevel` = 63, `maxlevel` = 63, `DamageModifier` = 10, `unit_flags` = 2, `MovementType` = 0 WHERE (`entry` = 16775);

0 comments on commit 64c82a1

Please sign in to comment.