aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-05-10 17:06:39 +0200
committerShauren <shauren.trinity@gmail.com>2016-05-10 17:06:39 +0200
commit9fa5906c40a64ba74a96a692e51cfba979685671 (patch)
tree01dc35d29592606ca63921e33b33005be1bac648
parent42ab42ce2781f8d89bcf35b11b2ca12775c9b4b7 (diff)
Core/Spells: Fixed Elemental Blast random buff (shaman)
-rw-r--r--sql/updates/world/6.x/2016_05_10_00_world.sql3
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp65
2 files changed, 68 insertions, 0 deletions
diff --git a/sql/updates/world/6.x/2016_05_10_00_world.sql b/sql/updates/world/6.x/2016_05_10_00_world.sql
new file mode 100644
index 00000000000..6a7c27196d7
--- /dev/null
+++ b/sql/updates/world/6.x/2016_05_10_00_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sha_elemental_blast';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(117014,'spell_sha_elemental_blast');
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index e20712f7e02..4f0d8e7912a 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -32,6 +32,12 @@
enum ShamanSpells
{
SPELL_SHAMAN_EARTH_SHIELD_HEAL = 379,
+ SPELL_SHAMAN_ELEMENTAL_BLAST_CRIT = 118522,
+ SPELL_SHAMAN_ELEMENTAL_BLAST_HASTE = 173183,
+ SPELL_SHAMAN_ELEMENTAL_BLAST_MASTERY = 173184,
+ SPELL_SHAMAN_ELEMENTAL_BLAST_MULTISTRIKE = 173185,
+ SPELL_SHAMAN_ELEMENTAL_BLAST_AGILITY = 173186,
+ SPELL_SHAMAN_ELEMENTAL_BLAST_SPIRIT = 173187,
SPELL_SHAMAN_ELEMENTAL_MASTERY = 16166,
SPELL_SHAMAN_EXHAUSTION = 57723,
SPELL_SHAMAN_FIRE_NOVA_TRIGGERED = 8349,
@@ -252,6 +258,64 @@ class spell_sha_earth_shield : public SpellScriptLoader
}
};
+uint32 const ElementalBlastBuffSpells[] =
+{
+ SPELL_SHAMAN_ELEMENTAL_BLAST_CRIT,
+ SPELL_SHAMAN_ELEMENTAL_BLAST_HASTE,
+ SPELL_SHAMAN_ELEMENTAL_BLAST_MASTERY,
+ SPELL_SHAMAN_ELEMENTAL_BLAST_MULTISTRIKE,
+ SPELL_SHAMAN_ELEMENTAL_BLAST_AGILITY,
+};
+
+// 117014 - Elemental Blast
+class spell_sha_elemental_blast : public SpellScriptLoader
+{
+public:
+ spell_sha_elemental_blast() : SpellScriptLoader("spell_sha_elemental_blast") { }
+
+ class spell_sha_elemental_blast_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_sha_elemental_blast_SpellScript);
+
+ static TRINITY_CONSTEXPR uint32 EnhancementBuffCount = std::extent<decltype(ElementalBlastBuffSpells)>::value;
+ static TRINITY_CONSTEXPR uint32 BuffCount = EnhancementBuffCount - 1;
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ for (uint32 i = 0; i < EnhancementBuffCount; ++i)
+ if (!sSpellMgr->GetSpellInfo(ElementalBlastBuffSpells[i]))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ELEMENTAL_BLAST_SPIRIT))
+ return false;
+ return true;
+ }
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void TriggerBuff()
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ uint32 possbleSpells = (caster->GetSpecId(caster->GetActiveTalentGroup()) == TALENT_SPEC_SHAMAN_ENHANCEMENT ? EnhancementBuffCount : BuffCount) - 1;
+ caster->CastSpell(caster, ElementalBlastBuffSpells[urand(0, possbleSpells)], TRIGGERED_FULL_MASK);
+ if (caster->GetSpecId(caster->GetActiveTalentGroup()) == TALENT_SPEC_SHAMAN_RESTORATION)
+ caster->CastSpell(caster, SPELL_SHAMAN_ELEMENTAL_BLAST_SPIRIT, TRIGGERED_FULL_MASK);
+ }
+
+ void Register() override
+ {
+ AfterCast += SpellCastFn(spell_sha_elemental_blast_SpellScript::TriggerBuff);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_sha_elemental_blast_SpellScript();
+ }
+};
+
// 1535 Fire Nova
class spell_sha_fire_nova : public SpellScriptLoader
{
@@ -1018,6 +1082,7 @@ void AddSC_shaman_spell_scripts()
new spell_sha_bloodlust();
new spell_sha_chain_heal();
new spell_sha_earth_shield();
+ new spell_sha_elemental_blast();
new spell_sha_fire_nova();
new spell_sha_flametongue();
new spell_sha_fulmination();