Skip to content

Commit

Permalink
[Scripts] Naxxramas scripts refactor with namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
liyunfan1223 committed May 26, 2024
1 parent 1e22c4d commit 12ea82a
Show file tree
Hide file tree
Showing 28 changed files with 239 additions and 66 deletions.
1 change: 1 addition & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "ScriptedCreature.h"
#include "naxxramas.h"

using namespace Anubrekhan;

void AddSC_boss_anubrekhan()
{
Expand Down
4 changes: 4 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "ScriptedCreature.h"
#include "naxxramas.h"

namespace Anubrekhan {

enum AnubrekhanSays
{
ANUBREKHAN_SAY_AGGRO = 0,
Expand Down Expand Up @@ -229,4 +231,6 @@ class boss_anubrekhan : public CreatureScript
};
};

}

#endif
1 change: 1 addition & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "SpellInfo.h"
#include "naxxramas.h"

using namespace Faerlina;

void AddSC_boss_faerlina()
{
Expand Down
4 changes: 4 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_faerlina.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "SpellInfo.h"
#include "naxxramas.h"

namespace Faerlina {

enum FaerlinaYells
{
FAERLINA_SAY_GREET = 0,
Expand Down Expand Up @@ -232,4 +234,6 @@ class boss_faerlina : public CreatureScript
};
};

}

#endif
58 changes: 23 additions & 35 deletions src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
#include "SpellScriptLoader.h"
#include "naxxramas.h"

enum FourHorsemenSpells
namespace FourHorsemen {

enum Spells
{
FOURHORSEMEN_SPELL_BERSERK = 26662,
SPELL_BERSERK = 26662,
// Marks
SPELL_MARK_OF_KORTHAZZ = 28832,
SPELL_MARK_OF_BLAUMEUX = 28833,
Expand All @@ -38,15 +40,15 @@ enum FourHorsemenSpells
SPELL_RIVENDARE_UNHOLY_SHADOW_25 = 57369
};

enum FourHorsemenEvents
enum Events
{
EVENT_MARK_CAST = 1,
EVENT_PRIMARY_SPELL = 2,
EVENT_SECONDARY_SPELL = 3,
FOURHORSEMEN_EVENT_BERSERK = 4
EVENT_BERSERK = 4
};

enum FourHorsemenMisc
enum Misc
{
// Movement
MOVE_PHASE_NONE = 0,
Expand All @@ -61,12 +63,12 @@ enum FourHorsemenMisc

enum FourHorsemen
{
FOURHORSEMEN_SAY_AGGRO = 0,
FOURHORSEMEN_SAY_TAUNT = 1,
FOURHORSEMEN_SAY_SPECIAL = 2,
FOURHORSEMEN_SAY_SLAY = 3,
FOURHORSEMEN_SAY_DEATH = 4,
FOURHORSEMEN_EMOTE_RAGECAST = 7
SAY_AGGRO = 0,
SAY_TAUNT = 1,
SAY_SPECIAL = 2,
SAY_SLAY = 3,
SAY_DEATH = 4,
EMOTE_RAGECAST = 7
};

// MARKS
Expand Down Expand Up @@ -180,7 +182,7 @@ class boss_four_horsemen : public CreatureScript
me->SetReactState(REACT_AGGRESSIVE);
events.Reset();
events.RescheduleEvent(EVENT_MARK_CAST, 24s);
events.RescheduleEvent(FOURHORSEMEN_EVENT_BERSERK, 10min);
events.RescheduleEvent(EVENT_BERSERK, 10min);
if ((me->GetEntry() != NPC_LADY_BLAUMEUX && me->GetEntry() != NPC_SIR_ZELIEK))
{
events.RescheduleEvent(EVENT_PRIMARY_SPELL, 10s, 15s);
Expand Down Expand Up @@ -247,7 +249,7 @@ class boss_four_horsemen : public CreatureScript
if (who->GetTypeId() != TYPEID_PLAYER)
return;

Talk(FOURHORSEMEN_SAY_SLAY);
Talk(SAY_SLAY);
if (pInstance)
{
pInstance->SetData(DATA_IMMORTAL_FAIL, 0);
Expand Down Expand Up @@ -277,15 +279,15 @@ class boss_four_horsemen : public CreatureScript
}
}
}
Talk(FOURHORSEMEN_SAY_DEATH);
Talk(SAY_DEATH);
}

