diff options
Diffstat (limited to 'src/server/scripts')
9 files changed, 382 insertions, 0 deletions
diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index bc5f7b0d942..b3ab239f315 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -716,6 +716,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(); @@ -724,4 +741,5 @@ void AddSC_azuremyst_isle() new npc_magwin(); 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 6fc163ad10b..65ec84aa855 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -44,6 +44,7 @@ EndContentData */ #include "Player.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" +#include "SpellAuraEffects.h" #include "TemporarySummon.h" /*##### @@ -1385,6 +1386,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->GetEffect(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()->GetEffect(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(); @@ -1392,4 +1434,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 ff4d610a59e..1ed17eda42e 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -830,6 +830,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(SPELL_PERMAFROST)) + 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: @@ -909,6 +952,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 15bf3343129..aab0cd46128 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -1374,6 +1374,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->GetEffect(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()->GetEffect(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: @@ -1460,6 +1484,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 2203c878b77..d6cfcf0a165 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 158aba2266b..128a332ec3d 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -75,6 +75,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: @@ -558,9 +586,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 d3a080b2c74..3695e39a40d 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1791,6 +1791,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->GetEffect(EFFECT_0)->TriggerSpell }); + } + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + GetTarget()->CastCustomSpell(GetSpellInfo()->GetEffect(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 @@ -1872,6 +1895,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, @@ -2264,6 +2308,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 @@ -3819,8 +3895,10 @@ void AddSC_generic_spell_scripts() new spell_gen_lifebloom("spell_faction_champion_dru_lifebloom", SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL); 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); RegisterSpellScript(spell_gen_oracle_wolvar_reputation); RegisterSpellScript(spell_gen_orc_disguise); @@ -3836,6 +3914,7 @@ void AddSC_generic_spell_scripts() RegisterSpellScript(spell_gen_profession_research); RegisterSpellScript(spell_gen_pvp_trinket); RegisterSpellScript(spell_gen_remove_flight_auras); + RegisterAuraScript(spell_gen_restoration); RegisterSpellAndAuraScriptPair(spell_gen_replenishment, spell_gen_replenishment_aura); // Running Wild RegisterSpellAndAuraScriptPair(spell_gen_running_wild, spell_gen_running_wild_aura); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index c19cd6e1657..3fff26738fe 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -28,6 +28,7 @@ #include "DB2Stores.h" #include "Item.h" #include "Log.h" +#include "LootMgr.h" #include "Map.h" #include "ObjectMgr.h" #include "Player.h" @@ -109,6 +110,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_ALCHEMIST_STONE_EXTRA_HEAL = 21399, @@ -758,6 +791,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, ItemContext::NONE, 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 { @@ -3986,6 +4050,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_alchemist_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"); @@ -4005,6 +4070,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_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index ff962ece703..48fda95f406 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -1036,6 +1036,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, flag128(0x400), GetCaster()->GetGUID())) + 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 { @@ -1282,6 +1302,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_path_of_flames_spread(); new spell_sha_tidal_waves(); 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(); |
