diff options
Diffstat (limited to 'src')
12 files changed, 471 insertions, 254 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 4d0093a3b13..ac51952c4aa 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -26,7 +26,6 @@ #include "GridNotifiersImpl.h" #include "Item.h" #include "Log.h" -#include "LootMgr.h" #include "MotionMaster.h" #include "ObjectAccessor.h" #include "ObjectMgr.h" @@ -5000,260 +4999,8 @@ void AuraEffect::HandlePreventResurrection(AuraApplication const* aurApp, uint8 void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) const { - // generic casting code with custom spells and target/caster customs uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell; - - SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId); - SpellInfo const* auraSpellInfo = GetSpellInfo(); - uint32 auraId = auraSpellInfo->Id; - - // specific code for cases with no trigger spell provided in field - if (triggeredSpellInfo == nullptr) - { - switch (auraSpellInfo->SpellFamilyName) - { - case SPELLFAMILY_GENERIC: - { - switch (auraId) - { - // Brood Affliction: Bronze - case 23170: - triggerSpellId = 23171; - break; - // Restoration - case 24379: - case 23493: - { - if (caster) - { - int32 heal = caster->CountPctFromMaxHealth(10); - HealInfo healInfo(caster, target, heal, auraSpellInfo, auraSpellInfo->GetSchoolMask()); - caster->HealBySpell(healInfo); - - /// @todo: should proc other auras? - if (int32 mana = caster->GetMaxPower(POWER_MANA)) - { - mana /= 10; - caster->EnergizeBySpell(caster, 23493, mana, POWER_MANA); - } - } - return; - } - // Nitrous Boost - case 27746: - if (caster && target->GetPower(POWER_MANA) >= 10) - { - target->ModifyPower(POWER_MANA, -10); - target->SendEnergizeSpellLog(caster, 27746, 10, POWER_MANA); - } - else - target->RemoveAurasDueToSpell(27746); - return; - // Frost Blast - case 27808: - if (caster) - caster->CastCustomSpell(29879, SPELLVALUE_BASE_POINT0, int32(target->CountPctFromMaxHealth(21)), target, true, nullptr, this); - return; - // Inoculate Nestlewood Owlkin - case 29528: - if (target->GetTypeId() != TYPEID_UNIT) // prevent error reports in case ignored player target - return; - break; - // Feed Captured Animal - case 29917: - triggerSpellId = 29916; - break; - // Extract Gas - case 30427: - { - // move loot to player inventory and despawn target - if (caster && caster->GetTypeId() == TYPEID_PLAYER && - target->GetTypeId() == TYPEID_UNIT && - target->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_GAS_CLOUD) - { - Player* player = caster->ToPlayer(); - Creature* creature = target->ToCreature(); - // missing lootid has been reported on startup - just return - if (!creature->GetCreatureTemplate()->SkinLootId) - return; - - player->AutoStoreLoot(creature->GetCreatureTemplate()->SkinLootId, LootTemplates_Skinning, true); - - creature->DespawnOrUnsummon(); - } - return; - } - // Quake - case 30576: - triggerSpellId = 30571; - break; - // Doom - /// @todo effect trigger spell may be independant on spell targets, and executed in spell finish phase - // so instakill will be naturally done before trigger spell - case 31347: - { - target->CastSpell(target, 31350, true, nullptr, this); - target->KillSelf(); - return; - } - // Spellcloth - case 31373: - { - // Summon Elemental after create item - target->SummonCreature(17870, 0, 0, 0, target->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 0); - return; - } - // Flame Quills - case 34229: - { - // cast 24 spells 34269-34289, 34314-34316 - for (uint32 spell_id = 34269; spell_id != 34290; ++spell_id) - target->CastSpell(target, spell_id, true, nullptr, this); - for (uint32 spell_id = 34314; spell_id != 34317; ++spell_id) - target->CastSpell(target, spell_id, true, nullptr, this); - return; - } - // Remote Toy - case 37027: - triggerSpellId = 37029; - break; - // Eye of Grillok - case 38495: - triggerSpellId = 38530; - break; - // Absorb Eye of Grillok (Zezzak's Shard) - case 38554: - { - if (!caster || target->GetTypeId() != TYPEID_UNIT) - return; - - caster->CastSpell(caster, 38495, true, nullptr, this); - - Creature* creatureTarget = target->ToCreature(); - - creatureTarget->DespawnOrUnsummon(); - return; - } - // Tear of Azzinoth Summon Channel - it's not really supposed to do anything, and this only prevents the console spam - case 39857: - triggerSpellId = 39856; - break; - // Personalized Weather - case 46736: - triggerSpellId = 46737; - break; - } - break; - } - case SPELLFAMILY_SHAMAN: - { - switch (auraId) - { - // Lightning Shield (The Earthshatterer set trigger after cast Lighting Shield) - case 28820: - { - // Need remove self if Lightning Shield not active - if (!target->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0)) - target->RemoveAurasDueToSpell(28820); - return; - } - } - break; - } - default: - break; - } - } - else - { - // Spell exist but require custom code - switch (auraId) - { - // Pursuing Spikes (Anub'arak) - case 65920: - case 65922: - case 65923: - { - Unit* permafrostCaster = nullptr; - Aura* permafrostAura = target->GetAura(66193); - if (!permafrostAura) - permafrostAura = target->GetAura(67855); - if (!permafrostAura) - permafrostAura = target->GetAura(67856); - if (!permafrostAura) - permafrostAura = target->GetAura(67857); - - if (permafrostAura) - permafrostCaster = permafrostAura->GetCaster(); - - if (permafrostCaster) - { - if (Creature* permafrostCasterCreature = permafrostCaster->ToCreature()) - permafrostCasterCreature->DespawnOrUnsummon(3000); - - target->CastSpell(target, 66181, false); - target->RemoveAllAuras(); - if (Creature* targetCreature = target->ToCreature()) - targetCreature->DisappearAndDie(); - } - break; - } - // Mana Tide - case 16191: - target->CastCustomSpell(target, triggerSpellId, &m_amount, nullptr, nullptr, true, nullptr, this); - return; - // Negative Energy Periodic - case 46284: - target->CastCustomSpell(triggerSpellId, SPELLVALUE_MAX_TARGETS, _ticksDone / 10 + 1, nullptr, true, nullptr, this); - return; - // Slime Pool (Dreadscale & Acidmaw) - case 66882: - target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, static_cast<int32>(((_ticksDone / 60.f) * 0.9f + 0.1f) * 10000.f * 2.f / 3.f), nullptr, true, nullptr, this); - return; - // Beacon of Light - case 53563: - { - // area aura owner casts the spell - GetBase()->GetUnitOwner()->CastSpell(target, triggeredSpellInfo, true, nullptr, this, GetBase()->GetUnitOwner()->GetGUID()); - return; - } - // Slime Spray - temporary here until preventing default effect works again - // added on 9.10.2010 - case 69508: - { - if (caster) - caster->CastSpell(target, triggerSpellId, true, nullptr, nullptr, caster->GetGUID()); - return; - } - case 24745: // Summon Templar, Trigger - case 24747: // Summon Templar Fire, Trigger - case 24757: // Summon Templar Air, Trigger - case 24759: // Summon Templar Earth, Trigger - case 24761: // Summon Templar Water, Trigger - case 24762: // Summon Duke, Trigger - case 24766: // Summon Duke Fire, Trigger - case 24769: // Summon Duke Air, Trigger - case 24771: // Summon Duke Earth, Trigger - case 24773: // Summon Duke Water, Trigger - case 24785: // Summon Royal, Trigger - case 24787: // Summon Royal Fire, Trigger - case 24791: // Summon Royal Air, Trigger - case 24792: // Summon Royal Earth, Trigger - case 24793: // Summon Royal Water, Trigger - { - // All this spells trigger a spell that requires reagents; if the - // triggered spell is cast as "triggered", reagents are not consumed - if (caster) - caster->CastSpell(target, triggerSpellId, false); - return; - } - } - } - - // Reget trigger spell proto - triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId); - - if (triggeredSpellInfo) + if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) { if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? caster : target) { diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 4ae414a3838..6be03a6b714 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2938,6 +2938,45 @@ void SpellMgr::LoadSpellInfoCorrections() }); } + // specific code for cases with no trigger spell provided in field + { + // Brood Affliction: Bronze + ApplySpellFix({ 23170 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].TriggerSpell = 23171; + }); + + // Feed Captured Animal + ApplySpellFix({ 29917 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].TriggerSpell = 29916; + }); + + // Remote Toy + ApplySpellFix({ 37027 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].TriggerSpell = 37029; + }); + + // Eye of Grillok + ApplySpellFix({ 38495 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].TriggerSpell = 38530; + }); + + // Tear of Azzinoth Summon Channel - it's not really supposed to do anything, and this only prevents the console spam + ApplySpellFix({ 39857 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].TriggerSpell = 39856; + }); + + // Personalized Weather + ApplySpellFix({ 46736 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_1].TriggerSpell = 46737; + }); + } + // Spell Reflection ApplySpellFix({ 57643 }, [](SpellInfo* spellInfo) { diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index 3ce50e2f2f4..d78e855d7d1 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -718,6 +718,23 @@ public: } }; +// 29528 - Inoculate Nestlewood Owlkin +class spell_inoculate_nestlewood : public AuraScript +{ + PrepareAuraScript(spell_inoculate_nestlewood); + + void PeriodicTick(AuraEffect const* /*aurEff*/) + { + if (GetTarget()->GetTypeId() != TYPEID_UNIT) // prevent error reports in case ignored player target + PreventDefaultAction(); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_inoculate_nestlewood::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + void AddSC_azuremyst_isle() { new npc_draenei_survivor(); @@ -727,4 +744,5 @@ void AddSC_azuremyst_isle() new npc_geezle(); new npc_death_ravager(); new go_ravager_cage(); + RegisterAuraScript(spell_inoculate_nestlewood); } diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index 83cf9ac1680..22d6978fdb7 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -45,6 +45,7 @@ EndContentData */ #include "Player.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" +#include "SpellAuraEffects.h" #include "TemporarySummon.h" /*##### @@ -1386,6 +1387,47 @@ class go_wind_stone : public GameObjectScript } }; +// 24745 - Summon Templar, Trigger +// 24747 - Summon Templar Fire, Trigger +// 24757 - Summon Templar Air, Trigger +// 24759 - Summon Templar Earth, Trigger +// 24761 - Summon Templar Water, Trigger +// 24762 - Summon Duke, Trigger +// 24766 - Summon Duke Fire, Trigger +// 24769 - Summon Duke Air, Trigger +// 24771 - Summon Duke Earth, Trigger +// 24773 - Summon Duke Water, Trigger +// 24785 - Summon Royal, Trigger +// 24787 - Summon Royal Fire, Trigger +// 24791 - Summon Royal Air, Trigger +// 24792 - Summon Royal Earth, Trigger +// 24793 - Summon Royal Water, Trigger +// 46595 - Summon Ice Stone Lieutenant, Trigger +class spell_silithus_summon_cultist_periodic : public AuraScript +{ + PrepareAuraScript(spell_silithus_summon_cultist_periodic); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell }); + } + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + // All these spells trigger a spell that requires reagents; if the + // triggered spell is cast as "triggered", reagents are not consumed + if (Unit* caster = GetCaster()) + caster->CastSpell(nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST), nullptr, aurEff); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_silithus_summon_cultist_periodic::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + void AddSC_silithus() { new go_crystalline_tear(); @@ -1393,4 +1435,5 @@ void AddSC_silithus() new npc_anachronos_the_ancient(); new npc_qiraj_war_spawn(); new go_wind_stone(); + RegisterAuraScript(spell_silithus_summon_cultist_periodic); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 4d3f243a4a7..a5c155714e4 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -832,6 +832,49 @@ class npc_anubarak_spike : public CreatureScript }; }; +// 65920 - Pursuing Spikes +// 65922 - Pursuing Spikes +// 65923 - Pursuing Spikes +class spell_pursuing_spikes : public AuraScript +{ + PrepareAuraScript(spell_pursuing_spikes); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_PERMAFROST, SPELL_SPIKE_FAIL }); + } + + bool Load() override + { + return InstanceHasScript(GetUnitOwner(), ToCrScriptName); + } + + void PeriodicTick(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + + Unit* permafrostCaster = nullptr; + if (Aura* permafrostAura = GetTarget()->GetAura(sSpellMgr->GetSpellIdForDifficulty(SPELL_PERMAFROST, GetTarget()))) + permafrostCaster = permafrostAura->GetCaster(); + + if (permafrostCaster) + { + if (Creature* permafrostCasterCreature = permafrostCaster->ToCreature()) + permafrostCasterCreature->DespawnOrUnsummon(3000); + + GetTarget()->CastSpell(nullptr, SPELL_SPIKE_FAIL, false); + GetTarget()->RemoveAllAuras(); + if (Creature* targetCreature = GetTarget()->ToCreature()) + targetCreature->DisappearAndDie(); + } + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_pursuing_spikes::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + class spell_impale : public SpellScriptLoader { public: @@ -912,6 +955,7 @@ void AddSC_boss_anubarak_trial() new npc_anubarak_spike(); new npc_frost_sphere(); + RegisterAuraScript(spell_pursuing_spikes); new spell_impale(); new spell_anubarak_leeching_swarm(); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 3fa16f06a0c..4a832406e43 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -1375,6 +1375,30 @@ public: } }; +// 66882 - Slime Pool +class spell_jormungars_slime_pool : public AuraScript +{ + PrepareAuraScript(spell_jormungars_slime_pool); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell }); + } + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + int32 const radius = static_cast<int32>(((aurEff->GetTickNumber() / 60.f) * 0.9f + 0.1f) * 10000.f * 2.f / 3.f); + GetTarget()->CastCustomSpell(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, SPELLVALUE_RADIUS_MOD, radius, nullptr, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_jormungars_slime_pool::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + class spell_jormungars_snakes_spray : public SpellScriptLoader { public: @@ -1461,6 +1485,7 @@ void AddSC_boss_northrend_beasts() new boss_dreadscale(); new npc_slime_pool(); new spell_jormungars_paralytic_toxin(); + RegisterAuraScript(spell_jormungars_slime_pool); new spell_jormungars_snakes_spray("spell_jormungars_burning_spray", SPELL_BURNING_BILE); new spell_jormungars_snakes_spray("spell_jormungars_paralytic_spray", SPELL_PARALYTIC_TOXIN); new spell_jormungars_paralysis(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 02313e8d286..e37999c4993 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -94,6 +94,7 @@ enum Spells SPELL_DETONATE_MANA = 27819, SPELL_MANA_DETONATION_DAMAGE = 27820, SPELL_FROST_BLAST = 27808, + SPELL_FROST_BLAST_DMG = 29879, SPELL_CHAINS = 28410, SPELL_CHAINS_DUMMY = 28408, // this holds the category cooldown - the main chains spell can't have one as it is cast multiple times @@ -943,6 +944,31 @@ public: } }; +// 27808 - Frost Blast +class spell_kelthuzad_frost_blast : public AuraScript +{ + PrepareAuraScript(spell_kelthuzad_frost_blast); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_FROST_BLAST_DMG }); + } + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + // Stuns the target, dealing 26% of the target's maximum health in Frost damage every second for 4 sec. + if (Unit* caster = GetCaster()) + caster->CastCustomSpell(SPELL_FROST_BLAST_DMG, SPELLVALUE_BASE_POINT0, int32(GetTarget()->CountPctFromMaxHealth(26)), GetTarget(), true, nullptr, aurEff); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_kelthuzad_frost_blast::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + class at_kelthuzad_center : public AreaTriggerScript { public: @@ -995,6 +1021,7 @@ void AddSC_boss_kelthuzad() new npc_kelthuzad_guardian(); new spell_kelthuzad_chains(); new spell_kelthuzad_detonate_mana(); + RegisterAuraScript(spell_kelthuzad_frost_blast); new at_kelthuzad_center(); new achievement_just_cant_get_enough(); } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 6d65ceae758..8fc66bef7e3 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -76,6 +76,34 @@ enum WaitEventType WE_SUMMON = 10 }; +uint32 const flameQuillsSpells[] = +{ + 34269, + 34270, + 34271, + 34272, + 34273, + 34274, + 34275, + 34276, + 34277, + 34278, + 34279, + 34280, + 34281, + 34282, + 34283, + 34284, + 34285, + 34286, + 34287, + 34288, + 34289, + 34314, + 34315, + 34316 +}; + class boss_alar : public CreatureScript { public: @@ -559,9 +587,40 @@ class npc_flame_patch_alar : public CreatureScript } }; +// 34229 - Flame Quills +class spell_alar_flame_quills : public AuraScript +{ + PrepareAuraScript(spell_alar_flame_quills); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + return ValidateSpellInfo(flameQuillsSpells); + } + + bool Load() override + { + return InstanceHasScript(GetUnitOwner(), TheEyeScriptName); + } + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + // cast 24 spells 34269-34289, 34314-34316 + for (uint32 spellId : flameQuillsSpells) + GetTarget()->CastSpell(nullptr, spellId, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_alar_flame_quills::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + void AddSC_boss_alar() { new boss_alar(); new npc_ember_of_alar(); new npc_flame_patch_alar(); + RegisterAuraScript(spell_alar_flame_quills); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index bc3ce8a88a7..fc24a7221ee 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1980,6 +1980,29 @@ class spell_gen_moss_covered_feet : public AuraScript } }; +// 46284 - Negative Energy Periodic +class spell_gen_negative_energy_periodic : public AuraScript +{ + PrepareAuraScript(spell_gen_negative_energy_periodic); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell }); + } + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + GetTarget()->CastCustomSpell(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, SPELLVALUE_MAX_TARGETS, aurEff->GetTickNumber() / 10 + 1, nullptr, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_negative_energy_periodic::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + enum Netherbloom : uint32 { SPELL_NETHERBLOOM_POLLEN_1 = 28703 @@ -2061,6 +2084,27 @@ class spell_gen_nightmare_vine : public SpellScript } }; +// 27746 - Nitrous Boost +class spell_gen_nitrous_boost : public AuraScript +{ + PrepareAuraScript(spell_gen_nitrous_boost); + + void PeriodicTick(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + + if (GetCaster() && GetTarget()->GetPower(POWER_MANA) >= 10) + GetTarget()->ModifyPower(POWER_MANA, -10); + else + Remove(); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_nitrous_boost::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + enum ObsidianArmor { SPELL_GEN_OBSIDIAN_ARMOR_HOLY = 27536, @@ -2454,6 +2498,38 @@ class spell_gen_remove_flight_auras : public SpellScript } }; +// 23493 - Restoration +// 24379 - Restoration +class spell_gen_restoration : public AuraScript +{ + PrepareAuraScript(spell_gen_restoration); + + void PeriodicTick(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + + Unit* caster = GetCaster(); + if (!caster) + return; + + int32 heal = caster->CountPctFromMaxHealth(10); + HealInfo healInfo(caster, GetTarget(), heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask()); + caster->HealBySpell(healInfo); + + /// @todo: should proc other auras? + if (int32 mana = caster->GetMaxPower(POWER_MANA)) + { + mana /= 10; + caster->EnergizeBySpell(caster, GetId(), mana, POWER_MANA); + } + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_restoration::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + // 38772 Grievous Wound // 43937 Grievous Wound // 62331 Impale @@ -3707,8 +3783,10 @@ void AddSC_generic_spell_scripts() new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310); RegisterSpellScript(spell_gen_mounted_charge); RegisterAuraScript(spell_gen_moss_covered_feet); + RegisterAuraScript(spell_gen_negative_energy_periodic); RegisterSpellScript(spell_gen_netherbloom); RegisterSpellScript(spell_gen_nightmare_vine); + RegisterAuraScript(spell_gen_nitrous_boost); RegisterAuraScript(spell_gen_obsidian_armor); RegisterAuraScript(spell_gen_one_tick_dummy); RegisterSpellScript(spell_gen_oracle_wolvar_reputation); @@ -3725,6 +3803,7 @@ void AddSC_generic_spell_scripts() RegisterSpellScript(spell_gen_pet_summoned); RegisterSpellScript(spell_gen_profession_research); RegisterSpellScript(spell_gen_remove_flight_auras); + RegisterAuraScript(spell_gen_restoration); RegisterSpellAndAuraScriptPair(spell_gen_replenishment, spell_gen_replenishment_aura); RegisterAuraScript(spell_gen_remove_on_health_pct); RegisterAuraScript(spell_gen_remove_on_full_health); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index e78bd3804be..5399a91830e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -27,6 +27,7 @@ #include "Creature.h" #include "CreatureAIImpl.h" #include "DBCStores.h" +#include "LootMgr.h" #include "Map.h" #include "ObjectMgr.h" #include "Player.h" @@ -106,6 +107,38 @@ class spell_item_aegis_of_preservation : public AuraScript } }; +enum ZezzaksShard +{ + SPELL_EYE_OF_GRILLOK = 38495 +}; + +// 38554 - Absorb Eye of Grillok (31463: Zezzak's Shard) +class spell_item_absorb_eye_of_grillok : public AuraScript +{ + PrepareAuraScript(spell_item_absorb_eye_of_grillok); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + return ValidateSpellInfo({ SPELL_EYE_OF_GRILLOK }); + } + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + if (!GetCaster() || GetTarget()->GetTypeId() != TYPEID_UNIT) + return; + + GetCaster()->CastSpell(GetCaster(), SPELL_EYE_OF_GRILLOK, true, nullptr, aurEff); + GetTarget()->ToCreature()->DespawnOrUnsummon(); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_item_absorb_eye_of_grillok::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + enum AlchemistStone { SPELL_ALCHEMISTS_STONE_EXTRA_HEAL = 21399, @@ -759,6 +792,37 @@ class spell_item_echoes_of_light : public SpellScript } }; +// 30427 - Extract Gas (23821: Zapthrottle Mote Extractor) +class spell_item_extract_gas : public AuraScript +{ + PrepareAuraScript(spell_item_extract_gas); + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + // move loot to player inventory and despawn target + if (GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER && + GetTarget()->GetTypeId() == TYPEID_UNIT && + GetTarget()->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_GAS_CLOUD) + { + Player* player = GetCaster()->ToPlayer(); + Creature* creature = GetTarget()->ToCreature(); + // missing lootid has been reported on startup - just return + if (!creature->GetCreatureTemplate()->SkinLootId) + return; + + player->AutoStoreLoot(creature->GetCreatureTemplate()->SkinLootId, LootTemplates_Skinning, true); + creature->DespawnOrUnsummon(); + } + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_item_extract_gas::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + // 7434 - Fate Rune of Unsurpassed Vigor enum FateRuneOfUnsurpassedVigor { @@ -3808,6 +3872,7 @@ void AddSC_item_spell_scripts() new spell_item_trigger_spell("spell_item_mithril_mechanical_dragonling", SPELL_MITHRIL_MECHANICAL_DRAGONLING); RegisterAuraScript(spell_item_aegis_of_preservation); + RegisterAuraScript(spell_item_absorb_eye_of_grillok); RegisterAuraScript(spell_item_alchemists_stone); new spell_item_anger_capacitor<8>("spell_item_tiny_abomination_in_a_jar"); new spell_item_anger_capacitor<7>("spell_item_tiny_abomination_in_a_jar_hero"); @@ -3827,6 +3892,7 @@ void AddSC_item_spell_scripts() RegisterSpellScript(spell_item_deviate_fish); RegisterAuraScript(spell_item_discerning_eye_beast_dummy); RegisterSpellScript(spell_item_echoes_of_light); + RegisterAuraScript(spell_item_extract_gas); RegisterAuraScript(spell_item_fate_rune_of_unsurpassed_vigor); RegisterSpellScript(spell_item_flask_of_the_north); RegisterAuraScript(spell_item_frozen_shadoweave); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 28455808c01..d3d1ed57ccf 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -335,6 +335,30 @@ class spell_pal_avenging_wrath : public SpellScriptLoader } }; +// 53563 - Beacon of Light +class spell_pal_beacon_of_light : public AuraScript +{ + PrepareAuraScript(spell_pal_beacon_of_light); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell }); + } + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + // area aura owner casts the spell + GetAura()->GetUnitOwner()->CastSpell(GetTarget(), GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true, nullptr, aurEff, GetAura()->GetUnitOwner()->GetGUID()); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_pal_beacon_of_light::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + // 37877 - Blessing of Faith class spell_pal_blessing_of_faith : public SpellScriptLoader { @@ -2363,6 +2387,7 @@ void AddSC_paladin_spell_scripts() new spell_pal_aura_mastery(); new spell_pal_aura_mastery_immune(); new spell_pal_avenging_wrath(); + RegisterAuraScript(spell_pal_beacon_of_light); new spell_pal_blessing_of_faith(); new spell_pal_blessing_of_sanctuary(); new spell_pal_divine_purpose(); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 4585f4435f4..c2ec92843ff 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -1544,6 +1544,29 @@ class spell_sha_mana_spring_totem : public SpellScriptLoader } }; +// 16191 - Mana Tide +class spell_sha_mana_tide : public AuraScript +{ + PrepareAuraScript(spell_sha_mana_tide); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell }); + } + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + GetTarget()->CastCustomSpell(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), nullptr, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_mana_tide::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + // 39610 - Mana Tide Totem class spell_sha_mana_tide_totem : public SpellScriptLoader { @@ -1976,6 +1999,26 @@ class spell_sha_t3_6p_bonus : public SpellScriptLoader } }; +// 28820 - Lightning Shield +class spell_sha_t3_8p_bonus : public AuraScript +{ + PrepareAuraScript(spell_sha_t3_8p_bonus); + + void PeriodicTick(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + + // Need remove self if Lightning Shield not active + if (!GetTarget()->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0)) + Remove(); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_t3_8p_bonus::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + // 64928 - Item - Shaman T8 Elemental 4P Bonus class spell_sha_t8_elemental_4p_bonus : public SpellScriptLoader { @@ -2293,6 +2336,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_lightning_shield(); new spell_sha_maelstrom_weapon(); new spell_sha_mana_spring_totem(); + RegisterAuraScript(spell_sha_mana_tide); new spell_sha_mana_tide_totem(); new spell_sha_nature_guardian(); new spell_sha_sentry_totem(); @@ -2303,6 +2347,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_thunderstorm(); new spell_sha_totemic_mastery(); new spell_sha_t3_6p_bonus(); + RegisterAuraScript(spell_sha_t3_8p_bonus); new spell_sha_t8_elemental_4p_bonus(); new spell_sha_t9_elemental_4p_bonus(); new spell_sha_t10_elemental_4p_bonus(); |