Core/Scripts: Convert Torek script_texts to creature_text.

Apply coding style in it.
This commit is contained in:
Venugh
2012-01-14 00:20:03 +01:00
parent c548f4ea73
commit 46d1736d0d
2 changed files with 37 additions and 19 deletions

View File

@@ -0,0 +1,10 @@
-- Remove old script text for npc_torek
DELETE FROM `script_texts` WHERE `entry` IN (-1000106, -1000110);
-- Add creature texts for Torek
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(12858, 0, 0, 'Everyone ready?', 0, 0, 100, 0, 0, 0, 'Torek'),
(12858, 1, 0, 'Ok, Lets move out!', 0, 0, 100, 0, 0, 0, 'Torek'),
(12858, 2, 0, 'Prepare yourselves. Silverwing is just around the bend.', 0, 0, 100, 0, 0, 0, 'Torek'),
(12858, 3, 0, 'Silverwing is ours!', 0, 0, 100, 0, 0, 0, 'Torek'),
(12858, 4, 0, 'Go report that the outpost is taken. We will remain here.', 0, 0, 100, 0, 0, 0, 'Torek');

View File

@@ -35,34 +35,42 @@ EndContentData */
# npc_torek
####*/
#define SAY_READY -1000106
#define SAY_MOVE -1000107
#define SAY_PREPARE -1000108
#define SAY_WIN -1000109
#define SAY_END -1000110
enum eTorekSays
{
SAY_READY = 0,
SAY_MOVE = 1,
SAY_PREPARE = 2,
SAY_WIN = 3,
SAY_END = 4,
};
#define SPELL_REND 11977
#define SPELL_THUNDERCLAP 8078
enum eTorekSpells
{
SPELL_REND = 11977,
SPELL_THUNDERCLAP = 8078,
};
#define QUEST_TOREK_ASSULT 6544
enum
{
QUEST_TOREK_ASSULT = 6544,
#define ENTRY_SPLINTERTREE_RAIDER 12859
#define ENTRY_DURIEL 12860
#define ENTRY_SILVERWING_SENTINEL 12896
#define ENTRY_SILVERWING_WARRIOR 12897
ENTRY_SPLINTERTREE_RAIDER = 12859,
ENTRY_DURIEL = 12860,
ENTRY_SILVERWING_SENTINEL = 12896,
ENTRY_SILVERWING_WARRIOR = 12897,
};
class npc_torek : public CreatureScript
{
public:
npc_torek()
: CreatureScript("npc_torek")
npc_torek() : CreatureScript("npc_torek")
{
}
struct npc_torekAI : public npc_escortAI
{
npc_torekAI(Creature* c) : npc_escortAI(c) {}
npc_torekAI(Creature* creature) : npc_escortAI(creature) {}
uint32 Rend_Timer;
uint32 Thunderclap_Timer;
@@ -78,10 +86,10 @@ class npc_torek : public CreatureScript
switch (i)
{
case 1:
DoScriptText(SAY_MOVE, me, player);
Talk(SAY_MOVE, player->GetGUID());
break;
case 8:
DoScriptText(SAY_PREPARE, me, player);
Talk(SAY_PREPARE, player->GetGUID());
break;
case 19:
//TODO: verify location and creatures amount.
@@ -96,7 +104,7 @@ class npc_torek : public CreatureScript
player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
break;
case 21:
DoScriptText(SAY_END, me, player);
Talk(SAY_END, player->GetGUID());
break;
}
}
@@ -148,7 +156,7 @@ class npc_torek : public CreatureScript
if (quest->GetQuestId() == QUEST_TOREK_ASSULT)
{
//TODO: find companions, make them follow Torek, at any time (possibly done by core/database in future?)
DoScriptText(SAY_READY, creature, player);
creature->AI()->Talk(SAY_READY, player->GetGUID());
creature->setFaction(113);
if (npc_escortAI* pEscortAI = CAST_AI(npc_torekAI, creature->AI()))