diff options
-rw-r--r-- | sql/updates/world/master/2021_01_16_06_world_2017_10_29_00_world.sql | 10 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_borean_tundra.cpp | 104 |
2 files changed, 114 insertions, 0 deletions
diff --git a/sql/updates/world/master/2021_01_16_06_world_2017_10_29_00_world.sql b/sql/updates/world/master/2021_01_16_06_world_2017_10_29_00_world.sql new file mode 100644 index 00000000000..7f2f287a1ad --- /dev/null +++ b/sql/updates/world/master/2021_01_16_06_world_2017_10_29_00_world.sql @@ -0,0 +1,10 @@ +-- quest: A Suitable Test Subject (11719) +DELETE FROM `spell_script_names` WHERE `ScriptName`="spell_q11719_bloodspore_ruination_45997"; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(45997, "spell_q11719_bloodspore_ruination_45997"); + +UPDATE `creature_template` SET `ScriptName`="npc_bloodmage_laurith" WHERE `entry`=25381; + +DELETE FROM `creature_text` WHERE `CreatureID`=25381; +INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(25381, 0, 0, "How positively awful! You were totally incapacitated? Weak? Hot flashes?", 15, 0, 100, 21, 0, 0, 24992, 0, "Bloodmage Laurith"); diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 3cb7d03631b..dd160545a7c 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -2379,6 +2379,108 @@ public: } }; +enum BloodsporeRuination +{ + NPC_BLOODMAGE_LAURITH = 25381, + SAY_BLOODMAGE_LAURITH = 0, + EVENT_TALK = 1, + EVENT_RESET_ORIENTATION +}; + +class spell_q11719_bloodspore_ruination_45997 : public SpellScriptLoader +{ +public: + spell_q11719_bloodspore_ruination_45997() : SpellScriptLoader("spell_q11719_bloodspore_ruination_45997") { } + + class spell_q11719_bloodspore_ruination_45997_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q11719_bloodspore_ruination_45997_SpellScript); + + void HandleEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + if (Creature* laurith = caster->FindNearestCreature(NPC_BLOODMAGE_LAURITH, 100.0f)) + laurith->AI()->SetGUID(caster->GetGUID()); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q11719_bloodspore_ruination_45997_SpellScript::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q11719_bloodspore_ruination_45997_SpellScript(); + } +}; + +class npc_bloodmage_laurith : public CreatureScript +{ +public: + npc_bloodmage_laurith() : CreatureScript("npc_bloodmage_laurith") { } + + struct npc_bloodmage_laurithAI : public ScriptedAI + { + npc_bloodmage_laurithAI(Creature* creature) : ScriptedAI(creature) { } + + void Reset() override + { + _events.Reset(); + _playerGUID.Clear(); + } + + void SetGUID(ObjectGuid guid, int32 /*action*/) override + { + if (!_playerGUID.IsEmpty()) + return; + + _playerGUID = guid; + + if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID)) + me->SetFacingToObject(player); + + _events.ScheduleEvent(EVENT_TALK, Seconds(1)); + } + + void UpdateAI(uint32 diff) override + { + if (UpdateVictim()) + { + DoMeleeAttackIfReady(); + return; + } + + _events.Update(diff); + + if (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_TALK: + if (Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID)) + Talk(SAY_BLOODMAGE_LAURITH, player); + _playerGUID.Clear(); + _events.ScheduleEvent(EVENT_RESET_ORIENTATION, Seconds(5)); + break; + case EVENT_RESET_ORIENTATION: + me->SetFacingTo(me->GetHomePosition().GetOrientation()); + break; + } + } + } + + private: + EventMap _events; + ObjectGuid _playerGUID; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_bloodmage_laurithAI(creature); + } +}; + void AddSC_borean_tundra() { new npc_sinkhole_kill_credit(); @@ -2404,4 +2506,6 @@ void AddSC_borean_tundra() new npc_warmage_coldarra(); new npc_hidden_cultist(); new spell_windsoul_totem_aura(); + new spell_q11719_bloodspore_ruination_45997(); + new npc_bloodmage_laurith(); } |