Skip to content

Commit

Permalink
fix(Scripts/Spells): Remove some magic numbers (azerothcore#13193)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitzunu authored Oct 1, 2022
1 parent b977068 commit 434b98e
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions src/server/scripts/Spells/spell_item.cpp
Original file line number Diff line number Diff line change
@@ -31,6 +31,11 @@
#include "SpellScript.h"
#include "WorldSession.h"

enum MassiveSeaforiumCharge
{
ITEM_MASSIVE_SEAFORIUM_CHARGE = 39213,
};

class spell_item_massive_seaforium_charge : public SpellScript
{
PrepareSpellScript(spell_item_massive_seaforium_charge);
@@ -41,7 +46,7 @@ class spell_item_massive_seaforium_charge : public SpellScript
return;

Player* target = GetHitUnit()->ToPlayer();
target->DestroyItemCount(39213, 1, true);
target->DestroyItemCount(ITEM_MASSIVE_SEAFORIUM_CHARGE, 1, true);
}

void Register() override
@@ -136,6 +141,11 @@ class spell_item_mind_amplify_dish : public SpellScript
}
};

enum RunescrollOfFortitude
{
SPELL_FORTITUDE = 72590,
};

class spell_item_runescroll_of_fortitude : public SpellScript
{
PrepareSpellScript(spell_item_runescroll_of_fortitude)
@@ -149,7 +159,7 @@ class spell_item_runescroll_of_fortitude : public SpellScript
if (target->getLevel() < 70)
return;

target->CastSpell(target, 72590, true); // Stamina spell (Fortitude)
target->CastSpell(target, SPELL_FORTITUDE, true);
}
}

@@ -159,6 +169,12 @@ class spell_item_runescroll_of_fortitude : public SpellScript
}
};

enum BrannsCommunicator
{
NPC_BRANN_BRONZEBEARD = 29579,
SPELL_CONTACT_BRANN = 55038,
};

class spell_item_branns_communicator : public SpellScript
{
PrepareSpellScript(spell_item_branns_communicator)
@@ -169,8 +185,8 @@ class spell_item_branns_communicator : public SpellScript

if (Player* target = GetHitPlayer())
{
target->KilledMonsterCredit(29579); // Brann's entry
target->CastSpell(target, 55038, true); // Brann summoning spell
target->KilledMonsterCredit(NPC_BRANN_BRONZEBEARD); // Brann's entry
target->CastSpell(target, SPELL_CONTACT_BRANN, true); // Brann summoning spell
}
}

@@ -2301,6 +2317,7 @@ enum Shadowmourne
SPELL_SHADOWMOURNE_VISUAL_LOW = 72521,
SPELL_SHADOWMOURNE_VISUAL_HIGH = 72523,
SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF = 73422,
SPELL_BLOOD_PLAGUE = 55078,
};

// 71903 - Item - Shadowmourne Legendary
@@ -2336,7 +2353,7 @@ class spell_item_shadowmourne : public AuraScript
}
else if (procSpell->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT)
{
if (procSpell->Id != 55078 /*Blood Plague*/)
if (procSpell->Id != SPELL_BLOOD_PLAGUE)
return false;
}
}

0 comments on commit 434b98e

Please sign in to comment.