HachasyDados / HD-TCore

www.hachasydados.es
GNU General Public License v2.0
57 stars 24 forks source link

Jack Likes His Drink #3

Closed JasperAppec closed 12 years ago

JasperAppec commented 13 years ago

Should work like this: http://www.youtube.com/watch?v=fk6gbalyNr4

But there's no gossip option at the moment. =/

Souler commented 12 years ago

@Discover- I would like to ask you for two things.

First of all, I would like to know what do you think about the script, the style and anything you want to tell me about the fix that could be improved or solved in a different (better, easier) way. I might considere going back to the DB fixes when viable.

Secondly I would apreciate if you can send me the quest full sentence (DELETE / INSERT) of this quest_template because I've realized that it autocompletes on quest accept, even with the Method setted to 2.

JasperAppec commented 12 years ago

I never knew you actually worked on this quest and never saw your SQL for it. I worked on this before I started on Brewfest so I kinda dropped it halfway through, this is what I've got and I currently have a hard time even sitting behind my computer lately due to study. It's really time consuming.. =/

-- [Q] Jack Likes His Drink
-- We are making Jack dance through SAI instead of creature(_template)_addon so we can cancel it in the actual SAI

-- Olga, the Scalawag Wench SAI
SET @ENTRY_OLGA := 24639;
SET @ENTRY_JACK := 24788;
SET @GOSSIP := 9015;
SET @QUEST := 11466;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@ENTRY_OLGA,@ENTRY_JACK);
UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP+10 WHERE `entry`=@ENTRY_JACK;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY_OLGA,@ENTRY_OLGA*100,@ENTRY_OLGA*100+1,@ENTRY_JACK,@ENTRY_JACK*100);
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_OLGA,0,0,0,62,0,100,0,@GOSSIP+1,0,0,0,80,@ENTRY_OLGA*100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Olga, the Scalawag Wench - On Gossip Select - Run Script"),
(@ENTRY_OLGA*100,9,0,0,0,0,100,0,0,0,0,0,53,0,@ENTRY_OLGA,0,0,0,0,1,0,0,0,0,0,0,0,"Olga, the Scalawag Wench - On Script - Start WP"),
(@ENTRY_OLGA*100,9,1,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Olga, the Scalawag Wench - On Script - Close Gossip"),
(@ENTRY_OLGA*100,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Olga, the Scalawag Wench - On Script - Whisper Line 0"),
(@ENTRY_OLGA*100,9,3,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Olga, the Scalawag Wench - On Script - Remove Gossip Flag"),

(@ENTRY_OLGA,0,1,0,40,0,100,0,2,@ENTRY_OLGA,0,0,80,@ENTRY_OLGA*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Olga, the Scalawag Wench - On WP 2 - Run Script 2"),
(@ENTRY_OLGA*100+1,9,0,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,11,@ENTRY_JACK,15,0,0,0,0,0,"Olga, the Scalawag Wench - On Script 2 - Face Jack Adams"),
(@ENTRY_OLGA*100+1,9,1,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Olga, the Scalawag Wench - On Script 2 - Say Line 1"),
(@ENTRY_OLGA*100+1,9,2,0,0,0,100,0,3000,3000,0,0,45,1,1,0,0,0,0,19,@ENTRY_JACK,0,0,0,0,0,0,"Olga, the Scalawag Wench - On Script 2 - Set Data 1 1 Jack Adams"),
(@ENTRY_OLGA*100+1,9,3,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Olga, the Scalawag Wench - On Script 2 - Say Line 2"),
(@ENTRY_OLGA*100+1,9,4,0,0,0,100,0,4000,4000,0,0,45,2,2,0,0,0,0,19,@ENTRY_JACK,0,0,0,0,0,0,"Olga, the Scalawag Wench - On Script 2 - Set Data 2 2 Jack Adams"),

(@ENTRY_JACK,0,0,0,1,0,100,1,0,0,0,0,5,10,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - Out of Combat - Start Dancing"),
(@ENTRY_JACK,0,1,2,38,0,100,0,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - On Data 1 1 Set - Say Line 0"),
(@ENTRY_JACK,0,2,0,61,0,100,0,0,0,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - On Data 1 1 Set - Set Faction 35"),
(@ENTRY_JACK,0,3,4,62,0,100,0,@GOSSIP+10,0,0,0,56,34116,1,0,0,0,0,7,0,0,0,0,0,0,0,"Jack Adams - On Gossip Select - Give Quest Item"),
(@ENTRY_JACK,0,4,5,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Jack Adams - On Gossip Select - Close Gossip"),
(@ENTRY_JACK,0,5,0,61,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - On Gossip Select - Remove Gossip Flag"), -- To prevent getting more than one item per event

(@ENTRY_JACK,0,6,0,38,0,100,0,2,2,0,0,80,@ENTRY_JACK*100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - On Data 2 2 Set - Run Script"),
(@ENTRY_JACK*100,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - On Script - Say Line 1"),
(@ENTRY_JACK*100,9,1,0,0,0,100,0,0,0,0,0,5,26,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - On Script - Stop Dancing"),
(@ENTRY_JACK*100,9,2,0,0,0,100,0,2000,2000,0,0,5,16,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - On Script - EMOTE_ONESHOT_KNEEL"),
(@ENTRY_JACK*100,9,3,0,0,0,100,0,4000,4000,0,0,5,7,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - On Script - EMOTE_ONESHOT_EAT"),
(@ENTRY_JACK*100,9,4,0,0,0,100,0,4000,4000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - On Script - Say Line 2"),
(@ENTRY_JACK*100,9,5,0,0,0,100,0,3000,3000,0,0,5,65,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - On Script - STATE_DEAD"),
(@ENTRY_JACK*100,9,6,0,0,0,100,0,0,0,0,0,81,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jack Adams - On Script - Add Gossip Flag");

-- Texts
DELETE FROM `creature_text` WHERE `entry` IN (@ENTRY_OLGA,@ENTRY_JACK);
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(@ENTRY_OLGA,0,0,"Keep quiet, will you? If anyone catches on, we're both dead.",15,0,100,0,0,0,"Olga, the Scalawag Wench"),
(@ENTRY_OLGA,1,0,"All right, fellas! Who ordered the spiced rum? Was it you, Jackie boy?",12,0,100,0,0,0,"Olga, the Scalawag Wench"),
(@ENTRY_OLGA,2,0,"It's okay, sweetheart. This one's on the house.",12,0,100,0,0,0,"Olga, the Scalawag Wench"),

(@ENTRY_JACK,0,0,"Sure thing, love. Put it on Harry's tab, will ya? He owes me a drink!",12,0,100,0,0,0,"Jack Adams"),
(@ENTRY_JACK,1,0,"Free rum? Why... that's me favorite kind!",12,0,100,0,0,0,"Jack Adams"),
(@ENTRY_JACK,2,0,"Sweet Neptulon! That was... one drink... too many!",12,0,100,0,0,0,"Jack Adams"),
(@ENTRY_JACK,3,0,"What are you lot looking at? Pour me another drink!",12,0,100,0,0,0,"Jack Adams");

-- Insert option menu
DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (@GOSSIP,@GOSSIP+1,@GOSSIP+10);
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`box_money`,`box_text`) VALUES
(@GOSSIP+0,0,0,"I'd like to buy Jack a drink. Perhaps something... extra strong.",1,1,@GOSSIP+1,0,''),
(@GOSSIP+1,0,0,"Here's a gold, buy yourself something nice.",1,1,0,10000,'Do you really want to bribe Olga?'),
(@GOSSIP+10,0,0,"<Discreetly search the pirate's pockets for Taruk's payment.>",1,1,0,0,'');

-- Waypoints for Olga, the Scalawag Wench
DELETE FROM `waypoints` WHERE `entry`=@ENTRY_OLGA;
INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
(@ENTRY_OLGA,1,-89.466621,-3539.939941,7.715524,'Olga, the Scalawag Wench'),
(@ENTRY_OLGA,2,-86.451447,-3544.374268,7.716601,'Olga, the Scalawag Wench');

-- Only show first gossip if player is on quest Gambling Debt
DELETE FROM `conditions` WHERE `SourceGroup` IN (@GOSSIP+0,@GOSSIP+10) AND `ConditionValue1` IN (@QUEST);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,@GOSSIP+0,0,0,9,@QUEST,0,0,0,'',"Only show first gossip if player is on quest Gambling Debt"),
(15,@GOSSIP+10,0,0,9,@QUEST,0,0,0,'',"Only show first gossip if player is on quest Gambling Debt");