aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp30
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp37
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp58
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp23
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp41
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp21
6 files changed, 206 insertions, 4 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 1cbe0537563..decd33701db 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -1020,6 +1020,11 @@ class spell_dk_death_rune : public SpellScriptLoader
{
PrepareAuraScript(spell_dk_death_rune_AuraScript);
+ bool Load() override
+ {
+ return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER && GetUnitOwner()->ToPlayer()->getClass() == CLASS_DEATH_KNIGHT;
+ }
+
bool CheckProc(ProcEventInfo& eventInfo)
{
Unit* caster = eventInfo.GetActor();
@@ -1073,10 +1078,17 @@ class spell_dk_death_rune : public SpellScriptLoader
}
}
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ // timer expired - remove death runes
+ GetTarget()->ToPlayer()->RemoveRunesByAuraEffect(aurEff);
+ }
+
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_dk_death_rune_AuraScript::CheckProc);
OnProc += AuraProcFn(spell_dk_death_rune_AuraScript::HandleProc);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_dk_death_rune_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
@@ -1240,6 +1252,23 @@ class spell_dk_glyph_of_scourge_strike : public SpellScriptLoader
}
};
+// 49016 - Hysteria
+class spell_dk_hysteria : public AuraScript
+{
+ PrepareAuraScript(spell_dk_hysteria);
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ uint32 const damage = GetTarget()->CountPctFromMaxHealth(GetTarget()->CalculateSpellDamage(nullptr, GetSpellInfo(), aurEff->GetEffIndex()));
+ GetTarget()->DealDamage(GetTarget(), damage, nullptr, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_dk_hysteria::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
// 51209 - Hungering Cold
class spell_dk_hungering_cold : public SpellScriptLoader
{
@@ -2948,6 +2977,7 @@ void AddSC_deathknight_spell_scripts()
new spell_dk_ghoul_explode();
new spell_dk_glyph_of_death_grip();
new spell_dk_glyph_of_scourge_strike();
+ RegisterAuraScript(spell_dk_hysteria);
new spell_dk_hungering_cold();
new spell_dk_icebound_fortitude();
new spell_dk_improved_blood_presence();
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 1fda9d3ebf2..c4e7d96652c 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -88,7 +88,8 @@ enum DruidSpells
SPELL_DRUID_BALANCE_T10_BONUS = 70718,
SPELL_DRUID_BALANCE_T10_BONUS_PROC = 70721,
SPELL_DRUID_BARKSKIN_01 = 63058,
- SPELL_DRUID_RESTORATION_T10_2P_BONUS = 70658
+ SPELL_DRUID_RESTORATION_T10_2P_BONUS = 70658,
+ SPELL_DRUID_FRENZIED_REGENERATION_HEAL = 22845
};
// 22812 - Barkskin
@@ -477,6 +478,39 @@ class spell_dru_flight_form : public SpellScriptLoader
}
};
+// 22842 - Frenzied Regeneration
+class spell_dru_frenzied_regeneration : public AuraScript
+{
+ PrepareAuraScript(spell_dru_frenzied_regeneration);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_DRUID_FRENZIED_REGENERATION_HEAL });
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ // Converts up to 10 rage per second into health for $d. Each point of rage is converted into ${$m2/10}.1% of max health.
+ if (GetTarget()->getPowerType() != POWER_RAGE)
+ return;
+
+ uint32 rage = GetTarget()->GetPower(POWER_RAGE);
+ // Nothing to do
+ if (!rage)
+ return;
+
+ int32 const mod = std::min(static_cast<int32>(rage), 100);
+ int32 const regen = CalculatePct(GetTarget()->GetMaxHealth(), GetTarget()->CalculateSpellDamage(nullptr, GetSpellInfo(), EFFECT_1) * mod / 100.f);
+ GetTarget()->CastCustomSpell(SPELL_DRUID_FRENZIED_REGENERATION_HEAL, SPELLVALUE_BASE_POINT0, regen, nullptr, true, nullptr, aurEff);
+ GetTarget()->SetPower(POWER_RAGE, rage - mod);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_dru_frenzied_regeneration::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
// 63057 - Glyph of Barkskin
class spell_dru_glyph_of_barkskin : public SpellScriptLoader
{
@@ -2308,6 +2342,7 @@ void AddSC_druid_spell_scripts()
new spell_dru_enrage();
new spell_dru_forms_trinket();
new spell_dru_flight_form();
+ RegisterAuraScript(spell_dru_frenzied_regeneration);
new spell_dru_glyph_of_barkskin();
new spell_dru_glyph_of_innervate();
new spell_dru_glyph_of_rake();
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index a7fed99dccf..a96f9a4cd88 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -66,7 +66,10 @@ enum HunterSpells
SPELL_REPLENISHMENT = 57669,
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R1 = 56654,
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R2 = 58882,
- SPELL_HUNTER_GLYPH_OF_MEND_PET_HAPPINESS = 57894
+ SPELL_HUNTER_GLYPH_OF_MEND_PET_HAPPINESS = 57894,
+ SPELL_HUNTER_EXPLOSIVE_SHOT_DAMAGE = 53352,
+ SPELL_HUNTER_FEEDING_FRENZY_BUFF_R1 = 60096,
+ SPELL_HUNTER_FEEDING_FRENZY_BUFF_R2 = 60097
};
// 13161 - Aspect of the Beast
@@ -458,6 +461,57 @@ class spell_hun_glyph_of_mend_pet : public SpellScriptLoader
}
};
+// -53301 - Explosive Shot
+class spell_hun_explosive_shot : public AuraScript
+{
+ PrepareAuraScript(spell_hun_explosive_shot);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_HUNTER_EXPLOSIVE_SHOT_DAMAGE });
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ if (Unit* caster = GetCaster())
+ caster->CastCustomSpell(SPELL_HUNTER_EXPLOSIVE_SHOT_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_explosive_shot::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
+// -53511 - Feeding Frenzy
+class spell_hun_feeding_frenzy : public AuraScript
+{
+ PrepareAuraScript(spell_hun_feeding_frenzy);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_HUNTER_FEEDING_FRENZY_BUFF_R1, SPELL_HUNTER_FEEDING_FRENZY_BUFF_R2 });
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ static uint32 const triggerSpells[2] = { SPELL_HUNTER_FEEDING_FRENZY_BUFF_R1, SPELL_HUNTER_FEEDING_FRENZY_BUFF_R2 };
+
+ uint8 rank = GetSpellInfo()->GetRank();
+ uint32 spellId = triggerSpells[rank - 1];
+
+ if (GetTarget()->GetVictim() && GetTarget()->EnsureVictim()->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT))
+ GetTarget()->CastSpell(nullptr, spellId, true, nullptr, aurEff);
+ else
+ GetTarget()->RemoveAurasDueToSpell(spellId);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_feeding_frenzy::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
// -53290 - Hunting Party
class spell_hun_hunting_party : public SpellScriptLoader
{
@@ -1544,6 +1598,8 @@ void AddSC_hunter_spell_scripts()
new spell_hun_disengage();
new spell_hun_glyph_of_arcane_shot();
new spell_hun_glyph_of_mend_pet();
+ RegisterAuraScript(spell_hun_explosive_shot);
+ RegisterAuraScript(spell_hun_feeding_frenzy);
new spell_hun_hunting_party();
new spell_hun_improved_mend_pet();
new spell_hun_invigoration();
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index e45ed806ec2..b5b12afae5e 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -1176,6 +1176,28 @@ class spell_mage_master_of_elements : public SpellScriptLoader
}
};
+// 55342 - Mirror Image
+class spell_mage_mirror_image : public AuraScript
+{
+ PrepareAuraScript(spell_mage_mirror_image);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ spellInfo->Effects[EFFECT_2].TriggerSpell });
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ // Set name of summons to name of caster
+ GetTarget()->CastSpell(nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_mage_mirror_image::PeriodicTick, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
// -44404 - Missile Barrage
class spell_mage_missile_barrage : public SpellScriptLoader
{
@@ -1334,6 +1356,7 @@ void AddSC_mage_spell_scripts()
new spell_mage_magic_absorption();
new spell_mage_mana_shield();
new spell_mage_master_of_elements();
+ RegisterAuraScript(spell_mage_mirror_image);
new spell_mage_missile_barrage();
new spell_mage_polymorph_cast_visual();
new spell_mage_summon_water_elemental();
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index 0476c4c09df..d7c0e61ec1e 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -52,7 +52,9 @@ enum RogueSpells
SPELL_ROGUE_T10_2P_BONUS = 70804,
SPELL_ROGUE_GLYPH_OF_BACKSTAB_TRIGGER = 63975,
SPELL_ROGUE_QUICK_RECOVERY_ENERGY = 31663,
- SPELL_ROGUE_CRIPPLING_POISON = 3409
+ SPELL_ROGUE_CRIPPLING_POISON = 3409,
+ SPELL_ROGUE_MASTER_OF_SUBTLETY_BUFF = 31665,
+ SPELL_ROGUE_OVERKILL_BUFF = 58427
};
// 13877, 33735, (check 51211, 65956) - Blade Flurry
@@ -479,6 +481,41 @@ class spell_rog_nerves_of_steel : public SpellScriptLoader
}
};
+// 31666 - Master of Subtlety
+// 58428 - Overkill - aura remove spell (SERVERSIDE)
+template <uint32 RemoveSpell>
+class spell_rog_overkill_mos : public SpellScriptLoader
+{
+ public:
+ spell_rog_overkill_mos(char const* ScriptName) : SpellScriptLoader(ScriptName) { }
+
+ template <uint32 RemoveSpellId>
+ class spell_rog_overkill_mos_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_rog_overkill_mos_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ RemoveSpellId });
+ }
+
+ void PeriodicTick(AuraEffect const* /*aurEff*/)
+ {
+ GetTarget()->RemoveAurasDueToSpell(RemoveSpellId);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_overkill_mos_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_rog_overkill_mos_AuraScript<RemoveSpell>();
+ }
+};
+
// 14185 - Preparation
class spell_rog_preparation : public SpellScriptLoader
{
@@ -1084,6 +1121,8 @@ void AddSC_rogue_spell_scripts()
new spell_rog_deadly_poison();
new spell_rog_killing_spree();
new spell_rog_nerves_of_steel();
+ new spell_rog_overkill_mos<SPELL_ROGUE_OVERKILL_BUFF>("spell_rog_overkill");
+ new spell_rog_overkill_mos<SPELL_ROGUE_MASTER_OF_SUBTLETY_BUFF>("spell_rog_master_of_subtlety");
new spell_rog_preparation();
new spell_rog_prey_on_the_weak();
new spell_rog_quick_recovery();
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index ecde34a4b8e..4585f4435f4 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -88,7 +88,7 @@ enum ShamanSpells
SPELL_SHAMAN_SHAMANISTIC_RAGE_PROC = 30824,
SPELL_SHAMAN_MAELSTROM_POWER = 70831,
SPELL_SHAMAN_T10_ENHANCEMENT_4P_BONUS = 70832,
- SPELL_SHAMAN_BLESSING_OF_THE_ETERNALS_R1 = 51554
+ SPELL_SHAMAN_BLESSING_OF_THE_ETERNALS_R1 = 51554,
};
enum ShamanSpellIcons
@@ -265,6 +265,24 @@ class spell_sha_astral_shift_aura : public SpellScriptLoader
}
};
+// 52179 - Astral Shift
+class spell_sha_astral_shift_visual_dummy : public AuraScript
+{
+ PrepareAuraScript(spell_sha_astral_shift_visual_dummy);
+
+ void PeriodicTick(AuraEffect const* /*aurEff*/)
+ {
+ // Periodic needed to remove visual on stun/fear/silence lost
+ if (!GetTarget()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED))
+ Remove();
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_astral_shift_visual_dummy::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
// 2825 - Bloodlust
class spell_sha_bloodlust : public SpellScriptLoader
{
@@ -2247,6 +2265,7 @@ void AddSC_shaman_spell_scripts()
new spell_sha_ancestral_awakening_proc();
new spell_sha_astral_shift();
new spell_sha_astral_shift_aura();
+ RegisterAuraScript(spell_sha_astral_shift_visual_dummy);
new spell_sha_bloodlust();
new spell_sha_chain_heal();
new spell_sha_cleansing_totem_pulse();