aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Kalimdor
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-12-15 00:14:55 -0300
committerfunjoker <funjoker109@gmail.com>2021-03-15 20:17:31 +0100
commit44c8ccadd701c1a4bc0ce08ee53a7a7ba55289d4 (patch)
tree51509fbe5b77c2b6abfadc53e4caf19c9ae71000 /src/server/scripts/Kalimdor
parentd9b145615dd2bafe1ae74e6dc11c9b86a0fb6f28 (diff)
Core/Auras: periodics refactor part 5: ported periodic trigger spell auras to scripts
(cherry picked from commit a36e804ae4639be40be17282e6c79fad9a769517)
Diffstat (limited to 'src/server/scripts/Kalimdor')
-rw-r--r--src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp18
-rw-r--r--src/server/scripts/Kalimdor/zone_silithus.cpp43
2 files changed, 61 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);
}