TrinityCore/TrinityCore — Issue #5172: [Fix] Overlord Drakuru
Author: w1sht0l1v3
Created: 2012-02-10 13:17:20+00:00
State: open

```
SET @ENTRY := 28503; -- Overlord Drakuru
SET @MENUID := 9731;

UPDATE `creature_template` SET `gossip_menu_id`=@MENUID,`AIName`='SmartAI' WHERE `entry`=@ENTRY;
SET @SOURCETYPE := 0;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=@SOURCETYPE;
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,@SOURCETYPE,0,0,62,0,100,0,@MENUID,1,0,0,11,52224,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0,"On gossip 1 - Cast spell - Invoker"),
(@ENTRY,@SOURCETYPE,1,0,62,0,100,0,@MENUID,2,0,0,11,52253,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0,"On gossip 2 - Cast spell - Invoker"),
(@ENTRY,@SOURCETYPE,2,0,62,0,100,0,@MENUID,3,0,0,11,52355,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0,"On gossip 3 - Cast spell - Invoker"),
(@ENTRY,@SOURCETYPE,3,0,62,0,100,0,@MENUID,4,0,0,11,52680,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0,"On gossip 4 - Cast spell - Invoker"),
(@ENTRY,@SOURCETYPE,4,0,62,0,100,0,@MENUID,5,0,0,11,52675,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0,"On gossip 5 - Cast spell - Invoker");

DELETE FROM `gossip_menu` WHERE `entry` IN (@MENUID,10403,10404,10405,10406,10407);
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
-- main texts
(@MENUID,13325),
(@MENUID,13348),
(@MENUID,13422),
-- submenus texts
(10403,14441),
(10404,14442),
(10405,14443),
(10406,14444),
(10407,14445);

DELETE FROM `gossip_menu_option` WHERE `menu_id`=@MENUID;
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
(@MENUID,1,0,'Gorebag showed me the empire Drakkar. I am ready to help you win it!',1,1,10403,0,0,0,NULL),
(@MENUID,2,0,'I\'m cool-stands this Blight Geists!',1,1,10404,0,0,0,NULL),
(@MENUID,3,0,'I have defeated Darmuk! How else may I serve you?',1,1,10405,0,0,0,NULL),
(@MENUID,4,0,'The Drakkari Chieftains have been captured! What more would you have me do?',1,1,10406,0,0,0,NULL),
(@MENUID,5,0,'I have witnessed your magnificent operation, Drakuru. When do we put your plan into effect?',1,1,10407,0,0,0,NULL),
(@MENUID,6,0,'I am ready to accompany you, Drakuru.',1,1,0,0,0,0,NULL);

-- delete a wrong link
DELETE FROM `gossip_menu_option` WHERE `menu_id`=10403;

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@MENUID;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
-- menu conditions
(15,@MENUID,1,0,0,9,12661,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest taken"),
(15,@MENUID,1,0,0,8,12663,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest rewarded"),
(15,@MENUID,1,0,1,9,12661,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest taken"),
(15,@MENUID,1,0,1,8,12664,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest rewarded"),
(15,@MENUID,2,0,0,9,12669,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest taken"),
(15,@MENUID,2,0,0,8,12673,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest rewarded"),
(15,@MENUID,3,0,0,9,12677,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest taken"),
(15,@MENUID,3,0,0,8,12686,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest rewarded"),
(15,@MENUID,4,0,0,9,12676,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest taken"),
(15,@MENUID,4,0,0,8,12690,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest rewarded"),
(15,@MENUID,4,0,0,14,12710,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest not taken"),
(15,@MENUID,5,0,0,9,12676,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest taken"),
(15,@MENUID,5,0,0,8,12710,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest rewarded"),
(15,@MENUID,6,0,0,9,12713,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest taken"),
-- text conditions
(14,@MENUID,13348,0,0,14,12669,0,0,0,'',"Overlord Drakuru - Show gossip text if player didn't take quest"),
(14,@MENUID,13325,0,0,14,12713,0,0,0,'',"Overlord Drakuru - Show gossip text if player didn't take quest"),
(14,@MENUID,13422,0,0,9,12713,0,0,0,'',"Overlord Drakuru - Show gossip if player has quest taken");
```

Gossip options 3 to 6 are from sniff,but i need a proper text for options 1 and 2.
Also need to add a SAI script for option 6,wich is supposed to start Drakuru on some wp before fighting him.