TrinityCore/TrinityCore — Issue #5192: [QUEST] Something Stinks (24536)
Author: nelegalno
Created: 2012-02-11 19:08:12+00:00
State: open

```SQL
-- Something Stinks (24536) Horde fix by nelegalno

SET @GUID := 220001; -- need 59
SET @EVENT := 8;

-- doesn't seem to work, can anyone suggest alternative way?
/*
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=17 AND `SourceEntry`=71507 AND `ConditionTypeOrReference`=12 AND `ConditionValue1`=8);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(17,0,71507,0,0,12,8,0,0,0,'','Heavily Perfumed - Only while Love is in the Air is active');
*/

DELETE FROM `creature` WHERE `id`=31416; -- http://old.wowhead.com/npc=31416 aren they event only or not?
INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES
(@GUID+00,31416,1,1,1,0,0,1620.45,-4252.84,47.5273,3.70010,300,0,0,16050,0,0,0,0,0),
(@GUID+01,31416,1,1,1,0,0,1552.41,-4324.75,21.8029,5.51524,300,0,0,16050,0,0,0,0,0),
(@GUID+02,31416,1,1,1,0,0,1628.89,-4274.76,24.0855,5.13127,300,0,0,16050,0,0,0,0,0),
(@GUID+03,31416,1,1,1,0,0,1889.53,-4485.08,21.3103,1.44862,300,0,0,16050,0,0,0,0,0),
(@GUID+04,31416,1,1,1,0,0,1952.53,-4368.57,22.6590,3.68265,300,0,0,16050,0,0,0,0,0),
(@GUID+05,31416,1,1,1,0,0,1817.08,-4357.14,-9.8164,2.30383,300,0,0,16050,0,0,0,0,0),
(@GUID+06,31416,1,1,1,0,0,1741.42,-4217.94,44.3144,3.38795,300,5,0,16050,0,1,0,0,0),
(@GUID+07,31416,1,1,1,0,0,1953.01,-4431.15,25.1469,3.31613,300,0,0,16050,0,0,0,0,0),
(@GUID+08,31416,1,1,1,0,0,1523.92,-4429.44,16.7349,0.50615,300,0,0,16050,0,0,0,0,0),
(@GUID+09,31416,1,1,1,0,0,1688.53,-4474.58,20.1537,1.95477,300,0,0,16050,0,0,0,0,0),
(@GUID+10,31416,1,1,1,0,0,1896.44,-4603.17,33.8937,3.75642,300,0,0,16050,0,0,0,0,0),
(@GUID+11,31416,1,1,1,0,0,1751.45,-4208.82,42.7326,5.34071,300,0,0,16050,0,0,0,0,0),
(@GUID+12,31416,1,1,1,0,0,1906.25,-4564.21,33.9758,0.62832,300,0,0,16050,0,0,0,0,0),
(@GUID+13,31416,1,1,1,0,0,2015.69,-4719.41,24.5092,2.53025,300,5,0,16050,0,1,0,0,0),
(@GUID+14,31416,1,1,1,0,0,1629.47,-4400.14,13.8212,0.10756,300,0,0,16050,0,0,0,0,0),
(@GUID+15,31416,1,1,1,0,0,2126.41,-4738.09,50.4491,2.74017,300,0,0,16050,0,0,0,0,0),
(@GUID+16,31416,1,1,1,0,0,1416.90,-4365.66,25.2354,3.25185,300,5,0,16050,0,1,0,0,0),
(@GUID+17,31416,1,1,1,0,0,1518.15,-4425.35,18.7986,1.27409,300,0,0,16050,0,0,0,0,0),
(@GUID+18,31416,1,1,1,0,0,1950.89,-4374.69,22.0430,2.70526,300,0,0,16050,0,0,0,0,0),
(@GUID+19,31416,1,1,1,0,0,1951.07,-4358.41,23.1693,3.32572,300,0,0,16050,0,0,0,0,0),
(@GUID+20,31416,1,1,1,0,0,1596.65,-4388.67,9.98323,5.98648,300,0,0,16050,0,0,0,0,0),
(@GUID+21,31416,1,1,1,0,0,1668.56,-4323.66,61.3295,5.96903,300,0,0,16050,0,0,0,0,0),
(@GUID+22,31416,1,1,1,0,0,1690.52,-4262.62,53.7757,2.61799,300,0,0,16050,0,0,0,0,0),
(@GUID+23,31416,1,1,1,0,0,1775.07,-4319.91,-7.8786,5.60251,300,0,0,16050,0,0,0,0,0),
(@GUID+24,31416,1,1,1,0,0,1759.03,-4301.89,7.01614,5.46288,300,0,0,16050,0,0,0,0,0),
(@GUID+25,31416,1,1,1,0,0,1603.48,-4449.95,8.11650,2.39110,300,0,0,16050,0,0,0,0,0),
(@GUID+26,31416,1,1,1,0,0,1902.63,-4628.79,33.9763,0.59341,300,0,0,16050,0,0,0,0,0),
(@GUID+27,31416,1,1,1,0,0,1615.63,-4376.11,12.4018,4.24115,300,0,0,16050,0,0,0,0,0),
(@GUID+28,31416,1,1,1,0,0,1479.39,-4406.25,25.3187,0.01745,300,0,0,16050,0,0,0,0,0),
(@GUID+29,31416,1,1,1,0,0,1387.28,-4379.89,27.0983,3.29867,300,0,0,16050,0,0,0,0,0),
(@GUID+30,31416,1,1,1,0,0,1886.46,-4415.86,11.7157,3.76991,300,0,0,16050,0,0,0,0,0),
(@GUID+31,31416,1,1,1,0,0,1673.20,-4250.00,51.8765,5.04400,300,0,0,16050,0,0,0,0,0),
(@GUID+32,31416,1,1,1,0,0,1623.15,-4279.64,22.5694,6.16101,300,0,0,16050,0,0,0,0,0),
(@GUID+33,31416,1,1,1,0,0,1537.41,-4380.75,16.7599,3.42085,300,0,0,16050,0,0,0,0,0),
(@GUID+34,31416,1,1,1,0,0,1923.98,-4447.80,44.9684,0.71559,300,0,0,16050,0,0,0,0,0),
(@GUID+35,31416,1,1,1,0,0,2079.58,-4710.36,38.8957,6.05860,300,5,0,16050,0,1,0,0,0),
(@GUID+36,31416,1,1,1,0,0,1481.77,-4427.79,25.3187,0.19199,300,0,0,16050,0,0,0,0,0),
(@GUID+37,31416,1,1,1,0,0,1689.99,-4279.85,32.1304,4.11898,300,0,0,16050,0,0,0,0,0),
(@GUID+38,31416,1,1,1,0,0,1557.74,-4364.25,1.07971,0.22689,300,0,0,16050,0,0,0,0,0),
(@GUID+39,31416,1,1,1,0,0,1900.53,-4481.11,20.7270,3.35369,300,0,0,16050,0,0,0,0,0),
(@GUID+40,31416,1,1,1,0,0,1561.79,-4360.50,1.19455,4.85202,300,0,0,16050,0,0,0,0,0),
(@GUID+41,31416,1,1,1,0,0,2096.59,-4668.50,44.7122,4.66795,300,5,0,16050,0,1,0,0,0),
(@GUID+42,31416,1,1,1,0,0,1696.02,-4463.71,20.1522,2.39110,300,0,0,16050,0,0,0,0,0),
(@GUID+43,31416,1,1,1,0,0,1572.83,-4318.32,21.7125,0.59048,300,5,0,16050,0,1,0,0,0),
(@GUID+44,31416,1,1,1,0,0,1384.62,-4358.56,27.0983,3.38594,300,0,0,16050,0,0,0,0,0),
(@GUID+45,31416,1,1,1,0,0,2131.15,-4729.88,50.4302,2.60054,300,0,0,16050,0,0,0,0,0),
(@GUID+46,31416,1,1,1,0,0,1748.53,-4260.13,27.0722,2.33874,300,0,0,16050,0,0,0,0,0),
(@GUID+47,31416,1,1,1,0,0,1928.32,-4424.41,23.7505,0.55851,300,0,0,16050,0,0,0,0,0),
(@GUID+48,31416,1,1,1,0,0,1920.62,-4365.93,22.8040,0.29671,300,0,0,16050,0,0,0,0,0),
(@GUID+49,31416,1,1,1,0,0,1566.22,-4194.07,42.6709,0.15708,300,0,0,16050,0,0,0,0,0),
(@GUID+50,31416,1,1,1,0,0,1902.14,-4275.21,31.7987,4.17134,300,0,0,16050,0,0,0,0,0),
(@GUID+51,31416,1,1,1,0,0,1762.71,-4496.99,44.6195,2.13173,300,0,0,16050,0,0,0,0,0),
(@GUID+52,31416,1,1,1,0,0,1913.71,-4559.36,33.9759,3.71755,300,0,0,16050,0,0,0,0,0),
(@GUID+53,31416,1,1,1,0,0,1882.15,-4483.99,20.6388,2.09439,300,0,0,16050,0,0,0,0,0),
(@GUID+54,31416,1,1,1,0,0,1910.24,-4623.92,33.9762,3.73500,300,0,0,16050,0,0,0,0,0),
(@GUID+55,31416,1,1,1,0,0,1963.01,-4730.91,48.9608,2.49582,300,0,0,16050,0,0,0,0,0),
(@GUID+56,31416,1,1,1,0,0,2004.18,-4719.80,26.2996,0.95993,300,0,0,16050,0,0,0,0,0),
(@GUID+57,31416,1,1,1,0,0,1886.20,-4546.68,28.5148,1.09956,300,0,0,16050,0,0,0,0,0),
(@GUID+58,31416,1,1,1,0,0,1829.26,-4507.27,21.4564,4.95674,300,0,0,16050,0,0,0,0,0);

DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @GUID+00 AND @GUID+58;
INSERT INTO `game_event_creature` (`guid`,`event`) VALUES
(@GUID+00,@EVENT),
(@GUID+01,@EVENT),
(@GUID+02,@EVENT),
(@GUID+03,@EVENT),
(@GUID+04,@EVENT),
(@GUID+05,@EVENT),
(@GUID+06,@EVENT),
(@GUID+07,@EVENT),
(@GUID+08,@EVENT),
(@GUID+09,@EVENT),
(@GUID+10,@EVENT),
(@GUID+11,@EVENT),
(@GUID+12,@EVENT),
(@GUID+13,@EVENT),
(@GUID+14,@EVENT),
(@GUID+15,@EVENT),
(@GUID+16,@EVENT),
(@GUID+17,@EVENT),
(@GUID+18,@EVENT),
(@GUID+19,@EVENT),
(@GUID+20,@EVENT),
(@GUID+21,@EVENT),
(@GUID+22,@EVENT),
(@GUID+23,@EVENT),
(@GUID+24,@EVENT),
(@GUID+25,@EVENT),
(@GUID+26,@EVENT),
(@GUID+27,@EVENT),
(@GUID+28,@EVENT),
(@GUID+29,@EVENT),
(@GUID+30,@EVENT),
(@GUID+31,@EVENT),
(@GUID+32,@EVENT),
(@GUID+33,@EVENT),
(@GUID+34,@EVENT),
(@GUID+35,@EVENT),
(@GUID+36,@EVENT),
(@GUID+37,@EVENT),
(@GUID+38,@EVENT),
(@GUID+39,@EVENT),
(@GUID+40,@EVENT),
(@GUID+41,@EVENT),
(@GUID+42,@EVENT),
(@GUID+43,@EVENT),
(@GUID+44,@EVENT),
(@GUID+45,@EVENT),
(@GUID+46,@EVENT),
(@GUID+47,@EVENT),
(@GUID+48,@EVENT),
(@GUID+49,@EVENT),
(@GUID+50,@EVENT),
(@GUID+51,@EVENT),
(@GUID+52,@EVENT),
(@GUID+53,@EVENT),
(@GUID+54,@EVENT),
(@GUID+55,@EVENT),
(@GUID+56,@EVENT),
(@GUID+57,@EVENT),
(@GUID+58,@EVENT);

UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=31416;
DELETE FROM `smart_scripts` WHERE (`entryorguid`=31416 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
(31416,0,0,0,2,0,100,0,1,15,0,0,25,71507,0,0,0,0,0,1,0,0,0,0,0,0,0,'Orgrimmar Grunt - Flee at 15% HP'),
(31416,0,1,0,22,0,100,0,66,6,67,0,5,66,0,0,0,0,0,1,0,0,0,0,0,0,0,'Orgrimmar Grunt - Salute Emote on Recieve Salute Emote'),
(31416,0,2,0,22,0,100,0,17,6,67,0,5,23,0,0,0,0,0,1,0,0,0,0,0,0,0,'Orgrimmar Grunt - Flex Emote on Recieve Kiss Emote'),
(31416,0,3,0,22,0,100,0,71,6,67,0,5,71,0,0,0,0,0,1,0,0,0,0,0,0,0,'Orgrimmar Grunt - Cheer Emote on Recieve Cheer Emote'), -- doesn't work with emoteid 4 eather
(31416,0,4,0,22,0,100,0,70,6,67,0,5,70,0,0,0,0,0,1,0,0,0,0,0,0,0,'Orgrimmar Grunt - Wave Emote on Recieve Wave Emote'),
(31416,0,5,0,1,0,100,0,1000,3000,900000,1800000,11,71507,0,0,0,0,0,1,0,0,0,0,0,0,0,'Orgrimmar Grunt - Cast Heavily Perfumed');

```

P.S. Need help for the Alliance version of the quest.