diff --git a/sql/updates/world/4.3.4/2021_08_26_00_world.sql b/sql/updates/world/4.3.4/2021_08_26_00_world.sql new file mode 100644 index 00000000000..032f947e659 --- /dev/null +++ b/sql/updates/world/4.3.4/2021_08_26_00_world.sql @@ -0,0 +1,5 @@ +SET @ENTRY := 43495; +INSERT INTO `item_loot_template` (`Entry`,`Item`,`Reference`,`Chance`,`QuestRequired`,`IsCurrency`,`LootMode`,`GroupId`,`MinCount`,`MaxCount`,`Comment`) VALUES (57540,57541,0,97,0,0,1,0,1,1,NULL), +(@ENTRY,57542,0,97,0,0,1,0,1,1,NULL), +(@ENTRY,57543,0,99,0,0,1,0,3,3,NULL), +(@ENTRY,57544,0,99,0,0,1,0,5,5,NULL); \ No newline at end of file diff --git a/sql/updates/world/4.3.4/2021_08_27_00_world.sql b/sql/updates/world/4.3.4/2021_08_27_00_world.sql new file mode 100644 index 00000000000..9e2973d9ebf --- /dev/null +++ b/sql/updates/world/4.3.4/2021_08_27_00_world.sql @@ -0,0 +1 @@ +UPDATE `creature` SET `ScriptName` = "npc_frostmane_builder" WHERE id=41251; \ No newline at end of file diff --git a/src/server/scripts/EasternKingdoms/zone_dun_morogh.cpp b/src/server/scripts/EasternKingdoms/zone_dun_morogh.cpp index c1b6ca1ed93..e73f7b7660f 100644 --- a/src/server/scripts/EasternKingdoms/zone_dun_morogh.cpp +++ b/src/server/scripts/EasternKingdoms/zone_dun_morogh.cpp @@ -19,13 +19,77 @@ #include "MotionMaster.h" #include "ScriptedCreature.h" +enum FrostmaneBuilder +{ + SPELL_EQUALIZE_VIEWPOINT = 93773, + QUEST_FROSTMANE_BUILDER_CREDIT = 50606 +}; + enum FrozenMountaineer { - DATA_SET_ICE_BROKEN = 1, - EVENT_RUN_AWAY = 1, - SAY_MONSTEREMOTE = 0, + DATA_SET_ICE_BROKEN = 1, + EVENT_RUN_AWAY = 1, + SAY_MONSTEREMOTE = 0, SPELL_SUMMON_FROZEN_TOMB = 77906, - SPELL_FREEZE_ANIM = 77910 + SPELL_FREEZE_ANIM = 77910 +}; + +/*###### +# npc_frostmane_builder +######*/ + +class npc_frostmane_builder : public CreatureScript +{ +public: + npc_frostmane_builder() : CreatureScript("npc_frostmane_builder") {} + struct npc_frostmane_builderAI : public ScriptedAI + { + npc_frostmane_builderAI(Creature* creature) : ScriptedAI(creature), _hitBySpell(false) + { + Initialize(); + } + + void Initialize() + { + _hitBySpell = false; + } + + void Reset() override + { + Initialize(); + } + + + void SpellHit(Unit* caster, SpellInfo const* spell) override + { + if (!_hitBySpell) + _hitBySpell = true; + + if (spell->Id == SPELL_EQUALIZE_VIEWPOINT) + { + if (Player* player = caster->ToPlayer()) + player->KilledMonsterCredit(QUEST_FROSTMANE_BUILDER_CREDIT); + } + } + + void UpdateAI(uint32 diff) override + { + if (!_hitBySpell) + return; + + _events.Update(diff); + } + + private: + EventMap _events; + ObjectGuid _playerGUID; + bool _hitBySpell; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_frostmane_builderAI(creature); + } }; /*###### @@ -86,4 +150,5 @@ class npc_frozen_mountaineer : public CreatureScript void AddSC_dun_morogh() { new npc_frozen_mountaineer(); + new npc_frostmane_builder(); }