void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
if (movementPhase == MOVE_PHASE_NONE)
{
Talk(FOURHORSEMEN_SAY_AGGRO);
Talk(SAY_AGGRO);
me->SetReactState(REACT_PASSIVE);
movementPhase = MOVE_PHASE_STARTED;
me->SetSpeed(MOVE_RUN, me->GetSpeedRate(MOVE_RUN), true);
Expand Down Expand Up @@ -324,12 +326,12 @@ class boss_four_horsemen : public CreatureScript
me->CastSpell(me, TABLE_SPELL_MARK[horsemanId], false);
events.Repeat((me->GetEntry() == NPC_LADY_BLAUMEUX || me->GetEntry() == NPC_SIR_ZELIEK) ? 15s : 12s);
return;
case FOURHORSEMEN_EVENT_BERSERK:
Talk(FOURHORSEMEN_SAY_SPECIAL);
me->CastSpell(me, FOURHORSEMEN_SPELL_BERSERK, true);
case EVENT_BERSERK:
Talk(SAY_SPECIAL);
me->CastSpell(me, SPELL_BERSERK, true);
return;
case EVENT_PRIMARY_SPELL:
Talk(FOURHORSEMEN_SAY_TAUNT);
Talk(SAY_TAUNT);
me->CastSpell(me->GetVictim(), RAID_MODE(TABLE_SPELL_PRIMARY_10[horsemanId], TABLE_SPELL_PRIMARY_25[horsemanId]), false);
events.Repeat(15s);
return;
Expand All @@ -355,7 +357,7 @@ class boss_four_horsemen : public CreatureScript
else if (!me->IsWithinDistInMap(me->GetVictim(), 45.0f) || !me->IsValidAttackTarget(me->GetVictim()))
{
DoCastAOE(TABLE_SPELL_PUNISH[horsemanId]);
Talk(FOURHORSEMEN_EMOTE_RAGECAST);
Talk(EMOTE_RAGECAST);
}
}
else
Expand Down Expand Up @@ -423,20 +425,6 @@ class spell_four_horsemen_mark : public SpellScriptLoader
}
};

class spell_four_horsemen_consumption : public SpellScript
{
PrepareSpellScript(spell_four_horsemen_consumption);

void HandleDamageCalc(SpellEffIndex /*effIndex*/)
{
uint32 damage = GetCaster()->GetMap()->ToInstanceMap()->GetDifficulty() == REGULAR_DIFFICULTY ? 2750 : 4250;
SetHitDamage(damage);
}

void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_four_horsemen_consumption::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
} // namespace FourHorsemen

#endif
1 change: 1 addition & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "SpellScriptLoader.h"
#include "naxxramas.h"

using namespace Gluth;

void AddSC_boss_gluth()
{
Expand Down
4 changes: 4 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_gluth.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "SpellScript.h"
#include "naxxramas.h"

namespace Gluth {

enum GluthSpells
{
GLUTH_SPELL_MORTAL_WOUND = 25646,
Expand Down Expand Up @@ -263,4 +265,6 @@ class spell_gluth_decimate : public SpellScriptLoader
}
};

}

#endif
2 changes: 2 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "SpellScriptLoader.h"
#include "naxxramas.h"

using namespace Gothik;

void AddSC_boss_gothik()
{
new boss_gothik();
Expand Down
4 changes: 4 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_gothik.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "SpellScript.h"
#include "naxxramas.h"

namespace Gothik {

enum GothikYells
{
GOTHIK_SAY_INTRO_1 = 0,
Expand Down Expand Up @@ -699,4 +701,6 @@ class spell_gothik_shadow_bolt_volley : public SpellScriptLoader
}
};

}

#endif
2 changes: 2 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "SpellScriptLoader.h"
#include "naxxramas.h"

using namespace Grobbulus;

void AddSC_boss_grobbulus()
{
new boss_grobbulus();
Expand Down
4 changes: 4 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_grobbulus.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "SpellScript.h"
#include "naxxramas.h"

namespace Grobbulus {

enum GrobbulusSpells
{
GROBBULUS_SPELL_POISON_CLOUD = 28240,
Expand Down Expand Up @@ -305,4 +307,6 @@ class spell_grobbulus_mutating_injection : public SpellScriptLoader
}
};

}

#endif
2 changes: 2 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

#include "boss_heigan.h"

using namespace Heigan;

void AddSC_boss_heigan()
{
new boss_heigan();
Expand Down
3 changes: 3 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_heigan.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "ScriptedCreature.h"
#include "naxxramas.h"

namespace Heigan {

enum HeiganSays
{
HEIGAN_SAY_AGGRO = 0,
Expand Down Expand Up @@ -232,4 +234,5 @@ class boss_heigan : public CreatureScript
};
};

}
#endif
2 changes: 2 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "SpellScriptLoader.h"
#include "naxxramas.h"

using namespace Kelthuzad;

void AddSC_boss_kelthuzad()
{
new boss_kelthuzad();
Expand Down
3 changes: 3 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "SpellScript.h"
#include "naxxramas.h"

namespace Kelthuzad {

enum KelthuzadYells
{
KELTHUZAD_SAY_ANSWER_REQUEST = 3,
Expand Down Expand Up @@ -729,4 +731,5 @@ class spell_kelthuzad_detonate_mana : public SpellScriptLoader
}
};

}
#endif
2 changes: 2 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include "ScriptedCreature.h"
#include "naxxramas.h"

using namespace Loatheb;

void AddSC_boss_loatheb()
{
new boss_loatheb();
Expand Down
3 changes: 3 additions & 0 deletions src/server/scripts/Northrend/Naxxramas/boss_loatheb.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "ScriptedCreature.h"
#include "naxxramas.h"

namespace Loatheb {

enum LoathebSpells
{
SPELL_NECROTIC_AURA = 55593,
Expand Down Expand Up @@ -183,4 +185,5 @@ class boss_loatheb : public CreatureScript
};
};

}
#endif
Loading

0 comments on commit 12ea82a

Please sign in to comment.