Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sql/updates/world/4.3.4/2021_08_26_00_world.sql
Original file line number Diff line number Diff line change
@@ -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);
1 change: 1 addition & 0 deletions sql/updates/world/4.3.4/2021_08_27_00_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UPDATE `creature` SET `ScriptName` = "npc_frostmane_builder" WHERE id=41251;
73 changes: 69 additions & 4 deletions src/server/scripts/EasternKingdoms/zone_dun_morogh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

/*######
Expand Down Expand Up @@ -86,4 +150,5 @@ class npc_frozen_mountaineer : public CreatureScript
void AddSC_dun_morogh()
{
new npc_frozen_mountaineer();
new npc_frostmane_builder();
}