aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcrom <malcromdev@gmail.com>2012-06-05 21:50:05 -0230
committerMalcrom <malcromdev@gmail.com>2012-06-05 21:50:05 -0230
commit4ca77c5b0bf01752f9302a7591ba0c4226b889e1 (patch)
tree5a104682b6d41d5faf447325f1862e5d2d11c5ba
parent565aa070feb53db2a91b25cdc27f0e166cff48c9 (diff)
DB/Gossip Core/Scripts: Replace core script with db gossip for Lorax
-rw-r--r--sql/updates/world/2012_06_05_01_world_gossip_sai.sql23
-rw-r--r--src/server/scripts/Kalimdor/winterspring.cpp67
2 files changed, 23 insertions, 67 deletions
diff --git a/sql/updates/world/2012_06_05_01_world_gossip_sai.sql b/sql/updates/world/2012_06_05_01_world_gossip_sai.sql
new file mode 100644
index 00000000000..84893613c75
--- /dev/null
+++ b/sql/updates/world/2012_06_05_01_world_gossip_sai.sql
@@ -0,0 +1,23 @@
+-- Lorax SAI
+SET @ENTRY := 10918;
+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,0,62,0,100,0,3051,0,0,0,5,11,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lorax - On Gossip Option Select - Laugh emote'),
+(@ENTRY,0,1,2,62,0,100,0,3054,0,0,0,15,5126,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lorax - On Gossip Option Select - Give Quest Credit'),
+(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lorax - On Gossip Option Select - Close gossip');
+-- Lorax Gossip
+DELETE FROM `gossip_menu` WHERE `entry` IN (3050,3051,3052,3053,3054);
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (3050,3759),(3051,3760),(3052,3761),(3053,3762),(3054,3763);
+DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 3049 AND 3054;
+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
+(3049,0,0, 'You will have to excuse me, Lorax, I do not speak ''crazy''.',1,1,3050,0,0,0, ''),
+(3050,0,0, 'My apologies, I did not realize that you could understand what I was saying. What is it you are doing out here?',1,1,3051,0,0,0, ''),
+(3051,0,0, 'Do you? Perhaps you should tell me what it is that is bothering you',1,1,3052,0,0,0, ''),
+(3052,0,0, 'What deal?',1,1,3053,0,0,0, ''),
+(3053,0,0, 'So how did he break the deal?',1,1,3054,0,0,0, ''),
+(3054,0,0, 'Perhaps I can be of some assistance. I will make a deal with you, Satyr. I shall recover this unforged breastplate and slay the beast. In exchange for this task, you will teach me how to create the breastplate',1,1,0,0,0,0, '');
+-- Add conditions for gossip options
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=3049;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,3049,0,0,9,5126,0,0,0,0,'','Only show gossip option if player has quest 5126');
diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp
index 6143fbaf74b..cdcfedb9892 100644
--- a/src/server/scripts/Kalimdor/winterspring.cpp
+++ b/src/server/scripts/Kalimdor/winterspring.cpp
@@ -24,7 +24,6 @@ SDCategory: Winterspring
EndScriptData */
/* ContentData
-npc_lorax
npc_rivern_frostwind
EndContentData */
@@ -33,71 +32,6 @@ EndContentData */
#include "ScriptedGossip.h"
/*######
-## npc_lorax
-######*/
-
-#define GOSSIP_HL "Talk to me"
-
-#define GOSSIP_SL1 "What do you do here?"
-#define GOSSIP_SL2 "I can help you"
-#define GOSSIP_SL3 "What deal?"
-#define GOSSIP_SL4 "Then what happened?"
-#define GOSSIP_SL5 "He is not safe, i'll make sure of that."
-
-class npc_lorax : public CreatureScript
-{
-public:
- npc_lorax() : CreatureScript("npc_lorax") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(3759, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(3760, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(3761, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(3762, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(3763, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(5126);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(5126) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*######
## npc_rivern_frostwind
######*/
@@ -132,6 +66,5 @@ public:
void AddSC_winterspring()
{
- new npc_lorax();
new npc_rivern_frostwind();
}