aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/3.3.5/2019_06_04_03_world.sql4
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp59
2 files changed, 63 insertions, 0 deletions
diff --git a/sql/updates/world/3.3.5/2019_06_04_03_world.sql b/sql/updates/world/3.3.5/2019_06_04_03_world.sql
new file mode 100644
index 00000000000..e641038a82f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2019_06_04_03_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_stasis_field_aura');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(40306,'spell_stasis_field_aura');
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index ac85b24e9c8..e03a43331bb 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -4182,6 +4182,64 @@ class spell_corrupting_plague_aura : public AuraScript
}
};
+enum StasisFieldEntrys
+{
+ NPC_DAGGERTAIL_LIZARD = 22255,
+ SPELL_STASIS_FIELD = 40307
+};
+
+// 40307 - Stasis Field
+class StasisFieldSearcher
+{
+public:
+ StasisFieldSearcher(Unit* obj, float distance) : _unit(obj), _distance(distance) { }
+
+ bool operator()(Unit* u) const
+ {
+ if (_unit->GetDistance2d(u) < _distance &&
+ (u->GetEntry() == NPC_APEXIS_FLAYER || u->GetEntry() == NPC_SHARD_HIDE_BOAR || u->GetEntry() == NPC_AETHER_RAY || u->GetEntry() == NPC_DAGGERTAIL_LIZARD) &&
+ !u->HasAura(SPELL_STASIS_FIELD))
+ return true;
+
+ return false;
+ }
+
+private:
+ Unit* _unit;
+ float _distance;
+};
+
+// 40306 - Stasis Field
+class spell_stasis_field_aura : public AuraScript
+{
+ PrepareAuraScript(spell_stasis_field_aura);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_STASIS_FIELD });
+ }
+
+ void OnPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ Unit* owner = GetTarget();
+
+ std::list<Creature*> targets;
+ StasisFieldSearcher creature_check(owner, 15.0f);
+ Trinity::CreatureListSearcher<StasisFieldSearcher> creature_searcher(owner, targets, creature_check);
+ Cell::VisitGridObjects(owner, creature_searcher, 15.0f);
+
+ if (!targets.empty())
+ return;
+
+ PreventDefaultAction();
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_stasis_field_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+};
+
enum SiegeTankControl
{
SPELL_SIEGE_TANK_CONTROL = 47963
@@ -4390,6 +4448,7 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_clear_debuffs);
RegisterAuraScript(spell_gen_pony_mount_check);
RegisterAuraScript(spell_corrupting_plague_aura);
+ RegisterAuraScript(spell_stasis_field_aura);
RegisterAuraScript(spell_gen_vehicle_control_link);
RegisterSpellScript(spell_freezing_circle);
RegisterSpellScript(spell_gen_charmed_unit_spell_cooldown);