diff options
author | Malcrom <malcromdev@gmail.com> | 2013-06-26 13:18:17 -0230 |
---|---|---|
committer | Malcrom <malcromdev@gmail.com> | 2013-06-26 13:18:17 -0230 |
commit | f4bceb86c045565d52e12b157ea6aa4abbdb1835 (patch) | |
tree | 50fea234369a7c92cac3d7d59c87a1e45474a642 | |
parent | 83c1e69d74300a5b6378a8c752c87f02e3718dfe (diff) |
Core/Scripting: Replace a couple core scripts in Storm Peaks with SAI and DB gossip.
-rw-r--r-- | sql/updates/world/2013_06_26_01_world_misc.sql | 39 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_storm_peaks.cpp | 99 |
2 files changed, 39 insertions, 99 deletions
diff --git a/sql/updates/world/2013_06_26_01_world_misc.sql b/sql/updates/world/2013_06_26_01_world_misc.sql new file mode 100644 index 00000000000..2e54cb9497e --- /dev/null +++ b/sql/updates/world/2013_06_26_01_world_misc.sql @@ -0,0 +1,39 @@ +-- Add gossip id to Frostborn Scout +UPDATE `creature_template` SET `gossip_menu_id`=9841 WHERE `entry`=29811; +-- Add Missing Gossip for Frostborn Scout +DELETE FROM `gossip_menu` WHERE `entry`=9841 AND `text_id`=13611; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (9841,13611); +DELETE FROM `gossip_menu` WHERE `entry`=9842 AND `text_id`=13612; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (9842,13612); +DELETE FROM `gossip_menu` WHERE `entry`=9843 AND `text_id`=13613; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (9843,13613); +DELETE FROM `gossip_menu` WHERE `entry`=9844 AND `text_id`=13614; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (9844,13614); +-- Add Any Missing Gossip Option for Frostborn Scout +DELETE FROM `gossip_menu_option` WHERE menu_id IN (9841,9842,9843); +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 +(9841,0,0,"Are you okay? I''ve come TO take you back TO Frosthold IF you can stand.",1,1,9842,0,0,0,''), +(9842,0,0,"I''m sorry that I didn''t get here sooner. What happened?",1,1,9843,0,0,0,''), +(9843,0,0,"I''ll go get SOME help. Hang IN there.",1,1,9844,0,0,0,''); +-- Add Gossip option condition +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (9841); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9841,0,0,28,12864,0,0,1,0,'','Agnetta Tyrsdottar - Show gossip option only if quest "Missing scouts" is not complete'); + +-- Frostborn Scout SAI for Quest: Missing scouts +SET @ENTRY := 29647; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`= '' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +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,62,0,100,0,9843,0,0,0,15,12864,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Frostborn Scout - On Gossip Option Select - Give quest credit for Quest: Missing scouts'); + +-- Agnetta_Tyrsdottar SAI Quest: Is That Your Goblin? +SET @ENTRY := 30154; +UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`= '' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +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,62,0,100,0,9874,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Agnetta_Tyrsdottar - On Gossip Option Select - Close Gossip Window'), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,2,45,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Agnetta_Tyrsdottar - On Gossip Option Select - Set Faction'), +(@ENTRY,0,2,3,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Agnetta_Tyrsdottar - On Gossip Option Select - Say 0'), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Agnetta_Tyrsdottar - On Gossip Option Select - Attack Envoker'), +(@ENTRY,0,4,0,25,0,100,0,0,0,0,0,2,2109,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Agnetta_Tyrsdottar - On Reset - Set faction'); diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 83262ee6964..c34fbce6a66 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -26,103 +26,6 @@ #include "Player.h" #include "WorldSession.h" -/*###### -## npc_agnetta_tyrsdottar for QUEST_ITS_THAT_YOUR_GOBLIN 12969 -######*/ - -enum eAgnetta -{ - FACTION_HOSTILE_AT1 = 45, - SAY_AGGRO = 0, - GOSSIP_ID = 9874, - GOSSIP_OPTION_ID = 0 -}; - -class npc_agnetta_tyrsdottar : public CreatureScript -{ -public: - npc_agnetta_tyrsdottar() : CreatureScript("npc_agnetta_tyrsdottar") { } - - struct npc_agnetta_tyrsdottarAI : public ScriptedAI - { - npc_agnetta_tyrsdottarAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() - { - me->RestoreFaction(); - } - - void sGossipSelect(Player* player, uint32 sender, uint32 action) - { - if (sender == GOSSIP_ID && action == GOSSIP_OPTION_ID) - { - player->CLOSE_GOSSIP_MENU(); - me->setFaction(FACTION_HOSTILE_AT1); - Talk(SAY_AGGRO); - AttackStart(player); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_agnetta_tyrsdottarAI(creature); - } -}; - -/*###### -## npc_frostborn_scout -######*/ - -#define GOSSIP_ITEM1 "Are you okay? I've come to take you back to Frosthold if you can stand." -#define GOSSIP_ITEM2 "I'm sorry that I didn't get here sooner. What happened?" -#define GOSSIP_ITEM3 "I'll go get some help. Hang in there." - -enum eFrostbornScout -{ - QUEST_MISSING_SCOUTS = 12864 -}; - -class npc_frostborn_scout : public CreatureScript -{ -public: - npc_frostborn_scout() : CreatureScript("npc_frostborn_scout") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - - if (player->GetQuestStatus(QUEST_MISSING_SCOUTS) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->PlayerTalkClass->SendGossipMenu(13611, 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_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->PlayerTalkClass->SendGossipMenu(13612, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->PlayerTalkClass->SendGossipMenu(13613, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->PlayerTalkClass->SendGossipMenu(13614, creature->GetGUID()); - player->AreaExploredOrEventHappens(QUEST_MISSING_SCOUTS); - break; - } - - return true; - } -}; - ///////////////////// ///npc_injured_goblin ///////////////////// @@ -576,8 +479,6 @@ class spell_close_rift : public SpellScriptLoader void AddSC_storm_peaks() { - new npc_agnetta_tyrsdottar(); - new npc_frostborn_scout(); new npc_injured_goblin(); new npc_roxi_ramrocket(); new npc_brunnhildar_prisoner(); |