diff options
| -rw-r--r-- | sql/updates/2011_01_30_0_world_spell_script_names.sql | 3 | ||||
| -rw-r--r-- | sql/updates/2011_01_30_1_world_scriptnames.sql | 1 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/storm_peaks.cpp | 50 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 61 |
4 files changed, 115 insertions, 0 deletions
diff --git a/sql/updates/2011_01_30_0_world_spell_script_names.sql b/sql/updates/2011_01_30_0_world_spell_script_names.sql new file mode 100644 index 00000000000..56f3a7a2186 --- /dev/null +++ b/sql/updates/2011_01_30_0_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 54798 AND `ScriptName`='spell_q12851_going_bearback'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(54798,'spell_q12851_going_bearback'); diff --git a/sql/updates/2011_01_30_1_world_scriptnames.sql b/sql/updates/2011_01_30_1_world_scriptnames.sql new file mode 100644 index 00000000000..55532c44f1f --- /dev/null +++ b/sql/updates/2011_01_30_1_world_scriptnames.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_icefang' WHERE `entry`=29602; diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index f56c372faf4..1b1e4f06939 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -665,6 +665,55 @@ public: } }; +class npc_icefang : public CreatureScript +{ +public: + npc_icefang() : CreatureScript("npc_icefang") { } + + struct npc_icefangAI : public npc_escortAI + { + npc_icefangAI(Creature* creature) : npc_escortAI(creature) {} + + void AttackStart(Unit* who) {} + void EnterCombat(Unit* who) {} + void EnterEvadeMode() {} + + void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) + { + if (who->GetTypeId() == TYPEID_PLAYER) + { + if (apply) + Start(false, true, who->GetGUID()); + } + } + + void WaypointReached(uint32 wp) + { + } + + void JustDied(Unit* killer) + { + } + + void OnCharmed(bool /*apply*/) + { + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_icefangAI (creature); + } +}; + void AddSC_storm_peaks() { new npc_agnetta_tyrsdottar; @@ -676,4 +725,5 @@ void AddSC_storm_peaks() new npc_injured_goblin; new npc_roxi_ramrocket; new npc_brunnhildar_prisoner; + new npc_icefang; } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index a9fa3a4928e..c6fb1332333 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -619,6 +619,66 @@ public: } }; +// http://www.wowhead.com/quest=12851 Going Bearback +// 54798 FLAMING Arrow Triggered Effect +enum eQuest12851Data +{ + NPC_FROSTGIANT = 29351, + NPC_FROSTWORG = 29358, + SPELL_FROSTGIANT_CREDIT = 58184, + SPELL_FROSTWORG_CREDIT = 58183, + SPELL_IMMOLATION = 54690, + SPELL_ABLAZE = 54683, +}; + +class spell_q12851_going_bearback : public SpellScriptLoader +{ +public: + spell_q12851_going_bearback() : SpellScriptLoader("spell_q12851_going_bearback") { } + + class spell_q12851_going_bearback_AuraScript : public AuraScript + { + public: + PrepareAuraScript(spell_q12851_going_bearback_AuraScript) + void HandleEffectApply(AuraEffect const * /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + if (Unit* target = GetTarget()) + { + if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + switch(target->GetEntry()) + { + case NPC_FROSTWORG: + target->CastSpell(player, SPELL_FROSTWORG_CREDIT, true); + target->CastSpell(target, SPELL_IMMOLATION, true); + target->CastSpell(target, SPELL_ABLAZE, true); + break; + case NPC_FROSTGIANT: + target->CastSpell(player, SPELL_FROSTGIANT_CREDIT, true); + target->CastSpell(target, SPELL_IMMOLATION, true); + target->CastSpell(target, SPELL_ABLAZE, true); + break; + } + } + } + } + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_q12851_going_bearback_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + + }; + + AuraScript* GetAuraScript() const + { + return new spell_q12851_going_bearback_AuraScript(); + } +}; + // http://www.wowhead.com/quest=12937 Relief for the Fallen // 55804 Healing Finished enum eQuest12937Data @@ -684,5 +744,6 @@ void AddSC_quest_spell_scripts() new spell_q12459_seeds_of_natures_wrath(); new spell_q12634_despawn_fruit_tosser(); new spell_q12683_take_sputum_sample(); + new spell_q12851_going_bearback(); new spell_q12937_relief_for_the_fallen(); } |
