aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2017-07-18 18:32:43 +0200
committertreeston <treeston.mmoc@gmail.com>2017-07-18 18:32:56 +0200
commit02b1d8bb484ed82be055438cd2bac1db5f18a101 (patch)
tree093034812b18b1743e37400f78183c5fecb44950 /src
parentedb82fcfbf325c472c156157269d699881e7633c (diff)
Scripts/Item: Change Nitro -> Boosts <- to use the correct knockup effect for their backfire. Also, script that knockup effect to work properly ("usually" deploy a rescue parachute).
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_item.cpp52
1 files changed, 51 insertions, 1 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index b4d6ade2226..4d6712ef80c 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -3334,7 +3334,8 @@ class spell_item_brewfest_mount_transformation : public SpellScriptLoader
enum NitroBoosts
{
SPELL_NITRO_BOOSTS_SUCCESS = 54861,
- SPELL_NITRO_BOOSTS_BACKFIRE = 46014,
+ SPELL_NITRO_BOOSTS_BACKFIRE = 54621,
+ SPELL_NITRO_BOOSTS_PARACHUTE = 54649,
};
class spell_item_nitro_boosts : public SpellScriptLoader
@@ -3380,6 +3381,54 @@ class spell_item_nitro_boosts : public SpellScriptLoader
}
};
+class spell_item_nitro_boosts_backfire : public SpellScriptLoader
+{
+ public:
+ spell_item_nitro_boosts_backfire() : SpellScriptLoader("spell_item_nitro_boosts_backfire") { }
+
+ class spell_item_nitro_boosts_backfire_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_item_nitro_boosts_backfire_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ return ValidateSpellInfo({ SPELL_NITRO_BOOSTS_PARACHUTE });
+ }
+
+ void HandleApply(AuraEffect const* /*effect*/, AuraEffectHandleModes /*mode*/)
+ {
+ lastZ = GetTarget()->GetPositionZ();
+ }
+
+ void HandlePeriodicDummy(AuraEffect const* effect)
+ {
+ PreventDefaultAction();
+ float curZ = GetTarget()->GetPositionZ();
+ if (curZ < lastZ)
+ {
+ if (roll_chance_i(80)) // we don't have enough sniffs to verify this, guesstimate
+ GetTarget()->CastSpell(GetTarget(), SPELL_NITRO_BOOSTS_PARACHUTE, true, nullptr, effect);
+ GetAura()->Remove();
+ }
+ else
+ lastZ = curZ;
+ }
+
+ void Register() override
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_item_nitro_boosts_backfire_AuraScript::HandleApply, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_item_nitro_boosts_backfire_AuraScript::HandlePeriodicDummy, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+
+ float lastZ = INVALID_HEIGHT;
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_item_nitro_boosts_backfire_AuraScript();
+ }
+};
+
enum TeachLanguage
{
SPELL_LEARN_GNOMISH_BINARY = 50242,
@@ -4736,6 +4785,7 @@ void AddSC_item_spell_scripts()
new spell_item_impale_leviroth();
new spell_item_brewfest_mount_transformation();
new spell_item_nitro_boosts();
+ new spell_item_nitro_boosts_backfire();
new spell_item_teach_language();
new spell_item_rocket_boots();
new spell_item_pygmy_oil();