DB/Quests: Fix The Explorer's League Outpost

Move a corescript to SAI
This commit is contained in:
Pitcrawler
2013-06-09 18:10:03 +02:00
parent f8d9a8d2e9
commit fb28dcb3c4
2 changed files with 41 additions and 51 deletions

View File

@@ -0,0 +1,41 @@
-- Fix quests: The Explorers' League Outpost (11448), We Can Rebuild It (11483)
SET @MCGOYVER := 24040;
SET @GOSSIP := 8991;
UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@MCGOYVER;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@MCGOYVER 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
(@MCGOYVER,0,0,3,62,0,100,0,@GOSSIP,0,0,0,11,51221,0,0,0,0,0,7,0,0,0,0,0,0,0, 'McGoyver - On gossip option select - Spellcast Taxi to Explorers'' League Outpost'),
(@MCGOYVER,0,1,3,62,0,100,0,9023,0,0,0,11,44280,0,0,0,0,0,7,0,0,0,0,0,0,0, 'McGoyver - On gossip option select - Spellcast Taxi to Explorers'' League Outpost'),
(@MCGOYVER,0,2,3,62,0,100,0,@GOSSIP,1,0,0,11,51221,0,0,0,0,0,7,0,0,0,0,0,0,0, 'McGoyver - On gossip option select - Spellcast Taxi to Explorers'' League Outpost'),
(@MCGOYVER,0,3,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'McGoyver - On gossip option select - Close gossip'),
(@MCGOYVER,0,4,0,62,0,100,0,@GOSSIP,2,0,0,11,44512,0,0,0,0,0,7,0,0,0,0,0,0,0, 'McGoyver - On gossip option select - Spellcast Create Dark Iron Ingots');
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=-51221;
INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
(-51221,44280,0,'On spellfade Taxi to Explorers'' League Outpost - Spellcast Taxi to Explorers'' League');
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=12144;
DELETE FROM `gossip_menu` WHERE `entry`=9023 AND `text_id`=12193;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
(@GOSSIP,12144),
(9023,12193);
DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP AND `id` IN (0,1,2);
DELETE FROM `gossip_menu_option` WHERE `menu_id`=9023 AND `id`=0;
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
(@GOSSIP,0,0,'Official Explorers'' League business, McGoyver. Take me to the Explorers'' League Outpost!',1,1,0,0,0,0,''),
(@GOSSIP,1,0,'Official Explorers'' League business, McGoyver. Take me to the Explorers'' League Outpost!',1,1,0,0,0,0,''),
(@GOSSIP,2,0,'Walt sent me to pick up some dark iron ingots.',1,1,9023,0,0,0,''),
(9023,0,0,'Yarp.',1,1,0,0,0,0,'');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=@GOSSIP;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=@MCGOYVER;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(14,@GOSSIP,12191,0,0,8,11278,0,0,0,0,'','McGoyver show different gossip if player has rewarded quest Return to Valgarde'),
(15,@GOSSIP,0,0,0,28,11448,0,0,0,0,'','McGoyver show gossip option only if player has completed but not rewarded quest The Explorers'' League Outpost'),
(15,@GOSSIP,1,0,0,8,11448,0,0,0,0,'','McGoyver show gossip option only if player has rewarded quest The Explorers'' League Outpost'),
(15,@GOSSIP,2,0,0,9,11483,0,0,0,0,'','McGoyver show gossip option only if player has taken quest We Can Rebuild It'),
(22,5,@MCGOYVER,0,0,2,34135,1,1,1,0,'','SAI triggers only if player has no Dark Iron Ingots');

View File

@@ -275,56 +275,6 @@ public:
}
};
/*######
## npc_mcgoyver
######*/
#define GOSSIP_ITEM_MG_I "Walt sent me to pick up some dark iron ingots."
#define GOSSIP_ITEM_MG_II "Yarp."
enum eMcGoyver
{
QUEST_WE_CAN_REBUILD_IT = 11483,
SPELL_CREATURE_DARK_IRON_INGOTS = 44512,
SPELL_TAXI_EXPLORERS_LEAGUE = 44280,
GOSSIP_TEXTID_MCGOYVER = 12193
};
class npc_mcgoyver : public CreatureScript
{
public:
npc_mcgoyver() : CreatureScript("npc_mcgoyver") { }
bool OnGossipHello(Player* player, Creature* creature)
{
if (player->GetQuestStatus(QUEST_WE_CAN_REBUILD_IT) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MG_I, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
switch (action)
{
case GOSSIP_ACTION_INFO_DEF+1:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MG_II, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_MCGOYVER, creature->GetGUID());
player->CastSpell(player, SPELL_CREATURE_DARK_IRON_INGOTS, true);
break;
case GOSSIP_ACTION_INFO_DEF+2:
player->CastSpell(player, SPELL_TAXI_EXPLORERS_LEAGUE, true);
player->CLOSE_GOSSIP_MENU();
break;
}
return true;
}
};
/*######
## npc_daegarn
######*/
@@ -435,6 +385,5 @@ void AddSC_howling_fjord()
new npc_apothecary_hanes;
new npc_plaguehound_tracker;
new npc_razael_and_lyana;
new npc_mcgoyver;
new npc_daegarn;
}