TrinityCore/TrinityCore — Issue #4560: Quest 12050 "Lumber Hack"
Author: malcrom
Created: 2011-12-31 15:54:26+00:00
State: open

```SQL
-- Some fixups for quest 12050 "Lumber Hack"
-- Xink's Shredder update
UPDATE `creature_template` SET `spell1`=47938,`spell2`=47921,`spell3`=49857,`spell4`=47966,`spell6`=47939,`RegenHealth`=0 WHERE `entry`=27061;
-- Creature Gossip_menu_option Update from sniff
DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9422) AND `id` IN (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
(9422,0,0, 'I seem to have misplaced your Shredder Control Device... might you have another?',1,1,0,0,0,0, '');
-- Gossip option conditions
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=15 AND `SourceGroup`=9422);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,9422,0,1,9,12050,0,0,0,'','Show gossip only if Lumber Hack quest is taken'),
(15,9422,0,1,26,36734,0,0,0,'','Show gossip only if player doesnt have Xink''s Shredder Control Device');
-- NPC talk text insert from sniff
DELETE FROM `creature_text` WHERE `entry` IN (26660,27061) AND `groupid` IN (0);
DELETE FROM `creature_text` WHERE `entry` IN (26660,27061) AND `groupid` IN (1);
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(26660,0,0, 'About time! Get that lumber and get moving. The horde won''t be up there fighting forever, there''s money to be made!',12,0,100,25,1000,0, 'Xink'),
(27061,0,0, 'Xink''s Shredder ready and available for woodland destruction.',16,0,100,0,0,0, 'Xink''s Shredder'),
(27061,0,1, 'Xink''s Shredder security features activated. Returning to base.',16,0,100,0,0,0, 'Xink''s Shredder');
-- SAI for Xink
SET @ENTRY := 26660; -- NPC entry
SET @SPELL := 52872; -- Forceitem Xink's Shredder
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=22127;
DELETE FROM `smart_scripts` WHERE (`entryorguid`=22127 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,19,0,100,0,36734,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Xink - On Quest Accept - say 0');
(@ENTRY,0,1,0,62,0,100,0,9422,0,0,0,11,@SPELL,0,0,0,0,0,7,0,0,0,0,0,0,0,'Xink - On Gossip option select - Cast Forceitem Xink''s Shredder');

-- TODO spell click for Xink's Shredder
-- TODO get vehicle id. can't parse from 406 sniff

-- Xink's Shredder on click player SMSG_AURA_UPDATE Spell ID: 47920 (Xink's Shredder)
-- Xink's Shredder MonsterEmote (16) Xink's Shredder ready AND available FOR woodland destruction.
-- Player SMSG_SPELL_START Spell ID: 47920 (Xink's Shredder) target 27061 Xink's Shredder
-- CMSG_FAR_SIGHT ON enter Xink's Shredder
```