Scripts/Kalimdor: Ashenvale - Remove Torek C++ Script

This commit is contained in:
Rushor
2015-04-05 12:43:15 +02:00
parent 78d2f934b9
commit f49a1b0f1f

View File

@@ -24,7 +24,6 @@ SDCategory: Ashenvale Forest
EndScriptData */
/* ContentData
npc_torek
npc_ruul_snowhoof
EndContentData */
@@ -33,132 +32,6 @@ EndContentData */
#include "ScriptedEscortAI.h"
#include "Player.h"
/*####
# npc_torek
####*/
enum Torek
{
SAY_READY = 0,
SAY_MOVE = 1,
SAY_PREPARE = 2,
SAY_WIN = 3,
SAY_END = 4,
SPELL_REND = 11977,
SPELL_THUNDERCLAP = 8078,
QUEST_TOREK_ASSULT = 6544,
NPC_SPLINTERTREE_RAIDER = 12859,
NPC_DURIEL = 12860,
NPC_SILVERWING_SENTINEL = 12896,
NPC_SILVERWING_WARRIOR = 12897,
FACTION_QUEST = 113
};
class npc_torek : public CreatureScript
{
public:
npc_torek() : CreatureScript("npc_torek") { }
struct npc_torekAI : public npc_escortAI
{
npc_torekAI(Creature* creature) : npc_escortAI(creature)
{
Initialize();
}
void Initialize()
{
rend_Timer = 5000;
thunderclap_Timer = 8000;
_completed = false;
}
void Reset() override
{
Initialize();
}
void EnterCombat(Unit* /*who*/) override { }
void JustSummoned(Creature* summoned) override
{
summoned->AI()->AttackStart(me);
}
void sQuestAccept(Player* player, Quest const* quest) override
{
if (quest->GetQuestId() == QUEST_TOREK_ASSULT)
{
/// @todo find companions, make them follow Torek, at any time (possibly done by core/database in future?)
Talk(SAY_READY, player);
me->setFaction(FACTION_QUEST);
npc_escortAI::Start(true, true, player->GetGUID());
}
}
void WaypointReached(uint32 waypointId) override
{
if (Player* player = GetPlayerForEscort())
{
switch (waypointId)
{
case 1:
Talk(SAY_MOVE, player);
break;
case 8:
Talk(SAY_PREPARE, player);
break;
case 19:
/// @todo verify location and creatures amount.
me->SummonCreature(NPC_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(NPC_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(NPC_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 20:
Talk(SAY_WIN, player);
_completed = true;
player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
break;
case 21:
Talk(SAY_END, player);
break;
}
}
}
void UpdateAI(uint32 diff) override
{
npc_escortAI::UpdateAI(diff);
if (!UpdateVictim())
return;
if (rend_Timer <= diff)
{
DoCastVictim(SPELL_REND);
rend_Timer = 20000;
} else rend_Timer -= diff;
if (thunderclap_Timer <= diff)
{
DoCast(me, SPELL_THUNDERCLAP);
thunderclap_Timer = 30000;
} else thunderclap_Timer -= diff;
}
private:
uint32 rend_Timer;
uint32 thunderclap_Timer;
bool _completed;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_torekAI(creature);
}
};
/*####
# npc_ruul_snowhoof
####*/
@@ -472,7 +345,6 @@ class go_naga_brazier : public GameObjectScript
void AddSC_ashenvale()
{
new npc_torek();
new npc_ruul_snowhoof();
new npc_muglash();
new go_naga_brazier();