DB/Misc: Misc fixes for Dun Morogh

By Malcrom
This commit is contained in:
Aokromes
2017-06-02 16:07:06 +02:00
parent 2e3197f944
commit 214b5a65e3
3 changed files with 367 additions and 0 deletions

View File

@@ -185,6 +185,7 @@ void AddSC_instance_zulgurub();
//void AddSC_alterac_mountains();
void AddSC_arathi_highlands();
void AddSC_blasted_lands();
void AddSC_dun_morogh();
void AddSC_dun_morogh_area_coldridge_valley();
void AddSC_duskwood();
//void AddSC_eastern_plaguelands();
@@ -375,6 +376,7 @@ void AddEasternKingdomsScripts()
//AddSC_alterac_mountains();
AddSC_arathi_highlands();
AddSC_blasted_lands();
AddSC_dun_morogh();
AddSC_dun_morogh_area_coldridge_valley();
AddSC_duskwood();
//AddSC_eastern_plaguelands();

View File

@@ -0,0 +1,88 @@
/*
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
enum FrozenMountaineer
{
DATA_SET_ICE_BROKEN = 1,
EVENT_RUN_AWAY = 1,
SAY_MONSTEREMOTE = 0,
SPELL_SUMMON_FROZEN_TOMB = 77906,
SPELL_FREEZE_ANIM = 77910
};
/*######
# npc_frozen_mountaineer
######*/
class npc_frozen_mountaineer : public CreatureScript
{
public:
npc_frozen_mountaineer() : CreatureScript("npc_frozen_mountaineer") { }
struct npc_frozen_mountaineerAI : public ScriptedAI
{
npc_frozen_mountaineerAI(Creature* creature) : ScriptedAI(creature), _dataOneSet(false) { }
void Reset() override
{
_events.Reset();
DoCastSelf(SPELL_SUMMON_FROZEN_TOMB, true);
DoCastSelf(SPELL_FREEZE_ANIM, true);
}
void SetData(uint32 /*type*/, uint32 data) override
{
if (data == DATA_SET_ICE_BROKEN && !_dataOneSet)
{
me->RemoveAllAuras();
Talk(SAY_MONSTEREMOTE);
_dataOneSet = true;
_events.ScheduleEvent(EVENT_RUN_AWAY, Seconds(3));
}
}
void UpdateAI(uint32 diff) override
{
if (!_dataOneSet)
return;
_events.Update(diff);
if (_events.ExecuteEvent() == EVENT_RUN_AWAY)
{
me->GetMotionMaster()->MovePoint(0, me->GetPositionX() + (std::cos(me->GetOrientation()) * 15.0f), me->GetPositionY() + (std::sin(me->GetOrientation()) * 15.0f), me->GetPositionZ());
me->DespawnOrUnsummon(Seconds(2));
}
}
private:
EventMap _events;
bool _dataOneSet;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_frozen_mountaineerAI(creature);
}
};
void AddSC_dun_morogh()
{
new npc_frozen_mountaineer();
}