mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripting/Hellfire: Moved some gossip to db and fix some magic numbers.
This commit is contained in:
54
sql/updates/world/2013_12_24_01_world_misc.sql
Normal file
54
sql/updates/world/2013_12_24_01_world_misc.sql
Normal file
@@ -0,0 +1,54 @@
|
||||
-- Remove script for Naladu gossip already exist
|
||||
UPDATE `creature_template` SET `AIName`='', `ScriptName`= '' WHERE `entry`=19361;
|
||||
|
||||
-- Gossip text & Options for Tracy Proudwell
|
||||
UPDATE `creature_template` SET `gossip_menu_id`=7892 WHERE `entry`=18266;
|
||||
DELETE FROM `gossip_menu` WHERE `entry` IN (8544);
|
||||
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8544,10689);
|
||||
DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7892,8544);
|
||||
INSERT INTO `gossip_menu_option` (menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, action_menu_id, action_poi_id, box_coded, box_money, box_text) VALUES
|
||||
(7892,0,1, 'I have marks to redeem!',3,128,0,0,0,0, ''),
|
||||
(7892,1,0, 'I heard that your dog Fei Fei took Klatu''s prayer beads...',1,1,8544,0,0,0, ''),
|
||||
(8544,0,0, '<back>',1,1,7892,0,0,0, '');
|
||||
-- Add Conditions for Budd Nedreck gossip option
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7892;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(15,7892,1,0,0,9,0,10916,0,0,0,0,0, '', 'Gossip Option - Show Option if Quest 10916 is taken');
|
||||
|
||||
-- Commander Danath Trollbane SAI
|
||||
SET @ENTRY := 16819;
|
||||
UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`= '' WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
|
||||
(@ENTRY,0,0,1,50,0,100,0,10254,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Commander Danath Trollbane - On Quest Rewarded - Say 0"),
|
||||
(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,11,6245,0,0,0,0,0,7,0,0,0,0,0,0,0,"Commander Danath Trollbane - On Quest Rewarded - Cast Force Target - Salute");
|
||||
|
||||
-- Creature text for Commander Danath Trollbane
|
||||
DELETE FROM `creature_text` WHERE `entry`=16819;
|
||||
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
|
||||
(16819,0,0, 'Welcome to Honor Hold, $N. It''s good to have you.',12,0,100,66,0,0, 'Commander Danath Trollbane');
|
||||
|
||||
-- Gossip text & Options for Force Commander Danath Trollbane
|
||||
DELETE FROM `gossip_menu` WHERE `entry` IN (8043,8044,8049,8051);
|
||||
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8043,9933),(8044,9932),(8049,9941),(8051,8772);
|
||||
DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7352,8044);
|
||||
INSERT INTO `gossip_menu_option` (menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, action_menu_id, action_poi_id, box_coded, box_money, box_text) VALUES
|
||||
(7352,0,0, 'Tell me of the Sons of Lothar.',1,1,8044,0,0,0, ''),
|
||||
(7352,1,0, 'Tell me of the Hellfire orcs.',1,1,8049,0,0,0, ''),
|
||||
(7352,2,0, 'Tell me of your homeland.',1,1,8051,0,0,0, ''),
|
||||
(8044,0,0, '<more>',1,1,8043,0,0,0, '');
|
||||
|
||||
-- Add Conditions for Force Commander Danath Trollbane gossip text
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7352;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(14,7352,9938,0,0,8,0,10254,0,0,0,1,0, '', 'Gossip Text - Show Text if Quest 10254 is not rewarded'),
|
||||
(14,7352,9939,0,0,8,0,10254,0,0,0,0,0, '', 'Gossip Text - Show Text if Quest 10254 is rewarded'),
|
||||
(14,7352,9939,0,1,8,0,10937,0,0,0,1,0, '', 'Gossip Text - Show Text if Quest 10937 is not rewarded'),
|
||||
(14,7352,9944,0,0,8,0,10937,0,0,0,0,0, '', 'Gossip Text - Show Text if Quest 10937 is rewarded');
|
||||
|
||||
-- Add Conditions for Force Commander Danath Trollbane gossip options
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7352;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(15,7352,0,0,0,8,0,10254,0,0,0,0,0, '', 'Gossip Option - Show Option if Quest 10254 is rewarded'),
|
||||
(15,7352,1,0,0,8,0,10254,0,0,0,0,0, '', 'Gossip Option - Show Option if Quest 10254 is rewarded'),
|
||||
(15,7352,2,0,0,8,0,10141,0,0,0,0,0, '', 'Gossip Option - Show Option if Quest 10141 is rewarded');
|
||||
@@ -19,18 +19,15 @@
|
||||
/* ScriptData
|
||||
SDName: Hellfire_Peninsula
|
||||
SD%Complete: 100
|
||||
SDComment: Quest support: 9375, 9410, 9418, 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths)
|
||||
SDComment: Quest support: 9375, 9410, 9418, 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths) "Needs update"
|
||||
SDCategory: Hellfire Peninsula
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_aeranas
|
||||
npc_ancestral_wolf
|
||||
go_haaleshi_altar
|
||||
npc_naladu
|
||||
npc_tracy_proudwell
|
||||
npc_trollbane
|
||||
npc_wounded_blood_elf
|
||||
npc_fel_guard_hound
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
@@ -46,14 +43,12 @@ EndContentData */
|
||||
|
||||
enum Aeranas
|
||||
{
|
||||
SAY_SUMMON = 0,
|
||||
SAY_FREE = 1,
|
||||
|
||||
FACTION_HOSTILE = 16,
|
||||
FACTION_FRIENDLY = 35,
|
||||
|
||||
SPELL_ENVELOPING_WINDS = 15535,
|
||||
SPELL_SHOCK = 12553
|
||||
SAY_SUMMON = 0,
|
||||
SAY_FREE = 1,
|
||||
FACTION_HOSTILE = 16,
|
||||
FACTION_FRIENDLY = 35,
|
||||
SPELL_ENVELOPING_WINDS = 15535,
|
||||
SPELL_SHOCK = 12553
|
||||
};
|
||||
|
||||
class npc_aeranas : public CreatureScript
|
||||
@@ -61,24 +56,15 @@ class npc_aeranas : public CreatureScript
|
||||
public:
|
||||
npc_aeranas() : CreatureScript("npc_aeranas") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_aeranasAI(creature);
|
||||
}
|
||||
|
||||
struct npc_aeranasAI : public ScriptedAI
|
||||
{
|
||||
npc_aeranasAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 Faction_Timer;
|
||||
uint32 EnvelopingWinds_Timer;
|
||||
uint32 Shock_Timer;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
Faction_Timer = 8000;
|
||||
EnvelopingWinds_Timer = 9000;
|
||||
Shock_Timer = 5000;
|
||||
faction_Timer = 8000;
|
||||
envelopingWinds_Timer = 9000;
|
||||
shock_Timer = 5000;
|
||||
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->setFaction(FACTION_FRIENDLY);
|
||||
@@ -88,13 +74,13 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (Faction_Timer)
|
||||
if (faction_Timer)
|
||||
{
|
||||
if (Faction_Timer <= diff)
|
||||
if (faction_Timer <= diff)
|
||||
{
|
||||
me->setFaction(FACTION_HOSTILE);
|
||||
Faction_Timer = 0;
|
||||
} else Faction_Timer -= diff;
|
||||
faction_Timer = 0;
|
||||
} else faction_Timer -= diff;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
@@ -111,21 +97,31 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if (Shock_Timer <= diff)
|
||||
if (shock_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHOCK);
|
||||
Shock_Timer = 10000;
|
||||
} else Shock_Timer -= diff;
|
||||
shock_Timer = 10000;
|
||||
} else shock_Timer -= diff;
|
||||
|
||||
if (EnvelopingWinds_Timer <= diff)
|
||||
if (envelopingWinds_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_ENVELOPING_WINDS);
|
||||
EnvelopingWinds_Timer = 25000;
|
||||
} else EnvelopingWinds_Timer -= diff;
|
||||
envelopingWinds_Timer = 25000;
|
||||
} else envelopingWinds_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 faction_Timer;
|
||||
uint32 envelopingWinds_Timer;
|
||||
uint32 shock_Timer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_aeranasAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
@@ -134,13 +130,11 @@ public:
|
||||
|
||||
enum AncestralWolf
|
||||
{
|
||||
EMOTE_WOLF_LIFT_HEAD = 0,
|
||||
EMOTE_WOLF_HOWL = 1,
|
||||
SAY_WOLF_WELCOME = 2,
|
||||
|
||||
SPELL_ANCESTRAL_WOLF_BUFF = 29981,
|
||||
|
||||
NPC_RYGA = 17123
|
||||
EMOTE_WOLF_LIFT_HEAD = 0,
|
||||
EMOTE_WOLF_HOWL = 1,
|
||||
SAY_WOLF_WELCOME = 2,
|
||||
SPELL_ANCESTRAL_WOLF_BUFF = 29981,
|
||||
NPC_RYGA = 17123
|
||||
};
|
||||
|
||||
class npc_ancestral_wolf : public CreatureScript
|
||||
@@ -148,11 +142,6 @@ class npc_ancestral_wolf : public CreatureScript
|
||||
public:
|
||||
npc_ancestral_wolf() : CreatureScript("npc_ancestral_wolf") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_ancestral_wolfAI(creature);
|
||||
}
|
||||
|
||||
struct npc_ancestral_wolfAI : public npc_escortAI
|
||||
{
|
||||
npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature)
|
||||
@@ -166,20 +155,18 @@ public:
|
||||
Reset();
|
||||
}
|
||||
|
||||
Creature* pRyga;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
pRyga = NULL;
|
||||
ryga = NULL;
|
||||
DoCast(me, SPELL_ANCESTRAL_WOLF_BUFF, true);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) OVERRIDE
|
||||
|
||||
{
|
||||
if (!pRyga && who->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(who, 15.0f))
|
||||
if (!ryga && who->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(who, 15.0f))
|
||||
if (Creature* temp = who->ToCreature())
|
||||
pRyga = temp;
|
||||
ryga = temp;
|
||||
|
||||
npc_escortAI::MoveInLineOfSight(who);
|
||||
}
|
||||
@@ -195,154 +182,19 @@ public:
|
||||
Talk(EMOTE_WOLF_HOWL);
|
||||
break;
|
||||
case 50:
|
||||
if (pRyga && pRyga->IsAlive() && !pRyga->IsInCombat())
|
||||
pRyga->AI()->Talk(SAY_WOLF_WELCOME);
|
||||
if (ryga && ryga->IsAlive() && !ryga->IsInCombat())
|
||||
ryga->AI()->Talk(SAY_WOLF_WELCOME);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
Creature* ryga;
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_naladu
|
||||
######*/
|
||||
|
||||
#define GOSSIP_NALADU_ITEM1 "Why don't you escape?"
|
||||
|
||||
enum Naladu
|
||||
{
|
||||
GOSSIP_TEXTID_NALADU1 = 9788
|
||||
};
|
||||
|
||||
class npc_naladu : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_naladu() : CreatureScript("npc_naladu") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_NALADU1, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NALADU_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_tracy_proudwell
|
||||
######*/
|
||||
|
||||
#define GOSSIP_TEXT_REDEEM_MARKS "I have marks to redeem!"
|
||||
#define GOSSIP_TRACY_PROUDWELL_ITEM1 "I heard that your dog Fei Fei took Klatu's prayer beads..."
|
||||
#define GOSSIP_TRACY_PROUDWELL_ITEM2 "<back>"
|
||||
|
||||
enum Tracy
|
||||
{
|
||||
GOSSIP_TEXTID_TRACY_PROUDWELL1 = 10689,
|
||||
QUEST_DIGGING_FOR_PRAYER_BEADS = 10916
|
||||
};
|
||||
|
||||
class npc_tracy_proudwell : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_tracy_proudwell() : CreatureScript("npc_tracy_proudwell") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TRACY_PROUDWELL1, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_TRADE:
|
||||
player->GetSession()->SendListInventory(creature->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (creature->IsVendor())
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_REDEEM_MARKS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
|
||||
if (player->GetQuestStatus(QUEST_DIGGING_FOR_PRAYER_BEADS) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_trollbane
|
||||
######*/
|
||||
|
||||
#define GOSSIP_TROLLBANE_ITEM1 "Tell me of the Sons of Lothar."
|
||||
#define GOSSIP_TROLLBANE_ITEM2 "<more>"
|
||||
#define GOSSIP_TROLLBANE_ITEM3 "Tell me of your homeland."
|
||||
|
||||
enum Trollbane
|
||||
{
|
||||
GOSSIP_TEXTID_TROLLBANE1 = 9932,
|
||||
GOSSIP_TEXTID_TROLLBANE2 = 9933,
|
||||
GOSSIP_TEXTID_TROLLBANE3 = 8772
|
||||
};
|
||||
|
||||
class npc_trollbane : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_trollbane() : CreatureScript("npc_trollbane") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE1, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE2, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE3, creature->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
return new npc_ancestral_wolfAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -358,8 +210,10 @@ enum WoundedBloodElf
|
||||
SAY_ELF_SUMMON2 = 3,
|
||||
SAY_ELF_COMPLETE = 4,
|
||||
SAY_ELF_AGGRO = 5,
|
||||
|
||||
QUEST_ROAD_TO_FALCON_WATCH = 9375
|
||||
QUEST_ROAD_TO_FALCON_WATCH = 9375,
|
||||
NPC_HAALESHI_WINDWALKER = 16966,
|
||||
NPC_HAALESHI_TALONGUARD = 16967,
|
||||
FACTION_FALCON_WATCH_QUEST = 775
|
||||
};
|
||||
|
||||
class npc_wounded_blood_elf : public CreatureScript
|
||||
@@ -367,29 +221,23 @@ class npc_wounded_blood_elf : public CreatureScript
|
||||
public:
|
||||
npc_wounded_blood_elf() : CreatureScript("npc_wounded_blood_elf") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH)
|
||||
{
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_wounded_blood_elf::npc_wounded_blood_elfAI, creature->AI()))
|
||||
pEscortAI->Start(true, false, player->GetGUID());
|
||||
|
||||
// Change faction so mobs attack
|
||||
creature->setFaction(775);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_wounded_blood_elfAI(creature);
|
||||
}
|
||||
|
||||
struct npc_wounded_blood_elfAI : public npc_escortAI
|
||||
{
|
||||
npc_wounded_blood_elfAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void Reset() OVERRIDE { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
Talk(SAY_ELF_AGGRO);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned) OVERRIDE
|
||||
{
|
||||
summoned->AI()->AttackStart(me);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
@@ -404,8 +252,8 @@ public:
|
||||
case 9:
|
||||
Talk(SAY_ELF_SUMMON1, player);
|
||||
// Spawn two Haal'eshi Talonguard
|
||||
DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
DoSpawnCreature(NPC_HAALESHI_TALONGUARD, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
DoSpawnCreature(NPC_HAALESHI_TALONGUARD, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
break;
|
||||
case 13:
|
||||
Talk(SAY_ELF_RESTING, player);
|
||||
@@ -413,8 +261,8 @@ public:
|
||||
case 14:
|
||||
Talk(SAY_ELF_SUMMON2, player);
|
||||
// Spawn two Haal'eshi Windwalker
|
||||
DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
DoSpawnCreature(NPC_HAALESHI_WINDWALKER, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
DoSpawnCreature(NPC_HAALESHI_WINDWALKER, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
break;
|
||||
case 27:
|
||||
Talk(SAY_ELF_COMPLETE, player);
|
||||
@@ -423,20 +271,26 @@ public:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Reset() OVERRIDE { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
Talk(SAY_ELF_AGGRO);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned) OVERRIDE
|
||||
{
|
||||
summoned->AI()->AttackStart(me);
|
||||
}
|
||||
};
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH)
|
||||
{
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_wounded_blood_elf::npc_wounded_blood_elfAI, creature->AI()))
|
||||
pEscortAI->Start(true, false, player->GetGUID());
|
||||
|
||||
// Change faction so mobs attack
|
||||
creature->setFaction(FACTION_FALCON_WATCH_QUEST);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_wounded_blood_elfAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
@@ -445,9 +299,8 @@ public:
|
||||
|
||||
enum FelGuard
|
||||
{
|
||||
SPELL_SUMMON_POO = 37688,
|
||||
|
||||
NPC_DERANGED_HELBOAR = 16863
|
||||
SPELL_SUMMON_POO = 37688,
|
||||
NPC_DERANGED_HELBOAR = 16863
|
||||
};
|
||||
|
||||
class npc_fel_guard_hound : public CreatureScript
|
||||
@@ -455,32 +308,24 @@ class npc_fel_guard_hound : public CreatureScript
|
||||
public:
|
||||
npc_fel_guard_hound() : CreatureScript("npc_fel_guard_hound") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_fel_guard_houndAI(creature);
|
||||
}
|
||||
|
||||
struct npc_fel_guard_houndAI : public ScriptedAI
|
||||
{
|
||||
npc_fel_guard_houndAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 uiCheckTimer;
|
||||
uint64 uiHelboarGUID;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
uiCheckTimer = 5000; //check for creature every 5 sec
|
||||
uiHelboarGUID = 0;
|
||||
checkTimer = 5000; //check for creature every 5 sec
|
||||
helboarGUID = 0;
|
||||
}
|
||||
|
||||
void MovementInform(uint32 uiType, uint32 uiId) OVERRIDE
|
||||
void MovementInform(uint32 type, uint32 id) OVERRIDE
|
||||
{
|
||||
if (uiType != POINT_MOTION_TYPE || uiId != 1)
|
||||
if (type != POINT_MOTION_TYPE || id != 1)
|
||||
return;
|
||||
|
||||
if (Creature* pHelboar = me->GetCreature(*me, uiHelboarGUID))
|
||||
if (Creature* helboar = me->GetCreature(*me, helboarGUID))
|
||||
{
|
||||
pHelboar->RemoveCorpse();
|
||||
helboar->RemoveCorpse();
|
||||
DoCast(SPELL_SUMMON_POO);
|
||||
|
||||
if (Player* owner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
@@ -488,36 +333,43 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 uiDiff) OVERRIDE
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (uiCheckTimer <= uiDiff)
|
||||
if (checkTimer <= diff)
|
||||
{
|
||||
if (Creature* pHelboar = me->FindNearestCreature(NPC_DERANGED_HELBOAR, 10.0f, false))
|
||||
if (Creature* helboar = me->FindNearestCreature(NPC_DERANGED_HELBOAR, 10.0f, false))
|
||||
{
|
||||
if (pHelboar->GetGUID() != uiHelboarGUID && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && !me->FindCurrentSpellBySpellId(SPELL_SUMMON_POO))
|
||||
if (helboar->GetGUID() != helboarGUID && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && !me->FindCurrentSpellBySpellId(SPELL_SUMMON_POO))
|
||||
{
|
||||
uiHelboarGUID = pHelboar->GetGUID();
|
||||
me->GetMotionMaster()->MovePoint(1, pHelboar->GetPositionX(), pHelboar->GetPositionY(), pHelboar->GetPositionZ());
|
||||
helboarGUID = helboar->GetGUID();
|
||||
me->GetMotionMaster()->MovePoint(1, helboar->GetPositionX(), helboar->GetPositionY(), helboar->GetPositionZ());
|
||||
}
|
||||
}
|
||||
uiCheckTimer = 5000;
|
||||
}else uiCheckTimer -= uiDiff;
|
||||
checkTimer = 5000;
|
||||
}
|
||||
else checkTimer -= diff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 checkTimer;
|
||||
uint64 helboarGUID;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_fel_guard_houndAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_hellfire_peninsula()
|
||||
{
|
||||
new npc_aeranas();
|
||||
new npc_ancestral_wolf();
|
||||
new npc_naladu();
|
||||
new npc_tracy_proudwell();
|
||||
new npc_trollbane();
|
||||
new npc_wounded_blood_elf();
|
||||
new npc_fel_guard_hound();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user