diff options
author | Sorikoff <46191832+Sorikoff@users.noreply.github.com> | 2019-06-22 07:44:23 +0000 |
---|---|---|
committer | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-06-22 09:44:23 +0200 |
commit | 40b09e3df144304562a63f33d16e25bbde5079fd (patch) | |
tree | e4a36cf45b6abe9605d7970cbcd74af2191e1daa | |
parent | 8163ea60c8d517ebe3a88f595dd8291df8338811 (diff) |
Scripts/Spells: Ultra-Advanced Proto-Typical Shortening Blaster (#23456)
* Scripts/Spells: Ultra-Advanced Proto-Typical Shortening Blaster
* Fix NoPCH
* Correct header
* fixup! Clean up
* Rename 9999_99_99_99_world.sql to 2019_06_22_00_world.sql
-rw-r--r-- | sql/updates/world/3.3.5/2019_06_22_00_world.sql | 3 | ||||
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 27 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_borean_tundra.cpp | 44 |
3 files changed, 47 insertions, 27 deletions
diff --git a/sql/updates/world/3.3.5/2019_06_22_00_world.sql b/sql/updates/world/3.3.5/2019_06_22_00_world.sql new file mode 100644 index 00000000000..29f3e21722d --- /dev/null +++ b/sql/updates/world/3.3.5/2019_06_22_00_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_q11653_shortening_blaster'); +INSERT INTO `spell_script_names` VALUES +(45668,'spell_q11653_shortening_blaster'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 0bb9c013324..3f277336e4b 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3699,33 +3699,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) } return; } - case 45668: // Ultra-Advanced Proto-Typical Shortening Blaster - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) - return; - - static uint32 const spellPlayer[5] = - { - 45674, // Bigger! - 45675, // Shrunk - 45678, // Yellow - 45682, // Ghost - 45684 // Polymorph - }; - - static uint32 const spellTarget[5] = - { - 45673, // Bigger! - 45672, // Shrunk - 45677, // Yellow - 45681, // Ghost - 45683 // Polymorph - }; - - m_caster->CastSpell(m_caster, spellPlayer[urand(0, 4)], true); - unitTarget->CastSpell(unitTarget, spellTarget[urand(0, 4)], true); - break; - } } break; } diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 347a9433e5f..6f9f5eac349 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -39,6 +39,7 @@ EndContentData */ #include "ObjectMgr.h" #include "Player.h" #include "QuestDef.h" +#include "CreatureAIImpl.h" #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" #include "ScriptedGossip.h" @@ -2525,6 +2526,48 @@ public: } }; +// 45668 - Ultra-Advanced Proto-Typical Shortening Blaster +enum ShorteningBlaster +{ + SPELL_SHORTENING_BLASTER_BIGGER1 = 45674, + SPELL_SHORTENING_BLASTER_SHRUNK1 = 45675, + SPELL_SHORTENING_BLASTER_YELLOW1 = 45678, + SPELL_SHORTENING_BLASTER_GHOST1 = 45682, + SPELL_SHORTENING_BLASTER_POLYMORPH1 = 45684, + + SPELL_SHORTENING_BLASTER_BIGGER2 = 45673, + SPELL_SHORTENING_BLASTER_SHRUNK2 = 45672, + SPELL_SHORTENING_BLASTER_YELLOW2 = 45677, + SPELL_SHORTENING_BLASTER_GHOST2 = 45682, + SPELL_SHORTENING_BLASTER_POLYMORPH2 = 45683 +}; + +class spell_q11653_shortening_blaster : public SpellScript +{ + PrepareSpellScript(spell_q11653_shortening_blaster); + + void HandleScript(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + Unit* target = GetHitUnit(); + + uint32 spellId = RAND(SPELL_SHORTENING_BLASTER_BIGGER1, SPELL_SHORTENING_BLASTER_SHRUNK1, + SPELL_SHORTENING_BLASTER_YELLOW1, + SPELL_SHORTENING_BLASTER_GHOST1, SPELL_SHORTENING_BLASTER_POLYMORPH1); + uint32 spellId2 = RAND(SPELL_SHORTENING_BLASTER_BIGGER2, SPELL_SHORTENING_BLASTER_SHRUNK2, + SPELL_SHORTENING_BLASTER_YELLOW2, + SPELL_SHORTENING_BLASTER_GHOST2, SPELL_SHORTENING_BLASTER_POLYMORPH2); + + caster->CastSpell(caster, spellId, true); + target->CastSpell(target, spellId2, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q11653_shortening_blaster::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_borean_tundra() { new npc_sinkhole_kill_credit(); @@ -2552,4 +2595,5 @@ void AddSC_borean_tundra() new spell_q11719_bloodspore_ruination_45997(); new npc_bloodmage_laurith(); new npc_orabus_the_helmsman_ship_exit_pos(); + RegisterSpellScript(spell_q11653_shortening_blaster); } |