Page 1 of 7 12345 ... LastLast
Results 1 to 15 of 91

Thread: Bugs Fixing

http://idgs.in/581078
  1. #1
    Mindbender's Avatar
    Join Date
    Oct 2012
    Posts
    190
    Points
    479.27
    Thanks: 13 / 97 / 31

    Default Bugs Fixing




    ATTENTION



    Sebagai langkah awal demi kemajuan server kita bersama dan proses fixing bisa berjalan lebih cepat mengingat keterbatasan waktu kami sebagai GM dan sesuai dengan thread http://forum.indogamers.com/showthread.php?t=529413 maka kami mengundang siapapun yang mempunyai kemampuan scripting untuk berpartisipasi.

    Thread ini hanya berisi FIX dari sisi Script mengenai Quest, spell, achiev, dsb dan apabila setelah diperiksa Script berjalan dengan baik maka akan segera kami apply ke server. Oleh karena itu, dengan bantuan kita semua proses fixing dapat bekerja lebih cepat demi kenyamanan kita bersama.

    =============================================
    This is Open
    for Everyone to Join

    =============================================


    Spoiler untuk Format Penulisan :

    Nama Error (spell/Quest/achiev dsb):
    Referensi:
    Kondisi:
    Code:



    Silakan berpartisipasi dan gunakan thread ini sebaik-baiknya demi kemajuan server kita bersama. Posting diluar ketentuan akan saya delete. Thread ini akan kami awasi sesering mungkin..


    Terima Kasih
    Last edited by Mindbender; 04-11-12 at 11:59.
    Cheating and Fair Play? Actions speak louder than words.

  2. Hot Ad
  3. #2
    Anz69's Avatar
    Join Date
    May 2010
    Location
    Grizzly Hills
    Posts
    326
    Points
    372.64
    Thanks: 78 / 136 / 22

    Default

    Ulduar Achievements
    Boss yang berfungsi dengan baik dengan achievement penuh yaitu Boss Razorscale & Auriaya
    Berikut beberapa hasil survey dan searching buat script Ulduar
    Referensi :Here
    General Script before Boss Script:

    Ulduar.sql
    Spoiler untuk Ulduar.sql :

    Code:
    -- Ignis
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `flags_extra` = 9, `vehicleId` = 342 WHERE `entry` = 33118;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `flags_extra` = 9 WHERE `entry` = 33190;
    DELETE FROM creature WHERE id = 33121;
    DELETE FROM conditions WHERE SourceEntry = 62343;
    INSERT INTO `conditions` VALUES
    ('13','0','62343','0','18','1','33121','0','0','',NULL);
    
    -- Razorscale
    UPDATE `creature_template` SET `speed_run` = 0.00001 WHERE `entry` IN (34188, 34189);
    
    -- XT-002
    UPDATE `creature_template` SET `VehicleId` = 335 WHERE `entry` = 33293;
    
    -- Assembly of Iron
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235 WHERE `entry` IN (32867, 32927, 33693, 33692);
    UPDATE `creature_template` SET `mechanic_immune_mask` = 617299803 WHERE `entry` IN (32857, 33694);
    UPDATE `creature_template` SET `ScriptName` = 'npc_rune_of_power' WHERE `entry` = 33705;
    UPDATE `creature_template` SET `difficulty_entry_1` = 33691, `ScriptName` = 'npc_rune_of_summoning' WHERE `entry` = 33051;
    UPDATE `creature_template` SET `ScriptName` = 'npc_lightning_elemental' WHERE `entry` = 32958;
    -- Runemaster Molgeim
    UPDATE `creature_model_info` SET `bounding_radius` = 0.45, `combat_reach` = 4 WHERE `modelid` = 28381;
    -- Steelbreaker
    UPDATE `creature_model_info` SET `bounding_radius` = 0.45, `combat_reach` = 8 WHERE `modelid` = 28344;
    
    -- Kologarn
    UPDATE `creature_template` SET `baseattacktime` = 1800, `mechanic_immune_mask` = 650854235, `flags_extra` = 1 WHERE `entry` IN (32930, 33909);
    UPDATE `creature_model_info` SET `bounding_radius` = 1, `combat_reach` = 15 WHERE `modelid` = 28638;
    UPDATE `creature_model_info` SET `bounding_radius` = 0.465, `combat_reach` = 15 WHERE `modelid` = 28821;
    -- Left Arm
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `ScriptName` = 'npc_left_arm' WHERE `entry` = 32933;
    UPDATE `creature_model_info` SET `bounding_radius` = 0.465, `combat_reach` = 15 WHERE `modelid` = 28821;
    -- Right Arm
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `ScriptName` = 'npc_right_arm' WHERE `entry` = 32934;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235 WHERE `entry` IN (33910, 33911);
    UPDATE `creature_model_info` SET `bounding_radius` = 0.465, `combat_reach` = 15 WHERE `modelid` = 28822;
    -- Focused Eyebeam
    UPDATE `creature_template` SET `ScriptName` = 'npc_focused_eyebeam' WHERE `entry` IN (33632, 33802);
    DELETE FROM conditions WHERE SourceEntry IN (63676, 63702);
    INSERT INTO `conditions` VALUES
    ('13','0','63676','0','18','1','32930','0','0','',"Focused Eyebeam (Kologarn)"),
    ('13','0','63702','0','18','1','32930','0','0','',"Focused Eyebeam (Kologarn)");
    -- Cleanup
    DELETE FROM `creature` WHERE `id` IN (33632, 33802, 34297, 32933, 32934, 33809, 33661, 33742);
    DELETE FROM vehicle_accessory WHERE entry = 32930;
    
    
    -- Auriaya
    UPDATE `creature_template` SET `baseattacktime` = 1500, `equipment_id` = 2422, `mechanic_immune_mask` = 617299807, `flags_extra` = 1 WHERE `entry` = 33515;
    UPDATE `creature_template` SET `baseattacktime` = 1500, `equipment_id` = 2422, `mechanic_immune_mask` = 617299807, `flags_extra` = 1 WHERE `entry` = 34175;
    UPDATE `creature_model_info` SET `bounding_radius` = 0.775, `combat_reach` = 5 WHERE `modelid` = 28651;
    -- Sanctum Sentry
    UPDATE `creature_template` SET `speed_walk` = 1.66667, `mechanic_immune_mask` = 536870912, `flags_extra` = 1, `ScriptName` = 'npc_sanctum_sentry' WHERE `entry` = 34014;
    UPDATE `creature_template` SET `baseattacktime` = 1500, `speed_walk` = 1.66667, `mechanic_immune_mask` = 536870912, `flags_extra` = 1 WHERE `entry` = 34166;
    -- Feral Defender
    UPDATE `creature_template` SET `speed_walk` = 2, `dmg_multiplier` = 3.5, `flags_extra` = 1, `ScriptName` = 'npc_feral_defender' WHERE `entry` = 34035;
    UPDATE `creature_template` SET `speed_walk` = 2, `dmg_multiplier` = 5, `flags_extra` = 1, `baseattacktime` = 1500 WHERE `entry` = 34171;
    UPDATE `creature_template` SET `unit_flags` = 33554432, `ScriptName` = 'npc_seeping_trigger' WHERE `entry` = 34098;
    UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` = 34174;
    UPDATE `creature_template` SET `dmg_multiplier` = 1.5, `baseattacktime` = 1500 WHERE `entry` = 34169;
    UPDATE `creature_template` SET `ScriptName` = 'npc_feral_defender_trigger' WHERE `entry` = 34096;
    -- Mace equip
    DELETE FROM `creature_equip_template` WHERE entry = 2422;
    INSERT INTO `creature_equip_template` VALUES ('2422','45315','0','0');
    -- Cleanup
    DELETE FROM `creature` WHERE `id` = 34014;
    -- Auriaya movement path
    DELETE FROM `creature_addon` WHERE guid = 137496;
    INSERT INTO `creature_addon` VALUES ('137496','1033515','0','0','0','0','0');
    UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = 137496;
    DELETE FROM `waypoint_data` WHERE id = 1033515;
    INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `delay`, `move_flag`, `action`, `action_chance`, `wpguid`) VALUES
    ('1033515','1','1968.46','51.75','417.72','0','0','0','100','0'),
    ('1033515','2','1956.75','49.22','411.35','0','0','0','100','0'),
    ('1033515','3','1938.90','42.09','411.35','3000','0','0','100','0'),
    ('1033515','4','1956.75','49.22','411.35','0','0','0','100','0'),
    ('1033515','5','1968.46','51.75','417.72','0','0','0','100','0'),
    ('1033515','6','2011.43','44.91','417.72','0','0','0','100','0'),
    ('1033515','7','2022.65','37.74','411.36','0','0','0','100','0'),
    ('1033515','8','2046.65','9.61','411.36','0','0','0','100','0'),
    ('1033515','9','2053.4','-8.65','421.68','0','0','0','100','0'),
    ('1033515','10','2053.14','-39.8','421.66','0','0','0','100','0'),
    ('1033515','11','2046.26','-57.96','411.35','0','0','0','100','0'),
    ('1033515','12','2022.42','-86.39','411.35','0','0','0','100','0'),
    ('1033515','13','2011.26','-92.95','417.71','0','0','0','100','0'),
    ('1033515','14','1969.43','-100.02','417.72','0','0','0','100','0'),
    ('1033515','15','1956.66','-97.4','411.35','0','0','0','100','0'),
    ('1033515','16','1939.18','-90.90','411.35','3000','0','0','100','0'),
    ('1033515','17','1956.66','-97.4','411.35','0','0','0','100','0'),
    ('1033515','18','1969.43','-100.02','417.72','0','0','0','100','0'),
    ('1033515','19','2011.26','-92.95','417.71','0','0','0','100','0'),
    ('1033515','20','2022.42','-86.39','411.35','0','0','0','100','0'),
    ('1033515','21','2046.26','-57.96','411.35','0','0','0','100','0'),
    ('1033515','22','2053.14','-39.8','421.66','0','0','0','100','0'),
    ('1033515','23','2053.4','-8.65','421.68','0','0','0','100','0'),
    ('1033515','24','2046.65','9.61','411.36','0','0','0','100','0'),
    ('1033515','25','2022.65','37.74','411.36','0','0','0','100','0'),
    ('1033515','26','2011.43','44.91','417.72','0','0','0','100','0');
    
    
    
    -- Hodir
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854239, `flags_extra` = 1, `ScriptName` = 'boss_hodir' WHERE `entry` = 32845;
    UPDATE `creature_template` SET `equipment_id` = 1843, `mechanic_immune_mask` = 650854239, `flags_extra` = 1 WHERE `entry` = 32846;
    -- Hodir npcs
    UPDATE `creature_template` SET `ScriptName` = 'npc_hodir_priest' WHERE `entry` IN (32897, 33326, 32948, 33330);
    UPDATE `creature_template` SET `ScriptName` = 'npc_hodir_shaman' WHERE `entry` IN (33328, 32901, 33332, 32950);
    UPDATE `creature_template` SET `ScriptName` = 'npc_hodir_druid' WHERE `entry` IN (33325, 32900, 32941, 33333);
    UPDATE `creature_template` SET `ScriptName` = 'npc_hodir_mage' WHERE `entry` IN (32893, 33327, 33331, 32946);
    UPDATE `creature_template` SET `ScriptName` = 'npc_toasty_fire' WHERE `entry` = 33342;
    UPDATE `creature_template` SET `ScriptName` = 'npc_icicle' WHERE `entry` = 33169;
    UPDATE `creature_template` SET `ScriptName` = 'npc_icicle_snowdrift' WHERE `entry` = 33173;
    UPDATE `creature_template` SET `ScriptName` = 'npc_snowpacked_icicle' WHERE `entry` = 33174;
    UPDATE `creature_template` SET `difficulty_entry_1` = 33352, `mechanic_immune_mask` = 612597599, `ScriptName` = 'npc_flash_freeze' WHERE `entry` = 32926;
    UPDATE `creature_template` SET `difficulty_entry_1` = 33353, `mechanic_immune_mask` = 612597599, `ScriptName` = 'npc_flash_freeze' WHERE `entry` = 32938;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 612597599 WHERE `entry` IN (33352, 33353);
    UPDATE `gameobject_template` SET `flags` = 4 WHERE `entry` = 194173;
    -- Cleanup
    DELETE FROM `creature` WHERE `id` IN (32950, 32941, 32948, 32946, 32938);
    
    -- Mimiron Tram
    UPDATE `gameobject_template` SET `flags` = 32, `data2` = 3000, `ScriptName` = 'go_call_tram' WHERE `entry` IN (194914, 194912, 194437);
    DELETE FROM gameobject WHERE id = '194437';
    INSERT INTO `gameobject` (`id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
    ('194437','603','1','1','2306.87','274.237','424.288','1.52255','0','0','0.689847','0.723956','300','0','1');
    DELETE FROM gameobject_template WHERE entry = '194438';
    INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `faction`, `flags`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `ScriptName`, `WDBVerified`) VALUES
    ('194438','1','8504','Activate Tram','','','','0','32','1','0','0','0','0','0','0','0','0','3000','0','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','go_call_tram','11159');
    DELETE FROM gameobject WHERE id = '194438';
    INSERT INTO `gameobject` (`id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
    (194438, 603, 1,1,2306.99, 2589.35, 424.382, 4.71676, 0, 0, 0.705559, -0.708651, 300, 0, 1);
    
    -- Mimiron
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `ScriptName` = 'boss_mimiron' WHERE `entry` = 33350;
    -- Leviathan MKII
    UPDATE `creature_template` SET `vehicleid` = 370, `mechanic_immune_mask` = 650854235, `ScriptName` = 'boss_leviathan_mk' WHERE `entry` = 33432;
    UPDATE `creature_template` SET `minlevel` = 83, `maxlevel` = 83, `mechanic_immune_mask` = 650854235, `flags_extra` = 1 WHERE `entry` = 34106;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `ScriptName` = 'boss_leviathan_mk_turret' WHERE `entry` = 34071;
    DELETE FROM vehicle_accessory WHERE entry = 33432;
    INSERT INTO vehicle_accessory VALUE (33432, 34071, 3, 1, 'Leviathan Mk II turret');
    UPDATE creature_template SET ScriptName = 'npc_proximity_mine' WHERE entry = 34362;
    DELETE FROM `creature_model_info` WHERE `modelid`=28831;
    INSERT INTO `creature_model_info` (`modelid`, `bounding_radius`, `combat_reach`, `gender`, `modelid_other_gender`) VALUES
    (28831, 0.5, 7, 2, 0);
    -- VX-001
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `flags_extra` = 1, `vehicleid` = 371, `ScriptName` = 'boss_vx_001' WHERE `entry` = 33651;
    UPDATE `creature_template` SET `minlevel` = 83, `maxlevel` = 83, `mechanic_immune_mask` = 650854235, `flags_extra` = 1 WHERE `entry` = 34108;
    UPDATE `creature_template` SET `faction_A` = 35, `faction_H` = 35 WHERE `entry` = 34050;
    UPDATE `creature_template` SET `unit_flags` = 33686020, `flags_extra` = 2 WHERE `entry` = 34211;
    UPDATE `creature_template` SET `ScriptName` = 'npc_rocket_strike' WHERE `entry` = 34047;
    -- Aerial Command Unit
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `flags_extra` = 1, `ScriptName` = 'boss_aerial_unit' WHERE `entry` = 33670;
    UPDATE `creature_template` SET `minlevel` = 83, `maxlevel` = 83, `mechanic_immune_mask` = 650854235, `flags_extra` = 1 WHERE `entry` = 34109;
    UPDATE `creature_template` SET `ScriptName` = 'npc_magnetic_core' WHERE `entry` = 34068;
    UPDATE `creature_template` SET `ScriptName` = 'npc_assault_bot' WHERE `entry` = 34057;
    UPDATE `creature_template` SET `difficulty_entry_1` = 34148, `ScriptName` = 'npc_emergency_bot' WHERE `entry` = 34147;
    -- HardMode
    UPDATE `gameobject_template` SET `flags` = 32, `ScriptName` = 'go_not_push_button' WHERE `entry` = 194739;
    UPDATE `creature_template` SET `difficulty_entry_1` = 34361, `ScriptName` = 'npc_frost_bomb' WHERE `entry` = 34149;
    UPDATE `creature_template` SET `speed_walk` = 0.15, `speed_run` = 0.15, `ScriptName` = 'npc_mimiron_flame_trigger' WHERE `entry` = 34363;
    UPDATE `creature_template` SET `ScriptName` = 'npc_mimiron_flame_spread' WHERE `entry` = 34121;
    -- CleanUp
    DELETE FROM creature WHERE id IN (34071, 33856);
    UPDATE `creature_template` SET `flags_extra` = 2 WHERE `entry` = 34143;
    
    
    
    
    -- Freya
    UPDATE `creature_template` SET `baseattacktime` = 1500, `mechanic_immune_mask` = 650854235, `ScriptName` = 'boss_freya' WHERE `entry` = 32906;
    UPDATE `creature_template` SET `speed_walk` = 1.6, `baseattacktime` = 1500, `mechanic_immune_mask` = 650854235, `flags_extra` = 1 WHERE `entry` = 33360;
    -- Elders
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `flags_extra` = 1, `ScriptName` = 'npc_elder_brightleaf' WHERE `entry` = 32915;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `flags_extra` = 1, `ScriptName` = 'npc_elder_ironbranch' WHERE `entry` = 32913;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `flags_extra` = 1, `ScriptName` = 'npc_elder_stonebark' WHERE `entry` = 32914;
    UPDATE `creature_template` SET `speed_walk` = 1.66666, `mechanic_immune_mask` = 650854235, `flags_extra` = 1 WHERE `entry` IN (33393, 33392, 33391);
    -- Iron roots
    UPDATE `creature_template` SET `difficulty_entry_1` = 33397, `mechanic_immune_mask` = 650854239, `ScriptName` = 'npc_iron_roots' WHERE `entry` = 33168;
    UPDATE `creature_template` SET `difficulty_entry_1` = 33396, `mechanic_immune_mask` = 650854239, `ScriptName` = 'npc_iron_roots' WHERE `entry` = 33088;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854239 WHERE `entry` IN (33396, 33397);
    -- Eonar Gift
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `flags_extra` = 1, `ScriptName` = 'npc_eonars_gift' WHERE `entry` = 33228;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `flags_extra` = 1 WHERE `entry` = 33385;
    -- Unstable Sun Beam
    UPDATE `creature_template` SET `ScriptName` = 'npc_unstable_sun_beam' WHERE `entry` = 33050;
    -- Sun Beam
    UPDATE `creature_template` SET `ScriptName` = 'npc_sun_beam' WHERE `entry` = 33170;
    -- Nature Bomb
    UPDATE `creature_template` SET `ScriptName` = 'npc_nature_bomb' WHERE `entry` = 34129;
    UPDATE `gameobject_template` SET `flags` = 4 WHERE `entry` = 194902;
    -- Detonating Lasher
    UPDATE `creature_template` SET `flags_extra` = 256, `ScriptName` = 'npc_detonating_lasher' WHERE `entry` = 32918;
    UPDATE `creature_template` SET `flags_extra` = 256 WHERE `entry` = 33399;
    -- Ancient Conservator
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650853979, `ScriptName` = 'npc_ancient_conservator' WHERE `entry` = 33203;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650853979 WHERE `entry` = 33376;
    -- Healthy Spore
    UPDATE `creature_template` SET `ScriptName` = 'npc_healthy_spore' WHERE `entry` = 33215;
    -- Storm Lasher
    UPDATE `creature_template` SET `ScriptName` = 'npc_storm_lasher' WHERE `entry` = 32919;
    -- Snaplasher
    UPDATE `creature_template` SET `ScriptName` = 'npc_snaplasher' WHERE `entry` = 32916;
    -- Ancient Water Spirit
    UPDATE `creature_template` SET `ScriptName` = 'npc_ancient_water_spirit' WHERE `entry` = 33202;
    -- Cleanup
    DELETE FROM `creature` WHERE `guid` = 136607 OR id = 33575;
    
    
    
    -- Thorim
    UPDATE `creature_template` SET `speed_walk` = 1.66667, `mechanic_immune_mask` = 650854239, `flags_extra` = 1, `ScriptName` = 'boss_thorim' WHERE `entry` = 32865;
    UPDATE `creature_template` SET `speed_walk` = 1.66667, `baseattacktime` = 1500, `equipment_id` = 1844, `mechanic_immune_mask` = 650854239 WHERE `entry` = 33147;
    DELETE FROM `creature` WHERE `id`=32865;
    INSERT INTO `creature` (`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) VALUES
    (32865, 603, 3, 1, 28977, 0, 2134.967, -298.962, 438.331, 1.57, 604800, 0, 0, 4183500, 425800, 0, 1);
    DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=62042;
    INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
    ('62042','62470','1','Thorim: Deafening Thunder');
    -- Charge Orb
    DELETE FROM conditions WHERE SourceEntry = 62016;
    INSERT INTO `conditions` VALUES
    ('13','0','62016','0','18','1','33378','0','0','',NULL);
    UPDATE `creature_template` SET `unit_flags` = 33685508 WHERE `entry` = 33378;
    -- Gate
    DELETE FROM `gameobject_scripts` WHERE `id`=55194;
    INSERT INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES 
    (55194, 0, 11, 34155, 15, '0', 0, 0, 0, 0);
    DELETE FROM `gameobject_template` WHERE `entry`=194265;
    INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `faction`, `flags`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `ScriptName`, `WDBVerified`) VALUES
    ('194265','1','295','Lever','','','','0','16','3','0','0','0','0','0','0','0','0','6000','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
    UPDATE `gameobject` SET `id` = 194265, `rotation2` = 1, `rotation3` = 0, `spawntimesecs` = 7200, `animprogress` = 100 WHERE `guid` = 55194;
    -- Cleanup
    DELETE FROM `creature` WHERE `id` IN (32885, 32883, 32908, 32907, 32882, 33110, 32886, 32879, 32892, 33140, 33141, 33378, 32874, 32875)
    OR guid IN (136694, 136695, 136666, 136706, 136754, 136653, 136756, 136757, 136725, 136718);
    -- Pre adds
    UPDATE `creature_template` SET `equipment_id` = 1849, `ScriptName` = 'npc_thorim_pre_phase' WHERE `entry` = 32885;
    UPDATE `creature_template` SET `equipment_id` = 1849 WHERE `entry` = 33153;
    UPDATE `creature_template` SET `ScriptName` = 'npc_thorim_pre_phase' WHERE `entry` = 32883;
    UPDATE `creature_template` SET `equipment_id` = 1847 WHERE `entry` = 33152;
    UPDATE `creature_template` SET `equipment_id` = 1850, `ScriptName` = 'npc_thorim_pre_phase' WHERE `entry` = 32908;
    UPDATE `creature_template` SET `equipment_id` = 1850 WHERE `entry` = 33151;
    UPDATE `creature_template` SET `ScriptName` = 'npc_thorim_pre_phase' WHERE `entry` = 32907;
    UPDATE `creature_template` SET `equipment_id` = 1852 WHERE `entry` = 33150;
    UPDATE `creature_template` SET `ScriptName` = 'npc_thorim_pre_phase' WHERE `entry` = 32882;
    UPDATE `creature_template` SET `ScriptName` = 'npc_thorim_pre_phase' WHERE `entry` = 32886;
    UPDATE `creature_template` SET `modelid1` = 16925, `modelid2` = 0 WHERE `entry`IN (33378, 32892);
    -- Thorim Mini bosses
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854239, `flags_extra` = 1, `ScriptName` = 'npc_runic_colossus' WHERE `entry` = 32872;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854239, `flags_extra` = 1, `ScriptName` = 'npc_ancient_rune_giant' WHERE `entry` = 32873;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854239, `flags_extra` = 1, `ScriptName` = 'npc_sif' WHERE `entry` = 33196;
    UPDATE `creature_template` SET `ScriptName` = 'npc_thorim_arena_phase' WHERE `entry` IN (32876, 32904, 32878, 32877, 32874, 32875, 33110);
    DELETE FROM `creature_addon` WHERE `guid`IN (136059, 136816);
    INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
    ('136059','0','0','0','1','0','40775 0'),
    ('136816','0','0','0','1','0','40775 0');
    
    
    -- General Vezax
    UPDATE `creature_template` SET `mechanic_immune_mask` = 617299803, `flags_extra` = 257, `ScriptName` = 'boss_general_vezax' WHERE `entry` = 33271;
    UPDATE `creature_template` SET `baseattacktime` = 1500, `mechanic_immune_mask` = 617299803, `flags_extra` = 257 WHERE `entry` = 33449;
    UPDATE `creature_model_info` SET `bounding_radius` = 0.62, `combat_reach` = 12 WHERE `modelid` = 28548;
    UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `ScriptName` = 'npc_saronite_vapors' WHERE `entry` = 33488;
    UPDATE `creature_template` SET `minlevel` = 80, `maxlevel` = 80, `mechanic_immune_mask` = 650854235, `ScriptName` = 'npc_saronite_animus' WHERE `entry` = 33524;
    UPDATE `creature_template` SET `minlevel` = 80, `maxlevel` = 80, `mechanic_immune_mask` = 650854235 WHERE `entry` IN (33789, 34152);
    UPDATE `creature_model_info` SET `bounding_radius` = 0.62, `combat_reach` = 10 WHERE `modelid` = 28992;
    -- CleanUp
    DELETE FROM creature WHERE id = 33500;



    ulduar_spelldifficulty_dbc.sql
    Spoiler untuk ulduar_spelldifficulty_dbc.sql :

    Code:
    -- Cleanup
    DELETE FROM `spelldifficulty_dbc` WHERE `id` > 3194;
    
    -- Razorscale
    INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`, `spellid2`, `spellid3`) VALUES 
    ('3195','64758','64759','0','0'),
    ('3196','63809','64696','0','0'),
    ('3197','46763','64062','0','0'),
    ('3198','63807','63808','0','0');
    
    -- XT-002
    INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`, `spellid2`, `spellid3`) VALUES 
    ('3199','63018','65121','0','0'),
    ('3200','63024','64234','0','0'),
    ('3201','65737','64193','0','0'),
    ('3202','64203','64235','0','0'),
    ('3203','64227','64236','0','0');
    
    -- Assembly of Iron
    INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`, `spellid2`, `spellid3`) VALUES 
    ('3204','61890','63498','0','0'),
    ('3205','61903','63493','0','0'),
    ('3206','44008','63494','0','0'),
    ('3207','64637','61888','0','0'),
    ('3208','62274','63489','0','0'),
    ('3209','62269','63490','0','0'),
    ('3210','62054','63491','0','0'),
    ('3211','61879','63479','0','0'),
    ('3212','61869','63481','0','0'),
    ('3213','61915','63483','0','0'),
    ('3214','61887','63486','0','0');
    
    -- Kologarn
    INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`, `spellid2`, `spellid3`) VALUES 
    ('3215','63629','63979','0','0'),
    ('3216','63356','64003','0','0'),
    ('3217','63573','64006','0','0'),
    ('3218','63716','64005','0','0'),
    ('3219','62030','63980','0','0'),
    ('3220','63783','63982','0','0'),
    ('3221','64290','64292','0','0'),
    ('3222','62056','63985','0','0'),
    ('3223','63766','63983','0','0'),
    ('3224','63347','63977','0','0');
    
    -- Auriaya
    INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`, `spellid2`, `spellid3`) VALUES 
    ('3225','64389','64678','0','0'),
    ('3226','64422','64688','0','0'),
    ('3227','64496','64674','0','0'),
    ('3228','64478','64669','0','0'),
    ('3229','64458','64676','0','0'),
    ('3230','64666','64374','0','0'),
    ('3231','64375','64667','0','0');
    
    -- Hodir
    INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`, `spellid2`, `spellid3`) VALUES 
    ('3232','62478','63512','0','0'),
    ('3233','65123','65133','0','0');
    
    -- Thorim
    INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`, `spellid2`, `spellid3`) VALUES 
    ('3234','62131','64390','0','0');
    
    -- Freya
    INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`, `spellid2`, `spellid3`) VALUES 
    ('3235','62528','62892','0','0'),
    ('3236','62623','62872','0','0'),
    ('3237','62437','62859','0','0'),
    ('3238','62283','62930','0','0'),
    ('3239','62451','62865','0','0'),
    ('3240','62950','62955','0','0'),
    ('3241','62952','62956','0','0'),
    ('3242','62953','62957','0','0'),
    ('3243','62954','62958','0','0'),
    ('3244','62598','62937','0','0'),
    ('3245','62589','63571','0','0'),
    ('3246','62648','62939','0','0'),
    ('3247','62649','62938','0','0'),
    ('3248','62664','64191','0','0'),
    ('3249','64587','64650','0','0'),
    ('3250','62584','64185','0','0'),
    ('3251','62337','62933','0','0'),
    ('3252','62325','62932','0','0'),
    ('3253','62310','62928','0','0'),
    ('3254','64060','64071','0','0'),
    ('3255','62438','62861','0','0'),
    ('3256','62217','62922','0','0'),
    ('3257','62240','62920','0','0');
    
    -- Mimiron
    INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`, `spellid2`, `spellid3`) VALUES 
    ('3258','63666','65026','0','0'),
    ('3259','62997','64529','0','0'),
    ('3260','66351','63009','0','0'),
    ('3261','63677','64533','0','0'),
    ('3262','64348','64536','0','0'),
    ('3263','63689','64535','0','0');

    ulduar_eventai.sql
    Spoiler untuk ulduar_eventai.sql :

    Code:
    -- Runeforged Sentry
    UPDATE `creature_template` SET `spell1` = 64852, `spell2` = 64870, `spell3` = 64847, `AIName` = 'EventAI' WHERE `entry` = 34234;
    UPDATE `creature_template` SET `spell1` = 64852, `spell2` = 64870, `spell3` = 64847 WHERE `entry` = 34235;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34234);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3423401, 34234, 0, 0, 100, 1, 2000, 2000, 10000, 10000, 11, 64852, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Runeforged Sentry - Cast Flaming Rune'),
    (3423402, 34234, 0, 0, 100, 1, 3000, 5000, 5000, 7000, 11, 64870, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Runeforged Sentry - Cast Lava Burst'),
    (3423403, 34234, 0, 0, 100, 1, 2500, 3000, 12000, 15000, 11, 64847, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Runeforged Sentry - Cast Runed Flame Jets');
    
    -- Steelforged Defender
    UPDATE `creature_template` SET `spell1` = 62845, `spell2` = 57780, `spell3` = 50370, `AIName` = 'EventAI' WHERE `entry` = 33236;
    UPDATE `creature_template` SET `spell1` = 62845, `spell2` = 57780, `spell3` = 50370 WHERE `entry` = 34113;
    UPDATE `creature` SET `spawntimesecs` = 604800 WHERE `id` IN (33236, 33838);
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33236);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3323601, 33236, 0, 0, 100, 1, 4000, 6000, 15000, 20000, 11, 62845, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Steelforged Defender - Cast Hamstring'),
    (3323602, 33236, 0, 0, 100, 1, 0, 4000, 6000, 8000, 11, 57780, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Steelforged Defender - Cast Lightning Bolt'),
    (3323603, 33236, 0, 0, 100, 1, 5000, 6000, 4000, 6000, 11, 50370, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Steelforged Defender - Cast Sunder Armor');
    
    -- Mechagnome Battletank
    UPDATE `creature_template` SET `spell1` = 64693, `spell2` = 64953, `AIName` = 'EventAI' WHERE `entry` = 34164;
    UPDATE `creature_template` SET `spell1` = 64693, `spell2` = 64953 WHERE `entry` = 34165;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34164);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3416401, 34164, 0, 0, 100, 1, 3000, 4000, 6000, 8000, 11, 64693, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mechagnome Battletank - Cast Flame Cannon'),
    (3416402, 34164, 0, 0, 100, 1, 10000, 10000, 15000, 20000, 11, 64953, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mechagnome Battletank - Cast Jump Attack');
    
    -- Ulduar Colossus
    UPDATE `creature_template` SET `spell1` = 62625, `AIName` = 'EventAI' WHERE `entry` = 33237;
    UPDATE `creature_template` SET `spell1` = 62625 WHERE `entry` = 34105;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33237);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3323701, 33237, 0, 0, 100, 1, 8000, 10000, 20000, 25000, 11, 62625, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Ulduar Colossus - Cast Ground Slam');
    
    -- invisible triggers
    UPDATE `creature_template` SET `flags_extra` = 2 WHERE `entry` IN (33377, 33742, 34286, 33500, 33406, 33575);
    
    -- Molten Colossus
    UPDATE `creature_template` SET `spell1` = 64697, `spell2` = 64698, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 34069;
    UPDATE `creature_template` SET `spell1` = 64697, `spell2` = 64698, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34185;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34069);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3406901, 34069, 0, 0, 100, 1, 6000, 10000, 10000, 12000, 11, 64697, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Molten Colossus - Cast Earthquake'),
    (3406902, 34069, 0, 0, 100, 1, 2000, 4000, 6000, 9000, 11, 64698, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Molten Colossus - Cast Pyroblast');
    
    -- Magma Rager
    UPDATE `creature_template` SET `spell1` = 64773, `spell2` = 64746, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 34086;
    UPDATE `creature_template` SET `spell1` = 64773, `spell2` = 64746, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34201;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34086);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3408601, 34086, 0, 0, 100, 1, 2000, 40000, 6000, 8000, 11, 64773, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Magma Rager - Cast Fire Blast'),
    (3408602, 34086, 0, 0, 100, 1, 8000, 16000, 15000, 25000, 11, 64746, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Magma Rager - Cast Superheated winds');
    UPDATE `creature_template` SET `unit_flags` = 33718790, modelid1 = 11686, modelid2 = 0, `spell1` = 64724, `AIName` = 'EventAI' WHERE `entry` = 34194;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34194);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3419401, 34194, 0, 0, 100, 1, 0, 0, 10000, 10000, 11, 64724, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Superheated Winds');
    
    -- Forge Construct
    UPDATE `creature_template` SET `spell1` = 64719, `spell2` = 64720, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 34085;
    UPDATE `creature_template` SET `spell1` = 64719, `spell2` = 64721, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34186;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34085);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3408501, 34085, 0, 0, 100, 1, 8000, 12000, 10000, 15000, 11, 64719, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Forge Construct - Cast Charge'),
    (3408502, 34085, 0, 0, 100, 3, 2000, 6000, 6000, 9000, 11, 64720, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Forge Construct - Cast Flame Emission 10'),
    (3408503, 34085, 0, 0, 100, 5, 2000, 6000, 6000, 9000, 11, 64721, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Forge Construct - Cast Flame Emission 25');
    
    -- XB-488 Disposalbot
    UPDATE `creature_template` SET `spell1` = 65080, `spell2` = 65084, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 34273;
    UPDATE `creature_template` SET `spell1` = 65104, `spell2` = 65084, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34274;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34273);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3427301, 34273, 2, 0, 100, 1, 30, 20, 0, 0, 11, 65084, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'XB-488 Disposalbot - Cast Self Destruct'),
    (3427302, 34273, 0, 0, 100, 3, 2000, 6000, 10000, 15000, 11, 65080, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'XB-488 Disposalbot - Cast Cut Scrap Metal 10'),
    (3427303, 34273, 0, 0, 100, 5, 2000, 6000, 10000, 15000, 11, 65104, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'XB-488 Disposalbot - Cast Cut Scrap Metal 25');
    
    -- Parts Recovery Technician
    UPDATE `creature_template` SET `spell1` = 65071, `spell2` = 65070, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554432, `AIName` = 'EventAI' WHERE `entry` = 34267;
    UPDATE `creature_template` SET `spell1` = 65071, `spell2` = 65070, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554432 WHERE `entry` = 34268;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34267);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3426701, 34267, 0, 0, 100, 1, 8000, 12000, 10000, 15000, 11, 65071, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Parts Recovery Technician - Cast Mechano Kick'),
    (3426702, 34267, 0, 0, 100, 1, 6000, 8000, 25000, 30000, 11, 65070, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Parts Recovery Technician - Cast Defense Matrix');
    
    -- XD-175 Compactobot
    UPDATE `creature_template` SET `spell1` = 65073, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 34271;
    UPDATE `creature_template` SET `spell1` = 65106, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34272;
    UPDATE `creature_template` SET `mingold` = 7100, `maxgold` = 7600 WHERE `entry` = 34269;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34271);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3427101, 34271, 0, 0, 100, 3, 8000, 12000, 15000, 20000, 11, 65073, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'XD-175 Compactobot - Cast Trash Compactor 10'),
    (3427102, 34271, 0, 0, 100, 5, 8000, 12000, 15000, 20000, 11, 65106, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'XD-175 Compactobot - Cast Trash Compactor 25');
    
    -- Lightning Charged Iron Dwarf
    UPDATE `creature_template` SET `spell1` = 64889, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 34199;
    UPDATE `creature_template` SET `spell1` = 64975, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34237;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34199);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3419901, 34199, 0, 0, 100, 3, 0, 0, 10000, 15000, 11, 64889, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lightning Charged Iron Dwarf - Cast Lightning Charged 10'),
    (3419902, 34199, 0, 0, 100, 5, 0, 0, 10000, 15000, 11, 64975, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lightning Charged Iron Dwarf - Cast Lightning Charged 25');
    
    -- Hardened Iron Golem
    UPDATE `creature_template` SET `spell1` = 64877, `spell2` = 64874, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'EventAI' WHERE `entry` = 34190;
    UPDATE `creature_template` SET `spell1` = 64877, `spell2` = 64967, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 34229;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34190);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3419001, 34190, 0, 0, 100, 1, 4000, 8000, 25000, 30000, 11, 64877, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Hardened Iron Golem - Cast Harden Fists'),
    (3419002, 34190, 0, 0, 100, 3, 5000, 7000, 20000, 30000, 11, 64874, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Hardened Iron Golem - Cast Rune Punch 10'),
    (3419003, 34190, 0, 0, 100, 5, 5000, 7000, 20000, 30000, 11, 64967, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Hardened Iron Golem - Cast Rune Punch 25');
    
    -- Iron Mender
    UPDATE `creature_template` SET `spell1` = 64918, `spell2` = 64903, `spell3` = 64897, `mechanic_immune_mask` = 33554496, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 34198;
    UPDATE `creature_template` SET `spell1` = 64971, `spell2` = 64970, `spell3` = 64968, `mechanic_immune_mask` = 33554496, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34236;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34198);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3419801, 34198, 0, 0, 100, 3, 2000, 4000, 4000, 6000, 11, 64918, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Iron Mender - Cast Electro Shock 10'),
    (3419802, 34198, 0, 0, 100, 5, 2000, 4000, 4000, 6000, 11, 64971, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Iron Mender - Cast Electro Shock 25'),
    (3419803, 34198, 0, 0, 100, 3, 3000, 6000, 10000, 15000, 11, 64903, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Iron Mender - Cast Fuse Lightning 10'),
    (3419804, 34198, 0, 0, 100, 5, 3000, 6000, 10000, 15000, 11, 64970, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Iron Mender - Cast Fuse Lightning 25'),
    (3419805, 34198, 0, 0, 100, 3, 10000, 25000, 30000, 45000, 11, 64897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Iron Mender - Cast Fuse Metal 10'),
    (3419806, 34198, 0, 0, 100, 5, 10000, 25000, 30000, 45000, 11, 64968, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Iron Mender - Cast Fuse Metal 25');
    
    -- Rune Etched Sentry
    UPDATE `creature_template` SET `spell1` = 64852, `spell2` = 64870, `spell3` = 64847, `mechanic_immune_mask` = 33554496, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 34196;
    UPDATE `creature_template` SET `spell1` = 64852, `spell2` = 64870, `spell3` = 64847, `mechanic_immune_mask` = 33554496, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34245;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34196);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3419601, 34196, 0, 0, 100, 1, 2000, 2000, 10000, 10000, 11, 64852, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Rune Etched Sentry - Cast Flaming Rune'),
    (3419602, 34196, 0, 0, 100, 1, 3000, 5000, 5000, 7000, 11, 64870, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Rune Etched Sentry - Cast Lava Burst'),
    (3419603, 34196, 0, 0, 100, 1, 2500, 3000, 12000, 15000, 11, 64847, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Rune Etched Sentry - Cast Runed Flame Jets');
    
    -- Chamber Overseer
    UPDATE `creature_template` SET `spell1` = 64820, `spell2` = 64825, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'EventAI' WHERE `entry` = 34197;
    UPDATE `creature_template` SET `spell1` = 64943, `spell2` = 64944, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 34226;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34197);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3419701, 34197, 0, 0, 100, 3, 4000, 8000, 6000, 9000, 11, 64820, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Chamber Overseer - Cast Devastating Leap 10'),
    (3419702, 34197, 0, 0, 100, 5, 4000, 8000, 6000, 9000, 11, 64943, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Chamber Overseer - Cast Devastating Leap 25'),
    (3419703, 34197, 0, 0, 100, 3, 10000, 12000, 8000, 12000, 11, 64825, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Chamber Overseer - Cast Staggering Roar 10'),
    (3419704, 34197, 0, 0, 100, 5, 10000, 12000, 8000, 12000, 11, 64944, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Chamber Overseer - Cast Staggering Roar 25');
    
    -- Storm Tempered Keeper
    UPDATE `creature_template` SET `spell1` = 63541, `spell2` = 63630, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'EventAI' WHERE `entry` = 33722;
    UPDATE `creature_template` SET `spell1` = 63541, `spell2` = 63630, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 33723;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33722);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3372201, 33722, 0, 0, 100, 1, 120000, 120000, 120000, 150000, 11, 63630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Storm Tempered Keeper - Cast Vengeful Surge'),
    (3372202, 33722, 0, 0, 100, 1, 3000, 6000, 10000, 15000, 11, 63541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Storm Tempered Keeper - Cast Forked Lightning');
    
    -- Storm Tempered Keeper
    UPDATE `creature_template` SET `spell1` = 63541, `spell2` = 63630, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'EventAI' WHERE `entry` = 33699;
    UPDATE `creature_template` SET `spell1` = 63541, `spell2` = 63630, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 33700;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33699);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3369901, 33699, 0, 0, 100, 1, 120000, 120000, 120000, 150000, 11, 63630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Storm Tempered Keeper - Cast Vengeful Surge'),
    (3369902, 33699, 0, 0, 100, 1, 3000, 6000, 10000, 15000, 11, 63541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Storm Tempered Keeper - Cast Forked Lightning');
    
    -- Champion of Hodir
    UPDATE `creature_template` SET `spell1` = 64639, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 34133;
    UPDATE `creature_template` SET `spell1` = 64652, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34139;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34133);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3413301, 34133, 0, 0, 100, 3, 3000, 6000, 12000, 16000, 11, 64639, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Champion of Hodir - Cast Stomp 10'),
    (3413302, 34133, 0, 0, 100, 5, 3000, 6000, 12000, 16000, 11, 64652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Champion of Hodir - Cast Stomp 25');
    
    -- Winter Jormungar
    UPDATE `creature_template` SET `spell1` = 64638, `AIName` = 'EventAI' WHERE `entry` = 34137;
    UPDATE `creature_template` SET `spell1` = 64638 WHERE `entry` = 34140;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34137);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3413701, 34137, 0, 0, 100, 1, 3000, 6000, 6000, 9000, 11, 64638, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Winter Jormungar - Cast Acidic Bite');
    UPDATE `creature` SET `spawndist` = 0 WHERE `id` = 34137;
    
    -- Winter Revenant
    UPDATE `creature_template` SET `spell1` = 64642, `spell2` = 64643, `spell3` = 64644, `mechanic_immune_mask` = 33554496, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 34134;
    UPDATE `creature_template` SET `spell1` = 64653, `spell2` = 64643, `spell3` = 64644, `mechanic_immune_mask` = 33554496, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34141;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34134);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3413401, 34134, 0, 0, 100, 3, 8000, 12000, 15000, 20000, 11, 64642, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Winter Revenant - Cast Blizzard 10'),
    (3413402, 34134, 0, 0, 100, 5, 8000, 12000, 15000, 20000, 11, 64653, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Winter Revenant - Cast Blizzard 25'),
    (3413403, 34134, 0, 0, 100, 1, 3000, 5000, 10000, 12000, 11, 64643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Winter Revenant - Cast Whirling Strike'),
    (3413404, 34134, 0, 0, 100, 1, 15000, 20000, 60000, 75000, 11, 64644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Winter Revenant - Cast Shield of the Winter Revenant');
    
    -- Winter Rumbler
    UPDATE `creature_template` SET `spell1` = 64645, `spell2` = 64647, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'EventAI' WHERE `entry` = 34135;
    UPDATE `creature_template` SET `spell1` = 64645, `spell2` = 64654, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 34142;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34135);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3413501, 34135, 0, 0, 100, 1, 6000, 12000, 10000, 16000, 11, 64645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Winter Rumbler - Cast Cone of Cold'),
    (3413502, 34135, 0, 0, 100, 3, 3000, 6000, 8000, 12000, 11, 64647, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Winter Rumbler - Cast Snow Blindness 10'),
    (3413503, 34135, 0, 0, 100, 5, 3000, 6000, 8000, 12000, 11, 64654, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Winter Rumbler - Cast Snow Blindness 25');
    
    -- Guardian Lasher
    UPDATE `creature_template` SET `spell1` = 63007, `spell2` = 63047, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'EventAI' WHERE `entry` = 33430;
    UPDATE `creature_template` SET `spell1` = 63007, `spell2` = 63550, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 33732;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33430);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3343001, 33430, 4, 0, 100, 1, 0, 0, 0, 0, 11, 63007, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Guardian Lasher - Cast Guardian Pheromones'),
    (3343002, 33430, 0, 0, 100, 3, 3000, 6000, 10000, 14000, 11, 63047, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Guardian Lasher - Cast Guardian''s Lash 10'),
    (3343003, 33430, 0, 0, 100, 5, 3000, 6000, 10000, 14000, 11, 63550, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Guardian Lasher - Cast Guardian''s Lash 25');
    
    -- Forest Swarmer
    UPDATE `creature_template` SET `spell1` = 63059, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33431;
    UPDATE `creature_template` SET `spell1` = 63059, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33731;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33431);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3343101, 33431, 0, 0, 100, 1, 3000, 9000, 10000, 20000, 11, 63059, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Forest Swarmer - Cast Pollinate');
    DELETE FROM conditions WHERE SourceEntry = 63059;
    INSERT INTO `conditions` VALUES
    ('13','0','63059','0','18','1','33430','0','0','',NULL);
    
    -- Guardian of Life
    UPDATE `creature_template` SET `spell1` = 63226, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33528;
    UPDATE `creature_template` SET `spell1` = 63551, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33733;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33528);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3352801, 33528, 0, 0, 100, 3, 3000, 9000, 15000, 20000, 11, 63226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Guardian of Life - Cast Poison Breath 10'),
    (3352802, 33528, 0, 0, 100, 5, 3000, 9000, 15000, 20000, 11, 63551, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Guardian of Life - Cast Poison Breath 25');
    
    -- Nature's Blade
    UPDATE `creature_template` SET `spell1` = 63247, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33527;
    UPDATE `creature_template` SET `spell1` = 63568, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33741;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33527);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3352701, 33527, 0, 0, 100, 3, 3000, 9000, 18000, 24000, 11, 63247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Nature Blade - Cast Living Tsunami 10'),
    (3352702, 33527, 0, 0, 100, 5, 3000, 9000, 18000, 24000, 11, 63568, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Nature Blade - Cast Living Tsunami 25');
    
    -- Ironroot Lasher
    UPDATE `creature_template` SET `spell1` = 63240, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33526;
    UPDATE `creature_template` SET `spell1` = 63553, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33734;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33526);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3352601, 33526, 0, 0, 100, 3, 3000, 8000, 12000, 16000, 11, 63240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Ironroot Lasher - Cast Ironroot Thorns 10'),
    (3352602, 33526, 0, 0, 100, 5, 3000, 8000, 12000, 16000, 11, 63553, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Ironroot Lasher - Cast Ironroot Thorns 25');
    
    -- Mangrove Ent
    UPDATE `creature_template` SET `spell1` = 63272, `spell2` = 63242, `spell3` = 63241, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33525;
    UPDATE `creature_template` SET `spell1` = 63272, `spell2` = 63556, `spell3` = 63554, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33735;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33525);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3352501, 33525, 0, 0, 100, 1, 8000, 12000, 25000, 30000, 11, 63272, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mangrove Ent - Cast Hurricane'),
    (3352502, 33525, 0, 0, 100, 3, 12000, 16000, 12000, 16000, 11, 63242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mangrove Ent - Cast Nourish 10'),
    (3352503, 33525, 0, 0, 100, 5, 12000, 16000, 12000, 16000, 11, 63556, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mangrove Ent - Cast Nourish 25'),
    (3352504, 33525, 0, 0, 100, 3, 25000, 30000, 25000, 30000, 11, 63241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mangrove Ent - Cast Tranquility 10'),
    (3352505, 33525, 0, 0, 100, 5, 25000, 30000, 25000, 30000, 11, 63554, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Mangrove Ent - Cast Tranquility 25');
    
    -- Misguided Nymph
    UPDATE `creature_template` SET `spell1` = 63082, `spell2` = 63111, `spell3` = 63136, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33355;
    UPDATE `creature_template` SET `spell1` = 63559, `spell2` = 63562, `spell3` = 63564, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33737;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33355);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3335501, 33355, 0, 0, 100, 3, 8000, 12000, 25000, 30000, 11, 63082, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Misguided Nymph - Cast Bind Life 10'),
    (3335502, 33355, 0, 0, 100, 5, 8000, 12000, 25000, 30000, 11, 63559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Misguided Nymph - Cast Bind Life 25'),
    (3335503, 33355, 0, 0, 100, 3, 4000, 6000, 12000, 16000, 11, 63111, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Misguided Nymph - Cast Frost Spear 10'),
    (3335504, 33355, 0, 0, 100, 5, 4000, 6000, 12000, 16000, 11, 63562, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Misguided Nymph - Cast Frost Spear 25'),
    (3335505, 33355, 0, 0, 100, 3, 15000, 20000, 15000, 20000, 11, 63136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Misguided Nymph - Cast Winter''s Embrace 10'),
    (3335506, 33355, 0, 0, 100, 5, 15000, 20000, 15000, 20000, 11, 63564, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Misguided Nymph - Cast Winter''s Embrace 25');
    
    -- Corrupted Servitor
    UPDATE `creature_template` SET `spell1` = 63169, `spell2` = 63149, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'EventAI' WHERE `entry` = 33354;
    UPDATE `creature_template` SET `spell1` = 63549, `spell2` = 63149, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 33729;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33354);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3335401, 33354, 0, 0, 100, 3, 2000, 4000, 20000, 25000, 11, 63169, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Corrupted Servitor - Cast Petrify Joints 10'),
    (3335402, 33354, 0, 0, 100, 5, 2000, 4000, 20000, 25000, 11, 63549, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Corrupted Servitor - Cast Petrify Joints 25'),
    (3335403, 33354, 0, 0, 100, 1, 6000, 8000, 12000, 16000, 11, 63149, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Corrupted Servitor - Cast Violent Earth');
    
    -- Arachnopod Destroyer
    UPDATE `creature_template` SET `spell1` = 64717, `spell2` = 64776, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'EventAI' WHERE `entry` = 34183;
    UPDATE `creature_template` SET `spell1` = 64717, `spell2` = 64776, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 34214;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34183);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3418301, 34183, 0, 0, 100, 1, 2000, 4000, 12000, 16000, 11, 64717, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Arachnopod Destroyer - Cast Flame Spray'),
    (3418302, 34183, 0, 0, 100, 1, 8000, 10000, 12000, 16000, 11, 64776, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Arachnopod Destroyer - Cast Machine Gun');
    
    -- Boomer XP-500
    UPDATE `creature_template` SET `spell1` = 55714, `AIName` = 'EventAI' WHERE `entry` = 34192;
    UPDATE `creature_template` SET `spell1` = 55714 WHERE `entry` = 34216;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34192);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3419201, 34192, 9, 0, 100, 1, 0, 3, 0, 0, 11, 55714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Boomer XP-500 - Explode');
    
    -- Clockwork Sapper
    UPDATE `creature_template` SET `spell1` = 64740, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'EventAI' WHERE `entry` = 34193;
    UPDATE `creature_template` SET `spell1` = 64740, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 34220;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=34193);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3419301, 34193, 0, 0, 100, 1, 2000, 6000, 12000, 16000, 11, 64740, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Clockwork Sapper - Cast Energy Sap');
    
    -- Twilight Adherent
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63760, `spell3` = 13704, `equipment_id` = 1848, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33818;
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63760, `spell3` = 13704, `equipment_id` = 1848, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33827;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33818);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3381801, 33818, 0, 0, 100, 1, 10000, 16000, 20000, 25000, 11, 64663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Adherent - Cast Arcane Burst'),
    (3381802, 33818, 0, 0, 100, 1, 18000, 24000, 20000, 24000, 11, 63760, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Adherent - Cast Greater Heal'),
    (3381803, 33818, 0, 0, 100, 1, 2000, 4000, 10000, 16000, 11, 13704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Adherent - Cast Psychic Scream');
    
    -- Twilight Guardian
    UPDATE `creature_template` SET `spell1` = 52719, `spell2` = 62317, `spell3` = 63757, `mechanic_immune_mask` = 33554513, `equipment_id` = 1852, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33822;
    UPDATE `creature_template` SET `spell1` = 52719, `spell2` = 62317, `spell3` = 63757, `mechanic_immune_mask` = 33554513, `equipment_id` = 1852, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33828;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33822);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3382201, 33822, 0, 0, 100, 1, 6000, 10000, 8000, 10000, 11, 52719, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Guardian - Cast Concussion Blow'),
    (3382202, 33822, 0, 0, 100, 1, 2000, 3000, 3000, 6000, 11, 62317, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Guardian - Cast Devastate'),
    (3382203, 33822, 0, 0, 100, 1, 16000, 18000, 14000, 16000, 11, 63757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Guardian - Cast Thunderclap');
    
    -- Twilight Shadowblade
    UPDATE `creature_template` SET `spell1` = 63753, `mechanic_immune_mask` = 33554513,  `equipment_id` = 1862, `baseattacktime` = 1000, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33824;
    UPDATE `creature_template` SET `spell1` = 63753, `mechanic_immune_mask` = 33554513,  `equipment_id` = 1862, `baseattacktime` = 1000, `mingold` = 7100, `maxgold` = 7600 WHERE `entry` = 33831;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33824);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3382401, 33824, 0, 0, 100, 5, 6000, 8000, 14000, 16000, 11, 63753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Shadowblade - Cast Fan of Knives');
    
    -- Twilight Slayer
    UPDATE `creature_template` SET `spell1` = 63784, `spell2` = 35054, `mechanic_immune_mask` = 33554513, `equipment_id` = 1847, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33823;
    UPDATE `creature_template` SET `spell1` = 63784, `spell2` = 35054, `mechanic_immune_mask` = 33554513, `equipment_id` = 1847, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33832;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33823);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3382301, 33823, 0, 0, 100, 1, 3000, 5000, 16000, 20000, 11, 35054, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Slayer - Cast Mortal Strike'),
    (3382302, 33823, 0, 0, 100, 1, 9000, 12000, 28000, 34000, 11, 63784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Slayer - Cast Bladestorm');
    
    UPDATE `creature_template` SET `equipment_id` = 1849 WHERE `entry` = 32885;
    UPDATE `creature_template` SET `equipment_id` = 1850 WHERE `entry` = 32908;
    
    -- Faceless Horror
    UPDATE `creature_template` SET `spell1` = 64429, `spell2` = 63722, `spell3` = 63710, `spell4` = 63703, `mechanic_immune_mask` = 33554513, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33772;
    UPDATE `creature_template` SET `spell1` = 64429, `spell2` = 63722, `spell3` = 63710, `spell4` = 63703, `mechanic_immune_mask` = 33554513, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33773;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33772);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3377201, 33772, 0, 0, 100, 1, 18000, 22000, 15000, 20000, 11, 64429, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Faceless Horror - Cast Death Grip'),
    (3377202, 33772, 0, 0, 100, 1, 2000, 4000, 10000, 12000, 11, 63722, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Faceless Horror - Cast Shadow Crash'),
    (3377203, 33772, 4, 0, 100, 1, 0, 0, 0, 0, 11, 63703, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Faceless Horror - Cast Void Wave');
    
    -- Twilight Frost Mage
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63758, `spell3` = 63912, `spell4` = 63913, `equipment_id` = 1849, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33819;
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63758, `spell3` = 63912, `spell4` = 63913, `equipment_id` = 1849, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33829;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33819);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3381901, 33819, 0, 0, 100, 1, 10000, 16000, 20000, 25000, 11, 64663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Frost Mage - Cast Arcane Burst'),
    (3381902, 33819, 0, 0, 100, 1, 1000, 2000, 6000, 8000, 11, 63913, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Frost Mage - Cast Frostbolt'),
    (3381903, 33819, 0, 0, 100, 1, 2000, 4000, 10000, 16000, 11, 63758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Frost Mage - Cast Frost Bolt Volley'),
    (3381904, 33819, 0, 0, 100, 1, 8000, 10000, 12000, 16000, 11, 63912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Frost Mage - Cast Frost Nova');
    
    -- Twilight Pyromancer
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63789, `spell3` = 63775, `equipment_id` = 1848, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'EventAI' WHERE `entry` = 33820;
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63789, `spell3` = 63775, `equipment_id` = 1848, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33830;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33820);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3382001, 33820, 0, 0, 100, 1, 10000, 16000, 20000, 25000, 11, 64663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Pyromancer - Cast Arcane Burst'),
    (3382002, 33820, 0, 0, 100, 1, 1000, 2000, 6000, 8000, 11, 63789, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Pyromancer - Cast Fireball'),
    (3382003, 33820, 0, 0, 100, 1, 2000, 4000, 10000, 16000, 11, 63775, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Twilight Pyromancer - Cast Flamestrike');
    
    -- Enslaved Fire Elemental
    UPDATE `creature_template` SET `spell1` = 38064, `spell2` = 63778, `mechanic_immune_mask` = 33554513, `AIName` = 'EventAI' WHERE `entry` = 33838;
    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=33838);
    INSERT INTO `creature_ai_scripts` VALUES 
    (3383801, 33838, 0, 0, 100, 1, 4000, 8000, 12000, 14000, 11, 38064, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Enslaved Fire Elemental - Cast Blast Wave'),
    (3383802, 33838, 4, 0, 100, 1, 0, 0, 0, 0, 11, 63778, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Enslaved Fire Elemental - Cast Fire Shield');


    ulduar_smartai.sql
    Spoiler untuk ulduar_smartai.sql :

    Code:
    -- Runeforged Sentry
    UPDATE `creature_template` SET `spell1` = 64852, `spell2` = 64870, `spell3` = 64847, `AIName` = 'SmartAI' WHERE `entry` = 34234;
    UPDATE `creature_template` SET `spell1` = 64852, `spell2` = 64870, `spell3` = 64847 WHERE `entry` = 34235;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34234);
    INSERT INTO `smart_scripts` VALUES 
    (34234, 0, 0, 0, 0, 0, 100, 0, 2000, 2000, 10000, 10000, 11, 64852, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Runeforged Sentry - Cast Flaming Rune'),
    (34234, 0, 1, 0, 0, 0, 100, 0, 3000, 5000, 5000, 7000, 11, 64870, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Runeforged Sentry - Cast Lava Burst'),
    (34234, 0, 2, 0, 0, 0, 100, 0, 2500, 3000, 12000, 12000, 11, 64847, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Runeforged Sentry - Cast Runed Flame Jets');
    
    -- Steelforged Defender
    UPDATE `creature_template` SET `spell1` = 62845, `spell2` = 57780, `spell3` = 50370, `AIName` = 'SmartAI' WHERE `entry` = 33236;
    UPDATE `creature_template` SET `spell1` = 62845, `spell2` = 57780, `spell3` = 50370 WHERE `entry` = 34113;
    UPDATE `creature` SET `spawntimesecs` = 604800 WHERE `id` IN (33236, 33838);
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33236);
    INSERT INTO `smart_scripts` VALUES 
    (33236, 0, 0, 0, 0, 0, 100, 0, 4000, 6000, 15000, 20000, 11, 62845, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Steelforged Defender - Cast Hamstring'),
    (33236, 0, 1, 0, 0, 0, 100, 0, 2000, 4000, 6000, 8000, 11, 57780, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Steelforged Defender - Cast Lightning Bolt'),
    (33236, 0, 2, 0, 0, 0, 100, 0, 5000, 6000, 4000, 6000, 11, 50370, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Steelforged Defender - Cast Sunder Armor');
    
    -- Mechagnome Battletank
    UPDATE `creature_template` SET `spell1` = 64693, `spell2` = 64953, `AIName` = 'SmartAI' WHERE `entry` = 34164;
    UPDATE `creature_template` SET `spell1` = 64693, `spell2` = 64953 WHERE `entry` = 34165;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34164);
    INSERT INTO `smart_scripts` VALUES 
    (34164, 0, 0, 0, 0, 0, 100, 0, 3000, 4000, 6000, 8000, 11, 64693, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Mechagnome Battletank - Cast Flame Cannon'),
    (34164, 0, 1, 0, 0, 0, 100, 0, 10000, 10000, 15000, 20000, 11, 64953, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,'Mechagnome Battletank - Cast Jump Attack');
    
    -- Ulduar Colossus
    UPDATE `creature_template` SET `spell1` = 62625, `AIName` = 'SmartAI' WHERE `entry` = 33237;
    UPDATE `creature_template` SET `spell1` = 62625 WHERE `entry` = 34105;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33237);
    INSERT INTO `smart_scripts` VALUES 
    (33237, 0, 0, 0, 0, 0, 100, 0, 8000, 10000, 15000, 20000, 11, 62625, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Ulduar Colossus - Cast Ground Slam');
    
    -- invisible triggers
    UPDATE `creature_template` SET `flags_extra` = 2 WHERE `entry` IN (33377, 33742, 34286, 33500, 33406, 33575);
    
    -- Molten Colossus
    UPDATE `creature_template` SET `spell1` = 64697, `spell2` = 64698, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 34069;
    UPDATE `creature_template` SET `spell1` = 64697, `spell2` = 64698, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34185;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34069);
    INSERT INTO `smart_scripts` VALUES 
    (34069, 0, 0, 0, 0, 0, 100, 0, 6000, 10000, 10000, 12000, 11, 64697, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Molten Colossus - Cast Earthquake'),
    (34069, 0, 1, 0, 0, 0, 100, 0, 10000, 10000, 15000, 20000, 11, 64698, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Molten Colossus - Cast Pyroblast');
    
    -- Magma Rager
    UPDATE `creature_template` SET `spell1` = 64773, `spell2` = 64746, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 34086;
    UPDATE `creature_template` SET `spell1` = 64773, `spell2` = 64746, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34201;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34086);
    INSERT INTO `smart_scripts` VALUES 
    (34086, 0, 0, 0, 0, 0, 100, 0, 2000, 4000, 6000, 8000, 11, 64773, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Magma Rager - Cast Fire Blast'),
    (34086, 0, 1, 0, 0, 0, 100, 0, 8000, 16000, 15000, 25000, 11, 64746, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Magma Rager - Cast Superheated winds');
    UPDATE `creature_template` SET `unit_flags` = 33718790, modelid1 = 11686, modelid2 = 0, `spell1` = 64724, `AIName` = 'SmartAI' WHERE `entry` = 34194;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34194);
    INSERT INTO `smart_scripts` VALUES 
    (34194, 0, 0, 0, 0, 0, 100, 0, 1000, 2000, 10000, 10000, 11, 64724, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Superheated Winds');
    
    -- Forge Construct
    UPDATE `creature_template` SET `spell1` = 64719, `spell2` = 64720, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 34085;
    UPDATE `creature_template` SET `spell1` = 64719, `spell2` = 64721, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34186;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34085);
    INSERT INTO `smart_scripts` VALUES 
    (34085, 0, 0, 0, 0, 0, 100, 0, 8000, 12000, 10000, 16000, 11, 64719, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,'Forge Construct - Cast Charge'),
    (34085, 0, 1, 0, 0, 0, 100, 2, 2000, 6000, 6000, 8000, 11, 64720, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Forge Construct - Cast Flame Emission 10'),
    (34085, 0, 2, 0, 0, 0, 100, 4, 2000, 6000, 6000, 8000, 11, 64721, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Forge Construct - Cast Flame Emission 25');
    
    -- XB-488 Disposalbot
    UPDATE `creature_template` SET `spell1` = 65080, `spell2` = 65084, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 34273;
    UPDATE `creature_template` SET `spell1` = 65104, `spell2` = 65084, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34274;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34273);
    INSERT INTO `smart_scripts` VALUES 
    (34273, 0, 0, 0, 2, 0, 100, 0, 30, 20, 0, 0, 11, 65084, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'XB-488 Disposalbot - Cast Self Destruct'),
    (34273, 0, 1, 0, 0, 0, 100, 2, 2000, 6000, 10000, 15000, 11, 65080, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'XB-488 Disposalbot - Cast Cut Scrap Metal 10'),
    (34273, 0, 2, 0, 0, 0, 100, 4, 2000, 6000, 10000, 15000, 11, 65104, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'XB-488 Disposalbot - Cast Cut Scrap Metal 25');
    
    -- Parts Recovery Technician
    UPDATE `creature_template` SET `spell1` = 65071, `spell2` = 65070, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554432, `AIName` = 'SmartAI' WHERE `entry` = 34267;
    UPDATE `creature_template` SET `spell1` = 65071, `spell2` = 65070, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554432 WHERE `entry` = 34268;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34267);
    INSERT INTO `smart_scripts` VALUES 
    (34267, 0, 0, 0, 0, 0, 100, 0, 8000, 12000, 10000, 15000, 11, 65071, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,'Parts Recovery Technician - Cast Mechano Kick'),
    (34267, 0, 1, 0, 0, 0, 100, 0, 6000, 8000, 20000, 25000, 11, 65070, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Parts Recovery Technician - Cast Defense Matrix');
    
    -- XD-175 Compactobot
    UPDATE `creature_template` SET `spell1` = 65073, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 34271;
    UPDATE `creature_template` SET `spell1` = 65106, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34272;
    UPDATE `creature_template` SET `mingold` = 7100, `maxgold` = 7600 WHERE `entry` = 34269;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34271);
    INSERT INTO `smart_scripts` VALUES 
    (34271, 0, 0, 0, 0, 0, 100, 2, 8000, 12000, 15000, 20000, 11, 65073, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,'XD-175 Compactobot - Cast Trash Compactor 10'),
    (34271, 0, 1, 0, 0, 0, 100, 4, 8000, 12000, 15000, 20000, 11, 65106, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,'XD-175 Compactobot - Cast Trash Compactor 25');
    
    -- Lightning Charged Iron Dwarf
    UPDATE `creature_template` SET `spell1` = 64889, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 34199;
    UPDATE `creature_template` SET `spell1` = 64975, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34237;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34199);
    INSERT INTO `smart_scripts` VALUES 
    (34199, 0, 0, 0, 0, 0, 100, 2, 1000, 2000, 10000, 15000, 11, 64889, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Lightning Charged Iron Dwarf - Cast Lightning Charged 10'),
    (34199, 0, 1, 0, 0, 0, 100, 4, 1000, 2000, 10000, 15000, 11, 64975, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Lightning Charged Iron Dwarf - Cast Lightning Charged 25');
    
    -- Hardened Iron Golem
    UPDATE `creature_template` SET `spell1` = 64877, `spell2` = 64874, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'SmartAI' WHERE `entry` = 34190;
    UPDATE `creature_template` SET `spell1` = 64877, `spell2` = 64967, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 34229;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34190);
    INSERT INTO `smart_scripts` VALUES 
    (34190, 0, 0, 0, 0, 0, 100, 0, 4000, 8000, 25000, 30000, 11, 64877, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Hardened Iron Golem - Cast Harden Fists'),
    (34190, 0, 1, 0, 0, 0, 100, 2, 5000, 7000, 20000, 30000, 11, 64874, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Hardened Iron Golem - Cast Rune Punch 10'),
    (34190, 0, 2, 0, 0, 0, 100, 4, 5000, 7000, 20000, 30000, 11, 64967, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Hardened Iron Golem - Cast Rune Punch 25');
    
    -- Iron Mender
    UPDATE `creature_template` SET `spell1` = 64918, `spell2` = 64903, `spell3` = 64897, `mechanic_immune_mask` = 33554496, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 34198;
    UPDATE `creature_template` SET `spell1` = 64971, `spell2` = 64970, `spell3` = 64968, `mechanic_immune_mask` = 33554496, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34236;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34198);
    INSERT INTO `smart_scripts` VALUES 
    (34198, 0, 0, 0, 0, 0, 100, 2, 2000, 4000, 4000, 6000, 11, 64918, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Iron Mender - Cast Electro Shock 10'),
    (34198, 0, 1, 0, 0, 0, 100, 4, 2000, 4000, 4000, 6000, 11, 64971, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Iron Mender - Cast Electro Shock 25'),
    (34198, 0, 2, 0, 0, 0, 100, 2, 3000, 6000, 10000, 15000, 11, 64903, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Iron Mender - Cast Fuse Lightning 10'),
    (34198, 0, 3, 0, 0, 0, 100, 4, 3000, 6000, 10000, 15000, 11, 64970, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Iron Mender - Cast Fuse Lightning 25'),
    (34198, 0, 4, 0, 0, 0, 100, 2, 10000, 25000, 30000, 45000, 11, 64897, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Iron Mender - Cast Fuse Metal 10'),
    (34198, 0, 5, 0, 0, 0, 100, 4, 10000, 25000, 30000, 45000, 11, 64968, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Iron Mender - Cast Fuse Metal 25');
    
    -- Rune Etched Sentry
    UPDATE `creature_template` SET `spell1` = 64852, `spell2` = 64870, `spell3` = 64847, `mechanic_immune_mask` = 33554496, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 34196;
    UPDATE `creature_template` SET `spell1` = 64852, `spell2` = 64870, `spell3` = 64847, `mechanic_immune_mask` = 33554496, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34245;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34196);
    INSERT INTO `smart_scripts` VALUES 
    (34196, 0, 0, 0, 0, 0, 100, 0, 2000, 2000, 10000, 10000, 11, 64852, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Rune Etched Sentry - Cast Flaming Rune'),
    (34196, 0, 1, 0, 0, 0, 100, 0, 3000, 5000, 5000, 7000, 11, 64870, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Rune Etched Sentry - Cast Lava Burst'),
    (34196, 0, 2, 0, 0, 0, 100, 0, 2500, 3000, 12000, 15000, 11, 64847, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Rune Etched Sentry - Cast Runed Flame Jets');
    
    -- Chamber Overseer
    UPDATE `creature_template` SET `spell1` = 64820, `spell2` = 64825, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'SmartAI' WHERE `entry` = 34197;
    UPDATE `creature_template` SET `spell1` = 64943, `spell2` = 64944, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 34226;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34197);
    INSERT INTO `smart_scripts` VALUES 
    (34197, 0, 0, 0, 0, 0, 100, 2, 4000, 8000, 6000, 8000, 11, 64820, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Chamber Overseer - Cast Devastating Leap 10'),
    (34197, 0, 1, 0, 0, 0, 100, 4, 4000, 8000, 6000, 8000, 11, 64943, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Chamber Overseer - Cast Devastating Leap 25'),
    (34197, 0, 2, 0, 0, 0, 100, 2, 10000, 12000, 8000, 12000, 11, 64825, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Chamber Overseer - Cast Staggering Roar 10'),
    (34197, 0, 3, 0, 0, 0, 100, 4, 10000, 12000, 8000, 12000, 11, 64944, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Chamber Overseer - Cast Staggering Roar 25');
    
    -- Storm Tempered Keeper
    UPDATE `creature_template` SET `spell1` = 63541, `spell2` = 63630, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'SmartAI' WHERE `entry` IN (33722, 33699);
    UPDATE `creature_template` SET `spell1` = 63541, `spell2` = 63630, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` IN (33723, 33700);
    DELETE FROM `smart_scripts` WHERE `entryorguid` IN (33722, 33699);
    INSERT INTO `smart_scripts` VALUES 
    (33722, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 75, 63630, 33699, 0, 0, 0, 0, 11, 33699, 50, 0, 0, 0, 0, 0,'Storm Tempered Keeper - Cast Vengeful Surge on death'),
    (33722, 0, 1, 0, 0, 0, 100, 0, 3000, 6000, 10000, 15000, 11, 63541, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Storm Tempered Keeper - Cast Forked Lightning'),
    (33722, 0, 2, 0, 0, 0, 100, 0, 3000, 3000, 3000, 3000, 11, 63539, 0, 0, 0, 0, 0, 9, 33699, 15, 50, 0, 0, 0, 0,'Storm Tempered Keeper - Cast Separation Anxiety if separated'),
    (33699, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 75, 63630, 33722, 0, 0, 0, 0, 11, 33722, 50, 0, 0, 0, 0, 0,'Storm Tempered Keeper - Cast Vengeful Surge on death'),
    (33699, 0, 1, 0, 0, 0, 100, 0, 3000, 6000, 10000, 15000, 11, 63541, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Storm Tempered Keeper - Cast Forked Lightning'),
    (33699, 0, 2, 0, 0, 0, 100, 0, 3000, 3000, 3000, 3000, 11, 63539, 0, 0, 0, 0, 0, 9, 33722, 15, 50, 0, 0, 0, 0,'Storm Tempered Keeper - Cast Separation Anxiety if separated');
    
    -- Champion of Hodir
    UPDATE `creature_template` SET `spell1` = 64639, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 34133;
    UPDATE `creature_template` SET `spell1` = 64652, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34139;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34133);
    INSERT INTO `smart_scripts` VALUES 
    (34133, 0, 0, 0, 0, 0, 100, 2, 3000, 6000, 12000, 16000, 11, 64639, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Champion of Hodir - Cast Stomp 10'),
    (34133, 0, 1, 0, 0, 0, 100, 4, 3000, 6000, 12000, 16000, 11, 64652, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Champion of Hodir - Cast Stomp 25');
    
    -- Winter Jormungar
    UPDATE `creature_template` SET `spell1` = 64638, `AIName` = 'SmartAI' WHERE `entry` = 34137;
    UPDATE `creature_template` SET `spell1` = 64638 WHERE `entry` = 34140;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34137);
    INSERT INTO `smart_scripts` VALUES 
    (34137, 0, 0, 0, 0, 0, 100, 0, 3000, 6000, 6000, 9000, 11, 64638, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Winter Jormungar - Cast Acidic Bite');
    
    -- Winter Revenant
    UPDATE `creature_template` SET `spell1` = 64642, `spell2` = 64643, `spell3` = 64644, `mechanic_immune_mask` = 33554496, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 34134;
    UPDATE `creature_template` SET `spell1` = 64653, `spell2` = 64643, `spell3` = 64644, `mechanic_immune_mask` = 33554496, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 34141;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34134);
    INSERT INTO `smart_scripts` VALUES 
    (34134, 0, 0, 0, 0, 0, 100, 2, 8000, 12000, 15000, 20000, 11, 64642, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Winter Revenant - Cast Blizzard 10'),
    (34134, 0, 1, 0, 0, 0, 100, 4, 8000, 12000, 15000, 20000, 11, 64653, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Winter Revenant - Cast Blizzard 25'),
    (34134, 0, 2, 0, 0, 0, 100, 0, 3000, 5000, 10000, 12000, 11, 64643, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Winter Revenant - Cast Whirling Strike'),
    (34134, 0, 3, 0, 0, 0, 100, 0, 15000, 20000, 60000, 75000, 11, 64644, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Winter Revenant - Cast Shield of the Winter Revenant');
    
    -- Winter Rumbler
    UPDATE `creature_template` SET `spell1` = 64645, `spell2` = 64647, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'SmartAI' WHERE `entry` = 34135;
    UPDATE `creature_template` SET `spell1` = 64645, `spell2` = 64654, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 34142;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34135);
    INSERT INTO `smart_scripts` VALUES 
    (34135, 0, 0, 0, 0, 0, 100, 0, 6000, 12000, 10000, 16000, 11, 64645, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Winter Rumbler - Cast Cone of Cold'),
    (34135, 0, 1, 0, 0, 0, 100, 2, 3000, 6000, 8000, 12000, 11, 64647, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Winter Rumbler - Cast Snow Blindness 10'),
    (34135, 0, 2, 0, 0, 0, 100, 4, 3000, 6000, 8000, 12000, 11, 64654, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Winter Rumbler - Cast Snow Blindness 25');
    
    -- Guardian Lasher
    UPDATE `creature_template` SET `spell1` = 63007, `spell2` = 63047, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'SmartAI' WHERE `entry` = 33430;
    UPDATE `creature_template` SET `spell1` = 63007, `spell2` = 63550, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 33732;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33430);
    INSERT INTO `smart_scripts` VALUES 
    (33430, 0, 0, 0, 4, 0, 100, 0, 0, 0, 0, 0, 75, 63007, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Guardian Lasher - Cast Guardian Pheromones on aggro'),
    (33430, 0, 1, 0, 0, 0, 100, 2, 3000, 6000, 8000, 12000, 11, 63047, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Guardian Lasher - Cast Guardian''s Lash 10'),
    (33430, 0, 2, 0, 0, 0, 100, 4, 3000, 6000, 8000, 12000, 11, 63550, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Guardian Lasher - Cast Guardian''s Lash 25');
    
    -- Forest Swarmer
    UPDATE `creature_template` SET `spell1` = 63059, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33431;
    UPDATE `creature_template` SET `spell1` = 63059, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33731;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33431);
    INSERT INTO `smart_scripts` VALUES 
    (33431, 0, 0, 0, 0, 0, 100, 0, 3000, 9000, 10000, 20000, 11, 63059, 0, 0, 0, 0, 0, 11, 33430, 40, 0, 0, 0, 0, 0,'Forest Swarmer - Cast Pollinate');
    DELETE FROM conditions WHERE SourceEntry = 63059;
    
    -- Guardian of Life
    UPDATE `creature_template` SET `spell1` = 63226, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33528;
    UPDATE `creature_template` SET `spell1` = 63551, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33733;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33528);
    INSERT INTO `smart_scripts` VALUES 
    (33528, 0, 0, 0, 0, 0, 100, 2, 3000, 9000, 15000, 20000, 11, 63226, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Guardian of Life - Cast Poison Breath 10'),
    (33528, 0, 1, 0, 0, 0, 100, 4, 3000, 9000, 15000, 20000, 11, 63551, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Guardian of Life - Cast Poison Breath 25');
    
    -- Nature's Blade
    UPDATE `creature_template` SET `spell1` = 63247, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33527;
    UPDATE `creature_template` SET `spell1` = 63568, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33741;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33527);
    INSERT INTO `smart_scripts` VALUES 
    (33527, 0, 0, 0, 0, 0, 100, 2, 3000, 9000, 18000, 24000, 11, 63247, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Nature Blade - Cast Living Tsunami 10'),
    (33527, 0, 1, 0, 0, 0, 100, 4, 3000, 9000, 18000, 24000, 11, 63568, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Nature Blade - Cast Living Tsunami 25');
    
    -- Ironroot Lasher
    UPDATE `creature_template` SET `spell1` = 63240, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33526;
    UPDATE `creature_template` SET `spell1` = 63553, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33734;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33526);
    INSERT INTO `smart_scripts` VALUES 
    (33526, 0, 0, 0, 0, 0, 100, 2, 3000, 8000, 12000, 16000, 11, 63240, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Ironroot Lasher - Cast Ironroot Thorns 10'),
    (33526, 0, 1, 0, 0, 0, 100, 4, 3000, 8000, 12000, 16000, 11, 63553, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Ironroot Lasher - Cast Ironroot Thorns 25');
    
    -- Mangrove Ent
    UPDATE `creature_template` SET `spell1` = 63272, `spell2` = 63242, `spell3` = 63241, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33525;
    UPDATE `creature_template` SET `spell1` = 63272, `spell2` = 63556, `spell3` = 63554, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33735;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33525);
    INSERT INTO `smart_scripts` VALUES 
    (33525, 0, 0, 0, 0, 0, 100, 0, 8000, 12000, 16000, 20000, 11, 63272, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Mangrove Ent - Cast Hurricane'),
    (33525, 0, 1, 0, 0, 0, 100, 2, 4000, 6000, 12000, 16000, 11, 63242, 0, 0, 0, 0, 0, 11, 0, 30, 0, 0, 0, 0, 0,'Mangrove Ent - Cast Nourish 10'),
    (33525, 0, 2, 0, 0, 0, 100, 4, 4000, 6000, 12000, 16000, 11, 63556, 0, 0, 0, 0, 0, 11, 0, 30, 0, 0, 0, 0, 0,'Mangrove Ent - Cast Nourish 25'),
    (33525, 0, 3, 0, 0, 0, 100, 2, 20000, 25000, 20000, 25000, 11, 63241, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Mangrove Ent - Cast Tranquility 10'),
    (33525, 0, 4, 0, 0, 0, 100, 4, 20000, 25000, 20000, 25000, 11, 63554, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Mangrove Ent - Cast Tranquility 25');
    
    -- Misguided Nymph
    UPDATE `creature_template` SET `spell1` = 63082, `spell2` = 63111, `spell3` = 63136, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33355;
    UPDATE `creature_template` SET `spell1` = 63559, `spell2` = 63562, `spell3` = 63564, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33737;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33355);
    INSERT INTO `smart_scripts` VALUES 
    (33355, 0, 0, 0, 0, 0, 100, 2, 8000, 12000, 16000, 20000, 11, 63082, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Misguided Nymph - Cast Bind Life 10'),
    (33355, 0, 1, 0, 0, 0, 100, 4, 8000, 12000, 16000, 20000, 11, 63559, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Misguided Nymph - Cast Bind Life 25'),
    (33355, 0, 2, 0, 0, 0, 100, 2, 4000, 6000, 12000, 16000, 11, 63111, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Misguided Nymph - Cast Frost Spear 10'),
    (33355, 0, 3, 0, 0, 0, 100, 4, 4000, 6000, 12000, 16000, 11, 63562, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Misguided Nymph - Cast Frost Spear 25'),
    (33355, 0, 4, 0, 0, 0, 100, 2, 15000, 20000, 15000, 20000, 11, 63136, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Misguided Nymph - Cast Winter''s Embrace 10'),
    (33355, 0, 5, 0, 0, 0, 100, 4, 15000, 20000, 15000, 20000, 11, 63564, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Misguided Nymph - Cast Winter''s Embrace 25');
    
    -- Corrupted Servitor
    UPDATE `creature_template` SET `spell1` = 63169, `spell2` = 63149, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'SmartAI' WHERE `entry` = 33354;
    UPDATE `creature_template` SET `spell1` = 63549, `spell2` = 63149, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 33729;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33354);
    INSERT INTO `smart_scripts` VALUES 
    (33354, 0, 0, 0, 0, 0, 100, 2, 2000, 4000, 16000, 20000, 11, 63169, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Corrupted Servitor - Cast Petrify Joints 10'),
    (33354, 0, 1, 0, 0, 0, 100, 4, 2000, 4000, 16000, 20000, 11, 63549, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Corrupted Servitor - Cast Petrify Joints 25'),
    (33354, 0, 2, 0, 0, 0, 100, 0, 6000, 8000, 12000, 16000, 11, 63149, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Corrupted Servitor - Cast Violent Earth');
    
    -- Arachnopod Destroyer
    UPDATE `creature_template` SET `spell1` = 64717, `spell2` = 64776, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'SmartAI' WHERE `entry` = 34183;
    UPDATE `creature_template` SET `spell1` = 64717, `spell2` = 64776, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 34214;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34183);
    INSERT INTO `smart_scripts` VALUES 
    (34183, 0, 0, 0, 0, 0, 100, 0, 2000, 4000, 12000, 16000, 11, 64717, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Arachnopod Destroyer - Cast Flame Spray'),
    (34183, 0, 1, 0, 0, 0, 100, 0, 8000, 10000, 12000, 16000, 11, 64776, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Arachnopod Destroyer - Cast Machine Gun');
    
    -- Boomer XP-500
    UPDATE `creature_template` SET `spell1` = 55714, `AIName` = 'SmartAI' WHERE `entry` = 34192;
    UPDATE `creature_template` SET `spell1` = 55714 WHERE `entry` = 34216;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34192);
    INSERT INTO `smart_scripts` VALUES 
    (34192, 0, 0, 0, 9, 0, 100, 0, 0, 2, 1000, 1000, 11, 55714, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Boomer XP-500 - Explode');
    
    -- Clockwork Sapper
    UPDATE `creature_template` SET `spell1` = 64740, `mingold` = 7100, `maxgold` = 7600, `mechanic_immune_mask` = 33554496, `AIName` = 'SmartAI' WHERE `entry` = 34193;
    UPDATE `creature_template` SET `spell1` = 64740, `mingold` = 14200, `maxgold` = 15600, `mechanic_immune_mask` = 33554496 WHERE `entry` = 34220;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=34193);
    INSERT INTO `smart_scripts` VALUES 
    (34193, 0, 0, 0, 0, 0, 100, 0, 2000, 6000, 12000, 16000, 11, 64740, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Clockwork Sapper - Cast Energy Sap');
    
    -- Twilight Adherent
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63760, `spell3` = 13704, `equipment_id` = 1848, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33818;
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63760, `spell3` = 13704, `equipment_id` = 1848, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33827;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33818);
    INSERT INTO `smart_scripts` VALUES 
    (33818, 0, 0, 0, 0, 0, 100, 0, 10000, 16000, 16000, 20000, 11, 64663, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Twilight Adherent - Cast Arcane Burst'),
    (33818, 0, 1, 0, 0, 0, 100, 0, 8000, 10000, 16000, 20000, 11, 63760, 0, 0, 0, 0, 0, 11, 0, 30, 0, 0, 0, 0, 0,'Twilight Adherent - Cast Greater Heal'),
    (33818, 0, 2, 0, 0, 0, 100, 0, 2000, 4000, 15000, 18000, 11, 13704, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Twilight Adherent - Cast Psychic Scream');
    
    -- Twilight Guardian
    UPDATE `creature_template` SET `spell1` = 52719, `spell2` = 62317, `spell3` = 63757, `mechanic_immune_mask` = 33554513, `equipment_id` = 1852, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33822;
    UPDATE `creature_template` SET `spell1` = 52719, `spell2` = 62317, `spell3` = 63757, `mechanic_immune_mask` = 33554513, `equipment_id` = 1852, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33828;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33822);
    INSERT INTO `smart_scripts` VALUES 
    (33822, 0, 0, 0, 0, 0, 100, 0, 6000, 10000, 8000, 10000, 11, 52719, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Twilight Guardian - Cast Concussion Blow'),
    (33822, 0, 1, 0, 0, 0, 100, 0, 2000, 3000, 3000, 6000, 11, 62317, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Twilight Guardian - Cast Devastate'),
    (33822, 0, 2, 0, 0, 0, 100, 0, 8000, 10000, 14000, 16000, 11, 63757, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Twilight Guardian - Cast Thunderclap');
    
    -- Twilight Shadowblade
    UPDATE `creature_template` SET `spell1` = 63753, `mechanic_immune_mask` = 33554513,  `equipment_id` = 1862, `baseattacktime` = 1000, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33824;
    UPDATE `creature_template` SET `spell1` = 63753, `mechanic_immune_mask` = 33554513,  `equipment_id` = 1862, `baseattacktime` = 1000, `mingold` = 7100, `maxgold` = 7600 WHERE `entry` = 33831;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33824);
    INSERT INTO `smart_scripts` VALUES 
    (33824, 0, 0, 0, 0, 0, 100, 0, 6000, 8000, 12000, 16000, 11, 63753, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Twilight Shadowblade - Cast Fan of Knives');
    
    -- Twilight Slayer
    UPDATE `creature_template` SET `spell1` = 63784, `spell2` = 35054, `mechanic_immune_mask` = 33554513, `equipment_id` = 1847, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33823;
    UPDATE `creature_template` SET `spell1` = 63784, `spell2` = 35054, `mechanic_immune_mask` = 33554513, `equipment_id` = 1847, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33832;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33823);
    INSERT INTO `smart_scripts` VALUES 
    (33823, 0, 0, 0, 0, 0, 100, 0, 3000, 6000, 12000, 16000, 11, 35054, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,'Twilight Slayer - Cast Mortal Strike'),
    (33823, 0, 1, 0, 0, 0, 100, 0, 8000, 12000, 20000, 25000, 11, 63784, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Twilight Slayer - Cast Bladestorm');
    
    UPDATE `creature_template` SET `equipment_id` = 1849 WHERE `entry` = 32885;
    UPDATE `creature_template` SET `equipment_id` = 1850 WHERE `entry` = 32908;
    
    -- Faceless Horror
    UPDATE `creature_template` SET `spell1` = 64429, `spell2` = 63722, `spell3` = 63710, `spell4` = 63703, `mechanic_immune_mask` = 33554513, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33772;
    UPDATE `creature_template` SET `spell1` = 64429, `spell2` = 63722, `spell3` = 63710, `spell4` = 63703, `mechanic_immune_mask` = 33554513, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33773;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33772);
    INSERT INTO `smart_scripts` VALUES 
    (33772, 0, 0, 0, 0, 0, 100, 0, 18000, 20000, 16000, 20000, 11, 64429, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,'Faceless Horror - Cast Death Grip'),
    (33772, 0, 1, 0, 0, 0, 100, 0, 2000, 4000, 10000, 12000, 11, 63722, 0, 0, 0, 0, 0, 17, 10, 40, 0, 0, 0, 0, 0,'Faceless Horror - Cast Shadow Crash'),
    (33772, 0, 2, 0, 4, 0, 100, 0, 0, 0, 0, 0, 75, 63703, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Faceless Horror - add aura Void Wave on aggro');
    
    -- Twilight Frost Mage
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63758, `spell3` = 63912, `spell4` = 63913, `equipment_id` = 1849, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33819;
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63758, `spell3` = 63912, `spell4` = 63913, `equipment_id` = 1849, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33829;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33819);
    INSERT INTO `smart_scripts` VALUES 
    (33819, 0, 0, 0, 0, 0, 100, 0, 10000, 16000, 16000, 20000, 11, 64663, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Twilight Frost Mage - Cast Arcane Burst'),
    (33819, 0, 1, 0, 0, 0, 100, 0, 1000, 2000, 6000, 8000, 11, 63913, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Twilight Frost Mage - Cast Frostbolt'),
    (33819, 0, 2, 0, 0, 0, 100, 0, 2000, 4000, 10000, 16000, 11, 63758, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Twilight Frost Mage - Cast Frost Bolt Volley'),
    (33819, 0, 3, 0, 0, 0, 100, 0, 8000, 10000, 12000, 16000, 11, 63912, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Twilight Frost Mage - Cast Frost Nova');
    
    -- Twilight Pyromancer
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63789, `spell3` = 63775, `equipment_id` = 1848, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 7100, `maxgold` = 7600, `AIName` = 'SmartAI' WHERE `entry` = 33820;
    UPDATE `creature_template` SET `spell1` = 64663, `spell2` = 63789, `spell3` = 63775, `equipment_id` = 1848, `mechanic_immune_mask` = 33554513, `unit_class` = 2, `mingold` = 14200, `maxgold` = 15600 WHERE `entry` = 33830;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33820);
    INSERT INTO `smart_scripts` VALUES 
    (33820, 0, 0, 0, 0, 0, 100, 0, 10000, 16000, 16000, 20000, 11, 64663, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Twilight Pyromancer - Cast Arcane Burst'),
    (33820, 0, 1, 0, 0, 0, 100, 0, 1000, 2000, 6000, 8000, 11, 63789, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Twilight Pyromancer - Cast Fireball'),
    (33820, 0, 2, 0, 0, 0, 100, 0, 2000, 4000, 10000, 16000, 11, 63775, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,'Twilight Pyromancer - Cast Flamestrike');
    
    -- Enslaved Fire Elemental
    UPDATE `creature_template` SET `spell1` = 38064, `spell2` = 63778, `mechanic_immune_mask` = 33554513, `AIName` = 'SmartAI' WHERE `entry` = 33838;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33838);
    INSERT INTO `smart_scripts` VALUES 
    (33838, 0, 0, 0, 0, 0, 100, 0, 4000, 8000, 10000, 14000, 11, 38064, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Enslaved Fire Elemental - Cast Blast Wave'),
    (33838, 0, 1, 0, 4, 0, 100, 0, 0, 0, 0, 0, 75, 63778, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Enslaved Fire Elemental - Cast Fire Shield on aggro');
    
    -- Boom Bot
    UPDATE `creature_template` SET `spell1` = 63801, `AIName` = 'SmartAI' WHERE `entry` = 33836;
    UPDATE `creature_template` SET `spell1` = 63801 WHERE `entry` = 34218;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33836);
    INSERT INTO `smart_scripts` VALUES 
    (33836, 0, 0, 0, 9, 0, 100, 0, 0, 2, 1000, 1000, 11, 63801, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Boom Bot - Explode');
    
    -- Rubble
    UPDATE `creature_template` SET `spell1` = 38064, `AIName` = 'SmartAI' WHERE `entry` = 33768;
    UPDATE `creature_template` SET `spell1` = 63978 WHERE `entry` = 33908;
    DELETE FROM `smart_scripts` WHERE (`entryorguid`=33768);
    INSERT INTO `smart_scripts` VALUES 
    (33768, 0, 0, 0, 0, 0, 100, 2, 4000, 8000, 10000, 12000, 11, 38064, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Rubble - Cast Stone Nova 10'),
    (33768, 0, 1, 0, 0, 0, 100, 4, 4000, 8000, 10000, 12000, 11, 63978, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Rubble - Cast Stone Nova 25');


    ScriptLoader.cpp , see Ulduar boss line
    Spoiler untuk ScriptLoader.cpp :

    Code:
    /*
     * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program. If not, see <http://www.gnu.org/licenses/>.
     */
    
    #include "ScriptLoader.h"
    
    
    //examples
    void AddSC_example_creature();
    void AddSC_example_escort();
    void AddSC_example_gossip_codebox();
    void AddSC_example_misc();
    void AddSC_example_commandscript();
    
    // spells
    void AddSC_deathknight_spell_scripts();
    void AddSC_druid_spell_scripts();
    void AddSC_generic_spell_scripts();
    void AddSC_hunter_spell_scripts();
    void AddSC_mage_spell_scripts();
    void AddSC_paladin_spell_scripts();
    void AddSC_priest_spell_scripts();
    void AddSC_rogue_spell_scripts();
    void AddSC_shaman_spell_scripts();
    void AddSC_warlock_spell_scripts();
    void AddSC_warrior_spell_scripts();
    void AddSC_quest_spell_scripts();
    void AddSC_item_spell_scripts();
    void AddSC_example_spell_scripts();
    
    void AddSC_SmartSCripts();
    
    //Commands
    void AddSC_account_commandscript();
    void AddSC_achievement_commandscript();
    void AddSC_debug_commandscript();
    void AddSC_event_commandscript();
    void AddSC_gm_commandscript();
    void AddSC_go_commandscript();
    void AddSC_gobject_commandscript();
    void AddSC_honor_commandscript();
    void AddSC_learn_commandscript();
    void AddSC_modify_commandscript();
    void AddSC_npc_commandscript();
    void AddSC_quest_commandscript();
    void AddSC_reload_commandscript();
    void AddSC_tele_commandscript();
    void AddSC_titles_commandscript();
    void AddSC_wp_commandscript();
    
    #ifdef SCRIPTS
    //world
    void AddSC_areatrigger_scripts();
    void AddSC_boss_emeriss();
    void AddSC_boss_taerar();
    void AddSC_boss_ysondre();
    void AddSC_generic_creature();
    void AddSC_go_scripts();
    void AddSC_guards();
    void AddSC_item_scripts();
    void AddSC_npc_professions();
    void AddSC_npc_innkeeper();
    void AddSC_npcs_special();
    void AddSC_npc_taxi();
    void AddSC_achievement_scripts();
    
    //eastern kingdoms
    void AddSC_alterac_valley();                 //Alterac Valley
    void AddSC_boss_balinda();
    void AddSC_boss_drekthar();
    void AddSC_boss_galvangar();
    void AddSC_boss_vanndar();
    void AddSC_blackrock_depths();               //Blackrock Depths
    void AddSC_boss_ambassador_flamelash();
    void AddSC_boss_anubshiah();
    void AddSC_boss_draganthaurissan();
    void AddSC_boss_general_angerforge();
    void AddSC_boss_gorosh_the_dervish();
    void AddSC_boss_grizzle();
    void AddSC_boss_high_interrogator_gerstahn();
    void AddSC_boss_magmus();
    void AddSC_boss_moira_bronzebeard();
    void AddSC_boss_tomb_of_seven();
    void AddSC_instance_blackrock_depths();
    void AddSC_boss_drakkisath();                //Blackrock Spire
    void AddSC_boss_halycon();
    void AddSC_boss_highlordomokk();
    void AddSC_boss_mothersmolderweb();
    void AddSC_boss_overlordwyrmthalak();
    void AddSC_boss_shadowvosh();
    void AddSC_boss_thebeast();
    void AddSC_boss_warmastervoone();
    void AddSC_boss_quatermasterzigris();
    void AddSC_boss_pyroguard_emberseer();
    void AddSC_boss_gyth();
    void AddSC_boss_rend_blackhand();
    void AddSC_boss_razorgore();                 //Blackwing lair
    void AddSC_boss_vael();
    void AddSC_boss_broodlord();
    void AddSC_boss_firemaw();
    void AddSC_boss_ebonroc();
    void AddSC_boss_flamegor();
    void AddSC_boss_chromaggus();
    void AddSC_boss_nefarian();
    void AddSC_boss_victor_nefarius();
    void AddSC_boss_mr_smite();
    void AddSC_deadmines();                      //Deadmines
    void AddSC_instance_deadmines();
    void AddSC_gnomeregan();                     //Gnomeregan
    void AddSC_instance_gnomeregan();
    void AddSC_boss_attumen();                   //Karazhan
    void AddSC_boss_curator();
    void AddSC_boss_maiden_of_virtue();
    void AddSC_boss_shade_of_aran();
    void AddSC_boss_malchezaar();
    void AddSC_boss_terestian_illhoof();
    void AddSC_boss_moroes();
    void AddSC_bosses_opera();
    void AddSC_boss_netherspite();
    void AddSC_instance_karazhan();
    void AddSC_karazhan();
    void AddSC_boss_nightbane();
    void AddSC_boss_felblood_kaelthas();         // Magister's Terrace
    void AddSC_boss_selin_fireheart();
    void AddSC_boss_vexallus();
    void AddSC_boss_priestess_delrissa();
    void AddSC_instance_magisters_terrace();
    void AddSC_magisters_terrace();
    void AddSC_boss_lucifron();                  //Molten core
    void AddSC_boss_magmadar();
    void AddSC_boss_gehennas();
    void AddSC_boss_garr();
    void AddSC_boss_baron_geddon();
    void AddSC_boss_shazzrah();
    void AddSC_boss_golemagg();
    void AddSC_boss_sulfuron();
    void AddSC_boss_majordomo();
    void AddSC_boss_ragnaros();
    void AddSC_instance_molten_core();
    void AddSC_molten_core();
    void AddSC_the_scarlet_enclave();            //Scarlet Enclave
    void AddSC_the_scarlet_enclave_c1();
    void AddSC_the_scarlet_enclave_c2();
    void AddSC_the_scarlet_enclave_c5();
    void AddSC_boss_arcanist_doan();             //Scarlet Monastery
    void AddSC_boss_azshir_the_sleepless();
    void AddSC_boss_bloodmage_thalnos();
    void AddSC_boss_headless_horseman();
    void AddSC_boss_herod();
    void AddSC_boss_high_inquisitor_fairbanks();
    void AddSC_boss_houndmaster_loksey();
    void AddSC_boss_interrogator_vishas();
    void AddSC_boss_scorn();
    void AddSC_instance_scarlet_monastery();
    void AddSC_boss_mograine_and_whitemane();
    void AddSC_boss_darkmaster_gandling();       //Scholomance
    void AddSC_boss_death_knight_darkreaver();
    void AddSC_boss_theolenkrastinov();
    void AddSC_boss_illuciabarov();
    void AddSC_boss_instructormalicia();
    void AddSC_boss_jandicebarov();
    void AddSC_boss_kormok();
    void AddSC_boss_lordalexeibarov();
    void AddSC_boss_lorekeeperpolkelt();
    void AddSC_boss_rasfrost();
    void AddSC_boss_theravenian();
    void AddSC_boss_vectus();
    void AddSC_instance_scholomance();
    void AddSC_shadowfang_keep();                //Shadowfang keep
    void AddSC_instance_shadowfang_keep();
    void AddSC_boss_magistrate_barthilas();      //Stratholme
    void AddSC_boss_maleki_the_pallid();
    void AddSC_boss_nerubenkan();
    void AddSC_boss_cannon_master_willey();
    void AddSC_boss_baroness_anastari();
    void AddSC_boss_ramstein_the_gorger();
    void AddSC_boss_timmy_the_cruel();
    void AddSC_boss_postmaster_malown();
    void AddSC_boss_baron_rivendare();
    void AddSC_boss_dathrohan_balnazzar();
    void AddSC_boss_order_of_silver_hand();
    void AddSC_instance_stratholme();
    void AddSC_stratholme();
    void AddSC_sunken_temple();                  // Sunken Temple
    void AddSC_instance_sunken_temple();
    void AddSC_instance_sunwell_plateau();       //Sunwell Plateau
    void AddSC_boss_kalecgos();
    void AddSC_boss_brutallus();
    void AddSC_boss_felmyst();
    void AddSC_boss_eredar_twins();
    void AddSC_boss_muru();
    void AddSC_boss_kiljaeden();
    void AddSC_sunwell_plateau();
    void AddSC_boss_archaedas();                 //Uldaman
    void AddSC_boss_ironaya();
    void AddSC_uldaman();
    void AddSC_instance_uldaman();
    void AddSC_boss_akilzon();                   //Zul'Aman
    void AddSC_boss_halazzi();
    void AddSC_boss_hex_lord_malacrass();
    void AddSC_boss_janalai();
    void AddSC_boss_nalorakk();
    void AddSC_boss_zuljin();
    void AddSC_instance_zulaman();
    void AddSC_zulaman();
    void AddSC_boss_jeklik();                    //Zul'Gurub
    void AddSC_boss_venoxis();
    void AddSC_boss_marli();
    void AddSC_boss_mandokir();
    void AddSC_boss_gahzranka();
    void AddSC_boss_thekal();
    void AddSC_boss_arlokk();
    void AddSC_boss_jindo();
    void AddSC_boss_hakkar();
    void AddSC_boss_grilek();
    void AddSC_boss_hazzarah();
    void AddSC_boss_renataki();
    void AddSC_boss_wushoolay();
    void AddSC_instance_zulgurub();
    
    //void AddSC_alterac_mountains();
    void AddSC_arathi_highlands();
    void AddSC_blasted_lands();
    void AddSC_boss_kruul();
    void AddSC_burning_steppes();
    void AddSC_dun_morogh();
    void AddSC_duskwood();
    void AddSC_eastern_plaguelands();
    void AddSC_elwynn_forest();
    void AddSC_eversong_woods();
    void AddSC_ghostlands();
    void AddSC_hinterlands();
    void AddSC_ironforge();
    void AddSC_isle_of_queldanas();
    void AddSC_loch_modan();
    void AddSC_redridge_mountains();
    void AddSC_searing_gorge();
    void AddSC_silvermoon_city();
    void AddSC_silverpine_forest();
    void AddSC_stormwind_city();
    void AddSC_stranglethorn_vale();
    void AddSC_swamp_of_sorrows();
    void AddSC_tirisfal_glades();
    void AddSC_undercity();
    void AddSC_western_plaguelands();
    void AddSC_westfall();
    void AddSC_wetlands();
    
    //kalimdor
    void AddSC_blackfathom_deeps();              //Blackfathom Depths
    void AddSC_boss_gelihast();
    void AddSC_boss_kelris();
    void AddSC_boss_aku_mai();
    void AddSC_instance_blackfathom_deeps();
    void AddSC_hyjal();                          //CoT Battle for Mt. Hyjal
    void AddSC_boss_archimonde();
    void AddSC_instance_mount_hyjal();
    void AddSC_hyjal_trash();
    void AddSC_boss_rage_winterchill();
    void AddSC_boss_anetheron();
    void AddSC_boss_kazrogal();
    void AddSC_boss_azgalor();
    void AddSC_boss_captain_skarloc();           //CoT Old Hillsbrad
    void AddSC_boss_epoch_hunter();
    void AddSC_boss_lieutenant_drake();
    void AddSC_instance_old_hillsbrad();
    void AddSC_old_hillsbrad();
    void AddSC_boss_aeonus();                    //CoT The Dark Portal
    void AddSC_boss_chrono_lord_deja();
    void AddSC_boss_temporus();
    void AddSC_dark_portal();
    void AddSC_instance_dark_portal();
    void AddSC_boss_epoch();                     //CoT Culling Of Stratholme
    void AddSC_boss_infinite_corruptor();
    void AddSC_boss_salramm();
    void AddSC_boss_mal_ganis();
    void AddSC_boss_meathook();
    void AddSC_culling_of_stratholme();
    void AddSC_instance_culling_of_stratholme();
    void AddSC_boss_celebras_the_cursed();       //Maraudon
    void AddSC_boss_landslide();
    void AddSC_boss_noxxion();
    void AddSC_boss_ptheradras();
    void AddSC_boss_onyxia();                    //Onyxia's Lair
    void AddSC_instance_onyxias_lair();
    void AddSC_boss_amnennar_the_coldbringer();  //Razorfen Downs
    void AddSC_razorfen_downs();
    void AddSC_instance_razorfen_downs();
    void AddSC_razorfen_kraul();                 //Razorfen Kraul
    void AddSC_boss_kurinnaxx();                 //Ruins of ahn'qiraj
    void AddSC_boss_rajaxx();
    void AddSC_boss_moam();
    void AddSC_boss_buru();
    void AddSC_boss_ayamiss();
    void AddSC_boss_ossirian();
    void AddSC_instance_ruins_of_ahnqiraj();
    void AddSC_boss_cthun();                     //Temple of ahn'qiraj
    void AddSC_boss_fankriss();
    void AddSC_boss_huhuran();
    void AddSC_bug_trio();
    void AddSC_boss_sartura();
    void AddSC_boss_skeram();
    void AddSC_boss_twinemperors();
    void AddSC_mob_anubisath_sentinel();
    void AddSC_instance_temple_of_ahnqiraj();
    void AddSC_wailing_caverns();                //Wailing caverns
    void AddSC_instance_wailing_caverns();
    void AddSC_zulfarrak();                     //Zul'Farrak generic
    void AddSC_instance_zulfarrak();            //Zul'Farrak instance script
    
    void AddSC_ashenvale();
    void AddSC_azshara();
    void AddSC_azuremyst_isle();
    void AddSC_bloodmyst_isle();
    void AddSC_boss_azuregos();
    void AddSC_darkshore();
    void AddSC_desolace();
    void AddSC_durotar();
    void AddSC_dustwallow_marsh();
    void AddSC_felwood();
    void AddSC_feralas();
    void AddSC_moonglade();
    void AddSC_mulgore();
    void AddSC_orgrimmar();
    void AddSC_silithus();
    void AddSC_stonetalon_mountains();
    void AddSC_tanaris();
    void AddSC_teldrassil();
    void AddSC_the_barrens();
    void AddSC_thousand_needles();
    void AddSC_thunder_bluff();
    void AddSC_ungoro_crater();
    void AddSC_winterspring();
    
    //northrend
    void AddSC_boss_slad_ran();
    void AddSC_boss_moorabi();
    void AddSC_boss_drakkari_colossus();
    void AddSC_boss_gal_darah();
    void AddSC_boss_eck();
    void AddSC_instance_gundrak();
    void AddSC_boss_krik_thir();             //Azjol-Nerub
    void AddSC_boss_hadronox();
    void AddSC_boss_anub_arak();
    void AddSC_instance_azjol_nerub();
    void AddSC_instance_ahnkahet();          //Azjol-Nerub Ahn'kahet
    void AddSC_boss_amanitar();
    void AddSC_boss_taldaram();
    void AddSC_boss_jedoga_shadowseeker();
    void AddSC_boss_elder_nadox();
    void AddSC_boss_volazj();
    void AddSC_boss_argent_challenge();      //Trial of the Champion
    void AddSC_boss_black_knight();
    void AddSC_boss_grand_champions();
    void AddSC_instance_trial_of_the_champion();
    void AddSC_trial_of_the_champion();
    void AddSC_boss_anubarak_trial();        //Trial of the Crusader
    void AddSC_boss_faction_champions();
    void AddSC_boss_jaraxxus();
    void AddSC_boss_northrend_beasts();
    void AddSC_boss_twin_valkyr();
    void AddSC_trial_of_the_crusader();
    void AddSC_instance_trial_of_the_crusader();
    void AddSC_boss_anubrekhan();            //Naxxramas
    void AddSC_boss_maexxna();
    void AddSC_boss_patchwerk();
    void AddSC_boss_grobbulus();
    void AddSC_boss_razuvious();
    void AddSC_boss_kelthuzad();
    void AddSC_boss_loatheb();
    void AddSC_boss_noth();
    void AddSC_boss_gluth();
    void AddSC_boss_sapphiron();
    void AddSC_boss_four_horsemen();
    void AddSC_boss_faerlina();
    void AddSC_boss_heigan();
    void AddSC_boss_gothik();
    void AddSC_boss_thaddius();
    void AddSC_instance_naxxramas();
    void AddSC_boss_magus_telestra();        //The Nexus Nexus
    void AddSC_boss_anomalus();
    void AddSC_boss_ormorok();
    void AddSC_boss_keristrasza();
    void AddSC_instance_nexus();
    void AddSC_boss_drakos();                //The Nexus The Oculus
    void AddSC_boss_urom();
    void AddSC_instance_oculus();
    void AddSC_oculus();
    void AddSC_boss_sartharion();            //Obsidian Sanctum
    void AddSC_instance_obsidian_sanctum();
    void AddSC_boss_bjarngrim();             //Ulduar Halls of Lightning
    void AddSC_boss_loken();
    void AddSC_boss_ionar();
    void AddSC_boss_volkhan();
    void AddSC_instance_halls_of_lightning();
    void AddSC_boss_maiden_of_grief();       //Ulduar Halls of Stone
    void AddSC_boss_krystallus();
    void AddSC_boss_sjonnir();
    void AddSC_instance_halls_of_stone();
    void AddSC_halls_of_stone();
    void AddSC_boss_algalon();               //Ulduar Ulduar
    void AddSC_boss_assembly_of_iron();
    void AddSC_boss_auriaya();
    void AddSC_boss_flame_leviathan();
    void AddSC_boss_freya();
    void AddSC_boss_general_vezax();
    void AddSC_boss_hodir();
    void AddSC_boss_ignis();
    void AddSC_boss_kologarn();
    void AddSC_boss_mimiron();
    void AddSC_boss_razorscale();
    void AddSC_boss_thorim();
    void AddSC_boss_xt002();
    void AddSC_boss_yoggsaron();
    void AddSC_ulduar_teleporter();
    void AddSC_instance_ulduar();
    void AddSC_boss_keleseth();              //Utgarde Keep
    void AddSC_boss_skarvald_dalronn();
    void AddSC_boss_ingvar_the_plunderer();
    void AddSC_instance_utgarde_keep();
    void AddSC_boss_svala();                 //Utgarde Pinnacle
    void AddSC_boss_palehoof();
    void AddSC_boss_skadi();
    void AddSC_boss_ymiron();
    void AddSC_instance_utgarde_pinnacle();
    void AddSC_utgarde_keep();
    void AddSC_boss_archavon();              //Vault of Archavon
    void AddSC_boss_emalon();
    void AddSC_boss_koralon();
    void AddSC_boss_toravon();
    void AddSC_instance_archavon();
    void AddSC_boss_trollgore();             //Drak'Tharon Keep
    void AddSC_boss_novos();
    void AddSC_boss_dred();
    void AddSC_boss_tharon_ja();
    void AddSC_instance_drak_tharon();
    void AddSC_boss_cyanigosa();             //Violet Hold
    void AddSC_boss_erekem();
    void AddSC_boss_ichoron();
    void AddSC_boss_lavanthor();
    void AddSC_boss_moragg();
    void AddSC_boss_xevozz();
    void AddSC_boss_zuramat();
    void AddSC_instance_violet_hold();
    void AddSC_violet_hold();
    void AddSC_instance_forge_of_souls();   //Forge of Souls
    void AddSC_forge_of_souls();
    void AddSC_boss_bronjahm();
    void AddSC_boss_devourer_of_souls();
    void AddSC_instance_pit_of_saron();     //Pit of Saron
    void AddSC_pit_of_saron();
    void AddSC_boss_garfrost();
    void AddSC_boss_ick();
    void AddSC_boss_tyrannus();
    void AddSC_instance_halls_of_reflection();   // Halls of Reflection
    void AddSC_halls_of_reflection();
    void AddSC_boss_falric();
    void AddSC_boss_marwyn();
    void AddSC_boss_lord_marrowgar();       // Icecrown Citadel
    void AddSC_boss_lady_deathwhisper();
    void AddSC_boss_deathbringer_saurfang();
    void AddSC_boss_festergut();
    void AddSC_boss_rotface();
    void AddSC_boss_professor_putricide();
    void AddSC_boss_blood_prince_council();
    void AddSC_boss_blood_queen_lana_thel();
    void AddSC_icecrown_citadel_teleport();
    void AddSC_instance_icecrown_citadel();
    
    void AddSC_dalaran();
    void AddSC_borean_tundra();
    void AddSC_dragonblight();
    void AddSC_grizzly_hills();
    void AddSC_howling_fjord();
    void AddSC_icecrown();
    void AddSC_sholazar_basin();
    void AddSC_storm_peaks();
    void AddSC_zuldrak();
    void AddSC_crystalsong_forest();
    
    //outland
    void AddSC_boss_exarch_maladaar();           //Auchindoun Auchenai Crypts
    void AddSC_boss_shirrak_the_dead_watcher();
    void AddSC_boss_nexusprince_shaffar();       //Auchindoun Mana Tombs
    void AddSC_boss_pandemonius();
    void AddSC_boss_darkweaver_syth();           //Auchindoun Sekketh Halls
    void AddSC_boss_talon_king_ikiss();
    void AddSC_instance_sethekk_halls();
    void AddSC_instance_shadow_labyrinth();      //Auchindoun Shadow Labyrinth
    void AddSC_boss_ambassador_hellmaw();
    void AddSC_boss_blackheart_the_inciter();
    void AddSC_boss_grandmaster_vorpil();
    void AddSC_boss_murmur();
    void AddSC_black_temple();                   //Black Temple
    void AddSC_boss_illidan();
    void AddSC_boss_shade_of_akama();
    void AddSC_boss_supremus();
    void AddSC_boss_gurtogg_bloodboil();
    void AddSC_boss_mother_shahraz();
    void AddSC_boss_reliquary_of_souls();
    void AddSC_boss_teron_gorefiend();
    void AddSC_boss_najentus();
    void AddSC_boss_illidari_council();
    void AddSC_instance_black_temple();
    void AddSC_boss_fathomlord_karathress();     //CR Serpent Shrine Cavern
    void AddSC_boss_hydross_the_unstable();
    void AddSC_boss_lady_vashj();
    void AddSC_boss_leotheras_the_blind();
    void AddSC_boss_morogrim_tidewalker();
    void AddSC_instance_serpentshrine_cavern();
    void AddSC_boss_the_lurker_below();
    void AddSC_boss_hydromancer_thespia();       //CR Steam Vault
    void AddSC_boss_mekgineer_steamrigger();
    void AddSC_boss_warlord_kalithresh();
    void AddSC_instance_steam_vault();
    void AddSC_boss_hungarfen();                 //CR Underbog
    void AddSC_boss_the_black_stalker();
    void AddSC_boss_gruul();                     //Gruul's Lair
    void AddSC_boss_high_king_maulgar();
    void AddSC_instance_gruuls_lair();
    void AddSC_boss_broggok();                   //HC Blood Furnace
    void AddSC_boss_kelidan_the_breaker();
    void AddSC_boss_the_maker();
    void AddSC_instance_blood_furnace();
    void AddSC_boss_magtheridon();               //HC Magtheridon's Lair
    void AddSC_instance_magtheridons_lair();
    void AddSC_boss_grand_warlock_nethekurse();  //HC Shattered Halls
    void AddSC_boss_warbringer_omrogg();
    void AddSC_boss_warchief_kargath_bladefist();
    void AddSC_instance_shattered_halls();
    void AddSC_boss_watchkeeper_gargolmar();     //HC Ramparts
    void AddSC_boss_omor_the_unscarred();
    void AddSC_boss_vazruden_the_herald();
    void AddSC_instance_ramparts();
    void AddSC_arcatraz();                       //TK Arcatraz
    void AddSC_boss_harbinger_skyriss();
    void AddSC_instance_arcatraz();
    void AddSC_boss_high_botanist_freywinn();    //TK Botanica
    void AddSC_boss_laj();
    void AddSC_boss_warp_splinter();
    void AddSC_boss_alar();                      //TK The Eye
    void AddSC_boss_kaelthas();
    void AddSC_boss_void_reaver();
    void AddSC_boss_high_astromancer_solarian();
    void AddSC_instance_the_eye();
    void AddSC_the_eye();
    void AddSC_boss_gatewatcher_iron_hand();     //TK The Mechanar
    void AddSC_boss_nethermancer_sepethrea();
    void AddSC_boss_pathaleon_the_calculator();
    void AddSC_instance_mechanar();
    
    void AddSC_blades_edge_mountains();
    void AddSC_boss_doomlordkazzak();
    void AddSC_boss_doomwalker();
    void AddSC_hellfire_peninsula();
    void AddSC_nagrand();
    void AddSC_netherstorm();
    void AddSC_shadowmoon_valley();
    void AddSC_shattrath_city();
    void AddSC_terokkar_forest();
    void AddSC_zangarmarsh();
    
    // battlegrounds
    
    // outdoor pvp
    void AddSC_outdoorpvp_ep();
    void AddSC_outdoorpvp_hp();
    void AddSC_outdoorpvp_na();
    void AddSC_outdoorpvp_si();
    void AddSC_outdoorpvp_tf();
    void AddSC_outdoorpvp_zm();
    
    // player
    void AddSC_chat_log();
    
    #endif
    
    void AddScripts()
    {
        AddExampleScripts();
        AddSpellScripts();
        AddSC_SmartSCripts();
        AddCommandScripts();
    #ifdef SCRIPTS
        AddWorldScripts();
        AddEasternKingdomsScripts();
        AddKalimdorScripts();
        AddOutlandScripts();
        AddNorthrendScripts();
        AddBattlegroundScripts();
        AddOutdoorPvPScripts();
        AddCustomScripts();
    #endif
    }
    
    void AddExampleScripts()
    {
        AddSC_example_creature();
        AddSC_example_escort();
        AddSC_example_gossip_codebox();
        AddSC_example_misc();
        AddSC_example_commandscript();
    }
    
    void AddSpellScripts()
    {
        AddSC_deathknight_spell_scripts();
        AddSC_druid_spell_scripts();
        AddSC_generic_spell_scripts();
        AddSC_hunter_spell_scripts();
        AddSC_mage_spell_scripts();
        AddSC_paladin_spell_scripts();
        AddSC_priest_spell_scripts();
        AddSC_rogue_spell_scripts();
        AddSC_shaman_spell_scripts();
        AddSC_warlock_spell_scripts();
        AddSC_warrior_spell_scripts();
        AddSC_quest_spell_scripts();
        AddSC_item_spell_scripts();
        AddSC_example_spell_scripts();
    }
    
    void AddCommandScripts()
    {
        AddSC_account_commandscript();
        AddSC_achievement_commandscript();
        AddSC_debug_commandscript();
        AddSC_event_commandscript();
        AddSC_gm_commandscript();
        AddSC_go_commandscript();
        AddSC_gobject_commandscript();
        AddSC_honor_commandscript();
        AddSC_learn_commandscript();
        AddSC_modify_commandscript();
        AddSC_npc_commandscript();
        AddSC_quest_commandscript();
        AddSC_reload_commandscript();
        AddSC_tele_commandscript();
        AddSC_titles_commandscript();
        AddSC_wp_commandscript();
    }
    
    void AddWorldScripts()
    {
    #ifdef SCRIPTS
        AddSC_areatrigger_scripts();
        AddSC_boss_emeriss();
        AddSC_boss_taerar();
        AddSC_boss_ysondre();
        AddSC_generic_creature();
        AddSC_go_scripts();
        AddSC_guards();
        AddSC_item_scripts();
        AddSC_npc_professions();
        AddSC_npc_innkeeper();
        AddSC_npcs_special();
        AddSC_npc_taxi();
        AddSC_achievement_scripts();
        AddSC_chat_log();
    #endif
    }
    
    void AddEasternKingdomsScripts()
    {
    #ifdef SCRIPTS
        AddSC_alterac_valley();                 //Alterac Valley
        AddSC_boss_balinda();
        AddSC_boss_drekthar();
        AddSC_boss_galvangar();
        AddSC_boss_vanndar();
        AddSC_blackrock_depths();               //Blackrock Depths
        AddSC_boss_ambassador_flamelash();
        AddSC_boss_anubshiah();
        AddSC_boss_draganthaurissan();
        AddSC_boss_general_angerforge();
        AddSC_boss_gorosh_the_dervish();
        AddSC_boss_grizzle();
        AddSC_boss_high_interrogator_gerstahn();
        AddSC_boss_magmus();
        AddSC_boss_moira_bronzebeard();
        AddSC_boss_tomb_of_seven();
        AddSC_instance_blackrock_depths();
        AddSC_boss_drakkisath();                //Blackrock Spire
        AddSC_boss_halycon();
        AddSC_boss_highlordomokk();
        AddSC_boss_mothersmolderweb();
        AddSC_boss_overlordwyrmthalak();
        AddSC_boss_shadowvosh();
        AddSC_boss_thebeast();
        AddSC_boss_warmastervoone();
        AddSC_boss_quatermasterzigris();
        AddSC_boss_pyroguard_emberseer();
        AddSC_boss_gyth();
        AddSC_boss_rend_blackhand();
        AddSC_boss_razorgore();                 //Blackwing lair
        AddSC_boss_vael();
        AddSC_boss_broodlord();
        AddSC_boss_firemaw();
        AddSC_boss_ebonroc();
        AddSC_boss_flamegor();
        AddSC_boss_chromaggus();
        AddSC_boss_nefarian();
        AddSC_boss_victor_nefarius();
        AddSC_boss_mr_smite();
        AddSC_deadmines();                      //Deadmines
        AddSC_instance_deadmines();
        AddSC_gnomeregan();                     //Gnomeregan
        AddSC_instance_gnomeregan();
        AddSC_boss_attumen();                   //Karazhan
        AddSC_boss_curator();
        AddSC_boss_maiden_of_virtue();
        AddSC_boss_shade_of_aran();
        AddSC_boss_malchezaar();
        AddSC_boss_terestian_illhoof();
        AddSC_boss_moroes();
        AddSC_bosses_opera();
        AddSC_boss_netherspite();
        AddSC_instance_karazhan();
        AddSC_karazhan();
        AddSC_boss_nightbane();
        AddSC_boss_felblood_kaelthas();         // Magister's Terrace
        AddSC_boss_selin_fireheart();
        AddSC_boss_vexallus();
        AddSC_boss_priestess_delrissa();
        AddSC_instance_magisters_terrace();
        AddSC_magisters_terrace();
        AddSC_boss_lucifron();                  //Molten core
        AddSC_boss_magmadar();
        AddSC_boss_gehennas();
        AddSC_boss_garr();
        AddSC_boss_baron_geddon();
        AddSC_boss_shazzrah();
        AddSC_boss_golemagg();
        AddSC_boss_sulfuron();
        AddSC_boss_majordomo();
        AddSC_boss_ragnaros();
        AddSC_instance_molten_core();
        AddSC_molten_core();
        AddSC_the_scarlet_enclave();            //Scarlet Enclave
        AddSC_the_scarlet_enclave_c1();
        AddSC_the_scarlet_enclave_c2();
        AddSC_the_scarlet_enclave_c5();
        AddSC_boss_arcanist_doan();             //Scarlet Monastery
        AddSC_boss_azshir_the_sleepless();
        AddSC_boss_bloodmage_thalnos();
        AddSC_boss_headless_horseman();
        AddSC_boss_herod();
        AddSC_boss_high_inquisitor_fairbanks();
        AddSC_boss_houndmaster_loksey();
        AddSC_boss_interrogator_vishas();
        AddSC_boss_scorn();
        AddSC_instance_scarlet_monastery();
        AddSC_boss_mograine_and_whitemane();
        AddSC_boss_darkmaster_gandling();       //Scholomance
        AddSC_boss_death_knight_darkreaver();
        AddSC_boss_theolenkrastinov();
        AddSC_boss_illuciabarov();
        AddSC_boss_instructormalicia();
        AddSC_boss_jandicebarov();
        AddSC_boss_kormok();
        AddSC_boss_lordalexeibarov();
        AddSC_boss_lorekeeperpolkelt();
        AddSC_boss_rasfrost();
        AddSC_boss_theravenian();
        AddSC_boss_vectus();
        AddSC_instance_scholomance();
        AddSC_shadowfang_keep();                //Shadowfang keep
        AddSC_instance_shadowfang_keep();
        AddSC_boss_magistrate_barthilas();      //Stratholme
        AddSC_boss_maleki_the_pallid();
        AddSC_boss_nerubenkan();
        AddSC_boss_cannon_master_willey();
        AddSC_boss_baroness_anastari();
        AddSC_boss_ramstein_the_gorger();
        AddSC_boss_timmy_the_cruel();
        AddSC_boss_postmaster_malown();
        AddSC_boss_baron_rivendare();
        AddSC_boss_dathrohan_balnazzar();
        AddSC_boss_order_of_silver_hand();
        AddSC_instance_stratholme();
        AddSC_stratholme();
        AddSC_sunken_temple();                  // Sunken Temple
        AddSC_instance_sunken_temple();
        AddSC_instance_sunwell_plateau();       //Sunwell Plateau
        AddSC_boss_kalecgos();
        AddSC_boss_brutallus();
        AddSC_boss_felmyst();
        AddSC_boss_eredar_twins();
        AddSC_boss_muru();
        AddSC_boss_kiljaeden();
        AddSC_sunwell_plateau();
        AddSC_boss_archaedas();                 //Uldaman
        AddSC_boss_ironaya();
        AddSC_uldaman();
        AddSC_instance_uldaman();
        AddSC_boss_akilzon();                   //Zul'Aman
        AddSC_boss_halazzi();
        AddSC_boss_hex_lord_malacrass();
        AddSC_boss_janalai();
        AddSC_boss_nalorakk();
        AddSC_boss_zuljin();
        AddSC_instance_zulaman();
        AddSC_zulaman();
        AddSC_boss_jeklik();                    //Zul'Gurub
        AddSC_boss_venoxis();
        AddSC_boss_marli();
        AddSC_boss_mandokir();
        AddSC_boss_gahzranka();
        AddSC_boss_thekal();
        AddSC_boss_arlokk();
        AddSC_boss_jindo();
        AddSC_boss_hakkar();
        AddSC_boss_grilek();
        AddSC_boss_hazzarah();
        AddSC_boss_renataki();
        AddSC_boss_wushoolay();
        AddSC_instance_zulgurub();
    
        //AddSC_alterac_mountains();
        AddSC_arathi_highlands();
        AddSC_blasted_lands();
        AddSC_boss_kruul();
        AddSC_burning_steppes();
        AddSC_dun_morogh();
        AddSC_duskwood();
        AddSC_eastern_plaguelands();
        AddSC_elwynn_forest();
        AddSC_eversong_woods();
        AddSC_ghostlands();
        AddSC_hinterlands();
        AddSC_ironforge();
        AddSC_isle_of_queldanas();
        AddSC_loch_modan();
        AddSC_redridge_mountains();
        AddSC_searing_gorge();
        AddSC_silvermoon_city();
        AddSC_silverpine_forest();
        AddSC_stormwind_city();
        AddSC_stranglethorn_vale();
        AddSC_swamp_of_sorrows();
        AddSC_tirisfal_glades();
        AddSC_undercity();
        AddSC_western_plaguelands();
        AddSC_westfall();
        AddSC_wetlands();
    #endif
    }
    
    void AddKalimdorScripts()
    {
    #ifdef SCRIPTS
        AddSC_blackfathom_deeps();              //Blackfathom Depths
        AddSC_boss_gelihast();
        AddSC_boss_kelris();
        AddSC_boss_aku_mai();
        AddSC_instance_blackfathom_deeps();
        AddSC_hyjal();                          //CoT Battle for Mt. Hyjal
        AddSC_boss_archimonde();
        AddSC_instance_mount_hyjal();
        AddSC_hyjal_trash();
        AddSC_boss_rage_winterchill();
        AddSC_boss_anetheron();
        AddSC_boss_kazrogal();
        AddSC_boss_azgalor();
        AddSC_boss_captain_skarloc();           //CoT Old Hillsbrad
        AddSC_boss_epoch_hunter();
        AddSC_boss_lieutenant_drake();
        AddSC_instance_old_hillsbrad();
        AddSC_old_hillsbrad();
        AddSC_boss_aeonus();                    //CoT The Dark Portal
        AddSC_boss_chrono_lord_deja();
        AddSC_boss_temporus();
        AddSC_dark_portal();
        AddSC_instance_dark_portal();
        AddSC_boss_epoch();                     //CoT Culling Of Stratholme
        AddSC_boss_infinite_corruptor();
        AddSC_boss_salramm();
        AddSC_boss_mal_ganis();
        AddSC_boss_meathook();
        AddSC_culling_of_stratholme();
        AddSC_instance_culling_of_stratholme();
        AddSC_boss_celebras_the_cursed();       //Maraudon
        AddSC_boss_landslide();
        AddSC_boss_noxxion();
        AddSC_boss_ptheradras();
        AddSC_boss_onyxia();                    //Onyxia's Lair
        AddSC_instance_onyxias_lair();
        AddSC_boss_amnennar_the_coldbringer();  //Razorfen Downs
        AddSC_razorfen_downs();
        AddSC_instance_razorfen_downs();
        AddSC_razorfen_kraul();                 //Razorfen Kraul
        AddSC_boss_kurinnaxx();                 //Ruins of ahn'qiraj
        AddSC_boss_rajaxx();
        AddSC_boss_moam();
        AddSC_boss_buru();
        AddSC_boss_ayamiss();
        AddSC_boss_ossirian();
        AddSC_instance_ruins_of_ahnqiraj();
        AddSC_boss_cthun();                     //Temple of ahn'qiraj
        AddSC_boss_fankriss();
        AddSC_boss_huhuran();
        AddSC_bug_trio();
        AddSC_boss_sartura();
        AddSC_boss_skeram();
        AddSC_boss_twinemperors();
        AddSC_mob_anubisath_sentinel();
        AddSC_instance_temple_of_ahnqiraj();
        AddSC_wailing_caverns();                //Wailing caverns
        AddSC_instance_wailing_caverns();
        AddSC_zulfarrak();                      //Zul'Farrak generic
        AddSC_instance_zulfarrak();             //Zul'Farrak instance script
    
        AddSC_ashenvale();
        AddSC_azshara();
        AddSC_azuremyst_isle();
        AddSC_bloodmyst_isle();
        AddSC_boss_azuregos();
        AddSC_darkshore();
        AddSC_desolace();
        AddSC_durotar();
        AddSC_dustwallow_marsh();
        AddSC_felwood();
        AddSC_feralas();
        AddSC_moonglade();
        AddSC_mulgore();
        AddSC_orgrimmar();
        AddSC_silithus();
        AddSC_stonetalon_mountains();
        AddSC_tanaris();
        AddSC_teldrassil();
        AddSC_the_barrens();
        AddSC_thousand_needles();
        AddSC_thunder_bluff();
        AddSC_ungoro_crater();
        AddSC_winterspring();
    #endif
    }
    
    void AddOutlandScripts()
    {
    #ifdef SCRIPTS
        AddSC_boss_exarch_maladaar();           //Auchindoun Auchenai Crypts
        AddSC_boss_shirrak_the_dead_watcher();
        AddSC_boss_nexusprince_shaffar();       //Auchindoun Mana Tombs
        AddSC_boss_pandemonius();
        AddSC_boss_darkweaver_syth();           //Auchindoun Sekketh Halls
        AddSC_boss_talon_king_ikiss();
        AddSC_instance_sethekk_halls();
        AddSC_instance_shadow_labyrinth();      //Auchindoun Shadow Labyrinth
        AddSC_boss_ambassador_hellmaw();
        AddSC_boss_blackheart_the_inciter();
        AddSC_boss_grandmaster_vorpil();
        AddSC_boss_murmur();
        AddSC_black_temple();                   //Black Temple
        AddSC_boss_illidan();
        AddSC_boss_shade_of_akama();
        AddSC_boss_supremus();
        AddSC_boss_gurtogg_bloodboil();
        AddSC_boss_mother_shahraz();
        AddSC_boss_reliquary_of_souls();
        AddSC_boss_teron_gorefiend();
        AddSC_boss_najentus();
        AddSC_boss_illidari_council();
        AddSC_instance_black_temple();
        AddSC_boss_fathomlord_karathress();     //CR Serpent Shrine Cavern
        AddSC_boss_hydross_the_unstable();
        AddSC_boss_lady_vashj();
        AddSC_boss_leotheras_the_blind();
        AddSC_boss_morogrim_tidewalker();
        AddSC_instance_serpentshrine_cavern();
        AddSC_boss_the_lurker_below();
        AddSC_boss_hydromancer_thespia();       //CR Steam Vault
        AddSC_boss_mekgineer_steamrigger();
        AddSC_boss_warlord_kalithresh();
        AddSC_instance_steam_vault();
        AddSC_boss_hungarfen();                 //CR Underbog
        AddSC_boss_the_black_stalker();
        AddSC_boss_gruul();                     //Gruul's Lair
        AddSC_boss_high_king_maulgar();
        AddSC_instance_gruuls_lair();
        AddSC_boss_broggok();                   //HC Blood Furnace
        AddSC_boss_kelidan_the_breaker();
        AddSC_boss_the_maker();
        AddSC_instance_blood_furnace();
        AddSC_boss_magtheridon();               //HC Magtheridon's Lair
        AddSC_instance_magtheridons_lair();
        AddSC_boss_grand_warlock_nethekurse();  //HC Shattered Halls
        AddSC_boss_warbringer_omrogg();
        AddSC_boss_warchief_kargath_bladefist();
        AddSC_instance_shattered_halls();
        AddSC_boss_watchkeeper_gargolmar();     //HC Ramparts
        AddSC_boss_omor_the_unscarred();
        AddSC_boss_vazruden_the_herald();
        AddSC_instance_ramparts();
        AddSC_arcatraz();                       //TK Arcatraz
        AddSC_boss_harbinger_skyriss();
        AddSC_instance_arcatraz();
        AddSC_boss_high_botanist_freywinn();    //TK Botanica
        AddSC_boss_laj();
        AddSC_boss_warp_splinter();
        AddSC_boss_alar();                      //TK The Eye
        AddSC_boss_kaelthas();
        AddSC_boss_void_reaver();
        AddSC_boss_high_astromancer_solarian();
        AddSC_instance_the_eye();
        AddSC_the_eye();
        AddSC_boss_gatewatcher_iron_hand();     //TK The Mechanar
        AddSC_boss_nethermancer_sepethrea();
        AddSC_boss_pathaleon_the_calculator();
        AddSC_instance_mechanar();
    
        AddSC_blades_edge_mountains();
        AddSC_boss_doomlordkazzak();
        AddSC_boss_doomwalker();
        AddSC_hellfire_peninsula();
        AddSC_nagrand();
        AddSC_netherstorm();
        AddSC_shadowmoon_valley();
        AddSC_shattrath_city();
        AddSC_terokkar_forest();
        AddSC_zangarmarsh();
    #endif
    }
    
    void AddNorthrendScripts()
    {
    #ifdef SCRIPTS
        AddSC_boss_slad_ran();               //Gundrak
        AddSC_boss_moorabi();
        AddSC_boss_drakkari_colossus();
        AddSC_boss_gal_darah();
        AddSC_boss_eck();
        AddSC_instance_gundrak();
        AddSC_boss_amanitar();
        AddSC_boss_taldaram();              //Azjol-Nerub Ahn'kahet
        AddSC_boss_elder_nadox();
        AddSC_boss_jedoga_shadowseeker();
        AddSC_boss_volazj();
        AddSC_instance_ahnkahet();
        AddSC_boss_argent_challenge();      //Trial of the Champion
        AddSC_boss_black_knight();
        AddSC_boss_grand_champions();
        AddSC_instance_trial_of_the_champion();
        AddSC_trial_of_the_champion();
        AddSC_boss_anubarak_trial();        //Trial of the Crusader
        AddSC_boss_faction_champions();
        AddSC_boss_jaraxxus();
        AddSC_trial_of_the_crusader();
        AddSC_boss_twin_valkyr();
        AddSC_boss_northrend_beasts();
        AddSC_instance_trial_of_the_crusader();
        AddSC_boss_krik_thir();             //Azjol-Nerub Azjol-Nerub
        AddSC_boss_hadronox();
        AddSC_boss_anub_arak();
        AddSC_instance_azjol_nerub();
        AddSC_boss_anubrekhan();            //Naxxramas
        AddSC_boss_maexxna();
        AddSC_boss_patchwerk();
        AddSC_boss_grobbulus();
        AddSC_boss_razuvious();
        AddSC_boss_kelthuzad();
        AddSC_boss_loatheb();
        AddSC_boss_noth();
        AddSC_boss_gluth();
        AddSC_boss_sapphiron();
        AddSC_boss_four_horsemen();
        AddSC_boss_faerlina();
        AddSC_boss_heigan();
        AddSC_boss_gothik();
        AddSC_boss_thaddius();
        AddSC_instance_naxxramas();
        AddSC_boss_magus_telestra();        //The Nexus Nexus
        AddSC_boss_anomalus();
        AddSC_boss_ormorok();
        AddSC_boss_keristrasza();
        AddSC_instance_nexus();
        AddSC_boss_drakos();                //The Nexus The Oculus
        AddSC_boss_urom();
        AddSC_instance_oculus();
        AddSC_oculus();
        AddSC_boss_sartharion();            //Obsidian Sanctum
        AddSC_instance_obsidian_sanctum();
        AddSC_boss_bjarngrim();             //Ulduar Halls of Lightning
        AddSC_boss_loken();
        AddSC_boss_ionar();
        AddSC_boss_volkhan();
        AddSC_instance_halls_of_lightning();
        AddSC_boss_maiden_of_grief();       //Ulduar Halls of Stone
        AddSC_boss_krystallus();
        AddSC_boss_sjonnir();
        AddSC_instance_halls_of_stone();
        AddSC_halls_of_stone();
        AddSC_boss_algalon();               //Ulduar Ulduar
        AddSC_boss_assembly_of_iron();
        AddSC_boss_auriaya();
        AddSC_boss_flame_leviathan();
        AddSC_boss_freya();
        AddSC_boss_general_vezax();
        AddSC_boss_hodir();
        AddSC_boss_ignis();
        AddSC_boss_kologarn();
        AddSC_boss_mimiron();
        AddSC_boss_razorscale();
        AddSC_boss_thorim();
        AddSC_boss_xt002();
        AddSC_boss_yoggsaron();
        AddSC_ulduar_teleporter();
        AddSC_instance_ulduar();
        AddSC_boss_keleseth();              //Utgarde Keep
        AddSC_boss_skarvald_dalronn();
        AddSC_boss_ingvar_the_plunderer();
        AddSC_instance_utgarde_keep();
        AddSC_boss_svala();                 //Utgarde Pinnacle
        AddSC_boss_palehoof();
        AddSC_boss_skadi();
        AddSC_boss_ymiron();
        AddSC_instance_utgarde_pinnacle();
        AddSC_utgarde_keep();
        AddSC_boss_archavon();              //Vault of Archavon
        AddSC_boss_emalon();
        AddSC_boss_koralon();
        AddSC_boss_toravon();
        AddSC_instance_archavon();
        AddSC_boss_trollgore();             //Drak'Tharon Keep
        AddSC_boss_novos();
        AddSC_boss_dred();
        AddSC_boss_tharon_ja();
        AddSC_instance_drak_tharon();
        AddSC_boss_cyanigosa();             //Violet Hold
        AddSC_boss_erekem();
        AddSC_boss_ichoron();
        AddSC_boss_lavanthor();
        AddSC_boss_moragg();
        AddSC_boss_xevozz();
        AddSC_boss_zuramat();
        AddSC_instance_violet_hold();
        AddSC_violet_hold();
        AddSC_instance_forge_of_souls();   //Forge of Souls
        AddSC_forge_of_souls();
        AddSC_boss_bronjahm();
        AddSC_boss_devourer_of_souls();
        AddSC_instance_pit_of_saron();      //Pit of Saron
        AddSC_pit_of_saron();
        AddSC_boss_garfrost();
        AddSC_boss_ick();
        AddSC_boss_tyrannus();
        AddSC_instance_halls_of_reflection();   // Halls of Reflection
        AddSC_halls_of_reflection();
        AddSC_boss_falric();
        AddSC_boss_marwyn();
        AddSC_boss_lord_marrowgar();        // Icecrown Citadel
        AddSC_boss_lady_deathwhisper();
        AddSC_boss_deathbringer_saurfang();
        AddSC_boss_festergut();
        AddSC_boss_rotface();
        AddSC_boss_professor_putricide();
        AddSC_boss_blood_prince_council();
        AddSC_boss_blood_queen_lana_thel();
        AddSC_icecrown_citadel_teleport();
        AddSC_instance_icecrown_citadel();
    
        AddSC_dalaran();
        AddSC_borean_tundra();
        AddSC_dragonblight();
        AddSC_grizzly_hills();
        AddSC_howling_fjord();
        AddSC_icecrown();
        AddSC_sholazar_basin();
        AddSC_storm_peaks();
        AddSC_zuldrak();
        AddSC_crystalsong_forest();
    #endif
    }
    
    void AddOutdoorPvPScripts()
    {
    #ifdef SCRIPTS
        AddSC_outdoorpvp_ep();
        AddSC_outdoorpvp_hp();
        AddSC_outdoorpvp_na();
        AddSC_outdoorpvp_si();
        AddSC_outdoorpvp_tf();
        AddSC_outdoorpvp_zm();
    #endif
    }
    
    void AddBattlegroundScripts()
    {
    #ifdef SCRIPTS
    #endif
    }
    
    #ifdef SCRIPTS
    /* This is where custom scripts' loading functions should be declared. */
    void AddSC_npc_guildhouses();
    #endif
    
    void AddCustomScripts()
    {
    #ifdef SCRIPTS
        /* This is where custom scripts should be added. */
        AddSC_npc_guildhouses();
    #endif
    }


    • Nama Error : Assembly of Iron Achievement
    The Antechamber of Ulduar (10 player)
    The Antechamber of Ulduar (25 player)
    I Choose You, Runemaster Molgeim (10 player)
    I Choose You, Stormcaller Brundir (10 player)
    I Choose You, Steelbreaker (10 player)
    I Choose You, Runemaster Molgeim (25 player)
    I Choose You, Stormcaller Brundir (25 player)
    I Choose You, Steelbreaker (25 player)
    Can't Do That While Stunned (10 player)
    Can't Do That While Stunned (25 player)

    Referensi: Here
    Kondisi server : Boss dapat dikill tapi Tidak terhitung Kill Credit, Achievements yang sudah jalan diserverBut I'm On Your Side (10 player)
    But I'm On Your Side (25 player)
    Code:
    boss_assembly_of_iron.cpp
    Spoiler untuk cpp :

    Code:
    /*
     * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program. If not, see <http://www.gnu.org/licenses/>.
     */
    
    /* ScriptData
    SDName: Assembly of Iron
    Author: PrinceCreed
    SD%Complete: 100%
    SDComment:
    EndScriptData */
    
    #include "ScriptPCH.h"
    #include "ulduar.h"
    
    enum Spells
    {
        // Any boss
        SPELL_SUPERCHARGE                           = 61920,
        SPELL_BERSERK                               = 47008,    // Hard enrage, don't know the correct ID.
    
        // Steelbreaker
        SPELL_HIGH_VOLTAGE                          = 61890,
        SPELL_FUSION_PUNCH                          = 61903,
        SPELL_STATIC_DISRUPTION                     = 44008, //63494
        SPELL_OVERWHELMING_POWER                    = 64637,
        SPELL_ELECTRICAL_CHARGE                     = 61902,
    
        // Runemaster Molgeim
        SPELL_SHIELD_OF_RUNES                       = 62274,
        SPELL_RUNE_OF_POWER                         = 61973,
        SPELL_RUNE_OF_POWER_VISUAL                  = 61974,
        SPELL_RUNE_OF_DEATH                         = 62269,
        SPELL_RUNE_OF_SUMMONING                     = 62273,
        SPELL_RUNE_OF_SUMMONING_VISUAL              = 62019,
        SPELL_RUNE_OF_SUMMONING_SUMMON              = 62020,
        SPELL_LIGHTNING_BLAST                       = 62054,
    
        // Stormcaller Brundir
        SPELL_CHAIN_LIGHTNING                       = 61879,
        SPELL_OVERLOAD                              = 61869,
        SPELL_LIGHTNING_WHIRL                       = 61915,
        SPELL_LIGHTNING_TENDRILS                    = 61887,
        SPELL_LIGHTNING_TENDRILS_SELF_VISUAL        = 61883,
        SPELL_STORMSHIELD                           = 64187
    };
    
    enum eEnums
    {
        EVENT_ENRAGE,
        // Steelbreaker
        EVENT_FUSION_PUNCH,
        EVENT_STATIC_DISRUPTION,
        EVENT_OVERWHELMING_POWER,
        // Molgeim
        EVENT_RUNE_OF_POWER,
        EVENT_SHIELD_OF_RUNES,
        EVENT_RUNE_OF_DEATH,
        EVENT_RUNE_OF_SUMMONING,
        EVENT_LIGHTNING_BLAST,
        // Brundir
        EVENT_CHAIN_LIGHTNING,
        EVENT_OVERLOAD,
        EVENT_LIGHTNING_WHIRL,
        EVENT_LIGHTNING_TENDRILS,
        EVENT_FLIGHT,
        EVENT_ENDFLIGHT,
        EVENT_GROUND,
        EVENT_LAND,
        EVENT_MOVE_POS
    };
    
    enum Actions
    {
        ACTION_STEELBREAKER,
        ACTION_MOLGEIM,
        ACTION_BRUNDIR
    };
    
    // Achievements
    #define ACHIEVEMENT_ON_YOUR_SIDE                RAID_MODE(2945, 2946) // TODO
    #define ACHIEVEMENT_CANT_WHILE_STUNNED          RAID_MODE(2947, 2948) // TODO
    #define ACHIEVEMENT_CHOOSE_STEELBREAKER         RAID_MODE(2941, 2944)
    #define ACHIEVEMENT_CHOOSE_MOLGEIM              RAID_MODE(2939, 2942)
    #define ACHIEVEMENT_CHOOSE_BRUNDIR              RAID_MODE(2940, 2943)
    
    #define EMOTE_OVERLOAD              "Stormcaller Brundir begins to Overload!"
    
    enum Yells
    {
        SAY_STEELBREAKER_AGGRO                      = -1603020,
        SAY_STEELBREAKER_SLAY_1                     = -1603021,
        SAY_STEELBREAKER_SLAY_2                     = -1603022,
        SAY_STEELBREAKER_POWER                      = -1603023,
        SAY_STEELBREAKER_DEATH_1                    = -1603024,
        SAY_STEELBREAKER_DEATH_2                    = -1603025,
        SAY_STEELBREAKER_BERSERK                    = -1603026,
    
        SAY_MOLGEIM_AGGRO                           = -1603030,
        SAY_MOLGEIM_SLAY_1                          = -1603031,
        SAY_MOLGEIM_SLAY_2                          = -1603032,
        SAY_MOLGEIM_RUNE_DEATH                      = -1603033,
        SAY_MOLGEIM_SUMMON                          = -1603034,
        SAY_MOLGEIM_DEATH_1                         = -1603035,
        SAY_MOLGEIM_DEATH_2                         = -1603036,
        SAY_MOLGEIM_BERSERK                         = -1603037,
    
        SAY_BRUNDIR_AGGRO                           = -1603040,
        SAY_BRUNDIR_SLAY_1                          = -1603041,
        SAY_BRUNDIR_SLAY_2                          = -1603042,
        SAY_BRUNDIR_SPECIAL                         = -1603043,
        SAY_BRUNDIR_FLIGHT                          = -1603044,
        SAY_BRUNDIR_DEATH_1                         = -1603045,
        SAY_BRUNDIR_DEATH_2                         = -1603046,
        SAY_BRUNDIR_BERSERK                         = -1603047,
    };
    
    bool IsEncounterComplete(InstanceScript* pInstance, Creature* me)
    {
       if (!pInstance || !me)
            return false;
    
        for (uint8 i = 0; i < 3; ++i)
        {
            uint64 guid = pInstance->GetData64(DATA_STEELBREAKER+i);
            if (!guid)
                return false;
    
            if (Creature *boss = Unit::GetCreature(*me, guid))
            {
                if (boss->isAlive())
                    return false;
            }
            else
                return false;
        }
        return true;
    }
    
    // Avoid killing bosses one to one
    void CallBosses(InstanceScript* pInstance, uint32 caller, Unit *who)
    {
        // Respawn if dead
        if (Creature* Steelbreaker = who->GetCreature(*who, pInstance->GetData64(DATA_STEELBREAKER)))
            if (Steelbreaker->isDead())
            {            
                Steelbreaker->Respawn(true);
                Steelbreaker->GetMotionMaster()->MoveTargetedHome();
            }
        if (Creature* Brundir = who->GetCreature(*who, pInstance->GetData64(DATA_BRUNDIR)))
            if (Brundir->isDead())
            {
                Brundir->Respawn(true);
                Brundir->GetMotionMaster()->MoveTargetedHome();
            }
        if (Creature* Molgeim = who->GetCreature(*who, pInstance->GetData64(DATA_MOLGEIM)))
            if (Molgeim->isDead())
            {
                Molgeim->Respawn(true);
                Molgeim->GetMotionMaster()->MoveTargetedHome();
            }
        
        for (uint8 i = 0; i < 3; ++i)
        {
            if (caller == DATA_STEELBREAKER+i) continue;
            uint64 guid = pInstance->GetData64(DATA_STEELBREAKER+i);
            if (!guid) return;
            if (Creature* m_boss = pInstance->instance->GetCreature(guid))
            {
                if (m_boss->isAlive())
                {
                    m_boss->AddThreat(who, 100.0f);
                    m_boss->AI()->AttackStart(who);
                }
            }
        }
    }
    
    class boss_steelbreaker : public CreatureScript
    {
    public:
        boss_steelbreaker() : CreatureScript("boss_steelbreaker") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_steelbreakerAI (pCreature);
        }
    
        struct boss_steelbreakerAI : public ScriptedAI
        {
            boss_steelbreakerAI(Creature *c) : ScriptedAI(c)
            {
                pInstance = c->GetInstanceScript();
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
            }
            
            EventMap events;
            InstanceScript* pInstance;
            uint32 phase;
    
            void Reset()
            {
                events.Reset();
                phase = 0;
                me->RemoveAllAuras();
                me->ResetLootMode();
                if (pInstance)
                    pInstance->SetBossState(BOSS_ASSEMBLY, NOT_STARTED);
                
                // Respawn
                if (Creature* Brundir = me->GetCreature(*me, pInstance->GetData64(DATA_BRUNDIR)))
                    if (Brundir->isDead())
                    {
                        Brundir->Respawn(true);
                        Brundir->GetMotionMaster()->MoveTargetedHome();
                    }
                if (Creature* Molgeim = me->GetCreature(*me, pInstance->GetData64(DATA_MOLGEIM)))
                    if (Molgeim->isDead())
                    {
                        Molgeim->Respawn(true);
                        Molgeim->GetMotionMaster()->MoveTargetedHome();
                    }
            }
    
            void EnterCombat(Unit* who)
            {
                DoScriptText(SAY_STEELBREAKER_AGGRO, me);
                DoZoneInCombat();
                CallBosses(pInstance, DATA_STEELBREAKER, who);
                DoCast(me, SPELL_HIGH_VOLTAGE);
                phase = 1;
                events.SetPhase(phase);
                events.ScheduleEvent(EVENT_ENRAGE, 900000);
                events.ScheduleEvent(EVENT_FUSION_PUNCH, 15000);
            }
    
            void JustDied(Unit* /*Killer*/)
            {
                DoScriptText(RAND(SAY_STEELBREAKER_DEATH_1, SAY_STEELBREAKER_DEATH_2), me);
        
                if (IsEncounterComplete(pInstance, me) && pInstance)
                {
                    pInstance->SetBossState(BOSS_ASSEMBLY, DONE);
                    pInstance->DoCompleteAchievement(ACHIEVEMENT_CHOOSE_STEELBREAKER);
                    pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 65195);
                }
                else me->SetLootRecipient(NULL);
                
                if (Creature* Brundir = me->GetCreature(*me, pInstance->GetData64(DATA_BRUNDIR)))
                    if (Brundir->isAlive())
                        Brundir->AI()->DoAction(ACTION_BRUNDIR);
    
                if (Creature* Molgeim = me->GetCreature(*me, pInstance->GetData64(DATA_MOLGEIM)))
                    if (Molgeim->isAlive())
                        Molgeim->AI()->DoAction(ACTION_MOLGEIM);
            }
    
            void KilledUnit(Unit * /*who*/)
            {
                DoScriptText(RAND(SAY_STEELBREAKER_SLAY_1,SAY_STEELBREAKER_SLAY_2), me);
    
                if (phase == 3)
                    DoCast(me, SPELL_ELECTRICAL_CHARGE);
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                    return;
    
                events.Update(diff);
    
                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch(eventId)
                    {
                        case EVENT_ENRAGE:
                            DoScriptText(SAY_STEELBREAKER_BERSERK, me);
                            DoCast(SPELL_BERSERK);
                            break;
                        case EVENT_FUSION_PUNCH:
                            if (me->IsWithinMeleeRange(me->getVictim()))
                                DoCastVictim(SPELL_FUSION_PUNCH);
                            events.ScheduleEvent(EVENT_FUSION_PUNCH, urand(15000, 20000));
                            break;
                        case EVENT_STATIC_DISRUPTION:
                            if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                                DoCast(pTarget, SPELL_STATIC_DISRUPTION);
                            events.ScheduleEvent(EVENT_STATIC_DISRUPTION, 20000 + (rand()%20)*1000);
                            break;
                        case EVENT_OVERWHELMING_POWER:
                            DoScriptText(SAY_STEELBREAKER_POWER, me);
                            DoCastVictim(SPELL_OVERWHELMING_POWER);
                            events.ScheduleEvent(EVENT_OVERWHELMING_POWER, RAID_MODE(60000, 35000));
                            break;
                    }
                }
    
                DoMeleeAttackIfReady();
            }
    
            void DoAction(const int32 action)
            {
                switch (action)
                {
                    case ACTION_STEELBREAKER:
                        me->SetFullHealth();
                        me->AddAura(SPELL_SUPERCHARGE, me);
                        ++phase;
                        events.SetPhase(phase);
                        if (phase >= 2)
                        events.RescheduleEvent(EVENT_STATIC_DISRUPTION, 30000);
                        if (phase >= 3)
                        events.RescheduleEvent(EVENT_OVERWHELMING_POWER, urand(2000, 5000));
                        // Add HardMode Loot
                        me->AddLootMode(LOOT_MODE_HARD_MODE_2);
                        break;
                }
            }
        };
    
    };
    
    class boss_runemaster_molgeim : public CreatureScript
    {
    public:
        boss_runemaster_molgeim() : CreatureScript("boss_runemaster_molgeim") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_runemaster_molgeimAI (pCreature);
        }
    
        struct boss_runemaster_molgeimAI : public ScriptedAI
        {
            boss_runemaster_molgeimAI(Creature *c) : ScriptedAI(c)
            {
                pInstance = c->GetInstanceScript();
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
            }
    
            InstanceScript* pInstance;
            EventMap events;
            uint32 phase;
    
            void Reset()
            {
                if (pInstance)
                    pInstance->SetBossState(BOSS_ASSEMBLY, NOT_STARTED);
                events.Reset();
                me->ResetLootMode();
                me->RemoveAllAuras();
                phase = 0;
            
                // Respawn
                if (Creature* Brundir = me->GetCreature(*me, pInstance->GetData64(DATA_BRUNDIR)))
                    if (Brundir->isDead())
                    {
                        Brundir->Respawn(true);
                        Brundir->GetMotionMaster()->MoveTargetedHome();
                    }
                if (Creature* Steelbreaker = me->GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER)))
                    if (Steelbreaker->isDead())
                    {            
                        Steelbreaker->Respawn(true);
                        Steelbreaker->GetMotionMaster()->MoveTargetedHome();
                    }
            }
    
            void EnterCombat(Unit* who)
            {
                DoScriptText(SAY_MOLGEIM_AGGRO, me);
                DoZoneInCombat();
                CallBosses(pInstance, DATA_MOLGEIM, who);
                phase = 1;
                pInstance->SetBossState(BOSS_ASSEMBLY, IN_PROGRESS);
                events.ScheduleEvent(EVENT_ENRAGE, 900000);
                events.ScheduleEvent(EVENT_SHIELD_OF_RUNES, 30000);
                events.ScheduleEvent(EVENT_RUNE_OF_POWER, 20000);
            }
    
            void JustDied(Unit* /*Killer*/)
            {
                DoScriptText(RAND(SAY_MOLGEIM_DEATH_1, SAY_MOLGEIM_DEATH_2), me);
        
                if (IsEncounterComplete(pInstance, me) && pInstance)
                {
                    pInstance->SetBossState(BOSS_ASSEMBLY, DONE);
                    pInstance->DoCompleteAchievement(ACHIEVEMENT_CHOOSE_MOLGEIM);
                    pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 65195);
                }
                else me->SetLootRecipient(NULL);
                
                if (Creature* Brundir = me->GetCreature(*me, pInstance->GetData64(DATA_BRUNDIR)))
                    if (Brundir->isAlive())
                        Brundir->AI()->DoAction(ACTION_BRUNDIR);
    
                if (Creature* Steelbreaker = me->GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER)))
                    if (Steelbreaker->isAlive())
                        Steelbreaker->AI()->DoAction(ACTION_STEELBREAKER);
            }
    
            void KilledUnit(Unit * /*who*/)
            {
                DoScriptText(RAND(SAY_MOLGEIM_SLAY_1,SAY_MOLGEIM_SLAY_2), me);
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                    return;
    
                events.Update(diff);
    
                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch(eventId)
                    {
                        case EVENT_ENRAGE:
                            DoScriptText(SAY_MOLGEIM_BERSERK, me);
                            DoCast(SPELL_BERSERK);
                            break;
                        case EVENT_RUNE_OF_POWER: // random alive friendly
                        {
                            Creature* bosschoosed;
                            uint32 choice = urand(0,2);
    
                            if (!pInstance) break;
                        
                            bosschoosed = me->GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER+choice));
    
                            if (!bosschoosed || !bosschoosed->isAlive())
                            {
                                choice = ((choice == 2) ? 0 : choice++);
                                bosschoosed = me->GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER+choice));
                                if (!bosschoosed || !bosschoosed->isAlive())
                                {
                                    choice = ((choice == 2) ? 0 : choice++);
                                    bosschoosed = me->GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER+choice));
                                }
                            }
    
                            if (!bosschoosed || !bosschoosed->isAlive())
                                bosschoosed = me->GetCreature(*me, pInstance->GetData64(DATA_MOLGEIM));
                        
                            DoCast(bosschoosed, SPELL_RUNE_OF_POWER);
                            events.ScheduleEvent(EVENT_RUNE_OF_POWER, 35000);
                            break;
                        }
                        case EVENT_SHIELD_OF_RUNES:
                            DoCast(me, SPELL_SHIELD_OF_RUNES);
                            events.ScheduleEvent(EVENT_SHIELD_OF_RUNES, urand(60000, 80000));
                            break;
                        case EVENT_RUNE_OF_DEATH:
                            DoScriptText(SAY_MOLGEIM_RUNE_DEATH, me);
                            if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                                DoCast(pTarget, SPELL_RUNE_OF_DEATH);
                            events.ScheduleEvent(EVENT_RUNE_OF_DEATH, 30000);
                            break;
                        case EVENT_RUNE_OF_SUMMONING:
                            DoScriptText(SAY_MOLGEIM_SUMMON, me);
                            if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                                DoCast(pTarget, SPELL_RUNE_OF_SUMMONING);
                            events.ScheduleEvent(EVENT_RUNE_OF_SUMMONING, urand(40000, 50000));
                            break;
                    }
                }
    
                DoMeleeAttackIfReady();
            }
    
            void DoAction(const int32 action)
            {
                switch (action)
                {
                    case ACTION_MOLGEIM:
                        me->SetFullHealth();
                        me->AddAura(SPELL_SUPERCHARGE, me);
                        ++phase;
                        events.SetPhase(phase);
                        events.RescheduleEvent(EVENT_SHIELD_OF_RUNES, 30000);
                        events.RescheduleEvent(EVENT_RUNE_OF_POWER, 20000);
                        if (phase >= 2)
                            events.RescheduleEvent(EVENT_RUNE_OF_DEATH, 35000);
                        if (phase >= 3)
                            events.RescheduleEvent(EVENT_RUNE_OF_SUMMONING, 40000);
                        // Add HardMode Loot
                        me->AddLootMode(LOOT_MODE_HARD_MODE_1);
                        break;
                }
            }
        };
    
    };
    
    class npc_lightning_elemental : public CreatureScript
    {
    public:
        npc_lightning_elemental() : CreatureScript("npc_lightning_elemental") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_lightning_elementalAI (pCreature);
        }
    
        struct npc_lightning_elementalAI : public ScriptedAI
        {
            npc_lightning_elementalAI(Creature *c) : ScriptedAI(c)
            {
                Charge();
                Casted = false;
            }
    
            bool Casted;
    
            void Charge()
            {
                Unit* pTarget = me->SelectNearestTarget();
                me->AddThreat(pTarget, 5000000.0f);
                AttackStart(pTarget);
            }
    
            void UpdateAI(const uint32 /*diff*/)
            {
                if (!UpdateVictim())
                    return;
    
                if (me->IsWithinMeleeRange(me->getVictim()) && !Casted)
                {
                    me->CastSpell(me, SPELL_LIGHTNING_BLAST, true);
                    me->ForcedDespawn(500);
                    Casted = true;
                }
            }
        };
    
    };
    
    class npc_rune_of_summoning : public CreatureScript
    {
    public:
        npc_rune_of_summoning() : CreatureScript("npc_rune_of_summoning") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_rune_of_summoningAI (pCreature);
        }
    
        struct npc_rune_of_summoningAI : public Scripted_NoMovementAI
        {
            npc_rune_of_summoningAI(Creature *c) : Scripted_NoMovementAI(c)
            {
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED);
            }
    
            uint32 SummonTimer;
    
            void Reset()
            {
                SummonTimer = 1500;
                me->ForcedDespawn(12500);
                DoCast(me, SPELL_RUNE_OF_SUMMONING_VISUAL);
            }
    
            void UpdateAI(const uint32 uiDiff)
            {
                if (SummonTimer <= uiDiff)
                {
                    DoCast(me, SPELL_RUNE_OF_SUMMONING_SUMMON);
                    SummonTimer = 1500;
                } 
                else SummonTimer -= uiDiff;
            }
        };
    
    };
    
    class npc_rune_of_power : public CreatureScript
    {
    public:
        npc_rune_of_power() : CreatureScript("npc_rune_of_power") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_rune_of_powerAI (pCreature);
        }
    
        struct npc_rune_of_powerAI : public Scripted_NoMovementAI
        {
            npc_rune_of_powerAI(Creature *c) : Scripted_NoMovementAI(c)
            {
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED);
                me->setFaction(16);
            }
    
            void Reset()
            {
                DoCast(me, SPELL_RUNE_OF_POWER_VISUAL, true);
                me->ForcedDespawn(35000);
            }
        };
    
    };
    
    
    class boss_stormcaller_brundir : public CreatureScript
    {
    public:
        boss_stormcaller_brundir() : CreatureScript("boss_stormcaller_brundir") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_stormcaller_brundirAI (pCreature);
        }
    
        struct boss_stormcaller_brundirAI : public ScriptedAI
        {
            boss_stormcaller_brundirAI(Creature *c) : ScriptedAI(c)
            {
                pInstance = c->GetInstanceScript();
                me->SetReactState(REACT_PASSIVE);
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
            }
            
            EventMap events;
            InstanceScript* pInstance;
            uint32 phase;
            uint32 Position;
    
            void Reset()
            {
                if (pInstance)
                    pInstance->SetBossState(BOSS_ASSEMBLY, NOT_STARTED);
                me->RemoveAllAuras();
                me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING | MOVEMENTFLAG_WALKING);
                events.Reset();
                phase = 0;
            
                // Respawn
                if (Creature* Molgeim = me->GetCreature(*me, pInstance->GetData64(DATA_MOLGEIM)))
                    if (Molgeim->isDead())
                    {
                        Molgeim->Respawn(true);
                        Molgeim->GetMotionMaster()->MoveTargetedHome();
                    }
                if (Creature* Steelbreaker = me->GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER)))
                    if (Steelbreaker->isDead())
                    {            
                        Steelbreaker->Respawn(true);
                        Steelbreaker->GetMotionMaster()->MoveTargetedHome();
                    }
            }
    
            void EnterCombat(Unit* who)
            {
                DoScriptText(SAY_BRUNDIR_AGGRO, me);
                DoZoneInCombat();
                CallBosses(pInstance, DATA_BRUNDIR, who);
                phase = 1;
                events.ScheduleEvent(EVENT_MOVE_POS, 1000);
                events.ScheduleEvent(EVENT_ENRAGE, 900000);
                events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 2000);
                events.ScheduleEvent(EVENT_OVERLOAD, urand(60000, 120000));
            }
    
            void JustDied(Unit* /*Killer*/)
            {
                DoScriptText(RAND(SAY_BRUNDIR_DEATH_1, SAY_BRUNDIR_DEATH_2), me);
        
                if (IsEncounterComplete(pInstance, me) && pInstance)
                {
                    pInstance->SetBossState(BOSS_ASSEMBLY, DONE);
                    pInstance->DoCompleteAchievement(ACHIEVEMENT_CHOOSE_BRUNDIR);
                    pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 65195);
                    if (me->GetPositionZ() > 428)
                        me->GetMotionMaster()->MoveFall(427.28f);
                }
                else me->SetLootRecipient(NULL);
    
                if (Creature* Molgeim = me->GetCreature(*me, pInstance->GetData64(DATA_MOLGEIM)))
                    if (Molgeim->isAlive())
                        Molgeim->AI()->DoAction(ACTION_MOLGEIM);
    
                if (Creature* Steelbreaker = me->GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER)))
                    if (Steelbreaker->isAlive())
                        Steelbreaker->AI()->DoAction(ACTION_STEELBREAKER);
            }
    
            void KilledUnit(Unit* /*who*/)
            {
                DoScriptText(RAND(SAY_BRUNDIR_SLAY_1,SAY_BRUNDIR_SLAY_2), me);
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                    return;
                
                events.Update(diff);
            
                if (me->HasUnitState(UNIT_STAT_CASTING))
                    return;
    
                while (uint32 eventId = events.ExecuteEvent())
                {
                    switch(eventId)
                    {
                        case EVENT_MOVE_POS:
                            MovePos();
                            events.RescheduleEvent(EVENT_MOVE_POS, 10000);
                            break;            
                        case EVENT_ENRAGE:
                            DoScriptText(SAY_BRUNDIR_BERSERK, me);
                            DoCast(SPELL_BERSERK);
                            break;
                        case EVENT_CHAIN_LIGHTNING:
                            if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                                DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
                            events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, urand(4000, 6000));
                            break;
                        case EVENT_OVERLOAD:
                            me->MonsterTextEmote(EMOTE_OVERLOAD, 0, true);
                            DoScriptText(SAY_BRUNDIR_SPECIAL, me);
                            me->GetMotionMaster()->Initialize();
                            DoCast(SPELL_OVERLOAD);
                            events.ScheduleEvent(EVENT_OVERLOAD, urand(60000, 120000));
                            break;
                        case EVENT_LIGHTNING_WHIRL:
                            me->GetMotionMaster()->Initialize();
                            DoCast(SPELL_LIGHTNING_WHIRL);
                            events.ScheduleEvent(EVENT_LIGHTNING_WHIRL, urand(15000, 20000));
                            break;
                        case EVENT_LIGHTNING_TENDRILS:
                            DoScriptText(SAY_BRUNDIR_FLIGHT, me);
                            DoCast(SPELL_LIGHTNING_TENDRILS);
                            DoCast(SPELL_LIGHTNING_TENDRILS_SELF_VISUAL);
                            me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
                            me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), 435);
                            events.DelayEvents(34000);
                            events.ScheduleEvent(EVENT_FLIGHT, 2500);
                            events.ScheduleEvent(EVENT_ENDFLIGHT, 28000);
                            events.ScheduleEvent(EVENT_LIGHTNING_TENDRILS, 90000);
                            break;
                        case EVENT_FLIGHT:
                            if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                                me->GetMotionMaster()->MovePoint(0, pTarget->GetPositionX(), pTarget->GetPositionY(), 435);
                            events.ScheduleEvent(EVENT_FLIGHT, 6000);
                            break;
                        case EVENT_ENDFLIGHT:
                            me->GetMotionMaster()->MovePoint(0, 1586.920f, 119.849f, 435);
                            events.CancelEvent(EVENT_FLIGHT);
                            events.ScheduleEvent(EVENT_LAND, 4000);
                            break;
                        case EVENT_LAND:
                            me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), 427.28f);
                            events.ScheduleEvent(EVENT_GROUND, 1500);
                            break;
                        case EVENT_GROUND:
                            me->RemoveAurasDueToSpell(SPELL_LIGHTNING_TENDRILS);
                            me->RemoveAurasDueToSpell(SPELL_LIGHTNING_TENDRILS_SELF_VISUAL);
                            me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
                            me->SendMovementFlagUpdate();
                            break;
                    }
                }
            }
    
            void DoAction(const int32 action)
            {
                switch (action)
                {
                    case ACTION_BRUNDIR:
                        me->SetFullHealth();
                        me->AddAura(SPELL_SUPERCHARGE, me);
                        ++phase;
                        events.SetPhase(phase);
                        events.RescheduleEvent(EVENT_CHAIN_LIGHTNING, urand(6000, 12000));
                        events.RescheduleEvent(EVENT_OVERLOAD, 40000);
                        if (phase >= 2)
                            events.RescheduleEvent(EVENT_LIGHTNING_WHIRL, urand(15000, 20000));
                        if (phase >= 3)
                        {
                            me->AddAura(SPELL_STORMSHIELD, me);
                            events.RescheduleEvent(EVENT_LIGHTNING_TENDRILS, 60000);
                        }
                        break;
                }
            }
        
            void MovePos()
            {
                switch(Position)
                {
                    case 0:
                        me->GetMotionMaster()->MovePoint(0, 1587.28f, 97.030f, 427.28f);
                        break;
                    case 1:
                        me->GetMotionMaster()->MovePoint(0, 1587.18f, 121.03f, 427.28f);
                        break;
                    case 2:
                        me->GetMotionMaster()->MovePoint(0, 1587.34f, 142.58f, 427.28f);
                        break;
                    case 3:
                        me->GetMotionMaster()->MovePoint(0, 1587.18f, 121.03f, 427.28f);
                        break;
                }
    
                Position++;
                if (Position > 3)
                {
                    Position = 0;
                }
            }
        };
    
    };
    
    
    void AddSC_boss_assembly_of_iron()
    {
        new boss_steelbreaker();
        new boss_runemaster_molgeim();
        new boss_stormcaller_brundir();
        new npc_lightning_elemental();
        new npc_rune_of_summoning();
        new npc_rune_of_power();
    }
    Last edited by Anz69; 04-11-12 at 07:35.

  4. The Following 3 Users Say Thank You to Anz69 For This Useful Post:
  5. #3
    Anz69's Avatar
    Join Date
    May 2010
    Location
    Grizzly Hills
    Posts
    326
    Points
    372.64
    Thanks: 78 / 136 / 22

    Default

    • Nama Error : XT-002 Achievements
    Heartbreaker (10 player)
    Heartbreaker (25 player)
    Nerf Scrapbots (10 player)
    Nerf Scrapbots (25 player)
    Referensi : Here
    Kondisi Server : Boss dapat dikill tanpa ada fase Heart, achiv yang sudah berfungsi diserver

    Must Deconstruct Faster (10 player)
    Nerf Engineering (10 player)
    Nerf Gravity Bombs (10 player)
    Nerf Gravity Bombs (25 player)
    Nerf Engineering (25 player)
    Must Deconstruct Faster (25 player)
    Code :
    boss_xt002.cpp

    Spoiler untuk CPP :

    Code:
    /*
     * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program. If not, see <http://www.gnu.org/licenses/>.
     */
    
    #include "ScriptPCH.h"
    #include "ulduar.h"
    
    enum Spells
    {
        SPELL_TYMPANIC_TANTRUM                      = 62776,
        SPELL_SEARING_LIGHT_10                      = 63018,
        SPELL_SEARING_LIGHT_25                      = 65121,
    
        SPELL_GRAVITY_BOMB_10                       = 63024,
        SPELL_GRAVITY_BOMB_25                       = 63234,
    
        SPELL_HEARTBREAK_10                         = 65737,
        SPELL_HEARTBREAK_25                         = 64193,
    
        SPELL_ENRAGE                                = 26662,
    
        //------------------VOID ZONE--------------------
        SPELL_VOID_ZONE_10                          = 64203,
        SPELL_VOID_ZONE_25                          = 64235,
        SPELL_VOID_ZONE                             = 46264,
    
        // Life Spark
        SPELL_STATIC_CHARGED_10                     = 64227,
        SPELL_STATIC_CHARGED_25                     = 64236,
        SPELL_SHOCK                                 = 64230,
    
        //----------------XT-002 HEART-------------------
        SPELL_EXPOSED_HEART                         = 63849,
    
        //---------------XM-024 PUMMELLER----------------
        SPELL_ARCING_SMASH                          = 8374,
        SPELL_TRAMPLE                               = 5568,
        SPELL_UPPERCUT                              = 10966,
    
        //------------------BOOMBOT-----------------------
        SPELL_BOOM                                  = 62834,
        
        //------------------SCRAPBOT-----------------------
        SPELL_REPAIR                                = 62832,
    };
    
    enum Timers
    {
        TIMER_TYMPANIC_TANTRUM                      = 60000,
        TIMER_SEARING_LIGHT                         = 20000,
        TIMER_SPAWN_LIFE_SPARK                      = 9000,
        TIMER_GRAVITY_BOMB                          = 20000,
        TIMER_SPAWN_GRAVITY_BOMB                    = 9000,
        TIMER_HEART_PHASE                           = 35000,
        TIMER_ENRAGE                                = 600000,
    
        TIMER_VOID_ZONE                             = 2000,
    
        // Life Spark
        TIMER_SHOCK                                 = 12000,
    
        // Pummeller
        // Timers may be off
        TIMER_ARCING_SMASH                          = 27000,
        TIMER_TRAMPLE                               = 22000,
        TIMER_UPPERCUT                              = 17000,
    
        TIMER_SPAWN_ADD                             = 12000,
    };
    
    enum Creatures
    {
        NPC_VOID_ZONE                               = 34001,
        NPC_LIFE_SPARK                              = 34004,
        NPC_XT002_HEART                             = 33329,
        NPC_XS013_SCRAPBOT                          = 33343,
        NPC_XM024_PUMMELLER                         = 33344,
        NPC_XE321_BOOMBOT                           = 33346,
    };
    
    enum Actions
    {
        ACTION_ENTER_HARD_MODE                      = 0,
        ACTION_DISABLE_NERF_ACHI                    = 1,
    };
    
    enum Yells
    {
        SAY_AGGRO                                   = -1603300,
        SAY_HEART_OPENED                            = -1603301,
        SAY_HEART_CLOSED                            = -1603302,
        SAY_TYMPANIC_TANTRUM                        = -1603303,
        SAY_SLAY_1                                  = -1603304,
        SAY_SLAY_2                                  = -1603305,
        SAY_BERSERK                                 = -1603306,
        SAY_DEATH                                   = -1603307,
        SAY_SUMMON                                  = -1603308,
    };
    
    #define EMOTE_TYMPANIC    "XT-002 Deconstructor begins to cause the earth to quake."
    #define EMOTE_HEART       "XT-002 Deconstructor's heart is exposed and leaking energy."
    #define EMOTE_REPAIR      "XT-002 Deconstructor consumes a scrap bot to repair himself!"
    
    #define ACHIEV_TIMED_START_EVENT                21027
    #define ACHIEVEMENT_HEARTBREAKER                RAID_MODE(3058, 3059)
    #define ACHIEVEMENT_NERF_ENG                    RAID_MODE(2931, 2932)
    
    /************************************************
    -----------------SPAWN LOCATIONS-----------------
    ************************************************/
    //Shared Z-level
    #define SPAWN_Z                                 412
    //Lower right
    #define LR_X                                    796
    #define LR_Y                                    -94
    //Lower left
    #define LL_X                                    796
    #define LL_Y                                    57
    //Upper right
    #define UR_X                                    890
    #define UR_Y                                    -82
    //Upper left
    #define UL_X                                    894
    #define UL_Y                                    62
    
    
    /*-------------------------------------------------------
     *
     *        XT-002 DECONSTRUCTOR
     *
     *///----------------------------------------------------
    class boss_xt002 : public CreatureScript
    {
    public:
        boss_xt002() : CreatureScript("boss_xt002") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_xt002_AI(pCreature);
        }
    
        struct boss_xt002_AI : public BossAI
        {
            boss_xt002_AI(Creature *pCreature) : BossAI(pCreature, BOSS_XT002), vehicle(me->GetVehicleKit())
            {
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
            }
    
            Vehicle *vehicle;
        
            uint32 uiSearingLightTimer;
            uint32 uiSpawnLifeSparkTimer;
            uint32 uiGravityBombTimer;
            uint32 uiSpawnGravityBombTimer;
            uint32 uiTympanicTantrumTimer;
            uint32 uiHeartPhaseTimer;
            uint32 uiSpawnAddTimer;
            uint32 uiEnrageTimer;
    
            bool searing_light_active;
            bool gravity_bomb_active;
            uint64 uiSearingLightTarget;
            uint64 uiGravityBombTarget;
    
            uint8 phase;
            uint8 heart_exposed;
            bool enraged;
    
            bool enterHardMode;
            bool hardMode;
            bool achievement_nerf;
    
            void Reset()
            {
                _Reset();
                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE);
                me->SetReactState(REACT_AGGRESSIVE);
                me->ResetLootMode();
    
                //Makes XT-002 to cast a light bomb 10 seconds after aggro.
                uiSearingLightTimer = TIMER_SEARING_LIGHT / 2;
                uiSpawnLifeSparkTimer = TIMER_SPAWN_LIFE_SPARK;
                uiGravityBombTimer = TIMER_GRAVITY_BOMB;
                uiSpawnGravityBombTimer = TIMER_SPAWN_GRAVITY_BOMB;
                uiHeartPhaseTimer = TIMER_HEART_PHASE;
                uiSpawnAddTimer = TIMER_SPAWN_ADD;
                uiEnrageTimer = TIMER_ENRAGE;
                uiTympanicTantrumTimer = TIMER_TYMPANIC_TANTRUM / 2;
    
                searing_light_active = false;
                gravity_bomb_active = false;
                enraged = false;
                hardMode = false;
                enterHardMode = false;
                achievement_nerf = true;
    
                phase = 1;
                heart_exposed = 0;
    
                if (instance)
                    instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
            }
    
            void EnterCombat(Unit* /*who*/)
            {
                DoScriptText(SAY_AGGRO, me);
                _EnterCombat();
    
                if (instance)
                    instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
            }
    
            void DoAction(const int32 action)
            {
                switch (action)
                {
                    case ACTION_ENTER_HARD_MODE:
                        if (!hardMode)
                        {
                            hardMode = true;
                            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_DISABLE_MOVE);
                            me->SetReactState(REACT_AGGRESSIVE);
                            me->SetStandState(UNIT_STAND_STATE_STAND);
                            DoZoneInCombat();
    
                            uiEnrageTimer = TIMER_ENRAGE;
                            // Add HardMode Loot
                            me->AddLootMode(LOOT_MODE_HARD_MODE_1);
    
                            // Enter hard mode
                            enterHardMode = true;
    
                            // set max health
                            me->SetFullHealth();
    
                            // Get his heartbreak buff
                            DoCast(me, RAID_MODE(SPELL_HEARTBREAK_10, SPELL_HEARTBREAK_25), true);
                        }
                        break;
                    case ACTION_DISABLE_NERF_ACHI:
                        achievement_nerf = false;
                        break;
                }
            }
    
            void KilledUnit(Unit* /*victim*/)
            {
                DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
            }
    
            void JustDied(Unit* /*victim*/)
            {
                DoScriptText(SAY_DEATH, me);
                _JustDied();
    
                // Needed if is killed during the Heart-phase
                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_DISABLE_MOVE);
    
                if (instance)
                {
                    // Heartbreaker
                    if (hardMode)
                        instance->DoCompleteAchievement(ACHIEVEMENT_HEARTBREAKER);
                    // Nerf Engineering
                    if (achievement_nerf)
                        instance->DoCompleteAchievement(ACHIEVEMENT_NERF_ENG);
                }
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                    return;
    
                if (enterHardMode)
                {
                    SetPhaseOne();
                    enterHardMode = false;
                }
    
                // Handles spell casting. These spells only occur during phase 1 and hard mode
                if (phase == 1 || hardMode)
                {
                    if (uiSearingLightTimer <= diff)
                    {
                        if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                        {
                            me->AddAura(RAID_MODE(SPELL_SEARING_LIGHT_10, SPELL_SEARING_LIGHT_25), pTarget);
                            uiSearingLightTarget = pTarget->GetGUID();
                        }
                        uiSpawnLifeSparkTimer = TIMER_SPAWN_LIFE_SPARK;
                        if (hardMode)
                            searing_light_active = true;
                        uiSearingLightTimer = TIMER_SEARING_LIGHT;
                    } else uiSearingLightTimer -= diff;
    
                    if (uiGravityBombTimer <= diff)
                    {
                        if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
                        {
                            me->AddAura(RAID_MODE(SPELL_GRAVITY_BOMB_10,SPELL_GRAVITY_BOMB_25), pTarget);
                            uiGravityBombTarget = pTarget->GetGUID();
                        }
                        uiGravityBombTimer = TIMER_GRAVITY_BOMB;
                        if (hardMode)
                            gravity_bomb_active = true;
                    } else uiGravityBombTimer -= diff;
    
                    if (uiTympanicTantrumTimer <= diff)
                    {
                        DoScriptText(SAY_TYMPANIC_TANTRUM, me);
                        me->MonsterTextEmote(EMOTE_TYMPANIC, 0, true);
                        DoCast(SPELL_TYMPANIC_TANTRUM);
                        uiTympanicTantrumTimer = TIMER_TYMPANIC_TANTRUM;
                    } else uiTympanicTantrumTimer -= diff;
                }
    
                if (!hardMode)
                {
                    if (phase == 1)
                    {
                        if (HealthBelowPct(75) && heart_exposed == 0)
                        {
                            exposeHeart();
                        }
                        else if (HealthBelowPct(50) && heart_exposed == 1)
                        {
                            exposeHeart();
                        }
                        else if (HealthBelowPct(25) && heart_exposed == 2)
                        {
                            exposeHeart();
                        }
    
                        DoMeleeAttackIfReady();
                    }
                    else
                    {
                        //Start summoning adds
                        if (uiSpawnAddTimer <= diff)
                        {
                            //DoScriptText(SAY_SUMMON, me);
    
                            // Spawn Pummeller
                            switch (rand() % 4)
                            {
                                case 0: me->SummonCreature(NPC_XM024_PUMMELLER, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                                case 1: me->SummonCreature(NPC_XM024_PUMMELLER, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                                case 2: me->SummonCreature(NPC_XM024_PUMMELLER, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                                case 3: me->SummonCreature(NPC_XM024_PUMMELLER, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                            }
    
                            // Spawn 5 Scrapbots
                            switch(rand() % 4)
                            {
                                case 0: 
                                    for (int8 n = 0; n < 5; n++)
                                        me->SummonCreature(NPC_XS013_SCRAPBOT, irand(LR_X - 3, LR_X + 3), irand(LR_Y - 3, LR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                                case 1: 
                                    for (int8 n = 0; n < 5; n++)
                                        me->SummonCreature(NPC_XS013_SCRAPBOT, irand(LL_X - 3, LL_X + 3), irand(LL_Y - 3, LL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                                case 2: 
                                    for (int8 n = 0; n < 5; n++)
                                        me->SummonCreature(NPC_XS013_SCRAPBOT, irand(UR_X - 3, UR_X + 3), irand(UR_Y - 3, UR_Y + 3), SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                                case 3: 
                                    for (int8 n = 0; n < 5; n++)
                                        me->SummonCreature(NPC_XS013_SCRAPBOT, irand(UL_X - 3, UL_X + 3), irand(UL_Y - 3, UL_Y + 3), SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                            }
    
                            // Spawn Bombs
                            switch (rand() % 4)
                            {
                                case 0: me->SummonCreature(NPC_XE321_BOOMBOT, LR_X, LR_Y, SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                                case 1: me->SummonCreature(NPC_XE321_BOOMBOT, LL_X, LL_Y, SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                                case 2: me->SummonCreature(NPC_XE321_BOOMBOT, UR_X, UR_Y, SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                                case 3: me->SummonCreature(NPC_XE321_BOOMBOT, UL_X, UL_Y, SPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); break;
                            }
    
                            uiSpawnAddTimer = TIMER_SPAWN_ADD;
                        } else uiSpawnAddTimer -= diff;
    
                        // Is the phase over?
                        if (uiHeartPhaseTimer <= diff)
                        {
                            DoScriptText(SAY_HEART_CLOSED, me);
                            me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
                            SetPhaseOne();
                        }
                        else uiHeartPhaseTimer -= diff;
                    }
                }
                else
                {
                    // Adding life sparks when searing light debuff runs out if hard mode
                    if (searing_light_active)
                    {
                        if (uiSpawnLifeSparkTimer <= diff)
                        {
                            if (Unit *pSearingLightTarget = me->GetUnit(*me, uiSearingLightTarget))
                                pSearingLightTarget->SummonCreature(NPC_LIFE_SPARK, pSearingLightTarget->GetPositionX(), pSearingLightTarget->GetPositionY(), pSearingLightTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
                            uiSpawnLifeSparkTimer = TIMER_SPAWN_LIFE_SPARK;
                            searing_light_active = false;
                        } else uiSpawnLifeSparkTimer -= diff;
                    }
    
                    // Adding void zones when gravity bomb debuff runs out if hard mode
                    if (gravity_bomb_active)
                    {
                        if (uiSpawnGravityBombTimer <= diff)
                        {
                            if (Unit *pGravityBombTarget = me->GetUnit(*me, uiGravityBombTarget))
                                DoCast(pGravityBombTarget, RAID_MODE(SPELL_VOID_ZONE_10, SPELL_VOID_ZONE_25));
                            uiSpawnGravityBombTimer = TIMER_SPAWN_GRAVITY_BOMB;
                            gravity_bomb_active = false;
                        } else uiSpawnGravityBombTimer -= diff;
                    }
    
                    DoMeleeAttackIfReady();
                }
    
                //Enrage stuff
                if (!enraged)
                    if (uiEnrageTimer <= diff)
                    {
                        DoScriptText(SAY_BERSERK, me);
                        DoCast(me, SPELL_ENRAGE);
                        enraged = true;
                    } else uiEnrageTimer -= diff;
            }
    
            void exposeHeart()
            {
                //Make untargetable
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_DISABLE_MOVE);
                me->SetReactState(REACT_PASSIVE);
                me->SetStandState(UNIT_STAND_STATE_SUBMERGED);
                me->AttackStop();
    
                //Summon the heart npc
                if (Creature* Heart = me->SummonCreature(NPC_XT002_HEART, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0,
                    TEMPSUMMON_TIMED_DESPAWN, TIMER_HEART_PHASE))
                    Heart->EnterVehicle(me, 0);
                 
                // Start "end of phase 2 timer"
                uiHeartPhaseTimer = TIMER_HEART_PHASE;
    
                //Phase 2 has offically started
                phase = 2;
                heart_exposed++;
    
                //Reset the add spawning timer
                uiSpawnAddTimer = TIMER_SPAWN_ADD;
    
                DoScriptText(SAY_HEART_OPENED, me);
                me->MonsterTextEmote(EMOTE_HEART, 0, true);
                me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
            }
    
            void SetPhaseOne()
            {
                uiSearingLightTimer = TIMER_SEARING_LIGHT / 2;
                uiGravityBombTimer = TIMER_GRAVITY_BOMB;
                uiTympanicTantrumTimer = TIMER_TYMPANIC_TANTRUM / 2;
                uiSpawnAddTimer = TIMER_SPAWN_ADD;
    
                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_DISABLE_MOVE);
                me->SetReactState(REACT_AGGRESSIVE);
                me->SetStandState(UNIT_STAND_STATE_STAND);
                DoZoneInCombat();
                phase = 1;
            }
        };
    };
    
    /*-------------------------------------------------------
     *
     *        XT-002 HEART
     *
     *///----------------------------------------------------
    class mob_xt002_heart : public CreatureScript
    {
    public:
        mob_xt002_heart() : CreatureScript("mob_xt002_heart") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new mob_xt002_heartAI(pCreature);
        }
    
        struct mob_xt002_heartAI : public ScriptedAI
        {
            mob_xt002_heartAI(Creature* pCreature) : ScriptedAI(pCreature)
            {
                m_pInstance = pCreature->GetInstanceScript();
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
            }
    
            InstanceScript* m_pInstance;
    
            uint32 uiExposeTimer;
            uint32 uiEndExposedTimer;
            bool Exposed;
            bool EndExposed;
    
            void JustDied(Unit* /*victim*/)
            {
                if (m_pInstance)
                    if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(DATA_XT002)))
                        if (pXT002->AI())
                            pXT002->AI()->DoAction(ACTION_ENTER_HARD_MODE);
    
                me->ForcedDespawn();
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!Exposed)
                {
                    if (uiExposeTimer <= diff)
                    {
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->ChangeSeat(1);
                        DoCast(me, SPELL_EXPOSED_HEART, true);
                        Exposed = true;
                    }
                    else uiExposeTimer -= diff;
                }
                
                if (!EndExposed)
                {
                    if (uiEndExposedTimer <= diff)
                    {
                        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->RemoveAllAuras();
                        me->ChangeSeat(0);
                        EndExposed = true;
                    }
                    else uiEndExposedTimer -= diff;
                }
            }
        
            void Reset()
            {
                uiExposeTimer = 3000;
                uiEndExposedTimer = 33000;
                Exposed = false;
                EndExposed = false;
            }
    
            void DamageTaken(Unit *pDone, uint32 &damage)
            {
                if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(DATA_XT002)))
                {
                    if (damage > me->GetHealth())
                        damage = me->GetHealth();
                    
                    if (pDone)
                        pDone->DealDamage(pXT002, damage);
                }
            }
        };
    
    };
    
    /*-------------------------------------------------------
     *
     *        XS-013 SCRAPBOT
     *
     *///----------------------------------------------------
    class mob_scrapbot : public CreatureScript
    {
    public:
        mob_scrapbot() : CreatureScript("mob_scrapbot") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new mob_scrapbotAI(pCreature);
        }
    
        struct mob_scrapbotAI : public ScriptedAI
        {
            mob_scrapbotAI(Creature* pCreature) : ScriptedAI(pCreature)
            {
                m_pInstance = me->GetInstanceScript();
            }
    
            InstanceScript* m_pInstance;
            bool repaired;
    
            void Reset()
            {
                me->SetReactState(REACT_PASSIVE);
                repaired = false;
    
                if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(DATA_XT002)))
                    me->AI()->AttackStart(pXT002);
            }
    
            void UpdateAI(const uint32 /*diff*/)
            {
                if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(DATA_XT002)))
                {
                    if (!repaired && me->GetDistance2d(pXT002) <= 0.5)
                    {
                        me->MonsterTextEmote(EMOTE_REPAIR, 0, true);
    
                        // Increase health with 1 percent
                        pXT002->CastSpell(me, SPELL_REPAIR, true);
                        repaired = true;
    
                        // Disable Nerf Engineering Achievement
                        if (pXT002->AI())
                            pXT002->AI()->DoAction(ACTION_DISABLE_NERF_ACHI);
    
                        // Despawns the scrapbot
                        me->ForcedDespawn(500);
                    }
                }
            }
        };
    
    };
    
    
    /*-------------------------------------------------------
     *
     *        XM-024 PUMMELLER
     *
     *///----------------------------------------------------
    class mob_pummeller : public CreatureScript
    {
    public:
        mob_pummeller() : CreatureScript("mob_pummeller") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new mob_pummellerAI(pCreature);
        }
    
        struct mob_pummellerAI : public ScriptedAI
        {
            mob_pummellerAI(Creature* pCreature) : ScriptedAI(pCreature)
            {
                m_pInstance = pCreature->GetInstanceScript();
            }
    
            InstanceScript* m_pInstance;
            uint32 uiArcingSmashTimer;
            uint32 uiTrampleTimer;
            uint32 uiUppercutTimer;
    
            void Reset()
            {
                uiArcingSmashTimer = TIMER_ARCING_SMASH;
                uiTrampleTimer = TIMER_TRAMPLE;
                uiUppercutTimer = TIMER_UPPERCUT;
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                    return;
    
                if (me->IsWithinMeleeRange(me->getVictim()))
                {
                    if (uiArcingSmashTimer <= diff)
                    {
                        DoCast(me->getVictim(), SPELL_ARCING_SMASH);
                        uiArcingSmashTimer = TIMER_ARCING_SMASH;
                    } else uiArcingSmashTimer -= diff;
    
                    if (uiTrampleTimer <= diff)
                    {
                        DoCast(me->getVictim(), SPELL_TRAMPLE);
                        uiTrampleTimer = TIMER_TRAMPLE;
                    } else uiTrampleTimer -= diff;
    
                    if (uiUppercutTimer <= diff)
                    {
                        DoCast(me->getVictim(), SPELL_UPPERCUT);
                        uiUppercutTimer = TIMER_UPPERCUT;
                    } else uiUppercutTimer -= diff;
                }
    
                DoMeleeAttackIfReady();
            }
        };
    
    };
    
    
    /*-------------------------------------------------------
     *
     *        XE-321 BOOMBOT
     *
     *///----------------------------------------------------
    class mob_boombot : public CreatureScript
    {
    public:
        mob_boombot() : CreatureScript("mob_boombot") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new mob_boombotAI(pCreature);
        }
    
        struct mob_boombotAI : public ScriptedAI
        {
            mob_boombotAI(Creature* pCreature) : ScriptedAI(pCreature)
            {
                m_pInstance = pCreature->GetInstanceScript();
            }
    
            InstanceScript* m_pInstance;
    
            void Reset()
            {
                if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(DATA_XT002)))
                    me->AI()->AttackStart(pXT002);
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(DATA_XT002)))
                {
                    if (me->GetDistance2d(pXT002) <= 0.5 || HealthBelowPct(50))
                    {
                        //Explosion
                        DoCast(me, SPELL_BOOM);
                    }
                }
            }
        };
    
    };
    
    
    /*-------------------------------------------------------
     *
     *        VOID ZONE
     *
     *///----------------------------------------------------
    class mob_void_zone : public CreatureScript
    {
    public:
        mob_void_zone() : CreatureScript("mob_void_zone") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new mob_void_zoneAI(pCreature);
        }
    
        struct mob_void_zoneAI : public ScriptedAI
        {
            mob_void_zoneAI(Creature* pCreature) : ScriptedAI(pCreature)
            {
                m_pInstance = pCreature->GetInstanceScript();
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_PACIFIED);
            }
    
            InstanceScript* m_pInstance;
            uint32 uiVoidZoneTimer;
    
            void Reset()
            {
                uiVoidZoneTimer = TIMER_VOID_ZONE;
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (uiVoidZoneTimer <= diff)
                {
                    DoCast(SPELL_VOID_ZONE);
                    uiVoidZoneTimer = TIMER_VOID_ZONE;
                } else uiVoidZoneTimer -= diff;
            }
        };
    
    };
    
    
    /*-------------------------------------------------------
     *
     *        LIFE SPARK
     *
     *///----------------------------------------------------
    class mob_life_spark : public CreatureScript
    {
    public:
        mob_life_spark() : CreatureScript("mob_life_spark") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new mob_life_sparkAI(pCreature);
        }
    
        struct mob_life_sparkAI : public ScriptedAI
        {
            mob_life_sparkAI(Creature* pCreature) : ScriptedAI(pCreature)
            {
                m_pInstance = pCreature->GetInstanceScript();
            }
    
            InstanceScript* m_pInstance;
            uint32 uiShockTimer;
    
            void Reset()
            {
                DoCast(me, RAID_MODE(SPELL_STATIC_CHARGED_10, SPELL_STATIC_CHARGED_25));
                uiShockTimer = 0; // first one is immediate.
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (m_pInstance && m_pInstance->GetBossState(BOSS_XT002) != IN_PROGRESS)
                    me->ForcedDespawn();
    
                if (uiShockTimer <= diff)
                {
                    if (me->IsWithinMeleeRange(me->getVictim()))
                    {
                        DoCast(me->getVictim(), SPELL_SHOCK);
                        uiShockTimer = TIMER_SHOCK;
                    }
                }
                else uiShockTimer -= diff;
            }
        };
    
    };
    
    void AddSC_boss_xt002()
    {
        new mob_xt002_heart();
        new mob_scrapbot();
        new mob_pummeller();
        new mob_boombot();
        new mob_void_zone();
        new mob_life_spark();
        new boss_xt002();
        
        if (VehicleSeatEntry* vehSeat = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(3004)))
            vehSeat->m_flags |= 0x400;
    }



    • Nama Error : Hodir Achievements
    I Could Say That This Cache Was Rare (10 player)
    I Could Say That This Cache Was Rare (25 player)
    I Have the Coolest Friends (10 player)
    I Have the Coolest Friends (25 player)
    Cheese the Freeze (10 player)
    Cheese the Freeze (25 player)
    Getting Cold in Here (10 player)
    Getting Cold in Here (25 player)
    Staying Buffed All Winter (10 player)
    Staying Buffed All Winter (25 player)
    Referensi : Here
    Kondisi Server : Boss dapat dikill tanpa ada kill credit & Achievements


    Code :
    boss_hodir.cpp

    Spoiler untuk CPP :

    Code:
    /*
     * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program. If not, see <http://www.gnu.org/licenses/>.
     */
    
    /* ScriptData
    SDName: Hodir
    SDAuthor: PrinceCreed
    SD%Complete: 100
    SDComments:
    EndScriptData */
    
    #include "ScriptPCH.h"
    #include "ulduar.h"
    
    enum Spells
    {
        // Hodir
        SPELL_FROZEN_BLOWS                          = 62478,
        SPELL_FLASH_FREEZE                          = 61968,
        SPELL_FLASH_FREEZE_VISUAL                   = 62148,
        SPELL_BITING_COLD                           = 62038,
        SPELL_BITING_COLD_TRIGGERED                 = 62039,
        SPELL_FREEZE                                = 62469,
        SPELL_ICICLE                                = 62234,
        SPELL_ICICLE_SNOWDRIFT                      = 62462,
        SPELL_BLOCK_OF_ICE                          = 61969,
        SPELL_BLOCK_OF_ICE_NPC                      = 61990,
        SPELL_FROZEN_KILL                           = 62226,
        SPELL_ICICLE_FALL                           = 69428,
        SPELL_FALL_DAMAGE                           = 62236,
        SPELL_FALL_SNOWDRIFT                        = 62460,
        SPELL_BERSERK                               = 47008,
        
        // Druids
        SPELL_WRATH                                 = 62793,
        SPELL_STARLIGHT                             = 62807,
        // Shamans
        SPELL_LAVA_BURST                            = 61924,
        SPELL_STORM_CLOUD                           = 65123,
        // Mages
        SPELL_FIREBALL                              = 61909,
        SPELL_CONJURE_FIRE                          = 62823,
        SPELL_MELT_ICE                              = 64528,
        SPELL_SINGED                                = 62821,
        // Priests
        SPELL_SMITE                                 = 61923,
        SPELL_GREATER_HEAL                          = 62809,
        SPELL_DISPEL_MAGIC                          = 63499
    };
    
    // Achievements
    #define ACHIEVEMENT_CHEESE_THE_FREEZE           RAID_MODE(2961, 2962)
    #define ACHIEVEMENT_COLD_IN_HERE                RAID_MODE(2967, 2968)
    #define ACHIEVEMENT_THIS_CACHE_WAS_RARE         RAID_MODE(3182, 3184)
    #define ACHIEVEMENT_COOLEST_FRIENDS             RAID_MODE(2963, 2965)
    
    #define ACTION_FAILED_COOLEST_FRIENDS           1
    
    enum NPCs
    {
        NPC_FLASH_FREEZE_PRE                        = 32926,
        NPC_FLASH_FREEZE                            = 32938,
        NPC_ICICLE_TARGET                           = 33174,
        NPC_HODIR                                   = 32845
    };
    
    enum Events
    {
        EVENT_NONE,
        EVENT_FREEZE,
        EVENT_FLASH_CAST,
        EVENT_FLASH_EFFECT,
        EVENT_ICICLE,
        EVENT_BLOWS,
        EVENT_RARE_CACHE,
        EVENT_BERSERK
    };
    
    enum Yells
    {
        SAY_AGGRO                                   = -1603210,
        SAY_SLAY_1                                  = -1603211,
        SAY_SLAY_2                                  = -1603212,
        SAY_FLASH_FREEZE                            = -1603213,
        SAY_STALACTITE                              = -1603214,
        SAY_DEATH                                   = -1603215,
        SAY_BERSERK                                 = -1603216,
        SAY_YS_HELP                                 = -1603217,
        SAY_HARD_MODE_MISSED                        = -1603218
    };
    
    #define EMOTE_FREEZE                            "Hodir begins to cast Flash Freeze!"
    #define EMOTE_BLOWS                             "Hodir gains Frozen Blows!"
    
    enum HodirChests
    {
        CACHE_OF_WINTER_10                          = 194307,
        CACHE_OF_WINTER_25                          = 194308
    };
    
    struct SummonLocation
    {
        float x,y,z,o;
        uint32 entry;
    };
    
    SummonLocation addLocations[]=
    {
        {1983.75f, -243.36f, 432.767f, 1.57f, 32897}, // Priest 1
        {1999.90f, -230.49f, 432.767f, 1.57f, 33325}, // Druid 1
        {2010.06f, -243.45f, 432.767f, 1.57f, 33328}, // Shaman 1
        {2021.12f, -236.65f, 432.767f, 1.57f, 32893}, // Mage 1
        {2028.10f, -244.66f, 432.767f, 1.57f, 33326}, // Priest 2
        {2014.18f, -232.80f, 432.767f, 1.57f, 32901}, // Druid 2
        {1992.90f, -237.54f, 432.767f, 1.57f, 32900}, // Shaman 2
        {1976.60f, -233.53f, 432.767f, 1.57f, 33327}  // Mage 2
    };
    #define NORMAL_COUNT 4
    #define RAID_COUNT 8
    
    
    class boss_hodir : public CreatureScript
    {
    public:
        boss_hodir() : CreatureScript("boss_hodir") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_hodirAI(pCreature);
        }
    
        struct boss_hodirAI : public BossAI
        {
            boss_hodirAI(Creature *pCreature) : BossAI(pCreature, BOSS_HODIR)
            {
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                me->ApplySpellImmune(0, IMMUNITY_ID, 65280, true);  // Singed
            }
    
            uint32 uiCheckIntenseColdTimer;
            bool bMoreThanTwoIntenseCold;
            bool CheeseTheFreeze;
            bool CoolestFriends;
            bool RareCache;
    
            void Reset()
            {
                _Reset();
            
                me->SetReactState(REACT_PASSIVE);
            
                // Spawn NPC Helpers
                for (uint8 i = 0; i < RAID_MODE(NORMAL_COUNT, RAID_COUNT); i++)
                {
                    if (Creature* pHelper = me->SummonCreature(addLocations[i].entry,addLocations[i].x,addLocations[i].y,addLocations[i].z,addLocations[i].o))
                        if (Creature *pIceBlock = pHelper->SummonCreature(NPC_FLASH_FREEZE_PRE,addLocations[i].x,addLocations[i].y,addLocations[i].z,addLocations[i].o))
                            pHelper->AddThreat(me, 5000000.0f);
                }
            }
    
            void KilledUnit(Unit * /*victim*/)
            {
                if (!(rand()%5))
                    DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me);
            }
    
            void JustDied(Unit * /*victim*/)
            {
                _JustDied();
                DoScriptText(SAY_DEATH, me);
            
                me->setFaction(35);
            
                if (instance)
                {
                    // Kill credit
                    instance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, 64899);
                    // Getting Cold in Here
                    if (!bMoreThanTwoIntenseCold)
                        instance->DoCompleteAchievement(ACHIEVEMENT_COLD_IN_HERE);
                    // Cheese the Freeze
                    if (CheeseTheFreeze)
                        instance->DoCompleteAchievement(ACHIEVEMENT_CHEESE_THE_FREEZE);
                    // I Have the Coolest Friends
                    if (CoolestFriends)
                        instance->DoCompleteAchievement(ACHIEVEMENT_COOLEST_FRIENDS);
                    // I Could Say That This Cache Was Rare
                    if (RareCache)
                    {
                        instance->DoCompleteAchievement(ACHIEVEMENT_THIS_CACHE_WAS_RARE);
                        instance->SetData(DATA_HODIR_RARE_CHEST, GO_STATE_READY);
                    }
                
                    // Chest spawn
                    me->SummonGameObject(RAID_MODE(CACHE_OF_WINTER_10, CACHE_OF_WINTER_25), 1966.43f, -203.906f, 432.687f, -0.91f, 0, 0, 1, 1, 604800);
                }
            }
    
            void EnterCombat(Unit* /*pWho*/)
            {
                _EnterCombat();
                DoScriptText(SAY_AGGRO, me);
                me->SetReactState(REACT_AGGRESSIVE);
                DoCast(me, SPELL_BITING_COLD, true);
                events.ScheduleEvent(EVENT_ICICLE, 2000);
                events.ScheduleEvent(EVENT_FREEZE, 25000);
                events.ScheduleEvent(EVENT_BLOWS, urand(60000, 65000));
                events.ScheduleEvent(EVENT_FLASH_CAST, 50000);
                events.ScheduleEvent(EVENT_RARE_CACHE, 180000);
                events.ScheduleEvent(EVENT_BERSERK, 480000);
                uiCheckIntenseColdTimer = 2000;
                bMoreThanTwoIntenseCold = false;
                CheeseTheFreeze = true;
                CoolestFriends = true;
                RareCache = true;
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                    return;
                
                if (me->getVictim() && !me->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
                    me->Kill(me->getVictim());
    
                events.Update(diff);
            
                if (me->HasUnitState(UNIT_STAT_CASTING))
                    return;
                        
                if (uiCheckIntenseColdTimer < diff && !bMoreThanTwoIntenseCold)
                {
                    std::list<HostileReference*> ThreatList = me->getThreatManager().getThreatList();
                    for (std::list<HostileReference*>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
                    {
                        Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
                        if (!pTarget || pTarget->GetTypeId() != TYPEID_PLAYER)
                            continue;
    
                        Aura *AuraIntenseCold = pTarget->GetAura(SPELL_BITING_COLD_TRIGGERED);
                        if (AuraIntenseCold && AuraIntenseCold->GetStackAmount() > 2)
                        {
                            bMoreThanTwoIntenseCold = true;
                            break;
                        }
                    }
                    uiCheckIntenseColdTimer = 2000;
                } else uiCheckIntenseColdTimer -= diff;
    
                while(uint32 eventId = events.ExecuteEvent())
                {
                    switch(eventId)
                    {
                        case EVENT_FREEZE:
                            DoCastAOE(SPELL_FREEZE);
                            events.ScheduleEvent(EVENT_FREEZE, urand(30000, 35000));
                            break;
                        case EVENT_ICICLE:
                            if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                            {
                                if (pTarget->isAlive())
                                    DoCast(pTarget, SPELL_ICICLE);
                            }
                            events.ScheduleEvent(EVENT_ICICLE, 2000);
                            break;
                        case EVENT_FLASH_CAST:
                            DoScriptText(SAY_FLASH_FREEZE, me);
                            me->MonsterTextEmote(EMOTE_FREEZE, 0, true);
                            for (uint8 i = 0; i < RAID_MODE(2,3); ++i)
                            {
                                if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                                    if (pTarget->isAlive())
                                        pTarget->CastSpell(pTarget, SPELL_ICICLE_SNOWDRIFT, true);
                            }
                            DoCast(SPELL_FLASH_FREEZE);
                            events.RescheduleEvent(EVENT_ICICLE, 15000);
                            events.ScheduleEvent(EVENT_FLASH_CAST, 50000);
                            events.ScheduleEvent(EVENT_FLASH_EFFECT, 9000);
                            break;
                        case EVENT_FLASH_EFFECT:
                            DoCast(SPELL_FLASH_FREEZE_VISUAL);
                            FlashFreeze();
                            events.CancelEvent(EVENT_FLASH_EFFECT);
                            break;
                        case EVENT_BLOWS:
                            DoScriptText(SAY_STALACTITE, me);
                            me->MonsterTextEmote(EMOTE_BLOWS, 0, true);
                            DoCast(me, SPELL_FROZEN_BLOWS);
                            events.ScheduleEvent(EVENT_BLOWS, urand(60000, 65000));
                            break;
                        case EVENT_RARE_CACHE:
                            DoScriptText(SAY_HARD_MODE_MISSED, me);
                            RareCache = false;
                            events.CancelEvent(EVENT_RARE_CACHE);
                            break;
                        case EVENT_BERSERK:
                            DoCast(me, SPELL_BERSERK, true);
                            DoScriptText(SAY_BERSERK, me);
                            events.CancelEvent(EVENT_BERSERK);
                            break;
                    }
                }
    
                DoMeleeAttackIfReady();
            }
    
            void FlashFreeze()
            {
                DoZoneInCombat();
                std::list<HostileReference*> ThreatList = me->getThreatManager().getThreatList();
                for (std::list<HostileReference*>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
                {
                    if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
                    {
                        if (pTarget->HasAura(SPELL_BLOCK_OF_ICE))
                        {
                            DoCast(pTarget, SPELL_FROZEN_KILL);
                            continue;
                        }
                        else
                        {
                            if (GetClosestCreatureWithEntry(pTarget, NPC_ICICLE_TARGET, 5.0f))
                                continue;
                            
                            else if (Creature *pIceBlock = pTarget->SummonCreature(NPC_FLASH_FREEZE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,105000))
                            {
                                if (pTarget->GetTypeId() == TYPEID_PLAYER)
                                    CheeseTheFreeze = false;
                            }
                        }
                    }
                }
            }
        
            void DoAction(const int32 action)
            {
                switch(action)
                {
                    case ACTION_FAILED_COOLEST_FRIENDS:
                        CoolestFriends = false;
                        break;
                }
            }
        };
    
    };
    
    
    class npc_icicle : public CreatureScript
    {
    public:
        npc_icicle() : CreatureScript("npc_icicle") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_icicleAI (pCreature);
        }
    
        struct npc_icicleAI : public Scripted_NoMovementAI
        {
            npc_icicleAI(Creature *pCreature) : Scripted_NoMovementAI(pCreature)
            {
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED);
                me->SetReactState(REACT_PASSIVE);
                me->SetDisplayId(28470);
            }
    
            uint32 IcicleTimer;
    
            void Reset()
            {
                IcicleTimer = 2000;
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (IcicleTimer <= diff)
                {
                    DoCast(me, SPELL_FALL_DAMAGE);
                    DoCast(me, SPELL_ICICLE_FALL);
                    IcicleTimer = 10000;
                }
                else IcicleTimer -= diff;
            }
        };
    
    };
    
    
    class npc_icicle_snowdrift : public CreatureScript
    {
    public:
        npc_icicle_snowdrift() : CreatureScript("npc_icicle_snowdrift") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_icicle_snowdriftAI (pCreature);
        }
    
        struct npc_icicle_snowdriftAI : public Scripted_NoMovementAI
        {
            npc_icicle_snowdriftAI(Creature *pCreature) : Scripted_NoMovementAI(pCreature)
            {
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED);
                me->SetReactState(REACT_PASSIVE);
                me->SetDisplayId(28470);
            }
    
            uint32 IcicleTimer;
    
            void Reset()
            {
                IcicleTimer = 2000;
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (IcicleTimer <= diff)
                {
                    DoCast(me, SPELL_FALL_SNOWDRIFT);
                    DoCast(me, SPELL_ICICLE_FALL);
                    IcicleTimer = 10000;
                }
                else IcicleTimer -= diff;
            }
        };
    
    };
    
    
    class npc_snowpacked_icicle : public CreatureScript
    {
    public:
        npc_snowpacked_icicle() : CreatureScript("npc_snowpacked_icicle") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_snowpacked_icicleAI (pCreature);
        }
    
        struct npc_snowpacked_icicleAI : public Scripted_NoMovementAI
        {
            npc_snowpacked_icicleAI(Creature *pCreature) : Scripted_NoMovementAI(pCreature)
            {
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED);
                me->SetReactState(REACT_PASSIVE);
                me->SetDisplayId(15880);
            }
    
            uint32 DespawnTimer;
    
            void Reset()
            {
                DespawnTimer = 12000;
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (DespawnTimer <= diff)
                {
                    if (GameObject *pSnowdrift = me->FindNearestGameObject(194173, 2))
                        me->RemoveGameObject(pSnowdrift, true);
                    me->ForcedDespawn();
                }
                else DespawnTimer -= diff;
            }
        };
    
    };
    
    
    class npc_hodir_priest : public CreatureScript
    {
    public:
        npc_hodir_priest() : CreatureScript("npc_hodir_priest") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_hodir_priestAI (pCreature);
        }
    
        struct npc_hodir_priestAI : public ScriptedAI
        {
            npc_hodir_priestAI(Creature *pCreature) : ScriptedAI(pCreature)
            {
                pInstance = pCreature->GetInstanceScript();
                me->setFaction(1665);
            }
    
            InstanceScript* pInstance;
            uint32 HealTimer;
            uint32 DispelTimer;
    
            void Reset()
            {
                HealTimer = urand(4000, 8000);
                DispelTimer = urand(20000, 30000);
            }
    
            void AttackStart(Unit *who)
            {
                AttackStartCaster(who, 20);
            }
    
            void UpdateAI(const uint32 uiDiff)
            {
                if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED))
                    return;
    
                if (HealthBelowPct(35))
                    DoCastAOE(SPELL_GREATER_HEAL, true);
    
                if (HealTimer <= uiDiff)
                {
                    DoCastAOE(SPELL_GREATER_HEAL, true);
                    HealTimer = urand(12000, 14000);
                }
                else HealTimer -= uiDiff;
            
                if (DispelTimer < uiDiff)
                {
                    std::list<Player*> players;
                    Trinity::AnyPlayerInObjectRangeCheck checker(me, 30);
                    Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(me, players, checker);
                    me->VisitNearbyWorldObject(30, searcher);
                    if (!players.empty())
                    {
                        for (std::list<Player*>::iterator iter = players.begin(); iter != players.end(); ++iter)
                        {
                            if ((*iter)->HasAura(SPELL_FREEZE))
                            {
                                DoCast((*iter),SPELL_DISPEL_MAGIC, true);
                                DispelTimer = urand(25000,30000);
                                return;
                            }
                        }
                    }
                    DispelTimer = 5000;
                }
                else DispelTimer -= uiDiff;
    
                DoSpellAttackIfReady(SPELL_SMITE);
            }
    
            void JustDied(Unit* /*victim*/)
            {
                // I Have the Coolest Friends
                if (Creature* pHodir = me->FindNearestCreature(NPC_HODIR,60,true))
                    pHodir->AI()->DoAction(ACTION_FAILED_COOLEST_FRIENDS);
            }
        };
    
    };
    
    
    class npc_hodir_shaman : public CreatureScript
    {
    public:
        npc_hodir_shaman() : CreatureScript("npc_hodir_shaman") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_hodir_shamanAI (pCreature);
        }
    
        struct npc_hodir_shamanAI : public ScriptedAI
        {
            npc_hodir_shamanAI(Creature *pCreature) : ScriptedAI(pCreature)
            {
                pInstance = pCreature->GetInstanceScript();
                me->setFaction(1665);
            }
    
            InstanceScript* pInstance;
            uint32 StormTimer;
    
            void Reset()
            {
                StormTimer = urand(15000, 20000);
            }
    
            void AttackStart(Unit *who)
            {
                AttackStartCaster(who, 20);
            }
    
            void UpdateAI(const uint32 uiDiff)
            {
                if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED))
                    return;
    
                if (StormTimer <= uiDiff)
                {
                    std::list<Player*> players;
                    Trinity::AnyPlayerInObjectRangeCheck checker(me, 30);
                    Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(me, players, checker);
                    me->VisitNearbyWorldObject(30, searcher);
                    if (!players.empty())
                    {
                        std::list<Player*>::iterator iter = players.begin(); 
                        DoCast((*iter), SPELL_STORM_CLOUD, true);
                    }
                    StormTimer = urand(15000, 20000);
                }
                else StormTimer -= uiDiff;
    
                DoSpellAttackIfReady(SPELL_LAVA_BURST);
            }
    
            void JustDied(Unit* /*victim*/)
            {
                // I Have the Coolest Friends
                if (Creature* pHodir = me->FindNearestCreature(NPC_HODIR,60,true))
                    pHodir->AI()->DoAction(ACTION_FAILED_COOLEST_FRIENDS);
            }
        };
    
    };
    
    
    class npc_hodir_druid : public CreatureScript
    {
    public:
        npc_hodir_druid() : CreatureScript("npc_hodir_druid") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_hodir_druidAI (pCreature);
        }
    
        struct npc_hodir_druidAI : public ScriptedAI
        {
            npc_hodir_druidAI(Creature *pCreature) : ScriptedAI(pCreature)
            {
                pInstance = pCreature->GetInstanceScript();
                me->setFaction(1665);
            }
    
            InstanceScript* pInstance;
            uint32 StarlightTimer;
    
            void Reset()
            {
                StarlightTimer = urand(10000, 15000);
            }
    
            void AttackStart(Unit *who)
            {
                AttackStartCaster(who, 20);
            }
    
            void UpdateAI(const uint32 uiDiff)
            {
                if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED))
                    return;
    
                if (StarlightTimer <= uiDiff)
                {
                    DoCast(me, SPELL_STARLIGHT, true);
                    StarlightTimer = urand(20000, 25000);
                }
                else StarlightTimer -= uiDiff;
    
                DoSpellAttackIfReady(SPELL_WRATH);
            }
    
            void JustDied(Unit* /*victim*/)
            {
                // I Have the Coolest Friends
                if (Creature* pHodir = me->FindNearestCreature(NPC_HODIR,60,true))
                    pHodir->AI()->DoAction(ACTION_FAILED_COOLEST_FRIENDS);
            }
        };
    
    };
    
    
    class npc_hodir_mage : public CreatureScript
    {
    public:
        npc_hodir_mage() : CreatureScript("npc_hodir_mage") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_hodir_mageAI (pCreature);
        }
    
        struct npc_hodir_mageAI : public ScriptedAI
        {
            npc_hodir_mageAI(Creature *pCreature) : ScriptedAI(pCreature)
            {
                pInstance = pCreature->GetInstanceScript();
                me->setFaction(1665);
            }
    
            InstanceScript* pInstance;
            uint32 FireTimer;
            uint32 MeltIceTimer;
    
            void Reset()
            {
                FireTimer = urand(15000, 20000);
                MeltIceTimer = 5000;
            }
    
            void AttackStart(Unit *who)
            {
                AttackStartCaster(who, 20);
            }
    
            void UpdateAI(const uint32 uiDiff)
            {
                if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED))
                    return;
    
                if (FireTimer <= uiDiff)
                {
                    DoCast(me, SPELL_CONJURE_FIRE, true);
                    FireTimer = urand(25000, 30000);
                }
                else FireTimer -= uiDiff;
            
                if (MeltIceTimer < uiDiff)
                {
                    if (Creature *pShard = me->FindNearestCreature(NPC_FLASH_FREEZE,50,true))
                    {
                        DoCast(pShard, SPELL_MELT_ICE, true);
                        MeltIceTimer = urand(5000,10000);
                    }
                    MeltIceTimer = 5000;
                }
                else MeltIceTimer -= uiDiff;
    
                DoSpellAttackIfReady(SPELL_FIREBALL);
            }
    
            void JustDied(Unit* /*victim*/)
            {
                // I Have the Coolest Friends
                if (Creature* pHodir = me->FindNearestCreature(NPC_HODIR,60,true))
                    pHodir->AI()->DoAction(ACTION_FAILED_COOLEST_FRIENDS);
            }
        };
    
    };
    
    
    class npc_toasty_fire : public CreatureScript
    {
    public:
        npc_toasty_fire() : CreatureScript("npc_toasty_fire") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_toasty_fireAI (pCreature);
        }
    
        struct npc_toasty_fireAI : public Scripted_NoMovementAI
        {
            npc_toasty_fireAI(Creature *pCreature) : Scripted_NoMovementAI(pCreature)
            {
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
                me->SetReactState(REACT_PASSIVE);
                me->SetDisplayId(15880);
            }
    
            void Reset()
            {
                DoCast(me, SPELL_SINGED, true);
            }
    
            void SpellHit(Unit* /*caster*/, const SpellEntry *spell) 
            {
                // Toasty fire can be extinguished by falling ice or Flash Freeze
                if (spell->Id == SPELL_BLOCK_OF_ICE || spell->Id == 62457 || spell->Id == 65370)
                {
                    if (GameObject *pFire = me->FindNearestGameObject(194300, 4))
                        me->RemoveGameObject(pFire, true);
                    me->ForcedDespawn();
                }
            }
    
            void JustDied(Unit * /*victim*/)
            {
                if (GameObject *pFire = me->FindNearestGameObject(194300, 4))
                    me->RemoveGameObject(pFire, true);
            }
        };
    
    };
    
    
    class npc_flash_freeze : public CreatureScript
    {
    public:
        npc_flash_freeze() : CreatureScript("npc_flash_freeze") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_flash_freezeAI (pCreature);
        }
    
        struct npc_flash_freezeAI : public Scripted_NoMovementAI
        {
            npc_flash_freezeAI(Creature *pCreature) : Scripted_NoMovementAI(pCreature)
            {
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                me->setFaction(25865);
                me->setFaction(14);
            }
    
            void Reset()
            {
                if (me->ToTempSummon()->GetSummoner())
                {
                    if (me->GetEntry() == NPC_FLASH_FREEZE_PRE)
                        DoCast(SPELL_BLOCK_OF_ICE_NPC);
                    else
                        DoCast(SPELL_BLOCK_OF_ICE);
    
                    me->ToTempSummon()->GetSummoner()->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                }
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!me->ToTempSummon()->GetSummoner())
                {
                    me->DisappearAndDie();
                    return;
                }
    
                if (me->ToTempSummon()->GetSummoner()->isDead())
                {
                    me->ToTempSummon()->GetSummoner()->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, false);
                    me->DisappearAndDie();
                    return;
                }
    
                if (me->GetEntry() == NPC_FLASH_FREEZE_PRE && !me->ToTempSummon()->GetSummoner()->HasAura(SPELL_BLOCK_OF_ICE_NPC))
                    DoCast(SPELL_BLOCK_OF_ICE_NPC);
            }
    
            void DamageTaken(Unit* pKiller, uint32 &damage)
            {
                if (me->GetEntry() == NPC_FLASH_FREEZE_PRE)
                {
                    if (pKiller && pKiller->GetTypeId() == TYPEID_PLAYER)
                        if (Creature* pHodir = me->FindNearestCreature(NPC_HODIR, 40, true))
                            if (!pHodir->isInCombat())
                                pHodir->AI()->DoZoneInCombat();
                }
            }
    
            void JustDied(Unit * /*victim*/)
            {
                if (me->ToTempSummon()->GetSummoner())
                    me->ToTempSummon()->GetSummoner()->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, false);
            }
        };
    
    };
    
    
    void AddSC_boss_hodir()
    {
        new boss_hodir();
        new npc_icicle();
        new npc_icicle_snowdrift();
        new npc_snowpacked_icicle();
        new npc_hodir_priest();
        new npc_hodir_shaman();
        new npc_hodir_druid();
        new npc_hodir_mage();
        new npc_toasty_fire();
        new npc_flash_freeze();
    }




    • Nama Error : Thorim & Achievements
    Don't Stand in the Lightning (10 player)
    Don't Stand in the Lightning (25 player)
    I'll Take You All On (10 player)
    I'll Take You All On (25 player)
    Siffed (10 player)Lose Your Illusion (10 player)
    Siffed (25 player)Lose Your Illusion (25 player)
    Who Needs Bloodlust? (10 player)
    Who Needs Bloodlust? (25 player)
    Referensi : Here
    Kondisi Server : Event & Boss Belum Dapat Di-engage


    Code :
    boss_thorim.cpp

    Spoiler untuk CPP :

    Code:
    /*
     * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program. If not, see <http://www.gnu.org/licenses/>.
     */
    
    /* ScriptData
    SDName: Thorim
    SDAuthor: PrinceCreed
    SD%Complete: 75
    SDComments: Lightning Charge not works.
    EndScriptData */
    
    #include "ScriptPCH.h"
    #include "ulduar.h"
    
    // Thorim Spells
    enum Spells
    {
        SPELL_SHEAT_OF_LIGHTNING                    = 62276,
        SPELL_STORMHAMMER                           = 62042,
        SPELL_DEAFENING_THUNDER                     = 62470,
        SPELL_CHARGE_ORB                            = 62016,
        SPELL_SUMMON_LIGHTNING_ORB                  = 62391,
        SPELL_TOUCH_OF_DOMINION                     = 62565,
        SPELL_CHAIN_LIGHTNING                       = 62131,
        SPELL_LIGHTNING_CHARGE                      = 62279,
        SPELL_LIGHTNING_DESTRUCTION                 = 62393,
        SPELL_LIGHTNING_RELEASE                     = 62466,
        SPELL_UNBALANCING_STRIKE                    = 62130,
        SPELL_BERSERK                               = 62560
    };
    
    enum Phases
    {
        PHASE_NULL,
        PHASE_1,
        PHASE_2
    };
    
    enum Events
    {
        EVENT_NONE,
        EVENT_STORMHAMMER,
        EVENT_CHARGE_ORB,
        EVENT_SUMMON_ADDS,
        EVENT_BERSERK,
        EVENT_UNBALANCING_STRIKE,
        EVENT_CHAIN_LIGHTNING,
        EVENT_TRANSFER_ENERGY,
        EVENT_RELEASE_ENERGY
    };
    
    enum Yells
    {
        SAY_AGGRO_1                                 = -1603270,
        SAY_AGGRO_2                                 = -1603271,
        SAY_SPECIAL_1                               = -1603272,
        SAY_SPECIAL_2                               = -1603273,
        SAY_SPECIAL_3                               = -1603274,
        SAY_JUMPDOWN                                = -1603275,
        SAY_SLAY_1                                  = -1603276,
        SAY_SLAY_2                                  = -1603277,
        SAY_BERSERK                                 = -1603278,
        SAY_WIPE                                    = -1603279,
        SAY_DEATH                                   = -1603280,
        SAY_END_NORMAL_1                            = -1603281,
        SAY_END_NORMAL_2                            = -1603282,
        SAY_END_NORMAL_3                            = -1603283,
        SAY_END_HARD_1                              = -1603284,
        SAY_END_HARD_2                              = -1603285,
        SAY_END_HARD_3                              = -1603286,
        SAY_YS_HELP                                 = -1603287
    };
    
    #define EMOTE_BARRIER                           "Runic Colossus surrounds itself with a crackling Runic Barrier!"
    #define EMOTE_MIGHT                             "Ancient Rune Giant fortifies nearby allies with runic might!"
    
    // Thorim Pre-Phase Adds
    enum PreAdds
    {
        BEHEMOTH,
        MERCENARY_CAPTAIN_A,
        MERCENARY_SOLDIER_A,
        DARK_RUNE_ACOLYTE,
        MERCENARY_CAPTAIN_H,
        MERCENARY_SOLDIER_H
    };
    
    const uint32 PRE_PHASE_ADD[]                    = {32882, 32908, 32885, 32886, 32907, 32883};
    #define SPELL_PRE_PRIMARY(i)                    RAID_MODE(SPELL_PRE_PRIMARY_N[i],SPELL_PRE_PRIMARY_H[i])
    const uint32 SPELL_PRE_PRIMARY_N[]              = {62315, 62317, 62318, 62333, 62317, 62318};
    const uint32 SPELL_PRE_PRIMARY_H[]              = {62415, 62317, 62318, 62441, 62317, 62318};
    #define SPELL_PRE_SECONDARY(i)                  RAID_MODE(SPELL_PRE_SECONDARY_N[i],SPELL_PRE_SECONDARY_H[i])
    const uint32 SPELL_PRE_SECONDARY_N[]            = {62316, 62444, 16496, 62334, 62444, 62318};
    const uint32 SPELL_PRE_SECONDARY_H[]            = {62417, 62444, 16496, 62442, 62444, 62318};
    #define SPELL_HOLY_SMITE                        RAID_MODE(62335, 62443)
    
    #define INCREASE_PREADDS_COUNT                  1
    #define MAX_HARD_MODE_TIME                      180000 // 3 Minutes
    
    // Achievements
    #define ACHIEVEMENT_SIFFED                      RAID_MODE(2977, 2978)
    #define ACHIEVEMENT_LOSE_ILLUSION               RAID_MODE(3176, 3183)
    
    // Thorim Arena Phase Adds
    enum ArenaAdds
    {
        DARK_RUNE_CHAMPION,
        DARK_RUNE_COMMONER,
        DARK_RUNE_EVOKER,
        DARK_RUNE_WARBRINGER,
        IRON_RING_GUARD,
        IRON_HONOR_GUARD
    };
    
    #define NPC_SIF                                 33196
    
    const uint32 ARENA_PHASE_ADD[]                  = {32876, 32904, 32878, 32877, 32874, 32875, 33110};
    #define SPELL_ARENA_PRIMARY(i)                  RAID_MODE(SPELL_ARENA_PRIMARY_N[i],SPELL_ARENA_PRIMARY_H[i])
    const uint32 SPELL_ARENA_PRIMARY_N[]            = {35054, 62326, 62327, 62322, 64151, 42724, 62333};
    const uint32 SPELL_ARENA_PRIMARY_H[]            = {35054, 62326, 62445, 62322, 64151, 42724, 62441};
    #define SPELL_ARENA_SECONDARY(i)                RAID_MODE(SPELL_ARENA_SECONDARY_N[i],SPELL_ARENA_SECONDARY_H[i])
    const uint32 SPELL_ARENA_SECONDARY_N[]          = {15578, 38313, 62321, 0, 62331, 62332, 62334};
    const uint32 SPELL_ARENA_SECONDARY_H[]          = {15578, 38313, 62529, 0, 62418, 62420, 62442};
    #define SPELL_AURA_OF_CELERITY                  62320
    #define SPELL_CHARGE                            32323
    #define SPELL_RUNIC_MENDING                     RAID_MODE(62328, 62446)
    
    // Runic Colossus (Mini Boss) Spells
    enum RunicSpells
    {
        SPELL_SMASH                                 = 62339,
        SPELL_RUNIC_BARRIER                         = 62338,
        SPELL_RUNIC_CHARGE                          = 62613
    };
    
    // Ancient Rune Giant (Mini Boss) Spells
    enum AncientSpells
    {
        SPELL_RUNIC_FORTIFICATION                   = 62942,
        SPELL_RUNE_DETONATION                       = 62526,
        SPELL_STOMP                                 = 62411,
    };
    
    // Sif Spells
    enum SifSpells
    {
        SPELL_FROSTBOLT_VOLLEY                      = 62580,
        SPELL_FROSTNOVA                             = 62597,
        SPELL_BLIZZARD                              = 62576,
        SPELL_FROSTBOLT                             = 69274
    };
    
    enum ThorimChests
    {
        CACHE_OF_STORMS_10                          = 194312,
        CACHE_OF_STORMS_HARDMODE_10                 = 194313,
        CACHE_OF_STORMS_25                          = 194314,
        CACHE_OF_STORMS_HARDMODE_25                 = 194315
    };
    
    const Position Pos[7] =
    {
    {2095.53f, -279.48f, 419.84f, 0.504f},
    {2092.93f, -252.96f, 419.84f, 6.024f},
    {2097.86f, -240.97f, 419.84f, 5.643f},
    {2113.14f, -225.94f, 419.84f, 5.259f},
    {2156.87f, -226.12f, 419.84f, 4.202f},
    {2172.42f, -242.70f, 419.84f, 3.583f},
    {2171.92f, -284.59f, 419.84f, 2.691f}
    };
    
    const Position PosOrbs[7] =
    {
    {2104.99f, -233.484f, 433.576f, 5.49779f},
    {2092.64f, -262.594f, 433.576f, 6.26573f},
    {2104.76f, -292.719f, 433.576f, 0.78539f},
    {2164.97f, -293.375f, 433.576f, 2.35619f},
    {2164.58f, -233.333f, 433.576f, 3.90954f},
    {2145.81f, -222.196f, 433.576f, 4.45059f},
    {2123.91f, -222.443f, 433.576f, 4.97419f}
    };
    
    const Position PosCharge[7] =
    {
    {2104.99f, -233.484f, 419.573f, 5.49779f},
    {2092.64f, -262.594f, 419.573f, 6.26573f},
    {2104.76f, -292.719f, 419.573f, 0.78539f},
    {2164.97f, -293.375f, 419.573f, 2.35619f},
    {2164.58f, -233.333f, 419.573f, 3.90954f},
    {2145.81f, -222.196f, 419.573f, 4.45059f},
    {2123.91f, -222.443f, 419.573f, 4.97419f}
    };
    
    #define POS_X_ARENA  2181.19f
    #define POS_Y_ARENA  -299.12f
    
    #define IN_ARENA(who) (who->GetPositionX() < POS_X_ARENA && who->GetPositionY() > POS_Y_ARENA)
    
    struct SummonLocation
    {
        float x,y,z,o;
        uint32 entry;
    };
    
    SummonLocation preAddLocations[]=
    {
        {2149.68f, -263.477f, 419.679f, 3.120f, 32882},
        {2131.31f, -271.640f, 419.840f, 2.188f, 32908},
        {2127.24f, -259.182f, 419.974f, 5.917f, 32885},
        {2123.32f, -254.770f, 419.840f, 6.170f, 32885},
        {2120.10f, -258.990f, 419.840f, 6.250f, 32885},
        {2129.09f, -277.142f, 419.756f, 1.222f, 32886}
    };
    
    SummonLocation colossusAddLocations[]=
    {
        {2218.38f, -297.50f, 412.18f, 1.030f, 32874},
        {2235.07f, -297.98f, 412.18f, 1.613f, 32874},
        {2235.26f, -338.34f, 412.18f, 1.589f, 32874},
        {2217.69f, -337.39f, 412.18f, 1.241f, 32874},
        {2227.58f, -308.30f, 412.18f, 1.591f, 33110},
        {2227.47f, -345.37f, 412.18f, 1.566f, 33110}
    };
    
    SummonLocation giantAddLocations[]=
    {
        {2198.05f, -428.77f, 419.95f, 6.056f, 32875},
        {2220.31f, -436.22f, 412.26f, 1.064f, 32875},
        {2158.88f, -441.73f, 438.25f, 0.127f, 32875},
        {2198.29f, -436.92f, 419.95f, 0.261f, 33110},
        {2230.93f, -434.27f, 412.26f, 1.931f, 33110}
    };
    
    
    class boss_thorim : public CreatureScript
    {
    public:
        boss_thorim() : CreatureScript("boss_thorim") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_thorimAI(pCreature);
        }
    
        struct boss_thorimAI : public BossAI
        {
            boss_thorimAI(Creature* pCreature) : BossAI(pCreature, BOSS_THORIM)
            {
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                bWipe = false;
            }
    
            Phases phase;
    
            uint8 PreAddsCount;
            uint8 spawnedAdds;
            uint32 EncounterTime;
            bool bWipe;
            bool HardMode;
    
            void Reset()
            {
                if (bWipe)
                    DoScriptText(SAY_WIPE, me);
                
                _Reset();
            
                me->SetReactState(REACT_PASSIVE);
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE);
                bWipe = false;
                HardMode = false;
                PreAddsCount = 0;
                spawnedAdds = 0;
            
                // Respawn Mini Bosses
                for (uint8 i = DATA_RUNIC_COLOSSUS; i <= DATA_RUNE_GIANT; i++)
                    if (Creature* pMiniBoss = me->GetCreature(*me, instance->GetData64(i)))
                        pMiniBoss->Respawn(true);
    
                // Spawn Pre-Phase Adds
                for (uint8 i = 0; i < 6; i++)
                    me->SummonCreature(preAddLocations[i].entry,preAddLocations[i].x,preAddLocations[i].y,preAddLocations[i].z,preAddLocations[i].o,TEMPSUMMON_CORPSE_TIMED_DESPAWN,3000);
            }
    
            void KilledUnit(Unit * /*victim*/)
            {
                if (!(rand()%5))
                    DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
            }
    
            void JustDied(Unit * /*victim*/)
            {
                DoScriptText(SAY_DEATH, me);
                _JustDied();
            
                me->setFaction(35);
            
                if (instance)
                {
                    // Kill credit
                    instance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 64985);
                    // Lose Your Illusion
                    if (HardMode)
                    {
                        instance->DoCompleteAchievement(ACHIEVEMENT_LOSE_ILLUSION);
                        me->SummonGameObject(RAID_MODE(CACHE_OF_STORMS_HARDMODE_10, CACHE_OF_STORMS_HARDMODE_25), 2134.58f, -286.908f, 419.495f, 1.55988f, 0, 0, 1, 1, 604800);
                    }
                    else
                    {
                        me->SummonGameObject(RAID_MODE(CACHE_OF_STORMS_10, CACHE_OF_STORMS_25), 2134.58f, -286.908f, 419.495f, 1.55988f, 0, 0, 1, 1, 604800);
                    }
                }
            }
    
            void EnterCombat(Unit* /*pWho*/)
            {
                DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), me);
                _EnterCombat();
            
                // Spawn Thunder Orbs
                for(uint8 n = 0; n < 7; n++)
                    me->SummonCreature(33378, PosOrbs[n], TEMPSUMMON_CORPSE_DESPAWN);
            
                bWipe = true;
                EncounterTime = 0;
                phase = PHASE_1;
                events.SetPhase(PHASE_1);
                DoCast(me, SPELL_SHEAT_OF_LIGHTNING);
                events.ScheduleEvent(EVENT_STORMHAMMER, 40000, 0, PHASE_1);
                events.ScheduleEvent(EVENT_CHARGE_ORB, 30000, 0, PHASE_1);
                events.ScheduleEvent(EVENT_SUMMON_ADDS, 20000, 0, PHASE_1);
                events.ScheduleEvent(EVENT_BERSERK, 300000, 0, PHASE_1);
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                    return;
            
                if (phase == PHASE_2 && !IN_ARENA(me))
                {
                    EnterEvadeMode();
                    return;
                }
                
                events.Update(diff);
                EncounterTime += diff;
    
                if (me->HasUnitState(UNIT_STAT_CASTING))
                    return;
                
                if (phase == PHASE_1)
                {
                    while (uint32 eventId = events.ExecuteEvent())
                    {
                        switch(eventId)
                        {
                            case EVENT_STORMHAMMER:
                                if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true))
                                    if (pTarget->isAlive() && IN_ARENA(pTarget))
                                        DoCast(pTarget, SPELL_STORMHAMMER);
                                events.ScheduleEvent(EVENT_STORMHAMMER, urand(15000, 20000), 0, PHASE_1);
                                break;
                            case EVENT_CHARGE_ORB:
                                DoCastAOE(SPELL_CHARGE_ORB);
                                events.ScheduleEvent(EVENT_CHARGE_ORB, urand(15000, 20000), 0, PHASE_1);
                                break;
                            case EVENT_SUMMON_ADDS:
                                spawnAdd();
                                events.ScheduleEvent(EVENT_SUMMON_ADDS, 10000, 0, PHASE_1);
                                break;
                            case EVENT_BERSERK:
                                DoCast(me, SPELL_BERSERK);
                                DoScriptText(SAY_BERSERK, me);
                                events.CancelEvent(EVENT_BERSERK);
                                break;
                        }
                    }
                }
                else
                {
                    while (uint32 eventId = events.ExecuteEvent())
                    {
                        switch(eventId)
                        {
                            case EVENT_UNBALANCING_STRIKE:
                                DoCastVictim(SPELL_UNBALANCING_STRIKE);
                                events.ScheduleEvent(EVENT_UNBALANCING_STRIKE, 25000, 0, PHASE_2);
                                break;
                            case EVENT_CHAIN_LIGHTNING:
                                if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                                    if (pTarget->isAlive())
                                        DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
                                events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, urand(15000, 20000), 0, PHASE_2);
                                break;
                            /*case EVENT_TRANSFER_ENERGY:
                                events.ScheduleEvent(EVENT_TRANSFER_ENERGY, 20000, 0, PHASE_2);
                                break;*/
                            case EVENT_RELEASE_ENERGY:
                                DoCast(me, SPELL_LIGHTNING_CHARGE);
                                //DoCast(EnergySource, SPELL_LIGHTNING_RELEASE);
                                events.ScheduleEvent(EVENT_RELEASE_ENERGY, 20000, 0, PHASE_2);
                                break;
                            case EVENT_BERSERK:
                                DoCast(me, SPELL_BERSERK);
                                DoScriptText(SAY_BERSERK, me);
                                events.CancelEvent(EVENT_BERSERK);
                                break;
                        }
                    }
                }
                        
                DoMeleeAttackIfReady();
            }
    
            void DoAction(const int32 action)
            {
                switch (action)
                {
                    case INCREASE_PREADDS_COUNT:
                        ++PreAddsCount;
                        break;
                }
            
                if (PreAddsCount >= 6 && !bWipe)
                {
                    // Event starts
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                    DoZoneInCombat();
                }
            }
        
            void spawnAdd()
            {
                switch(spawnedAdds)
                {
                    case 0:
                        for (uint8 n = 0; n < 3; n++)
                            me->SummonCreature(ARENA_PHASE_ADD[n], Pos[rand()%7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
                        break;
                    case 1:
                        for (uint8 n = 0; n < 7; n++)
                            me->SummonCreature(ARENA_PHASE_ADD[3], Pos[n], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
                        break;
                }
    
                spawnedAdds++;
                if(spawnedAdds > 1)
                {
                    spawnedAdds = 0;
                }
            }
            
            void DamageTaken(Unit* pKiller, uint32 &damage)
            {
                if (phase == PHASE_1 && pKiller && instance)
                {
                    if (Creature* pRunicColossus = me->GetCreature(*me, instance->GetData64(DATA_RUNIC_COLOSSUS)))
                        if (pRunicColossus->isDead())
                            if (Creature* pRuneGiant = me->GetCreature(*me, instance->GetData64(DATA_RUNE_GIANT)))
                                if (pRuneGiant->isDead())
                                    if (me->IsWithinDistInMap(pKiller, 10.0f) && pKiller->ToPlayer())
                                    {
                                        DoScriptText(SAY_JUMPDOWN, me);
                                        phase = PHASE_2;
                                        events.SetPhase(PHASE_2);
                                        me->RemoveAurasDueToSpell(SPELL_SHEAT_OF_LIGHTNING);
                                        me->SetReactState(REACT_AGGRESSIVE);
                                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
                                        me->GetMotionMaster()->MoveJump(2134.79f, -263.03f, 419.84f, 10.0f, 20.0f);
                                        events.ScheduleEvent(EVENT_UNBALANCING_STRIKE, 15000, 0, PHASE_2);
                                        events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 20000, 0, PHASE_2);
                                        //events.ScheduleEvent(EVENT_TRANSFER_ENERGY, 20000, 0, PHASE_2);
                                        events.ScheduleEvent(EVENT_RELEASE_ENERGY, 25000, 0, PHASE_2);
                                        events.ScheduleEvent(EVENT_BERSERK, 300000, 0, PHASE_2);
                                        // Hard Mode
                                        if (EncounterTime <= MAX_HARD_MODE_TIME)
                                        {
                                            HardMode = true;
                                            // Summon Sif
                                            me->SummonCreature(NPC_SIF, 2149.27f, -260.55f, 419.69f, 2.527f, TEMPSUMMON_CORPSE_DESPAWN);
                                            // Achievement Siffed
                                            if (instance)
                                                instance->DoCompleteAchievement(ACHIEVEMENT_SIFFED);
                                        }
                                        else me->AddAura(SPELL_TOUCH_OF_DOMINION, me);
                                    }
                }
            }
        };
    
    };
    
    
    class npc_thorim_pre_phase : public CreatureScript
    {
    public:
        npc_thorim_pre_phase() : CreatureScript("npc_thorim_pre_phase") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_thorim_pre_phaseAI (pCreature);
        }
    
        struct npc_thorim_pre_phaseAI : public ScriptedAI
        {
            npc_thorim_pre_phaseAI(Creature *pCreature) : ScriptedAI(pCreature)
            {
                pInstance = pCreature->GetInstanceScript();
                me->setFaction(14);
                for (uint8 i = 0; i < 6; ++i)
                    if (me->GetEntry() == PRE_PHASE_ADD[i])
                        id = PreAdds(i);
            }
    
            InstanceScript* pInstance;
            PreAdds id;
            uint32 PrimaryTimer;
            uint32 SecondaryTimer;
    
            void Reset()
            {
                PrimaryTimer = urand(3000, 6000);
                SecondaryTimer = urand (12000, 15000);
            }
    
            void JustDied(Unit* /*victim*/)
            {
                if (Creature* pThorim = me->GetCreature(*me, pInstance->GetData64(DATA_THORIM)))
                    pThorim->AI()->DoAction(INCREASE_PREADDS_COUNT);
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_CASTING))
                    return;
                
                if (PrimaryTimer <= diff)
                {
                    DoCast(SPELL_PRE_PRIMARY(id));
                    PrimaryTimer = urand(15000, 20000);
                }
                else PrimaryTimer -= diff;
            
                if (SecondaryTimer <= diff)
                {
                    DoCast(SPELL_PRE_SECONDARY(id));
                    SecondaryTimer = urand(4000, 8000);
                }
                else SecondaryTimer -= diff;
    
                if (id == DARK_RUNE_ACOLYTE)
                    DoSpellAttackIfReady(SPELL_HOLY_SMITE);
                else
                    DoMeleeAttackIfReady();
            }
        };
    
    };
    
    
    class npc_thorim_arena_phase : public CreatureScript
    {
    public:
        npc_thorim_arena_phase() : CreatureScript("npc_thorim_arena_phase") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_thorim_arena_phaseAI (pCreature);
        }
    
        struct npc_thorim_arena_phaseAI : public ScriptedAI
        {
            npc_thorim_arena_phaseAI(Creature* pCreature) : ScriptedAI(pCreature)
            {
                pInstance = pCreature->GetInstanceScript();
                me->setFaction(14);
                for (uint8 i = 0; i < 7; ++i)
                    if (me->GetEntry() == ARENA_PHASE_ADD[i])
                        id = ArenaAdds(i);
                    
                IsInArena = IN_ARENA(me);
            }
    
            InstanceScript* pInstance;
            ArenaAdds id;
            uint32 PrimaryTimer;
            uint32 SecondaryTimer;
            uint32 ChargeTimer;
            bool IsInArena;
    
            bool isOnSameSide(const Unit* pWho)
            {
                return (IsInArena == IN_ARENA(pWho));
            }
        
            void DamageTaken(Unit* attacker, uint32 &damage)
            {
                if (!isOnSameSide(attacker))
                    damage = 0;
            }
    
            void EnterEvadeMode()
            {
                Map* pMap = me->GetMap();
                if (pMap->IsDungeon())
                {
                    Map::PlayerList const &PlayerList = pMap->GetPlayers();
                    if (!PlayerList.isEmpty())
                    {
                        for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
                        {
                            if (i->getSource() && i->getSource()->isAlive() && isOnSameSide(i->getSource()))
                            {
                                AttackStart(i->getSource());
                                return;
                            }
                        }
                    }
                }
    
                me->StopMoving();
                Reset();
            }
    
            void Reset()
            {
                PrimaryTimer = urand(3000, 6000);
                SecondaryTimer = urand (7000, 9000);
                ChargeTimer = 8000;
            }
    
            void EnterCombat(Unit* /*pWho*/)
            {
                if (id == DARK_RUNE_WARBRINGER)
                    DoCast(me, SPELL_AURA_OF_CELERITY);
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!isOnSameSide(me) || (me->getVictim() && !isOnSameSide(me->getVictim())))
                {
                    EnterEvadeMode();
                    return;
                }
                
                if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_CASTING))
                    return;
                
                if (PrimaryTimer <= diff)
                {
                    DoCast(SPELL_ARENA_PRIMARY(id));
                    PrimaryTimer = urand(3000, 6000);
                }
                else PrimaryTimer -= diff;
            
                if (SecondaryTimer <= diff)
                {
                    DoCast(SPELL_ARENA_SECONDARY(id));
                    SecondaryTimer = urand(12000, 16000);
                }
                else SecondaryTimer -= diff;
            
                if (ChargeTimer <= diff)
                {
                    if (id == DARK_RUNE_CHAMPION)
                        if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true))
                            DoCast(pTarget, SPELL_CHARGE);
                    ChargeTimer = 12000;
                }
                else ChargeTimer -= diff;
    
                if (id == DARK_RUNE_ACOLYTE)
                    DoSpellAttackIfReady(SPELL_HOLY_SMITE);
                else
                    DoMeleeAttackIfReady();
            }
        };
    
    };
    
    
    class npc_runic_colossus : public CreatureScript
    {
    public:
        npc_runic_colossus() : CreatureScript("npc_runic_colossus") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_runic_colossusAI (pCreature);
        }
    
        struct npc_runic_colossusAI : public ScriptedAI
        {
            npc_runic_colossusAI(Creature *pCreature) : ScriptedAI(pCreature), summons(me)
            {
                pInstance = pCreature->GetInstanceScript();
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
            }
    
            InstanceScript* pInstance;
            SummonList summons;
            
            uint32 BarrierTimer;
            uint32 SmashTimer;
            uint32 ChargeTimer;
    
            void Reset()
            {
                BarrierTimer = urand(12000, 15000);
                SmashTimer = urand (15000, 18000);
                ChargeTimer = urand (20000, 24000);
            
                me->GetMotionMaster()->MoveTargetedHome();
    
                // Runed Door closed
                if (pInstance)
                    pInstance->SetData(DATA_RUNIC_DOOR, GO_STATE_READY);
                
                // Spawn trashes
                summons.DespawnAll();
                for (uint8 i = 0; i < 6; i++)
                    me->SummonCreature(colossusAddLocations[i].entry,colossusAddLocations[i].x,colossusAddLocations[i].y,colossusAddLocations[i].z,colossusAddLocations[i].o,TEMPSUMMON_CORPSE_TIMED_DESPAWN,3000);
            }
    
            void JustSummoned(Creature *summon)
            {
                summons.Summon(summon);
            }
    
            void JustDied(Unit* /*victim*/)
            {
                // Runed Door opened
                if (pInstance)
                    pInstance->SetData(DATA_RUNIC_DOOR, GO_STATE_ACTIVE);
            }
    
            void UpdateAI(const uint32 diff)
            {
                // I cannot find the real spell
                if (!me->IsWithinMeleeRange(me->getVictim()))
                    DoCast(me, SPELL_SMASH);
        
                if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_CASTING))
                    return;
                
                if (BarrierTimer <= diff)
                {
                    me->MonsterTextEmote(EMOTE_MIGHT, 0, true);
                    DoCast(me, SPELL_RUNIC_BARRIER);
                    BarrierTimer = urand(35000, 45000);
                }
                else BarrierTimer -= diff;
            
                if (SmashTimer <= diff)
                {
                    DoCast(me, SPELL_SMASH);
                    SmashTimer = urand (15000, 18000);
                }
                else SmashTimer -= diff;
            
                if (ChargeTimer <= diff)
                {
                    if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true))
                        DoCast(pTarget, SPELL_RUNIC_CHARGE);
                    ChargeTimer = 20000;
                }
                else ChargeTimer -= diff;
    
                DoMeleeAttackIfReady();
            }
        };
    
    };
    
    
    class npc_ancient_rune_giant : public CreatureScript
    {
    public:
        npc_ancient_rune_giant() : CreatureScript("npc_ancient_rune_giant") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_ancient_rune_giantAI (pCreature);
        }
    
        struct npc_ancient_rune_giantAI : public ScriptedAI
        {
            npc_ancient_rune_giantAI(Creature *pCreature) : ScriptedAI(pCreature), summons(me)
            {
                pInstance = pCreature->GetInstanceScript();
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
            }
    
            InstanceScript* pInstance;
            SummonList summons;
            
            uint32 StompTimer;
            uint32 DetonationTimer;
    
            void Reset()
            {
                StompTimer = urand(10000, 12000);
                DetonationTimer = 25000;
            
                me->GetMotionMaster()->MoveTargetedHome();
    
                // Stone Door closed
                if (pInstance)
                    pInstance->SetData(DATA_STONE_DOOR, GO_STATE_READY);
                
                // Spawn trashes
                summons.DespawnAll();
                for (uint8 i = 0; i < 5; i++)
                    me->SummonCreature(giantAddLocations[i].entry,giantAddLocations[i].x,giantAddLocations[i].y,giantAddLocations[i].z,giantAddLocations[i].o,TEMPSUMMON_CORPSE_TIMED_DESPAWN,3000);
            }
    
            void JustSummoned(Creature *summon)
            {
                summons.Summon(summon);
            }
    
            void EnterCombat(Unit* /*pWho*/)
            {
                me->MonsterTextEmote(EMOTE_MIGHT, 0, true);
                DoCast(me, SPELL_RUNIC_FORTIFICATION);
            }
    
            void JustDied(Unit* /*victim*/)
            {
                // Stone Door opened
                if (pInstance)
                    pInstance->SetData(DATA_STONE_DOOR, GO_STATE_ACTIVE);
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_CASTING))
                    return;
                
                if (StompTimer <= diff)
                {
                    DoCast(me, SPELL_STOMP);
                    StompTimer = urand(10000, 12000);
                }
                else StompTimer -= diff;
            
                if (DetonationTimer <= diff)
                {
                    if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true))
                        DoCast(pTarget, SPELL_RUNE_DETONATION);
                    DetonationTimer = urand(10000, 12000);
                }
                else DetonationTimer -= diff;
    
                DoMeleeAttackIfReady();
            }
        };
    
    };
    
    
    class npc_sif : public CreatureScript
    {
    public:
        npc_sif() : CreatureScript("npc_sif") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_sifAI (pCreature);
        }
    
        struct npc_sifAI : public ScriptedAI
        {
            npc_sifAI(Creature *pCreature) : ScriptedAI(pCreature)
            {
                pInstance = pCreature->GetInstanceScript();
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED);
            }
    
            InstanceScript* pInstance;
            uint32 FrostTimer;
            uint32 VolleyTimer;
            uint32 BlizzardTimer;
            uint32 NovaTimer;
    
            void Reset()
            {
                FrostTimer = 2000;
                VolleyTimer = 15000;
                BlizzardTimer = 30000;
                NovaTimer = urand(20000, 25000);
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_CASTING))
                    return;
                
                if (FrostTimer <= diff)
                {
                    if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 60, true))
                        DoCast(pTarget, SPELL_FROSTBOLT);
                    FrostTimer = 4000;
                }
                else FrostTimer -= diff;
                
                if (VolleyTimer <= diff)
                {
                    if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true))
                    {
                        DoResetThreat();
                        me->AddThreat(pTarget, 5000000.0f);
                        DoCast(pTarget, SPELL_FROSTBOLT_VOLLEY, true);
                    }
                    VolleyTimer = urand(15000, 20000);
                }
                else VolleyTimer -= diff;
            
                if (BlizzardTimer <= diff)
                {
                    DoCast(me, SPELL_BLIZZARD, true);
                    BlizzardTimer = 45000;
                }
                else BlizzardTimer -= diff;
            
                if (NovaTimer <= diff)
                {
                    DoCastAOE(SPELL_FROSTNOVA, true);
                    NovaTimer = urand(20000, 25000);
                }
                else NovaTimer -= diff;
            }
        };
    
    };
    
    
    
    void AddSC_boss_thorim()
    {
        new boss_thorim();
        new npc_thorim_pre_phase();
        new npc_thorim_arena_phase();
        new npc_runic_colossus();
        new npc_ancient_rune_giant();
        new npc_sif();
    }





    • Nama Error : Mimiron & Achievements
    Firefighter (10 player)
    Firefighter (25 player)Not-So-Friendly Fire (10 player)
    Not-So-Friendly Fire (25 player)
    Set Up Us the Bomb (10 player)
    Set Up Us the Bomb (25 player)
    Referensi : Here
    Kondisi Server : Event & Boss Belum Dapat Di-engage, Mimiron Tram belum berfungsi


    Code :
    boss_mimiron.cpp

    Spoiler untuk CPP :

    Code:
    /*
     * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program. If not, see <http://www.gnu.org/licenses/>.
     */
     
    /* ScriptData
    SDName: Mimiron
    SDAuthor: PrinceCreed
    SD%Complete: 95
    SDComments: P3Wx2 Laser Barrage not works in phase 4 due to core limits.
    EndScriptData */
    
    #include "ScriptPCH.h"
    #include "ulduar.h"
    
    enum Yells
    {
        SAY_AGGRO                                   = -1603240,
        SAY_HARDMODE_ON                             = -1603241,
        SAY_MKII_ACTIVATE                           = -1603242,
        SAY_MKII_SLAY_1                             = -1603243,
        SAY_MKII_SLAY_2                             = -1603244,
        SAY_MKII_DEATH                              = -1603245,
        SAY_VX001_ACTIVATE                          = -1603246,
        SAY_VX001_SLAY_1                            = -1603247,
        SAY_VX001_SLAY_2                            = -1603248,
        SAY_VX001_DEATH                             = -1603249,
        SAY_AERIAL_ACTIVATE                         = -1603250,
        SAY_AERIAL_SLAY_1                           = -1603251,
        SAY_AERIAL_SLAY_2                           = -1603252,
        SAY_AERIAL_DEATH                            = -1603253,
        SAY_V07TRON_ACTIVATE                        = -1603254,
        SAY_V07TRON_SLAY_1                          = -1603255,
        SAY_V07TRON_SLAY_2                          = -1603256,
        SAY_V07TRON_DEATH                           = -1603257,
        SAY_BERSERK                                 = -1603258,
        SAY_YS_HELP                                 = -1603259
    };
    
    #define EMOTE_LEVIATHAN                         "Leviathan MK II begins to cast Plasma Blast!"
    
    enum eSpells
    {
        // Leviathan MK II
        SPELL_MINES_SPAWN                           = 65347,
        SPELL_PROXIMITY_MINES                       = 63027,
        SPELL_PLASMA_BLAST                          = 62997,
        SPELL_SHOCK_BLAST                           = 63631,
        SPELL_EXPLOSION                             = 66351,
        SPELL_NAPALM_SHELL                          = 63666,
        
        // VX-001
        SPELL_RAPID_BURST                           = 63382,
        SPELL_ROCKET_STRIKE                         = 63036,
        SPELL_ROCKET_STRIKE_AURA                    = 64064,
        SPELL_ROCKET_STRIKE_DMG                     = 63041,
        SPELL_LASER_BARRAGE                         = 63274,
        SPELL_SPINNING_UP                           = 63414,
        SPELL_HEAT_WAVE                             = 63677,
        SPELL_HAND_PULSE                            = 64348,
        
        // Aerial Command Unit
        SPELL_PLASMA_BALL                           = 63689,
        SPELL_MAGNETIC_CORE                         = 64436,
        SPELL_MAGNETIC_CORE_VISUAL                  = 64438,
        SPELL_BOOM_BOT                              = 63801,
        SPELL_MAGNETIC_FIELD                        = 64668,
        SPELL_HOVER                                 = 57764, // Set Hover position
        SPELL_BERSERK                               = 47008,
        
        // Hard Mode
        SPELL_EMERGENCY_MODE                        = 64582,
        SPELL_FLAME_SUPPRESSANT_1                   = 64570,
        SPELL_FLAME_SUPPRESSANT_2                   = 65192,
        SPELL_FLAME                                 = 64561,
        SPELL_FROST_BOMB                            = 64624,
        SPELL_WATER_SPRAY                           = 64619,
        SPELL_SIREN                                 = 64616
    };
    
    enum eEvents
    {
        // Leviathan MK II
        EVENT_NONE,
        EVENT_PROXIMITY_MINE,
        EVENT_NAPALM_SHELL,
        EVENT_PLASMA_BLAST,
        EVENT_SHOCK_BLAST,
        EVENT_FLAME_SUPPRESSANT,
        
        // VX-001
        EVENT_RAPID_BURST,
        EVENT_PRE_LASER_BARRAGE,
        EVENT_LASER_BARRAGE,
        EVENT_ROCKET_STRIKE,
        EVENT_HEAT_WAVE,
        EVENT_HAND_PULSE,
        EVENT_FROST_BOMB,
        
        // Aerial Command Unit
        EVENT_PLASMA_BALL,
        EVENT_REACTIVATE_AERIAL,
        EVENT_SUMMON_BOTS
    };
    
    enum Phases
    {
        PHASE_NULL,
        PHASE_INTRO,
        PHASE_COMBAT,
        PHASE_LEVIATHAN_SOLO,
        PHASE_LEVIATHAN_ASSEMBLED,
        PHASE_VX001_ACTIVATION,
        PHASE_VX001_SOLO,
        PHASE_VX001_ASSEMBLED,
        PHASE_AERIAL_ACTIVATION,
        PHASE_AERIAL_SOLO,
        PHASE_AERIAL_ASSEMBLED,
        PHASE_V0L7R0N_ACTIVATION,
    };
    
    enum eActions
    {
        DO_START_ENCOUNTER                          = 1,
        DO_ACTIVATE_VX001                           = 2,
        DO_START_VX001                              = 3,
        DO_ACTIVATE_AERIAL                          = 4,
        DO_START_AERIAL                             = 5,
        DO_DISABLE_AERIAL                           = 6,
        DO_ACTIVATE_V0L7R0N                         = 7,
        DO_LEVIATHAN_ASSEMBLED                      = 8,
        DO_VX001_ASSEMBLED                          = 9,
        DO_AERIAL_ASSEMBLED                         = 10,
        DO_ACTIVATE_DEATH_TIMER                     = 11,
        DO_ENTER_ENRAGE                             = 12,
        DO_ACTIVATE_HARD_MODE                       = 13
    };
    
    enum Npcs
    {
        NPC_VX_001                                  = 33651,
        NPC_AERIAL_UNIT                             = 33670,
        NPC_ROCKET                                  = 34050,
        NPC_BURST_TARGET                            = 34211,
        NPC_JUNK_BOT                                = 33855,
        NPC_ASSAULT_BOT                             = 34057,
        NPC_BOOM_BOT                                = 33836,
        NPC_EMERGENCY_BOT                           = 34147,
        NPC_FLAME                                   = 34363,
        NPC_FLAME_SPREAD                            = 34121,
        NPC_FROST_BOMB                              = 34149
    };
    
    bool MimironHardMode;
    
    // Achievements
    #define ACHIEVEMENT_FIREFIGHTER                 RAID_MODE(3180, 3189)
    #define ACHIEVEMENT_NOT_SO_FRIENDLY_FIRE        RAID_MODE(3138, 2995)
    #define ACHIEVEMENT_SET_UP_US_THE_BOMB          RAID_MODE(2989, 3237) // TODO
    
    enum MimironChests
    {
        CACHE_OF_INNOVATION_10                      = 194789,
        CACHE_OF_INNOVATION_HARDMODE_10             = 194790,
        CACHE_OF_INNOVATION_25                      = 194956,
        CACHE_OF_INNOVATION_HARDMODE_25             = 194957
    };
    
    const Position SummonPos[9] =
    {
    {2703.93f, 2569.32f, 364.397f, 0},
    {2715.33f, 2569.23f, 364.397f, 0},
    {2726.85f, 2569.28f, 364.397f, 0},
    {2765.24f, 2534.38f, 364.397f, 0},
    {2759.54f, 2544.30f, 364.397f, 0},
    {2753.82f, 2554.22f, 364.397f, 0},
    {2764.95f, 2604.11f, 364.397f, 0},
    {2759.19f, 2594.26f, 364.397f, 0},
    {2753.56f, 2584.30f, 364.397f, 0}
    };
    
    /*---------------------------------------------*
     *                   Mimiron                   *
     *---------------------------------------------*/
    
    class boss_mimiron : public CreatureScript
    {
    public:
        boss_mimiron() : CreatureScript("boss_mimiron") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_mimironAI(pCreature);
        }
    
        struct boss_mimironAI : public BossAI
        {
            boss_mimironAI(Creature *pCreature) : BossAI(pCreature, BOSS_MIMIRON)
            {
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_ROCKET_STRIKE_DMG, true);
                me->SetReactState(REACT_PASSIVE);
            }
            
            uint32 uiPhase_timer;
            uint32 uiStep;
            uint32 EnrageTimer;
            uint32 FlameTimer;
            uint32 uiBotTimer;
            bool checkBotAlive;
            bool Enraged;
    
            Phases phase;
            
            void Reset()
            {
                _Reset();
                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING);
                me->SetVisible(true);
                me->ExitVehicle();
                me->GetMotionMaster()->MoveTargetedHome();
                if (instance)
                {
                    instance->SetData(DATA_MIMIRON_ELEVATOR, GO_STATE_ACTIVE);
                    instance->SetBossState(BOSS_MIMIRON, FAIL);
                    
                    for (uint8 data = DATA_LEVIATHAN_MK_II; data <= DATA_AERIAL_UNIT; ++data)
                    {
                        if (Creature *pCreature = me->GetCreature(*me, instance->GetData64(data)))
                        {
                            if (pCreature->isAlive())
                            {
                                pCreature->ExitVehicle();
                                pCreature->AI()->EnterEvadeMode();
                            }
                        }
                    }
                }
                phase = PHASE_NULL;
                uiStep = 0;
                uiPhase_timer = -1;
                uiBotTimer = 0;
                MimironHardMode = false;
                checkBotAlive = true;
                Enraged = false;
                DespawnCreatures(34362, 100);
                DespawnCreatures(NPC_ROCKET, 100);
            }
            
            void JustDied(Unit *victim)
            {
                DoScriptText(SAY_V07TRON_DEATH, me);
                _JustDied();
                
                me->setFaction(35);
                
                if (instance)
                {
                    if (MimironHardMode)
                    {
                        instance->DoCompleteAchievement(ACHIEVEMENT_FIREFIGHTER);
                        me->SummonGameObject(RAID_MODE(CACHE_OF_INNOVATION_HARDMODE_10, CACHE_OF_INNOVATION_HARDMODE_25), 2744.65f, 2569.46f, 364.314f, 3.14159f, 0, 0, 0.7f, 0.7f, 604800);
                    }
                    else
                    {
                        me->SummonGameObject(RAID_MODE(CACHE_OF_INNOVATION_10, CACHE_OF_INNOVATION_25), 2744.65f, 2569.46f, 364.314f, 3.14159f, 0, 0, 0.7f, 0.7f, 604800);
                    }
                }
            }
    
            void EnterCombat(Unit *who)
            {
                _EnterCombat();
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                phase = PHASE_INTRO;
                FlameTimer = 30000;
                if (MimironHardMode)
                    EnrageTimer = 8*60*1000; // Enrage in 8 min
                else
                    EnrageTimer = 15*60*1000; // Enrage in 15 min
                JumpToNextStep(100);
            }
    
            void JumpToNextStep(uint32 uiTimer)
            {
                uiPhase_timer = uiTimer;
                ++uiStep;
            }
            
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                    return;
                    
                if (EnrageTimer<= diff && !Enraged)
                {
                    DoScriptText(SAY_BERSERK, me);
                    for (uint8 data = DATA_LEVIATHAN_MK_II; data <= DATA_AERIAL_UNIT; ++data)
                    {
                        if (Creature *pCreature = me->GetCreature(*me, instance->GetData64(data)))
                            pCreature->AI()->DoAction(DO_ENTER_ENRAGE);
                    }
                    Enraged = true;
                }
                else EnrageTimer -= diff;
                
                if (MimironHardMode)
                {
                    if (FlameTimer <= diff)
                    {
                        for (uint8 i = 0; i < 3; ++i)
                            if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                                if (Creature* Flame = me->SummonCreature(NPC_FLAME, pTarget->GetPositionX() + irand(-6,6), pTarget->GetPositionY() + irand(-6,6), pTarget->GetPositionZ(), 0, TEMPSUMMON_MANUAL_DESPAWN))
                                    Flame->AI()->AttackStart(pTarget);
                        FlameTimer = 30000;
                    }
                    else FlameTimer -= diff;
                }
                    
                // All sections need to die within 10 seconds, else they respawn
                if (checkBotAlive)
                    uiBotTimer = 0;
                else
                {
                    uiBotTimer += diff;
                    if (uiBotTimer > 10000)
                    {
                        if (Creature *pLeviathan = me->GetCreature(*me, instance->GetData64(DATA_LEVIATHAN_MK_II)))
                            pLeviathan->AI()->DoAction(DO_LEVIATHAN_ASSEMBLED);
                        if (Creature *pVX_001 = me->GetCreature(*me, instance->GetData64(DATA_VX_001)))
                            pVX_001->AI()->DoAction(DO_VX001_ASSEMBLED);
                        if (Creature *pAerialUnit = me->GetCreature(*me, instance->GetData64(DATA_AERIAL_UNIT)))
                            pAerialUnit->AI()->DoAction(DO_AERIAL_ASSEMBLED);
    
                        checkBotAlive = true;
                    }
                    else
                    {
                        if (Creature *pLeviathan = me->GetCreature(*me, instance->GetData64(DATA_LEVIATHAN_MK_II)))
                            if (Creature *pVX_001 = me->GetCreature(*me, instance->GetData64(DATA_VX_001)))
                                if (Creature *pAerialUnit = me->GetCreature(*me, instance->GetData64(DATA_AERIAL_UNIT)))
                                    if (pLeviathan->getStandState() == UNIT_STAND_STATE_DEAD)
                                        if (pVX_001->getStandState() == UNIT_STAND_STATE_DEAD)
                                            if (pAerialUnit->getStandState() == UNIT_STAND_STATE_DEAD)
                                            {
                                                pLeviathan->DisappearAndDie();
                                                pVX_001->DisappearAndDie();
                                                pAerialUnit->DisappearAndDie();
                                                DespawnCreatures(NPC_ROCKET, 100);
                                                me->Kill(me, false);
                                                checkBotAlive = true;
                                            }
                    }
                }
    
                if (phase == PHASE_INTRO)
                {
                    if (uiPhase_timer <= diff)
                    {
                        switch (uiStep)
                        {
                            case 1:
                                if (MimironHardMode)
                                    DoScriptText(SAY_HARDMODE_ON, me);
                                else
                                    DoScriptText(SAY_AGGRO, me);
                                JumpToNextStep(10000);
                                break;
                            case 2:
                                if (instance)
                                {
                                    if (Creature *pLeviathan = me->GetCreature(*me, instance->GetData64(DATA_LEVIATHAN_MK_II)))
                                        me->EnterVehicle(pLeviathan->GetVehicleKit(), 4);
                                }
                                JumpToNextStep(2000);
                                break;
                            case 3:
                                me->ChangeSeat(2);
                                JumpToNextStep(2000);
                                break;
                            case 4:
                                me->ChangeSeat(5);
                                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STAND);
                                JumpToNextStep(2500);
                                break;
                            case 5:
                                DoScriptText(SAY_MKII_ACTIVATE, me);
                                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
                                JumpToNextStep(6000);
                                break;
                            case 6:
                                me->ChangeSeat(6);
                                JumpToNextStep(2000);
                                break;
                            case 7:
                                if (instance)
                                {
                                    if (Creature *pLeviathan = me->GetCreature(*me, instance->GetData64(DATA_LEVIATHAN_MK_II)))
                                    {
                                        me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STAND);
                                        pLeviathan->AI()->DoAction(DO_START_ENCOUNTER);
                                        phase = PHASE_COMBAT;
                                    }
                                }
                                break;
                            default:
                                break;
                        }
                    }
                    else
                        uiPhase_timer -= diff;
                }
                
                if (phase == PHASE_VX001_ACTIVATION)
                {
                    if (uiPhase_timer <= diff)
                    {
                        switch (uiStep)
                        {
                            case 1:
                                DoScriptText(SAY_MKII_DEATH, me);
                                JumpToNextStep(10000);
                                break;
                            case 2:
                                me->ChangeSeat(1);
                                JumpToNextStep(2000);
                                break;
                            case 3:
                                if (instance)
                                    instance->SetData(DATA_MIMIRON_ELEVATOR, GO_STATE_READY);
                                JumpToNextStep(5000);
                                break;
                            case 4:
                                if (instance)
                                {
                                    if (Creature *pVX_001 = me->SummonCreature(NPC_VX_001, 2744.65f, 2569.46f, 364.397f, 3.14159f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000))
                                    {
                                        instance->SetData(DATA_MIMIRON_ELEVATOR, GO_STATE_ACTIVE_ALTERNATIVE);
                                        pVX_001->SetVisible(true);
                                        for (uint8 n = 5; n < 7; n++)
                                        {
                                            if (Creature* Rocket = me->SummonCreature(NPC_ROCKET, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_MANUAL_DESPAWN))
                                            {
                                                Rocket->SetReactState(REACT_PASSIVE);
                                                Rocket->EnterVehicle(pVX_001->GetVehicleKit(), n);
                                            }
                                        }
                                    }
                                }
                                JumpToNextStep(8000);
                                break;
                            case 5:
                                if (instance)
                                {
                                    if (Creature *pVX_001 = me->GetCreature(*me, instance->GetData64(DATA_VX_001)))
                                        me->EnterVehicle(pVX_001->GetVehicleKit(), 0);
                                }
                                JumpToNextStep(3500);
                                break;
                            case 6:
                                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
                                DoScriptText(SAY_VX001_ACTIVATE, me);
                                JumpToNextStep(10000);
                                break;
                            case 7:
                                me->ChangeSeat(1);
                                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SIT);
                                JumpToNextStep(2000);
                                break;
                            case 8:
                                if (instance)
                                {
                                    if (Creature *pVX_001 = me->GetCreature(*me, instance->GetData64(DATA_VX_001)))
                                        pVX_001->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
                                }
                                JumpToNextStep(3500);
                                break;
                            case 9:
                                if (instance)
                                    if (Creature *pVX_001 = me->GetCreature(*me, instance->GetData64(DATA_VX_001)))
                                    {
                                        pVX_001->AddAura(SPELL_HOVER, pVX_001); // Hover
                                        pVX_001->AI()->DoAction(DO_START_VX001);
                                        phase = PHASE_COMBAT;
                                    }
                                break;
                            default:
                                break;
                        }
                    }
                    else
                        uiPhase_timer -= diff;
                }
                
                if (phase == PHASE_AERIAL_ACTIVATION)
                {
                    if (uiPhase_timer <= diff)
                    {
                        switch (uiStep)
                        {
                            case 1:
                                me->ChangeSeat(4);
                                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STAND);
                                JumpToNextStep(2500);
                                break;
                            case 2:
                                DoScriptText(SAY_VX001_DEATH, me);
                                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
                                JumpToNextStep(5000);
                                break;
                            case 3:
                                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STAND);
                                if (instance)
                                {
                                    if (Creature *pAerialUnit = me->SummonCreature(NPC_AERIAL_UNIT, 2744.65f, 2569.46f, 380, 3.14159f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000))
                                        pAerialUnit->SetVisible(true);
                                }
                                JumpToNextStep(5000);
                                break;
                            case 4:
                                me->ExitVehicle();
                                me->GetMotionMaster()->MoveJump(2745.06f, 2569.36f, 379.90f, 10, 15);
                                JumpToNextStep(2000);
                                break;
                            case 5:
                                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
                                DoScriptText(SAY_AERIAL_ACTIVATE, me);
                                JumpToNextStep(8000);
                                break;
                            case 6:
                                me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STAND);
                                me->SetVisible(false);
                                if (instance)
                                {
                                    if (Creature *pAerialUnit = me->GetCreature(*me, instance->GetData64(DATA_AERIAL_UNIT)))
                                    {
                                        pAerialUnit->AI()->DoAction(DO_START_AERIAL);
                                        phase = PHASE_COMBAT;
                                    }
                                }
                                break;
                            default:
                                break;
                        }
                    }
                    else
                        uiPhase_timer -= diff;
                }
                
                if (phase == PHASE_V0L7R0N_ACTIVATION)
                {
                    if (uiPhase_timer <= diff)
                    {
                        switch (uiStep)
                        {
                            case 1:
                                if (instance)
                                {
                                    //me->SetVisible(true);
                                    if (Creature *pLeviathan = me->GetCreature(*me, instance->GetData64(DATA_LEVIATHAN_MK_II)))
                                       pLeviathan->GetMotionMaster()->MovePoint(0, 2744.65f, 2569.46f, 364.397f);
                                    if (Creature *pVX_001 = me->GetCreature(*me, instance->GetData64(DATA_VX_001)))
                                    {
                                        me->EnterVehicle(pVX_001->GetVehicleKit(), 1);
                                        me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STAND);
                                        DoScriptText(SAY_AERIAL_DEATH, me);
                                    }
                                }
                                JumpToNextStep(5000);
                                break;
                            case 2:
                                if (instance)
                                    if (Creature *pVX_001 = me->GetCreature(*me, instance->GetData64(DATA_VX_001)))
                                        if (Creature *pLeviathan = me->GetCreature(*me, instance->GetData64(DATA_LEVIATHAN_MK_II)))
                                        {
                                            pVX_001->SetStandState(UNIT_STAND_STATE_STAND);
                                            pVX_001->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_CUSTOM_SPELL_01);
                                            pVX_001->EnterVehicle(pLeviathan->GetVehicleKit(), 7);
                                        }
                                JumpToNextStep(2000);
                                break;
                            case 3:
                                if (instance)
                                    if (Creature *pVX_001 = me->GetCreature(*me, instance->GetData64(DATA_VX_001)))
                                        if (Creature *pAerialUnit = me->GetCreature(*me, instance->GetData64(DATA_AERIAL_UNIT)))
                                        {
                                            pAerialUnit->SetFlying(false);
                                            pAerialUnit->EnterVehicle(pVX_001->GetVehicleKit(), 3);
                                            DoScriptText(SAY_V07TRON_ACTIVATE, me);
                                        }
                                JumpToNextStep(10000);
                                break;
                            case 4:
                                if (instance)
                                {
                                    if (Creature *pLeviathan = me->GetCreature(*me, instance->GetData64(DATA_LEVIATHAN_MK_II)))
                                        pLeviathan->AI()->DoAction(DO_LEVIATHAN_ASSEMBLED);
                                    if (Creature *pVX_001 = me->GetCreature(*me, instance->GetData64(DATA_VX_001)))
                                        pVX_001->AI()->DoAction(DO_VX001_ASSEMBLED);
                                    if (Creature *pAerialUnit = me->GetCreature(*me, instance->GetData64(DATA_AERIAL_UNIT)))
                                        pAerialUnit->AI()->DoAction(DO_AERIAL_ASSEMBLED);
                                    phase = PHASE_COMBAT;
                                }
                                break;
                            default:
                                break;
                        }
                    }
                    else
                        uiPhase_timer -= diff;
                }
            }
            
            void DoAction(const int32 action)
            {
                switch(action)
                {
                    case DO_ACTIVATE_VX001:
                        phase = PHASE_VX001_ACTIVATION;
                        uiStep = 0;
                        uiPhase_timer = -1;
                        JumpToNextStep(100);
                        break;
                    case DO_ACTIVATE_AERIAL:
                        phase = PHASE_AERIAL_ACTIVATION;
                        uiStep = 0;
                        uiPhase_timer = -1;
                        JumpToNextStep(5000);
                        break;
                    case DO_ACTIVATE_V0L7R0N:
                        me->SetVisible(true);
                        phase = PHASE_V0L7R0N_ACTIVATION;
                        uiStep = 0;
                        uiPhase_timer = -1;
                        JumpToNextStep(1000);
                        break;
                    case DO_ACTIVATE_DEATH_TIMER:
                        checkBotAlive = false;
                        break;
                    case DO_ACTIVATE_HARD_MODE:
                        MimironHardMode = true;
                        DoZoneInCombat();
                        break;
                }
            }
            
            void DespawnCreatures(uint32 entry, float distance, bool discs = false)
            {
                std::list<Creature*> m_pCreatures;
                GetCreatureListWithEntryInGrid(m_pCreatures, me, entry, distance);
         
                if (m_pCreatures.empty())
                    return;
         
                for(std::list<Creature*>::iterator iter = m_pCreatures.begin(); iter != m_pCreatures.end(); ++iter)
                    (*iter)->ForcedDespawn();
            }
            
        };
    
    };
    
    
    /*---------------------------------------------*
     *              Leviathan MK II                *
     *---------------------------------------------*/
    
    class boss_leviathan_mk : public CreatureScript
    {
    public:
        boss_leviathan_mk() : CreatureScript("boss_leviathan_mk") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_leviathan_mkAI(pCreature);
        }
    
        struct boss_leviathan_mkAI : public BossAI
        {
            boss_leviathan_mkAI(Creature *pCreature) : BossAI(pCreature, BOSS_MIMIRON), vehicle(me->GetVehicleKit()), phase(PHASE_NULL)
            {
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_ROCKET_STRIKE_DMG, true);
            }
            
            Vehicle* vehicle;
            Phases phase;
            EventMap events;
            
            void Reset()
            {
                events.Reset();
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                me->SetStandState(UNIT_STAND_STATE_STAND);
                me->SetReactState(REACT_PASSIVE);
                me->RemoveAllAuras();
                phase = PHASE_NULL;
                events.SetPhase(PHASE_NULL);
                if (Creature *turret = CAST_CRE(me->GetVehicleKit()->GetPassenger(3)))
                {
                    turret->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                    turret->SetReactState(REACT_PASSIVE);
                    turret->AI()->EnterEvadeMode();
                }
            }
    
            void KilledUnit(Unit *who)
            {
                if (!(rand()%5))
                    if (instance)
                        if (Creature *pMimiron = me->GetCreature(*me, instance->GetData64(DATA_MIMIRON)))
                        {
                            if (phase == PHASE_LEVIATHAN_SOLO)
                                DoScriptText(RAND(SAY_MKII_SLAY_1, SAY_MKII_SLAY_2), pMimiron);
                            else
                                DoScriptText(RAND(SAY_V07TRON_SLAY_1, SAY_V07TRON_SLAY_2), pMimiron);
                        }
            }
    
            void DamageTaken(Unit *who, uint32 &damage)
            {
                if (phase == PHASE_LEVIATHAN_SOLO)
                    if (damage >= me->GetHealth())
                    {
                        damage = 0;
                        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->AttackStop();
                        me->SetReactState(REACT_PASSIVE);
                        me->RemoveAllAuras();
                        me->SetHealth(me->GetMaxHealth());
                        events.SetPhase(PHASE_NULL);
                        phase = PHASE_NULL;
                        if (Creature *pMimiron = me->GetCreature(*me, instance->GetData64(DATA_MIMIRON)))
                            pMimiron->AI()->DoAction(DO_ACTIVATE_VX001);
                        if (Creature *turret = CAST_CRE(me->GetVehicleKit()->GetPassenger(3)))
                            turret->Kill(turret, false);
                        me->SetSpeed(MOVE_RUN, 1.5f, true);
                        me->GetMotionMaster()->MovePoint(0, 2790.11f, 2595.83f, 364.32f);
                    }
                    
                if (phase == PHASE_LEVIATHAN_ASSEMBLED)
                    if (damage >= me->GetHealth())
                    {
                        damage = 0;
                        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->AttackStop();
                        me->SetReactState(REACT_PASSIVE);
                        me->RemoveAllAuras();
                        me->SetHealth(me->GetMaxHealth());
                        me->SetStandState(UNIT_STAND_STATE_DEAD);
                        events.SetPhase(PHASE_NULL);
                        phase = PHASE_NULL;
                        if (Creature *pMimiron = me->GetCreature(*me, instance->GetData64(DATA_MIMIRON)))
                            pMimiron->AI()->DoAction(DO_ACTIVATE_DEATH_TIMER);
                    }
            }
    
            void EnterCombat(Unit *who)
            {
                if (MimironHardMode)
                {
                    DoCast(me, SPELL_EMERGENCY_MODE);
                    events.ScheduleEvent(EVENT_FLAME_SUPPRESSANT, 60000, 0, PHASE_LEVIATHAN_SOLO);
                }
                
                if (Creature *turret = CAST_CRE(me->GetVehicleKit()->GetPassenger(3)))
                {
                    turret->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                    turret->SetReactState(REACT_AGGRESSIVE);
                    turret->AI()->DoZoneInCombat();
                }
                
                events.ScheduleEvent(EVENT_PROXIMITY_MINE, 1000);
                events.ScheduleEvent(EVENT_PLASMA_BLAST, 10000, 0, PHASE_LEVIATHAN_SOLO);
            }
            
            void DoAction(const int32 action)
            {
                switch(action)
                {
                    case DO_START_ENCOUNTER:
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->SetReactState(REACT_AGGRESSIVE);
                        phase = PHASE_LEVIATHAN_SOLO;
                        events.SetPhase(PHASE_LEVIATHAN_SOLO);
                        DoZoneInCombat();
                        break;
                    case DO_LEVIATHAN_ASSEMBLED:
                        if (MimironHardMode)
                            DoCast(me, SPELL_EMERGENCY_MODE);
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->SetReactState(REACT_AGGRESSIVE);
                        me->SetHealth(int32(me->GetMaxHealth() / 2));
                        me->SetSpeed(MOVE_RUN, 1.0f, true);
                        me->SetStandState(UNIT_STAND_STATE_STAND);
                        phase = PHASE_LEVIATHAN_ASSEMBLED;
                        events.SetPhase(PHASE_LEVIATHAN_ASSEMBLED);
                        events.RescheduleEvent(EVENT_PROXIMITY_MINE, 1000);
                        events.RescheduleEvent(EVENT_SHOCK_BLAST, 30000);
                        break;
                    case DO_ENTER_ENRAGE:
                        DoCast(me, SPELL_BERSERK, true);
                        break;
                }
            }
    
            void UpdateAI(const uint32 diff)
            {
                if(!UpdateVictim())
                    return;
    
                events.Update(diff);
    
                if (me->HasUnitState(UNIT_STAT_CASTING))
                    return;
    
                if (phase == PHASE_LEVIATHAN_SOLO || phase == PHASE_LEVIATHAN_ASSEMBLED)
                {
                    while (uint32 eventId = events.ExecuteEvent())
                    {
                        switch(eventId)
                        {
                            case EVENT_PROXIMITY_MINE:
                                for (int i = 0; i < 10; i++)
                                    DoCast(SPELL_MINES_SPAWN);
                                DoCast(SPELL_PROXIMITY_MINES);
                                events.RescheduleEvent(EVENT_PROXIMITY_MINE, 35000);
                                break;
                            case EVENT_PLASMA_BLAST:
                                me->MonsterTextEmote(EMOTE_LEVIATHAN, 0, true);
                                DoCast(SPELL_PLASMA_BLAST);
                                events.RescheduleEvent(EVENT_PLASMA_BLAST, urand(30000, 35000), 0, PHASE_LEVIATHAN_SOLO);
                                events.RescheduleEvent(EVENT_SHOCK_BLAST, urand(6000, 10000));
                                break;
                            case EVENT_SHOCK_BLAST:
                                DoCastAOE(SPELL_SHOCK_BLAST);
                                events.RescheduleEvent(EVENT_SHOCK_BLAST, 35000);
                                break;
                            case EVENT_FLAME_SUPPRESSANT:
                                DoCastAOE(SPELL_FLAME_SUPPRESSANT_1);
                                for (int8 n = 0; n < 2; n++)
                                {
                                    uint32 npc;
                                    if (n == 0)
                                        npc = NPC_FLAME;
                                    else 
                                        npc = NPC_FLAME_SPREAD;
                                    std::list<Creature*> m_pCreatures;
                                    GetCreatureListWithEntryInGrid(m_pCreatures, me, npc, 100);
                                    if (!m_pCreatures.empty())
                                        for(std::list<Creature*>::iterator iter = m_pCreatures.begin(); iter != m_pCreatures.end(); ++iter)
                                            (*iter)->ForcedDespawn(3000);
                                }
                                events.CancelEvent(EVENT_FLAME_SUPPRESSANT);
                                break;
                        }
                    }
                }
                            
                DoMeleeAttackIfReady();
            }
        };
    };
    
    class boss_leviathan_mk_turret : public CreatureScript
    {
    public:
        boss_leviathan_mk_turret() : CreatureScript("boss_leviathan_mk_turret") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_leviathan_mk_turretAI (pCreature);
        }
    
        struct boss_leviathan_mk_turretAI : public ScriptedAI
        {
            boss_leviathan_mk_turretAI(Creature *c) : ScriptedAI(c) 
            {
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                uiNapalmShell = urand(4000, 8000);
            }
    
            uint32 uiNapalmShell;
            
            void UpdateAI(const uint32 diff)
            {
                if(!UpdateVictim())
                    return;
    
                if (uiNapalmShell <= diff)
                {
                    if (Unit *pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0))
                        if (!me->IsWithinDist(pTarget, 12))
                            DoCast(pTarget, SPELL_NAPALM_SHELL);
                    uiNapalmShell = urand(8000, 12000);
                }
                else uiNapalmShell -= diff;
            }
        };
    
    };
    
    class npc_proximity_mine : public CreatureScript
    {
    public:
        npc_proximity_mine() : CreatureScript("npc_proximity_mine") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_proximity_mineAI (pCreature);
        }
    
        struct npc_proximity_mineAI : public Scripted_NoMovementAI
        {
            npc_proximity_mineAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature)
            {
               me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
               uiBoomTimer = 35000;
               Boom = false;
            }
            
            uint32 uiBoomTimer;
            bool Boom;
    
            void MoveInLineOfSight(Unit *who)
            {
                if (!Boom && me->IsWithinDistInMap(who, 0.5f) && who->ToPlayer() && !who->ToPlayer()->isGameMaster())
                {
                    DoCastAOE(SPELL_EXPLOSION);
                    me->ForcedDespawn(1000);
                    Boom = true;
                }
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (uiBoomTimer <= diff)
                {
                    if (!Boom)
                    {
                        DoCastAOE(SPELL_EXPLOSION);
                        me->ForcedDespawn(1000);
                        Boom = true;
                    }
                }
                else uiBoomTimer -= diff;
            }
        };
    };
    
    
    /*---------------------------------------------*
     *                    VX-001                   *
     *---------------------------------------------*/
    
    class boss_vx_001 : public CreatureScript
    {
    public:
        boss_vx_001() : CreatureScript("boss_vx_001") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_vx_001AI(pCreature);
        }
    
        struct boss_vx_001AI : public BossAI
        {
            boss_vx_001AI(Creature *pCreature) : BossAI(pCreature, BOSS_MIMIRON), vehicle(me->GetVehicleKit()), phase(PHASE_NULL)
            {
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_ROCKET_STRIKE_DMG, true);
            }
            
            Vehicle* vehicle;
            Phases phase;
            EventMap events;
            
            void Reset()
            {
                events.Reset();
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_DISABLE_MOVE);
                me->SetReactState(REACT_PASSIVE);
                me->SetStandState(UNIT_STAND_STATE_STAND);
                //me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STAND);
                me->SetVisible(false);
                me->RemoveAllAuras();
                phase = PHASE_NULL;
                events.SetPhase(PHASE_NULL);
            }
    
            void KilledUnit(Unit *who)
            {
                if (!(rand()%5))
                    if (instance)
                        if (Creature *pMimiron = me->GetCreature(*me, instance->GetData64(DATA_MIMIRON)))
                        {
                            if (phase == PHASE_VX001_SOLO)
                                DoScriptText(RAND(SAY_VX001_SLAY_1, SAY_VX001_SLAY_2), pMimiron);
                            else
                                DoScriptText(RAND(SAY_V07TRON_SLAY_1, SAY_V07TRON_SLAY_2), pMimiron);
                        }
            }
    
            void EnterCombat(Unit *who)
            {
                if (MimironHardMode)
                {
                    DoCast(me, SPELL_EMERGENCY_MODE);
                    events.ScheduleEvent(EVENT_FROST_BOMB, 15000);
                }
                    
                events.ScheduleEvent(EVENT_RAPID_BURST, 500, 0, PHASE_VX001_SOLO);
                events.ScheduleEvent(EVENT_PRE_LASER_BARRAGE, urand(35000, 40000), 0, PHASE_VX001_SOLO); // Not works in phase 4 :(
                events.ScheduleEvent(EVENT_ROCKET_STRIKE, 20000);
                events.ScheduleEvent(EVENT_HEAT_WAVE, urand(8000, 10000), 0, PHASE_VX001_SOLO);
                events.ScheduleEvent(EVENT_HAND_PULSE, 15000, 0, PHASE_VX001_ASSEMBLED);
            }
            
            void DoAction(const int32 action)
            {
                switch(action)
                {
                    case DO_START_VX001:
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        phase = PHASE_VX001_SOLO;
                        events.SetPhase(PHASE_VX001_SOLO);
                        DoZoneInCombat();
                        break;
                    case DO_VX001_ASSEMBLED:
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->SetHealth(int32(me->GetMaxHealth() / 2));
                        me->SetStandState(UNIT_STAND_STATE_STAND);
                        phase = PHASE_VX001_ASSEMBLED;
                        events.SetPhase(PHASE_VX001_ASSEMBLED);
                        events.RescheduleEvent(EVENT_PRE_LASER_BARRAGE, urand(35000, 40000), 0, PHASE_VX001_SOLO); // not works in phase 4
                        events.RescheduleEvent(EVENT_ROCKET_STRIKE, 20000);
                        events.RescheduleEvent(EVENT_HAND_PULSE, 15000, 0, PHASE_VX001_ASSEMBLED);
                        if (MimironHardMode)
                        {
                            DoCast(me, SPELL_EMERGENCY_MODE);
                            events.RescheduleEvent(EVENT_FROST_BOMB, 15000);
                        }
                        break;
                    case DO_ENTER_ENRAGE:
                        DoCast(me, SPELL_BERSERK, true);
                        break;
                }
            }
    
            void DamageTaken(Unit *who, uint32 &damage)
            {
                if (phase == PHASE_VX001_SOLO)
                    if (damage >= me->GetHealth())
                    {
                        damage = 0;
                        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->AttackStop();
                        me->GetMotionMaster()->Initialize();
                        me->RemoveAllAuras();
                        me->SetHealth(me->GetMaxHealth());
                        me->SetStandState(UNIT_STAND_STATE_DEAD);
                        phase = PHASE_NULL;
                        events.SetPhase(PHASE_NULL);
                        if (Creature *pMimiron = me->GetCreature(*me, instance->GetData64(DATA_MIMIRON)))
                            pMimiron->AI()->DoAction(DO_ACTIVATE_AERIAL);
                    }
                    
                if (phase == PHASE_VX001_ASSEMBLED)
                    if (damage >= me->GetHealth())
                    {
                        damage = 0;
                        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->AttackStop();
                        me->RemoveAllAuras();
                        me->SetHealth(me->GetMaxHealth());
                        me->SetStandState(UNIT_STAND_STATE_DEAD);
                        events.SetPhase(PHASE_NULL);
                        phase = PHASE_NULL;
                        if (Creature *pMimiron = me->GetCreature(*me, instance->GetData64(DATA_MIMIRON)))
                            pMimiron->AI()->DoAction(DO_ACTIVATE_DEATH_TIMER);
                    }
            }
    
            void UpdateAI(const uint32 diff)
            {
                if(!UpdateVictim())
                    return;
    
                events.Update(diff);
    
                if (me->HasUnitState(UNIT_STAT_CASTING))
                    return;
    
                if (phase == PHASE_VX001_SOLO || phase == PHASE_VX001_ASSEMBLED)
                {
                    while (uint32 eventId = events.ExecuteEvent())
                    {
                        switch(eventId)
                        {
                            case EVENT_RAPID_BURST:
                                me->GetMotionMaster()->Initialize();
                                if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                                    if (Creature *BurstTarget = me->SummonCreature(NPC_BURST_TARGET, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 3000))
                                        DoCast(BurstTarget, SPELL_RAPID_BURST);
                                events.RescheduleEvent(EVENT_RAPID_BURST, 3000, 0, PHASE_VX001_SOLO);
                                break;
                            case EVENT_PRE_LASER_BARRAGE:
                                DoCast(SPELL_SPINNING_UP);
                                me->GetMotionMaster()->MoveRotate(40000, rand()%2 ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT);
                                events.DelayEvents(14000);
                                events.RescheduleEvent(EVENT_PRE_LASER_BARRAGE, 40000, 0, PHASE_VX001_SOLO);
                                events.RescheduleEvent(EVENT_LASER_BARRAGE, 3000);
                                break;
                            case EVENT_LASER_BARRAGE:
                                DoCastAOE(SPELL_LASER_BARRAGE);
                                events.CancelEvent(EVENT_LASER_BARRAGE);
                                break;
                            case EVENT_ROCKET_STRIKE:
                                if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                                    if (Creature *missile = CAST_CRE(me->GetVehicleKit()->GetPassenger(5)))
                                        missile->CastSpell(pTarget, SPELL_ROCKET_STRIKE, true);
                                if (phase == PHASE_VX001_ASSEMBLED)
                                    if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                                        if (Creature *missile = CAST_CRE(me->GetVehicleKit()->GetPassenger(6)))
                                            missile->CastSpell(pTarget, SPELL_ROCKET_STRIKE, true);
                                events.RescheduleEvent(EVENT_ROCKET_STRIKE, urand(20000, 25000));
                                break;
                            case EVENT_HEAT_WAVE:
                                DoCastAOE(SPELL_HEAT_WAVE);
                                events.RescheduleEvent(EVENT_HEAT_WAVE, 10000, 0, PHASE_VX001_SOLO);
                                break;
                            case EVENT_HAND_PULSE:
                                if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                                    DoCast(pTarget, SPELL_HAND_PULSE);
                                events.RescheduleEvent(EVENT_HAND_PULSE, urand(10000, 12000));
                                break;
                            case EVENT_FROST_BOMB:
                                me->SummonCreature(NPC_FROST_BOMB, SummonPos[rand()%9], TEMPSUMMON_TIMED_DESPAWN, 11000);
                                events.RescheduleEvent(EVENT_FROST_BOMB, 45000);
                                break;
                        }
                    }
                }
            }
        };
    };
    
    class npc_rocket_strike : public CreatureScript
    {
    public:
        npc_rocket_strike() : CreatureScript("npc_rocket_strike") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_rocket_strikeAI (pCreature);
        }
    
        struct npc_rocket_strikeAI : public Scripted_NoMovementAI
        {
            npc_rocket_strikeAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature)
            {
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
                me->ForcedDespawn(10000);
                DoCast(me, SPELL_ROCKET_STRIKE_AURA);
            }
        };
    };
    
    
    /*---------------------------------------------*
     *             Aerial Command Unit             *
     *---------------------------------------------*/
    
    class boss_aerial_unit : public CreatureScript
    {
    public:
        boss_aerial_unit() : CreatureScript("boss_aerial_unit") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_aerial_unitAI(pCreature);
        }
    
        struct boss_aerial_unitAI : public BossAI
        {
            boss_aerial_unitAI(Creature *pCreature) : BossAI(pCreature, BOSS_MIMIRON), vehicle(me->GetVehicleKit()), phase(PHASE_NULL)
            {
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_ROCKET_STRIKE_DMG, true);
            }
            
            Vehicle* vehicle;
            Phases phase;
            EventMap events;
            uint8 spawnedAdds;
            
            void Reset()
            {
                events.Reset();
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_DISABLE_MOVE);
                me->SetReactState(REACT_PASSIVE);
                me->SetStandState(UNIT_STAND_STATE_STAND);
                me->SetVisible(false);
                me->RemoveAllAuras();
                me->SetFlying(true);
                phase = PHASE_NULL;
                events.SetPhase(PHASE_NULL);
                summons.DespawnAll();
                spawnedAdds = 0;
            }
    
            void KilledUnit(Unit *who)
            {
                if (!(rand()%5))
                    if (instance)
                        if (Creature *pMimiron = me->GetCreature(*me, instance->GetData64(DATA_MIMIRON)))
                        {
                            if (phase == PHASE_AERIAL_SOLO)
                                DoScriptText(RAND(SAY_AERIAL_SLAY_1, SAY_AERIAL_SLAY_2), pMimiron);
                            else
                                DoScriptText(RAND(SAY_V07TRON_SLAY_1, SAY_V07TRON_SLAY_2), pMimiron);
                        }
            }
    
            void EnterCombat(Unit *who)
            {
                if (MimironHardMode)
                    DoCast(me, SPELL_EMERGENCY_MODE);
    
                events.ScheduleEvent(EVENT_PLASMA_BALL, 1000);
                events.ScheduleEvent(EVENT_SUMMON_BOTS, 10000, 0, PHASE_AERIAL_SOLO);
            }
            
            void DoAction(const int32 action)
            {
                switch(action)
                {
                    case DO_START_AERIAL:
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->SetReactState(REACT_AGGRESSIVE);
                        phase = PHASE_AERIAL_SOLO;
                        events.SetPhase(PHASE_AERIAL_SOLO);
                        DoZoneInCombat();
                        break;
                    case DO_DISABLE_AERIAL:
                        me->CastStop();
                        me->SetReactState(REACT_PASSIVE);
                        me->GetMotionMaster()->Clear(true);
                        DoCast(me, SPELL_MAGNETIC_CORE);
                        DoCast(me, SPELL_MAGNETIC_CORE_VISUAL);
                        if (Creature *pMagneticCore = me->GetCreature(*me, instance->GetData64(DATA_MAGNETIC_CORE)))
                            if (pMagneticCore->isAlive())
                                me->NearTeleportTo(pMagneticCore->GetPositionX(), pMagneticCore->GetPositionY(), 368.965f, 0, false);
                        events.RescheduleEvent(EVENT_PLASMA_BALL, 22000, 0, PHASE_AERIAL_SOLO);
                        events.RescheduleEvent(EVENT_SUMMON_BOTS, 24000, 0, PHASE_AERIAL_SOLO);
                        events.ScheduleEvent(EVENT_REACTIVATE_AERIAL, 20000, 0, PHASE_AERIAL_SOLO);
                        break;
                    case DO_AERIAL_ASSEMBLED:
                        if (MimironHardMode)
                            DoCast(me, SPELL_EMERGENCY_MODE);
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->SetReactState(REACT_AGGRESSIVE);
                        me->SetHealth(int32(me->GetMaxHealth() / 2));
                        me->SetStandState(UNIT_STAND_STATE_STAND);
                        phase = PHASE_AERIAL_ASSEMBLED;
                        events.SetPhase(PHASE_AERIAL_ASSEMBLED);
                        events.RescheduleEvent(EVENT_PLASMA_BALL, 2000);
                        break;
                    case DO_ENTER_ENRAGE:
                        DoCast(me, SPELL_BERSERK, true);
                        break;
                }
            }
    
            void UpdateAI(const uint32 diff)
            {
                if(!UpdateVictim())
                    return;
    
                events.Update(diff);
    
                if (me->HasUnitState(UNIT_STAT_CASTING))
                    return;
    
                if (phase == PHASE_AERIAL_SOLO || phase == PHASE_AERIAL_ASSEMBLED)
                {
                    while (uint32 eventId = events.ExecuteEvent())
                    {
                        switch(eventId)
                        {
                            case EVENT_PLASMA_BALL:
                                if (phase == PHASE_AERIAL_SOLO && me->getVictim())
                                {
                                    float x = me->getVictim()->GetPositionX();
                                    float y = me->getVictim()->GetPositionY();
                                    float z = me->getVictim()->GetPositionZ();
                                    if (me->IsWithinDist3d(x, y, z, 30))
                                    {
                                        me->GetMotionMaster()->Initialize();
                                        DoCastVictim(SPELL_PLASMA_BALL);
                                    }
                                    else me->GetMotionMaster()->MovePoint(0, x, y, 380.04f);
                                }
                                else if (phase == PHASE_AERIAL_ASSEMBLED && me->getVictim())
                                {
                                    if (me->getVictim()->IsWithinDist3d(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 35))
                                        DoCastVictim(SPELL_PLASMA_BALL);
                                    else if (Unit *pTarget = SelectUnit(SELECT_TARGET_NEAREST, 0))
                                        DoCast(pTarget, SPELL_PLASMA_BALL);
                                }
                                events.RescheduleEvent(EVENT_PLASMA_BALL, 2000);
                                break;
                            case EVENT_REACTIVATE_AERIAL:
                                me->RemoveAurasDueToSpell(SPELL_MAGNETIC_CORE_VISUAL);
                                me->NearTeleportTo(me->GetPositionX(), me->GetPositionY(), 380.04f, 3.14159f, false);
                                me->SetReactState(REACT_AGGRESSIVE);
                                events.CancelEvent(EVENT_REACTIVATE_AERIAL);
                                break;
                            case EVENT_SUMMON_BOTS:
                                if (phase == PHASE_AERIAL_SOLO)
                                {
                                    spawnAdd();
                                    events.RescheduleEvent(EVENT_SUMMON_BOTS, 10000, 0, PHASE_AERIAL_SOLO);
                                }
                                break;
                        }
                    }
                }
            }
            
            void spawnAdd()
            {
                switch(spawnedAdds)
                {
                    case 0:
                        for(uint8 n = 0; n < 2; n++)
                            me->SummonCreature(NPC_JUNK_BOT, SummonPos[rand()%9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
                        break;
                    case 1:
                        me->SummonCreature(NPC_ASSAULT_BOT, SummonPos[rand()%9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
                        if (MimironHardMode)
                            for (uint8 i = 0; i < 2; ++i)
                                me->SummonCreature(NPC_EMERGENCY_BOT, SummonPos[rand()%9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
                        break;
                    case 2:
                        me->SummonCreature(NPC_BOOM_BOT, 2744.65f, 2569.46f, 364.397f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
                        break;
                }
    
                spawnedAdds++;
                if(spawnedAdds > 2)
                {
                    spawnedAdds = 0;
                }
            }
            
            void JustSummoned(Creature *summon)
            {
                summons.Summon(summon);
                
                if (summon->GetEntry() == NPC_EMERGENCY_BOT)
                    return;
                    
                summon->AI()->DoZoneInCombat();
                if (MimironHardMode)
                    DoCast(me, SPELL_EMERGENCY_MODE, true);
            }
            
            void DamageTaken(Unit *who, uint32 &damage)
            {
                if (phase == PHASE_AERIAL_SOLO)
                    if (damage >= me->GetHealth())
                    {
                        damage = 0;
                        me->GetMotionMaster()->Clear(true);
                        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->SetReactState(REACT_PASSIVE);
                        me->AttackStop();
                        me->RemoveAllAuras();
                        me->SetHealth(me->GetMaxHealth());
                        events.CancelEvent(EVENT_SUMMON_BOTS);
                        phase = PHASE_NULL;
                        events.SetPhase(PHASE_NULL);
                        if (Creature *pMimiron = me->GetCreature(*me, instance->GetData64(DATA_MIMIRON)))
                            pMimiron->AI()->DoAction(DO_ACTIVATE_V0L7R0N);
                    }
                    
                if (phase == PHASE_AERIAL_ASSEMBLED)
                    if (damage >= me->GetHealth())
                    {
                        damage = 0;
                        me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                        me->AttackStop();
                        me->SetReactState(REACT_PASSIVE);
                        me->RemoveAllAuras();
                        me->SetHealth(me->GetMaxHealth());
                        me->SetStandState(UNIT_STAND_STATE_DEAD);
                        events.SetPhase(PHASE_NULL);
                        phase = PHASE_NULL;
                        if (Creature *pMimiron = me->GetCreature(*me, instance->GetData64(DATA_MIMIRON)))
                            pMimiron->AI()->DoAction(DO_ACTIVATE_DEATH_TIMER);
                    }
            }
        };
    };
    
    class npc_magnetic_core : public CreatureScript
    {
    public:
        npc_magnetic_core() : CreatureScript("npc_magnetic_core") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_magnetic_coreAI (pCreature);
        }
    
        struct npc_magnetic_coreAI : public Scripted_NoMovementAI
        {
            npc_magnetic_coreAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature)
            {
                DoCast(SPELL_MAGNETIC_CORE);
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
                me->ForcedDespawn(21000);
                if (Creature *pAerialUnit = me->FindNearestCreature(NPC_AERIAL_UNIT, 20, true))
                    pAerialUnit->AI()->DoAction(DO_DISABLE_AERIAL);
            }
        };
    };
    
    class npc_assault_bot : public CreatureScript
    {
    public:
        npc_assault_bot() : CreatureScript("npc_assault_bot") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_assault_botAI (pCreature);
        }
    
        struct npc_assault_botAI : public ScriptedAI
        {
            npc_assault_botAI(Creature *pCreature) : ScriptedAI(pCreature)
            {
                pInstance = pCreature->GetInstanceScript();
            }
    
            InstanceScript* pInstance;
            uint32 uiFieldTimer;
    
            void Reset()
            {
                uiFieldTimer = urand(4000, 6000);
            }
            
    
            void UpdateAI(const uint32 uiDiff)
            {
                if (!UpdateVictim())
                    return;
    
                if (uiFieldTimer <= uiDiff)
                {
                    DoCastVictim(SPELL_MAGNETIC_FIELD);
                    uiFieldTimer = urand(15000, 20000);
                }
                else uiFieldTimer -= uiDiff;
    
                DoMeleeAttackIfReady();
            }
            
            void SpellHit(Unit *caster, const SpellEntry *spell)
            {
                // Achievement Not-So-Friendly Fire
                if (spell->Id == 63041 && pInstance)
                    pInstance->DoCompleteAchievement(ACHIEVEMENT_NOT_SO_FRIENDLY_FIRE);
            }
        };
    
    };
    
    class npc_emergency_bot : public CreatureScript
    {
    public:
        npc_emergency_bot() : CreatureScript("npc_emergency_bot") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_emergency_botAI (pCreature);
        }
    
        struct npc_emergency_botAI : public ScriptedAI
        {
            npc_emergency_botAI(Creature *pCreature) : ScriptedAI(pCreature)
            {
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                me->SetReactState(REACT_PASSIVE);
                me->GetMotionMaster()->MoveRandom(15);
                uiSprayTimer = 5000;
            }
    
            uint32 uiSprayTimer;
    
            void UpdateAI(const uint32 uiDiff)
            {
                if (uiSprayTimer <= uiDiff)
                {
                    DoCast(SPELL_WATER_SPRAY);
                    for (int8 n = 0; n < 2; n++)
                    {
                        uint32 npc;
                        if (n == 0)
                            npc = NPC_FLAME;
                        else 
                            npc = NPC_FLAME_SPREAD;
                        std::list<Creature*> m_pCreatures;
                        GetCreatureListWithEntryInGrid(m_pCreatures, me, npc, 12);
                        if (!m_pCreatures.empty())
                            for(std::list<Creature*>::iterator iter = m_pCreatures.begin(); iter != m_pCreatures.end(); ++iter)
                                (*iter)->ForcedDespawn();
                    }
                    uiSprayTimer = 5000;
                }
                else uiSprayTimer -= uiDiff;
            }
        };
    
    };
    
    
    /*---------------------------------------------*
     *           DO NOT PUSH THIS BUTTON!          *
     *---------------------------------------------*/
    
    class go_not_push_button : public GameObjectScript
    {
    public:
        go_not_push_button() : GameObjectScript("go_not_push_button") { }
    
        bool OnGossipHello(Player* pPlayer, GameObject* pGo)
        {
            InstanceScript* pInstance = pGo->GetInstanceScript();
    
            if (!pInstance)
                return false;
    
            if ((pInstance->GetBossState(BOSS_MIMIRON) != IN_PROGRESS || pInstance->GetBossState(BOSS_MIMIRON) != DONE) && pPlayer)
                if (Creature *pMimiron = pPlayer->GetCreature((*pPlayer), pInstance->GetData64(DATA_MIMIRON)))
                    pMimiron->AI()->DoAction(DO_ACTIVATE_HARD_MODE);
    
            return true;
        }
    };
    
    
    class npc_mimiron_flame_trigger : public CreatureScript
    {
    public:
        npc_mimiron_flame_trigger() : CreatureScript("npc_mimiron_flame_trigger") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_mimiron_flame_triggerAI (pCreature);
        }
    
        struct npc_mimiron_flame_triggerAI : public ScriptedAI
        {
            npc_mimiron_flame_triggerAI(Creature* pCreature) : ScriptedAI(pCreature)
            {
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
                DoCast(me, SPELL_FLAME, true);
                uiFlameTimer = 8000;
            }
            
            uint32 uiFlameTimer;
            
            void UpdateAI(const uint32 diff)
            {
                if (uiFlameTimer <= diff)
                {
                    me->SummonCreature(NPC_FLAME_SPREAD, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
                    uiFlameTimer = 8000;
                }
                else uiFlameTimer -= diff;
            }
        };
    };
    
    class npc_mimiron_flame_spread : public CreatureScript
    {
    public:
        npc_mimiron_flame_spread() : CreatureScript("npc_mimiron_flame_spread") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_mimiron_flame_spreadAI (pCreature);
        }
    
        struct npc_mimiron_flame_spreadAI : public Scripted_NoMovementAI
        {
            npc_mimiron_flame_spreadAI(Creature *pCreature) : Scripted_NoMovementAI(pCreature)
            {
                pInstance = pCreature->GetInstanceScript();
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
                me->SetReactState(REACT_PASSIVE);
                DoCast(me, SPELL_FLAME, true);
            }
    
            InstanceScript* pInstance;
            
            void UpdateAI(const uint32 uiDiff)
            {
                if (pInstance && pInstance->GetBossState(BOSS_MIMIRON) != IN_PROGRESS)
                    me->ForcedDespawn();
            }
        };
    
    };
    
    class npc_frost_bomb : public CreatureScript
    {
    public:
        npc_frost_bomb() : CreatureScript("npc_frost_bomb") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_frost_bombAI (pCreature);
        }
    
        struct npc_frost_bombAI : public Scripted_NoMovementAI
        {
            npc_frost_bombAI(Creature *pCreature) : Scripted_NoMovementAI(pCreature)
            {
                me->SetReactState(REACT_PASSIVE);
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
                DoCast(me, SPELL_FROST_BOMB);
                uiFrostTimer = 10000;
            }
    
            uint32 uiFrostTimer;
            
            void UpdateAI(const uint32 diff)
            {
                if (uiFrostTimer <= diff)
                {
                    DoCastAOE(SPELL_FLAME_SUPPRESSANT_2);
                    for (int8 n = 0; n < 2; n++)
                    {
                        uint32 npc;
                        if (n == 0)
                            npc = NPC_FLAME;
                        else 
                            npc = NPC_FLAME_SPREAD;
                        std::list<Creature*> m_pCreatures;
                        GetCreatureListWithEntryInGrid(m_pCreatures, me, npc, 25);
                        if (!m_pCreatures.empty())
                            for(std::list<Creature*>::iterator iter = m_pCreatures.begin(); iter != m_pCreatures.end(); ++iter)
                                (*iter)->ForcedDespawn(1000);
                    }
                    uiFrostTimer = 10000;
                }
                else uiFrostTimer -= diff;
            }
        };
    
    };
    
    void AddSC_boss_mimiron()
    {
        new boss_mimiron();
        new boss_leviathan_mk();
        new boss_leviathan_mk_turret();
        new npc_proximity_mine();
        new boss_vx_001();
        new npc_rocket_strike();
        new boss_aerial_unit();
        new npc_magnetic_core();
        new npc_assault_bot();
        new npc_emergency_bot();
        new go_not_push_button();
        new npc_mimiron_flame_trigger();
        new npc_mimiron_flame_spread();
        new npc_frost_bomb();
    }
    Last edited by Anz69; 04-11-12 at 07:39.

  6. The Following User Says Thank You to Anz69 For This Useful Post:
  7. #4
    Anz69's Avatar
    Join Date
    May 2010
    Location
    Grizzly Hills
    Posts
    326
    Points
    372.64
    Thanks: 78 / 136 / 22

    Default

    • Nama Error : Kologarn & Achievements

    Disarmed (10 player)
    If Looks Could Kill (10 player)
    Rubble and Roll (10 player)
    With Open Arms (10 player)
    Rubble and Roll (25 player)
    With Open Arms (25 player)
    If Looks Could Kill (25 player)
    Disarmed (25 player)
    Referensi : Here
    Kondisi Server : Boss dapat dikill dan ada kill credit, namun tidak ada achievement, Right & Left Hand Error tidak spawn2 lagi setelah dikill


    Code :
    boss_kologarn.cpp

    Spoiler untuk CPP :

    Code:
    /*
     * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program. If not, see <http://www.gnu.org/licenses/>.
     */
    
    /* ScriptData
    SDName: Kologarn
    SDAuthor: PrinceCreed
    SD%Complete: 100%
    SD%Comments:
    EndScriptData */
    
    #include "ScriptPCH.h"
    #include "ulduar.h"
    #include "Vehicle.h"
    
    enum Spells
    {
        // Kologarn
        SPELL_ARM_DEAD_DAMAGE                       = 63629,
        SPELL_TWO_ARM_SMASH                         = 63356,
        SPELL_ONE_ARM_SMASH                         = 63573,
        SPELL_ARM_SWEEP                             = 63766,
        SPELL_STONE_SHOUT                           = 63716,
        SPELL_PETRIFY_BREATH                        = 62030,
        SPELL_SHOCKWAVE                             = 63783,
        SPELL_SHOCKWAVE_VISUAL                      = 63788,
        
        SPELL_STONE_GRIP                            = 64290,
        SPELL_STONE_GRIP_STUN                       = 62056,
        SPELL_FOCUSED_EYEBEAM                       = 63347,
        SPELL_EYEBEAM_VISUAL_1                      = 63676,
        SPELL_EYEBEAM_VISUAL_2                      = 63702,
        SPELL_EYEBEAM_IMMUNITY                      = 64722,
        SPELL_ARM_RESPAWN                           = 64753
    };
    
    enum Events
    {
        EVENT_NONE,
        EVENT_SMASH,
        EVENT_GRIP,
        EVENT_SWEEP,
        EVENT_SHOCKWAVE,
        EVENT_EYEBEAM,
        EVENT_STONESHOT,
        EVENT_RIGHT,
        EVENT_LEFT
    };
    
    enum Actions
    {
        ACTION_RESPAWN_RIGHT,
        ACTION_RESPAWN_LEFT,
        ACTION_GRIP
    };
    
    enum Npcs
    {
        NPC_EYEBEAM_1                               = 33632,
        NPC_EYEBEAM_2                               = 33802,
        NPC_RUBBLE                                  = 33768,
        NPC_LEFT_ARM                                = 32933,
        NPC_RIGHT_ARM                               = 32934
    };
    
    enum Yells
    {
        SAY_AGGRO                                   = -1603230,
        SAY_SLAY_1                                  = -1603231,
        SAY_SLAY_2                                  = -1603232,
        SAY_LEFT_ARM_GONE                           = -1603233,
        SAY_RIGHT_ARM_GONE                          = -1603234,
        SAY_SHOCKWAVE                               = -1603235,
        SAY_GRAB_PLAYER                             = -1603236,
        SAY_DEATH                                   = -1603237,
        SAY_BERSERK                                 = -1603238
    };
    
    #define EMOTE_LEFT                              "The Left Arm has regrown!"
    #define EMOTE_RIGHT                             "The Right Arm has regrown!"
    #define EMOTE_STONE                             "Kologarn casts Stone Grip!"
    
    // Achievements
    #define ACHIEVEMENT_LOOKS_COULD_KILL            RAID_MODE(2955, 2956) // TODO
    #define ACHIEVEMENT_RUBBLE_AND_ROLL             RAID_MODE(2959, 2960)
    #define ACHIEVEMENT_WITH_OPEN_ARMS              RAID_MODE(2951, 2952)
    #define ACHIEV_DISARMED_START_EVENT             21687
    
    uint32 GripTargetGUID[3];
    
    const Position RubbleLeft   = {1781.814f, -45.07f, 448.808f, 2.260f};
    const Position RubbleRight  = {1781.814f, -3.716f, 448.808f, 4.211f};
    
    enum KologarnChests
    {
        CACHE_OF_LIVING_STONE_10                    = 195046,
        CACHE_OF_LIVING_STONE_25                    = 195047
    };
    
    class boss_kologarn : public CreatureScript
    {
    public:
        boss_kologarn() : CreatureScript("boss_kologarn") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new boss_kologarnAI (pCreature);
        }
    
        struct boss_kologarnAI : public BossAI
        {
            boss_kologarnAI(Creature *pCreature) : BossAI(pCreature, BOSS_KOLOGARN), vehicle(pCreature->GetVehicleKit()),
                left(false), right(false)
            {
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
                me->SetStandState(UNIT_STAND_STATE_SUBMERGED);
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                me->SetFlying(true);
                emerged = false;
            }
    
            Vehicle *vehicle;
    
            bool left, right;
            bool Gripped;
            bool emerged;
            uint32 RubbleCount;
    
            void MoveInLineOfSight(Unit* who)
            {
                // Birth animation
                if (!emerged && me->IsWithinDistInMap(who, 40.0f) && who->GetTypeId() == TYPEID_PLAYER && !who->ToPlayer()->isGameMaster())
                {
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    me->SetStandState(UNIT_STAND_STATE_STAND);
                    me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
                    emerged = true;
                }
            }
    
            void AttackStart(Unit *who)
            {
                me->Attack(who, true);
            }
    
            void JustDied(Unit* /*victim*/)
            {                
                DoScriptText(SAY_DEATH, me);
                _JustDied();
    
                if (instance)
                {
                    // Rubble and Roll
                    if (RubbleCount > 4)
                        instance->DoCompleteAchievement(ACHIEVEMENT_RUBBLE_AND_ROLL);
                    // With Open Arms
                    if (RubbleCount == 0)
                        instance->DoCompleteAchievement(ACHIEVEMENT_WITH_OPEN_ARMS);
    
                    // Remove Stone Grip from players
                    Map::PlayerList const &players = instance->instance->GetPlayers();
                    for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
                    {
                        Player* pPlayer = itr->getSource();
     
                        if (!pPlayer)
                            continue;
     
                        if (pPlayer->HasAura(SPELL_STONE_GRIP_STUN))
                        {
                            pPlayer->RemoveAurasDueToSpell(RAID_MODE(64290, 64292));
                            pPlayer->RemoveAurasDueToSpell(SPELL_STONE_GRIP_STUN);
                            pPlayer->GetMotionMaster()->MoveJump(1767.80f, -18.38f, 448.808f, 10, 10);
                        }
                    }
                }
    
                // Hack to disable corpse fall
                me->GetMotionMaster()->MoveTargetedHome();
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                me->setFaction(35);
                // Chest spawn
                me->SummonGameObject(RAID_MODE(CACHE_OF_LIVING_STONE_10, CACHE_OF_LIVING_STONE_25),1836.52f,-36.11f,448.81f,0.56f,0,0,1,1,604800);
            }
    
            void KilledUnit(Unit* /*who*/)
            {
                if (!(rand()%5))
                    DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me);
            }
    
            void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply)
            {
                if (who->GetTypeId() == TYPEID_UNIT)
                {
                    if (who->GetEntry() == NPC_LEFT_ARM)
                        left = apply;
                    else if (who->GetEntry() == NPC_RIGHT_ARM)
                        right = apply;
                    who->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
                }
            }
    
            void EnterCombat(Unit* /*who*/)
            {
                DoScriptText(SAY_AGGRO, me);
                _EnterCombat();
            
                RubbleCount = 0;
                Gripped = false;
                for (int32 n = 0; n < RAID_MODE(1, 3); ++n)
                    GripTargetGUID[n] = NULL;
                
                for (int32 n = 0; n < 2; ++n)
                {
                    if (vehicle->GetPassenger(n))
                        vehicle->GetPassenger(n)->ToCreature()->AI()->DoZoneInCombat();
                }
                events.ScheduleEvent(EVENT_SMASH, 5000);
                events.ScheduleEvent(EVENT_SWEEP, 10000);
                events.ScheduleEvent(EVENT_EYEBEAM, 10000);
                events.ScheduleEvent(EVENT_SHOCKWAVE, 12000);
                events.ScheduleEvent(EVENT_GRIP, 40000);
            }
    
            void Reset()
            {
                _Reset();
                
                if (instance)
                    instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_DISARMED_START_EVENT);
            
                if (Unit* LeftArm = me->SummonCreature(NPC_LEFT_ARM, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()))
                    LeftArm->EnterVehicle(vehicle, 0);
                if (Unit* RightArm = me->SummonCreature(NPC_RIGHT_ARM, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()))
                    RightArm->EnterVehicle(vehicle, 1);
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                    return;
    
                events.Update(diff);
    
                if (me->HasUnitState(UNIT_STAT_CASTING))
                    return;
                
                if (events.GetTimer() > 15000 && !me->IsWithinMeleeRange(me->getVictim()))
                    DoCastAOE(SPELL_PETRIFY_BREATH, true);
            
                if (!left && !right)
                    DoCast(me, SPELL_STONE_SHOUT, true);
    
                switch(events.GetEvent())
                {
                    case EVENT_NONE: break;
                    case EVENT_SMASH:
                        if (left && right)
                        {
                            if (me->IsWithinMeleeRange(me->getVictim()))
                                DoCastVictim(SPELL_TWO_ARM_SMASH, true);
                        }
                        else if (left || right)
                        {
                            if (me->IsWithinMeleeRange(me->getVictim()))
                                DoCastVictim(SPELL_ONE_ARM_SMASH, true);
                        }
                        events.RescheduleEvent(EVENT_SMASH, 15000);
                        break;
                    case EVENT_SWEEP:
                        if (left)
                            DoCastAOE(SPELL_ARM_SWEEP, true);
                        events.RescheduleEvent(EVENT_SWEEP, 15000);
                        break;
                    case EVENT_GRIP:
                        if (right && instance)
                        {
                            if (Unit* RightArm = vehicle->GetPassenger(1))
                            {
                                me->MonsterTextEmote(EMOTE_STONE, 0, true);
                                DoScriptText(SAY_GRAB_PLAYER, me);
                                // Grip up to 3 players
                                for (int32 n = 0; n < RAID_MODE(1, 3); ++n)
                                {
                                    if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 40, true))
                                        GripTargetGUID[n] = pTarget->GetGUID();
                                }
                                RightArm->ToCreature()->AI()->DoAction(ACTION_GRIP);
                            }
                        }
                        events.RescheduleEvent(EVENT_GRIP, 40000);
                        break;
                    case EVENT_SHOCKWAVE:
                        if (left)
                        {
                            DoScriptText(SAY_SHOCKWAVE, me);
                            DoCastAOE(SPELL_SHOCKWAVE, true);
                            DoCastAOE(SPELL_SHOCKWAVE_VISUAL, true);
                        }
                        events.RescheduleEvent(EVENT_SHOCKWAVE, urand(15000, 25000));
                        break;
                    case EVENT_EYEBEAM:
                        if (Unit *pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0, 50, true))
                        {
                            if (Creature* EyeBeam = me->SummonCreature(NPC_EYEBEAM_1,pTarget->GetPositionX(),pTarget->GetPositionY()+3,pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000))
                            {
                                EyeBeam->CastSpell(me, SPELL_EYEBEAM_VISUAL_1, true);
                                EyeBeam->AI()->AttackStart(pTarget);
                            }
                            if (Creature* EyeBeam = me->SummonCreature(NPC_EYEBEAM_2,pTarget->GetPositionX(),pTarget->GetPositionY()-3,pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000))
                            {
                                EyeBeam->CastSpell(me, SPELL_EYEBEAM_VISUAL_2, true);
                                EyeBeam->AI()->AttackStart(pTarget);
                            }
                        }
                        events.RescheduleEvent(EVENT_EYEBEAM, 20000);
                        break;
                    case EVENT_LEFT:
                        if (Unit* LeftArm = me->SummonCreature(NPC_LEFT_ARM, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()))
                        {
                            LeftArm->EnterVehicle(vehicle, 0);
                            DoCast(me, SPELL_ARM_RESPAWN, true);
                            me->MonsterTextEmote(EMOTE_LEFT, 0, true);
                            if (instance)
                                instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_DISARMED_START_EVENT);
                        }
                        events.CancelEvent(EVENT_LEFT);
                        break;                
                    case EVENT_RIGHT:
                        if (Unit* RightArm = me->SummonCreature(NPC_RIGHT_ARM, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()))
                        {
                            RightArm->EnterVehicle(vehicle, 1);
                            DoCast(me, SPELL_ARM_RESPAWN, true);
                            me->MonsterTextEmote(EMOTE_RIGHT, 0, true);
                            if (instance)
                                instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_DISARMED_START_EVENT);
                        }
                        events.CancelEvent(EVENT_RIGHT);
                        break;
                }
    
                DoMeleeAttackIfReady();
            }
    
            void DoAction(const int32 action)
            {
                switch (action)
                {
                    case ACTION_RESPAWN_LEFT:
                        DoScriptText(SAY_LEFT_ARM_GONE, me);
                        me->DealDamage(me, int32(me->GetMaxHealth() * 15 / 100)); // decreases Kologarn's health by 15%
                        ++RubbleCount;
                        if (instance && right)
                            instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_DISARMED_START_EVENT);
                        events.ScheduleEvent(EVENT_LEFT, 30000);
                        break;
                    case ACTION_RESPAWN_RIGHT:
                        DoScriptText(SAY_RIGHT_ARM_GONE, me);
                        me->DealDamage(me, int32(me->GetMaxHealth() * 15 / 100));
                        ++RubbleCount;
                        if (instance && left)
                            instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_DISARMED_START_EVENT);
                        events.ScheduleEvent(EVENT_RIGHT, 30000);
                        break;
                }
            }    
        };
    
    };
    
    
    class npc_focused_eyebeam : public CreatureScript
    {
    public:
        npc_focused_eyebeam() : CreatureScript("npc_focused_eyebeam") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_focused_eyebeamAI (pCreature);
        }
    
        struct npc_focused_eyebeamAI : public ScriptedAI
        {
            npc_focused_eyebeamAI(Creature *c) : ScriptedAI(c)
            {
                me->SetReactState(REACT_PASSIVE);
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
                DoCast(me, SPELL_EYEBEAM_IMMUNITY);
                DoCast(me, SPELL_FOCUSED_EYEBEAM);
                me->SetDisplayId(11686);
                checkTimer = 1500;
            }
    
            uint32 checkTimer;
    
            void UpdateAI(const uint32 diff)
            {
                if (checkTimer <= diff)
                {
                    if (me->getVictim() && me->getVictim()->isAlive())
                        me->GetMotionMaster()->MovePoint(0,me->getVictim()->GetPositionX(),me->getVictim()->GetPositionY(),me->getVictim()->GetPositionZ());
                
                    checkTimer = 500;
                }
                else checkTimer -= diff;
            }
        };
    
    };
    
    
    class npc_left_arm : public CreatureScript
    {
    public:
        npc_left_arm() : CreatureScript("npc_left_arm") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_left_armAI (pCreature);
        }
    
        struct npc_left_armAI : public ScriptedAI
        {
            npc_left_armAI(Creature *c) : ScriptedAI(c)
            {
                pInstance = c->GetInstanceScript();
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
                me->SetReactState(REACT_PASSIVE);
            }
    
            InstanceScript* pInstance;
    
            void JustDied(Unit* /*victim*/)
            {
                for (uint8 i = 0; i < 5; ++i)
                    me->SummonCreature(NPC_RUBBLE, RubbleLeft, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                
                if (pInstance)
                    if (Creature* pKologarn = me->GetCreature(*me, pInstance->GetData64(DATA_KOLOGARN)))
                        pKologarn->AI()->DoAction(ACTION_RESPAWN_LEFT);
                        
                // Hack to disable corpse fall
                me->GetMotionMaster()->MoveTargetedHome();
            }
        
            void JustSummoned(Creature *summon)
            {
                summon->AI()->DoZoneInCombat();
            }
        };
    
    };
    
    
    class npc_right_arm : public CreatureScript
    {
    public:
        npc_right_arm() : CreatureScript("npc_right_arm") { }
    
        CreatureAI* GetAI(Creature* pCreature) const
        {
            return new npc_right_armAI (pCreature);
        }
    
        struct npc_right_armAI : public ScriptedAI
        {
            npc_right_armAI(Creature *c) : ScriptedAI(c)
            {
                pInstance = c->GetInstanceScript();
                me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
                me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
                me->ApplySpellImmune(0, IMMUNITY_ID, 64708, true);
                me->SetReactState(REACT_PASSIVE);
            }
    
            InstanceScript* pInstance;
    
            bool Gripped;
            int32 ArmDamage;
            uint32 SqueezeTimer;
    
            void Reset()
            {
                Gripped = false;
                ArmDamage = 0;
                SqueezeTimer = 0;
            }
    
            void JustDied(Unit* /*victim*/)
            {
                for (uint8 i = 0; i < 5; ++i)
                    me->SummonCreature(NPC_RUBBLE, RubbleRight, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                
                if (pInstance)
                    if (Creature* pKologarn = me->GetCreature(*me, pInstance->GetData64(DATA_KOLOGARN)))
                        pKologarn->AI()->DoAction(ACTION_RESPAWN_RIGHT);
                        
                // Hack to disable corpse fall
                me->GetMotionMaster()->MoveTargetedHome();
            }
        
            void JustSummoned(Creature *summon)
            {
                summon->AI()->DoZoneInCombat();
            }
    
            void KilledUnit(Unit* Victim)
            {
                if (Victim)
                {
                    Victim->ExitVehicle();
                    Victim->GetMotionMaster()->MoveJump(1767.80f, -18.38f, 448.808f, 10, 10);
                }
            }
    
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                    return;
    
                if (Gripped)
                {
                    if (SqueezeTimer <= diff)
                    {
                        for (uint8 n = 0; n < RAID_MODE(1, 3); ++n)
                        {
                            if (me->GetVehicleKit()->GetPassenger(n) && me->GetVehicleKit()->GetPassenger(n)->isAlive())
                                me->Kill(me->GetVehicleKit()->GetPassenger(n), true);
                        }
                        Gripped = false;
                    }  
                    else SqueezeTimer -= diff;
                }
            }
    
            void DoAction(const int32 action)
            {
                switch (action)
                {
                    case ACTION_GRIP:
                        for (uint8 n = 0; n < RAID_MODE(1, 3); ++n)
                        {
                            if (Unit* GripTarget = Unit::GetUnit(*me, GripTargetGUID[n]))
                            {
                                if (GripTarget && GripTarget->isAlive())
                                {
                                    GripTarget->EnterVehicle(me, n);
                                    me->AddAura(SPELL_STONE_GRIP, GripTarget);
                                    me->AddAura(SPELL_STONE_GRIP_STUN, GripTarget);
                                    GripTargetGUID[n] = NULL;
                                }
                            }
                        }  
                        ArmDamage = 0;
                        SqueezeTimer = 16000;
                        Gripped = true;
                        break;
                }
            }
        
            void DamageTaken(Unit* pKiller, uint32 &damage)
            {
                if (Gripped)
                {
                    ArmDamage += damage;
                    int32 dmg = RAID_MODE(100000, 480000);
                
                    if (ArmDamage >= dmg || damage >= me->GetHealth())
                    {
                        for (uint8 n = 0; n < RAID_MODE(1, 3); ++n)
                        {
                            Unit* pGripTarget = me->GetVehicleKit()->GetPassenger(n);
                            if (pGripTarget && pGripTarget->isAlive())
                            {
                                pGripTarget->RemoveAurasDueToSpell(SPELL_STONE_GRIP);
                                pGripTarget->RemoveAurasDueToSpell(SPELL_STONE_GRIP_STUN);
                                pGripTarget->ExitVehicle();
                                pGripTarget->GetMotionMaster()->MoveJump(1767.80f, -18.38f, 448.808f, 10, 10);
                            }
                        }
                        Gripped = false;
                    }
                }
            }
        };
    
    };
    
    
    void AddSC_boss_kologarn()
    {
        new boss_kologarn();
        new npc_focused_eyebeam();
        new npc_left_arm();
        new npc_right_arm();
    }

  8. The Following User Says Thank You to Anz69 For This Useful Post:
  9. #5
    heaven1st's Avatar
    Join Date
    Aug 2007
    Location
    Bandung
    Posts
    635
    Points
    795.13
    Thanks: 31 / 139 / 54

    Default [SQL]Fix Unhittable Some NPCs in Drak'Tharon Keep

    NPCs: Risen Drakkari Bat Rider, Drakkari Guardian dan Drakkari Warrior

    Problem: Ga bisa di target/hit, tapi tetep aggro. Kesalahan pada table creature & creature_template, 'unit_flags' nya berunsur [33554432 = UNIT_FLAG_NOT_SELECTABLE = Can't be selected by mouse or with /target {name} command.] Bisa di cek di http://www.trinitycore.info/Creature...tc2#unit_flags

    Referensi:
    Test sendiri menggunakan core trinity terbaru.

    SQL Fixes:
    Code:
    -- Fix untuk table creature_template
    UPDATE creature_template SET type_flags=0, dynamicflags=0 ,unit_flags=64 WHERE entry IN (26620,26638,26425);
    
    -- Fix untuk table creature
    UPDATE creature SET unit_flags=64 WHERE id IN (26620,26638,26425);

    Keterangan tambahan:
    unit_flags=64 di dasari dari entry yg digunakan pada creature Drakkari Commander ( jadi disamakan saja dengan yg tidak error,a bit hacky but working ).
    Last edited by heaven1st; 07-11-12 at 03:21.
    If mood>0 Then open=notepad+,sqlyog,chrome,dbceditor Else sleep EndIf

  10. The Following User Says Thank You to heaven1st For This Useful Post:
  11. #6
    heaven1st's Avatar
    Join Date
    Aug 2007
    Location
    Bandung
    Posts
    635
    Points
    795.13
    Thanks: 31 / 139 / 54

    Default [SQL] Fix Unhittable Socrethar & Deathblow to the Legion Quest (Aldor side)

    NPC: Socrethar
    Quest: Deathblow to the Legion

    Problems:
    • Socrethar ga bisa di hit. Dikarenakan memiliki unit_flags=33088 (33088 = 32768 + 64 + 256)[256 = UNIT_FLAG_IMMUNE_TO_PC = disables combat/assistance with PlayerCharacters (PC)]
    • Setelah di fix , ternyata setelah di kill Socretharnya, quest Deathblow to the Legion tidak complete. Dikarenakan kekosongan entry RequiredNpcOrGo di table quest_template.


    Referensi:
    Test sendiri menggunakan core trinity terbaru.

    SQL Fixes:
    Code:
    -- Fix Socrethar
    UPDATE creature_template SET unit_flags=0 WHERE entry=20132;
    -- Fix DttL Quest
    UPDATE quest_template SET SpecialFlags=0, RequiredNpcOrGo1= 20132, RequiredNpcOrGoCount1=1, ObjectiveText1='Deathblow to the Legion' WHERE id=10409;
    Last edited by heaven1st; 07-11-12 at 03:22.
    If mood>0 Then open=notepad+,sqlyog,chrome,dbceditor Else sleep EndIf

  12. The Following User Says Thank You to heaven1st For This Useful Post:
  13. #7
    Tonggos's Avatar
    Join Date
    Feb 2010
    Location
    Yogyakarta
    Posts
    284
    Points
    185.80
    Thanks: 19 / 7 / 4

    Default

    Nama Error : The End of the Line Quest
    Referensi : Here
    Kondisi : Quest tidak Complete saat item quest digunakan pada tempatnya & pada saat melewati area azure dragon

    Code :

    Quest Item
    Spoiler untuk 2012_03_12_00_world_misc.sql :

    Code:
    SET @LEY_LINE_BEAM := 47334; -- Ley Line Beam (No kit)
    SET @BUNNY_BEAM := 47635; -- The End of the Line: Ley Line Focus Bunny Beam
    SET @TALISMAN_EFFECT := 50548; -- The End of the Line: Ley Line Focus Control Talisman Effect
    
    -- ELM General Purpose Bunny (Scale x0.01) SAI
    -- This is pure ****, those NPCs target some other NPCs with the same DB id, based on their GUIDs.
    DELETE FROM `smart_scripts` WHERE `entryorguid`=-116051 AND `source_type`=0;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=-116053 AND `source_type`=0;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=-116054 AND `source_type`=0;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=-116055 AND `source_type`=0;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=-116056 AND `source_type`=0;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=-116057 AND `source_type`=0;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=-116058 AND `source_type`=0;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=-116059 AND `source_type`=0;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=-116060 AND `source_type`=0;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=-116061 AND `source_type`=0;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=-116065 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
    (-116051,0,0,0,1,0,100,0,1000,1000,1000,2500,11,@LEY_LINE_BEAM,0,0,0,0,0,10,115958,24021,0,0,0,0,0, 'ELM General Purpose Bunny (Scale x0.01) - On update OOC - Cast Ley Line Beam (No kit) on ELM General Purpose Bunny (Scale x0.01)'),
    (-116053,0,0,0,1,0,100,0,1000,1000,1000,2500,11,@LEY_LINE_BEAM,0,0,0,0,0,10,115976,24021,0,0,0,0,0, 'ELM General Purpose Bunny (Scale x0.01) - On update OOC - Cast Ley Line Beam (No kit) on ELM General Purpose Bunny (Scale x0.01)'),
    (-116054,0,0,0,1,0,100,0,1000,1000,1000,2500,11,@LEY_LINE_BEAM,0,0,0,0,0,10,115973,24021,0,0,0,0,0, 'ELM General Purpose Bunny (Scale x0.01) - On update OOC - Cast Ley Line Beam (No kit) on ELM General Purpose Bunny (Scale x0.01)'),
    (-116055,0,0,0,1,0,100,0,1000,1000,1000,3500,11,@LEY_LINE_BEAM,0,0,0,0,0,10,115976,24021,0,0,0,0,0, 'ELM General Purpose Bunny (Scale x0.01) - On update OOC - Cast Ley Line Beam (No kit) on ELM General Purpose Bunny (Scale x0.01)'),
    (-116056,0,0,0,1,0,100,0,1000,1000,1000,3500,11,@LEY_LINE_BEAM,0,0,0,0,0,10,115958,24021,0,0,0,0,0, 'ELM General Purpose Bunny (Scale x0.01) - On update OOC - Cast Ley Line Beam (No kit) on ELM General Purpose Bunny (Scale x0.01)'),
    (-116057,0,0,0,1,0,100,0,1000,1000,1000,3500,11,@LEY_LINE_BEAM,0,0,0,0,0,10,115975,24021,0,0,0,0,0, 'ELM General Purpose Bunny (Scale x0.01) - On update OOC - Cast Ley Line Beam (No kit) on ELM General Purpose Bunny (Scale x0.01)'),
    (-116058,0,0,0,1,0,100,0,1000,1000,1000,4500,11,@LEY_LINE_BEAM,0,0,0,0,0,10,115959,24021,0,0,0,0,0, 'ELM General Purpose Bunny (Scale x0.01) - On update OOC - Cast Ley Line Beam (No kit) on ELM General Purpose Bunny (Scale x0.01)'),
    (-116059,0,0,0,1,0,100,0,1000,1000,1000,2500,11,@LEY_LINE_BEAM,0,0,0,0,0,10,115976,24021,0,0,0,0,0, 'ELM General Purpose Bunny (Scale x0.01) - On update OOC - Cast Ley Line Beam (No kit) on ELM General Purpose Bunny (Scale x0.01)'),
    (-116060,0,0,0,1,0,100,0,1000,1000,1000,3000,11,@LEY_LINE_BEAM,0,0,0,0,0,10,115973,24021,0,0,0,0,0, 'ELM General Purpose Bunny (Scale x0.01) - On update OOC - Cast Ley Line Beam (No kit) on ELM General Purpose Bunny (Scale x0.01)'),
    (-116061,0,0,0,1,0,100,0,1000,1000,1000,2500,11,@LEY_LINE_BEAM,0,0,0,0,0,10,115976,24021,0,0,0,0,0, 'ELM General Purpose Bunny (Scale x0.01) - On update OOC - Cast Ley Line Beam (No kit) on ELM General Purpose Bunny (Scale x0.01)'),
    (-116065,0,0,0,1,0,100,0,1000,1000,1000,2500,11,@LEY_LINE_BEAM,0,0,0,0,0,10,115959,24021,0,0,0,0,0, 'ELM General Purpose Bunny (Scale x0.01) - On update OOC - Cast Ley Line Beam (No kit) on ELM General Purpose Bunny (Scale x0.01)');
    
    -- ELM General Purpose Bunny SAI
    UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=24021;
    SET @ENTRY := -98564;
    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,8,0,100,0x1,@TALISMAN_EFFECT,0,0,0,11,@BUNNY_BEAM,0,0,0,0,0,7,0,0,0,0,0,0,0, 'ELM General Purpose Bunny - On The End of the Line: Ley Line Focus Control Talisman Effect hit - Cast The End of the Line: Ley Line Focus Bunny Beam on action invoker');
    
    -- ELM General Purpose Bunny SAI
    SET @ENTRY := -98617;
    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,8,0,100,0x1,@TALISMAN_EFFECT,0,0,0,11,@BUNNY_BEAM,0,0,0,0,0,7,0,0,0,0,0,0,0, 'ELM General Purpose Bunny - On The End of the Line: Ley Line Focus Control Talisman Effect hit - Cast The End of the Line: Ley Line Focus Bunny Beam on action invoker');
    
    -- Wrong conditions
    DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=47634;
    DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@TALISMAN_EFFECT;
    INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
    (13,0x1,47634,0,0,31,3,23837,0,0, '', 'Ley Line Focus Control Talisman only targets ELM General Purpose Bunny'),
    (13,0x1,@TALISMAN_EFFECT,0,0,31,1,23837,0,0, '', 'The End of the Line: Ley Line Focus Control Talisman Effect only targets ELM General Purpose Bunny');
    
    -- Areatrigger script
    DELETE FROM `areatrigger_scripts` WHERE `entry`=4956;
    INSERT INTO `areatrigger_scripts` VALUES (4956, 'at_azure_dragons_sanctuary');


    Area Trigger
    Spoiler untuk areatrigger_script.cpp :

    Code:
    /*#####
    ## at_azure_dragons_sanctuary
    ######*/
    
    enum DragonsSanctuary
    {
        QUEST_THE_END_OF_THE_LINE_A                  = 12107,
        QUEST_THE_END_OF_THE_LINE_H                  = 12110,
        NPC_THE_END_OF_THE_LINE_AT_KILL_CREDIT_BUNNY = 26889,
    };
    
    class AreaTrigger_at_azure_dragons_sanctuary : public AreaTriggerScript
    {
        public:
            AreaTrigger_at_azure_dragons_sanctuary() : AreaTriggerScript("at_azure_dragons_sanctuary") {}
    
            bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/)
            {
                if (player->GetQuestStatus(QUEST_THE_END_OF_THE_LINE_A) != QUEST_STATUS_INCOMPLETE)
                    || player->GetQuestStatus(QUEST_THE_END_OF_THE_LINE_H) != QUEST_STATUS_INCOMPLETE)
                    return false;
    
                player->KilledMonsterCredit(NPC_THE_END_OF_THE_LINE_AT_KILL_CREDIT_BUNNY, 0);
                return true;
            }
    };


    Maaf kalau salah (pingin quest ini buru2 kelar + masih newbie masalah ginian)
    Last edited by Tonggos; 08-11-12 at 10:39.
    Yes....it's Tonggos.....and yes....because it's Factor Face.........

  14. The Following User Says Thank You to Tonggos For This Useful Post:
  15. #8
    TeraPatrick's Avatar
    Join Date
    Nov 2006
    Location
    JO2 Studio
    Posts
    335
    Points
    313.23
    Thanks: 19 / 45 / 21

    Default

    Ijin nimbrung, buat bantu2. Maap kalo ada salah2.
    Nama Error (spell/Quest/achiev dsb) : dari thread Quest The Black Knight's Order
    Referensi : Quest: The Back Knights Orders (13663)
    Kondisi : Habis summon Gryphonnya, Gryphonnya gak mau terbang ke tempat tujuan..
    Code:
    Spoiler untuk code :
    Code:
    -- Quest: The Back Knights Orders (13663)
    -- Black Knights Camp Spawns
    SET @OGUID=xxxxxx; -- Need 10
    SET @CGUID=xxxxxx; -- Need 3
    DELETE FROM gameobject WHERE guid BETWEEN @OGUID+0 AND @OGUID+9;
    INSERT INTO gameobject (guid,id,map,spawnMask,phaseMask,position_x,position_y,position_z,orientation,rotation0,rotation1,rotation2,rotation3,spawntimesecs,animprogress,state) VALUES
    (@OGUID+0,194357,571,1,1,9070.324,2050.733,67.21755,0,0,0,0,1,0,0,0),
    (@OGUID+1,194357,571,1,1,9073.764,2050.12,68.15718,0,0,0,0,1,0,0,0),
    (@OGUID+2,194357,571,1,1,9074.699,2050.709,68.17049,0,0,0,0,1,0,0,0),
    (@OGUID+3,194357,571,1,1,9069.595,2050.349,67.21755,0,0,0,0,1,0,0,0),
    (@OGUID+4,194394,571,1,1,9083.578,2041.696,67.81812,0,0,0,0,1,0,0,0),
    (@OGUID+5,194357,571,1,1,9069.961,2050.538,67.21755,0,0,0,0,1,0,0,0),
    (@OGUID+6,194357,571,1,1,9072.077,2049.292,67.78963,0,0,0,0,1,0,0,0),
    (@OGUID+7,195011,571,1,1,9078.471,2057.547,67.21606,0,0,0,0.9981346,0.06105176,0,0,0),
    (@OGUID+8,194357,571,1,1,9065.68,2052.618,67.28638,3.019413,0,0,0,1,0,0,0),
    (@OGUID+9,300007,571,1,1,8523.900,566.635010,552.921,0,0,0,0,0,0,0,0); -- Is this GO used anywhere?
    
    
    DELETE FROM creature WHERE id=33537;
    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
    (@CGUID+0,33537,571,1,1,0,0,9071.043,2075.388,67.21542,4.93598,120,0,0,1,0,0,0,0,0),
    (@CGUID+1,33537,571,1,1,0,0,9074.414,2049.259,67.34636,2.181662,120,0,0,1,0,0,0,0,0),
    (@CGUID+2,33537,571,1,1,0,0,9081.28,2058.925,67.38979,3.612832,120,0,0,1,0,0,0,0,0);
    
    -- Template updates
    UPDATE creature_template SET unit_flags=unit_flags|8,speed_run=4, InhabitType=5 WHERE entry=33519; -- Black Knight's Gryphon
    UPDATE creature_template SET faction_A=2080,faction_H=2080,unit_flags=unit_flags|32768,equipment_id=823 WHERE entry=33537; -- Cult Conspirator
    
    -- Addon data
    DELETE FROM creature_template_addon WHERE entry IN (33519,33537);
    INSERT INTO creature_template_addon (entry,mount,bytes1,bytes2,emote,auras) VALUES
    (33519,0,0,2049,0,NULL),-- Black Knight's Gryphon
    (33537,0,1,1,0,NULL); -- Cult Conspirator
    
    -- SAI for Black Knight's Gryphon
    SET @entry :=33519;
    UPDATE creature_template SET AIName='SmartAI' WHERE entry=@entry;
    DELETE FROM smart_scripts WHERE source_type=0 AND entryorguid=@entry;
    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,27,0,100,0,0,0,0,0,53,0,@entry,0,13663,0,0,1,0,0,0,0,0,0,0,'Black Knight''s Gryphon - On Passenger - Start WP movement'),
    (@entry,0,1,0,40,0,100,0,40,@entry,0,0,33,33519,0,0,0,0,0,7,0,0,0,0,0,0,0,'Black Knight''s Gryphon - Quest Credit'),
    (@entry,0,2,0,40,0,100,0,43,@entry,0,0,11,50630,0,0,0,0,0,7,0,0,0,0,0,0,0,'Black Knight''s Gryphon - Dismount Spell'),
    (@entry,0,3,0,40,0,100,0,44,@entry,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Black Knight''s Gryphon - Despawn');
    
    DELETE FROM waypoints WHERE entry=33519;
    INSERT INTO waypoints (entry,pointid,position_x,position_y,position_z,point_comment) VALUES
    (33519,1,8521.271,569.596,552.8375,'Black Knight''s Gryphon'),
    (33519,2,8517.864,579.1095,553.2125,'Black Knight''s Gryphon'),
    (33519,3,8513.146,594.6724,551.2125,'Black Knight''s Gryphon'),
    (33519,4,8505.263,606.5569,550.4177,'Black Knight''s Gryphon'),
    (33519,5,8503.017,628.4188,547.4177,'Black Knight''s Gryphon'),
    (33519,6,8480.271,652.7083,547.4177,'Black Knight''s Gryphon'),
    (33519,7,8459.121,686.1427,547.4177,'Black Knight''s Gryphon'),
    (33519,8,8436.802,713.8687,547.3428,'Black Knight''s Gryphon'),
    (33519,9,8405.380,740.0045,547.4177,'Black Knight''s Gryphon'),
    (33519,10,8386.139,770.6009,547.5881,'Black Knight''s Gryphon'),
    (33519,11,8374.297,802.2525,547.9304,'Black Knight''s Gryphon'),
    (33519,12,8374.271,847.0363,548.0427,'Black Knight''s Gryphon'),
    (33519,13,8385.988,868.9881,548.0491,'Black Knight''s Gryphon'),
    (33519,14,8413.027,867.8573,547.2991,'Black Knight''s Gryphon'),
    (33519,15,8452.552,869.0339,547.2991,'Black Knight''s Gryphon'),
    (33519,16,8473.058,875.2012,547.2955,'Black Knight''s Gryphon'),
    (33519,17,8472.278,912.3134,547.4169,'Black Knight''s Gryphon'),
    (33519,18,8479.666,954.1650,547.3298,'Black Knight''s Gryphon'),
    (33519,19,8477.349,1001.368,547.3372,'Black Knight''s Gryphon'),
    (33519,20,8484.538,1025.797,547.4622,'Black Knight''s Gryphon'),
    (33519,21,8525.363,1029.284,547.4177,'Black Knight''s Gryphon'),
    (33519,22,8532.808,1052.904,548.1677,'Black Knight''s Gryphon'),
    (33519,23,8537.356,1077.927,554.5791,'Black Knight''s Gryphon'),
    (33519,24,8540.528,1083.379,569.6827,'Black Knight''s Gryphon'),
    (33519,25,8563.641,1140.965,569.6827,'Black Knight''s Gryphon'),
    (33519,26,8594.897,1205.458,569.6827,'Black Knight''s Gryphon'),
    (33519,27,8617.104,1257.399,566.1833,'Black Knight''s Gryphon'),
    (33519,28,8648.496,1329.349,558.0187,'Black Knight''s Gryphon'),
    (33519,29,8667.723,1388.411,546.188,'Black Knight''s Gryphon'),
    (33519,30,8699.145,1474.898,528.2197,'Black Knight''s Gryphon'),
    (33519,31,8726.869,1546.006,501.7741,'Black Knight''s Gryphon'),
    (33519,32,8739.058,1592.157,478.5511,'Black Knight''s Gryphon'),
    (33519,33,8750.799,1636.771,455.0797,'Black Knight''s Gryphon'),
    (33519,34,8760.006,1669.482,423.2208,'Black Knight''s Gryphon'),
    (33519,35,8783.31,1701.852,375.8872,'Black Knight''s Gryphon'),
    (33519,36,8817.336,1735.731,343.3323,'Black Knight''s Gryphon'),
    (33519,37,8882.32,1789.754,301.5807,'Black Knight''s Gryphon'),
    (33519,38,8958.597,1841.807,259.9141,'Black Knight''s Gryphon'),
    (33519,39,9045.891 ,1908.076,233.4143,'Black Knight''s Gryphon'),
    (33519,40,9107.177,1964.594,215.9704,'Black Knight''s Gryphon'),
    (33519,41,9134.763,2036.925,175.1925,'Black Knight''s Gryphon'),
    (33519,42,9128.608,2089.091,141.3593,'Black Knight''s Gryphon'),
    (33519,43,9093.364,2128.384,99.38685,'Black Knight''s Gryphon'),
    (33519,44,9050.709,2123.656,60.24802,'Black Knight''s Gryphon');


    Nama Error (spell/Quest/achiev dsb) : Gluttonous Lurkers
    Referensi : Quest : Gluttonous Lurkers (12527) SAI Convertion
    Kondisi : Loot Zul'drak Rat dari tikus2 di daerah Drak'Agal... Lalu menggunakan Item Quest 5 buah "Zul'drak Rat" pada Lurking Basilisk hingga basilisk menjadi "pacify" lalu loot Basilisk Crystals..
    Kenyataan nya disini setelah melempar 1 Zul'drak rat pada NPC Lurking Basilisk.. Basiliks menjadi "Pacify" dan ketika di loot NPC hilang dan tidak drop Basilisk Crystal..
    Code:
    Spoiler untuk code :
    Code:
    -- Quest: Gluttonous Lurkers (12527)
    -- SAI for Zul'Drak Rat
    SET @ENTRY :=28202;
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
    DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY;
    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,8,0,100,0,50926,0,1000,1000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zul''Drak Rat - Despawn on Spell Dummy');
    
    -- Remove EAI Scripts
    DELETE FROM creature_ai_scripts WHERE creature_id IN (28145,28203);
    
    -- SAI for Gorged Lurking Basilisk
    SET @ENTRY :=28203;
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
    DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY;
    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,8,0,100,0,50918,0,1000,1000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Gorged Lurking Basilisk - Despawn on Spell Dummy');
    
    -- SAI for Lurking Basilisk
    SET @ENTRY :=28145;
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
    DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY;
    DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*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,0,0,0,0,0,100,0,5000,5000,17000,27000,11,54470,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Lurking Basilisk - Cast Venemous Bite'),
    (@ENTRY,0,1,0,23,0,100,0,50894,5,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0, 'Lurking Basilisk - Start Script'),
    (@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Lurking Basilisk - Gorged Lurking Basilisk'),
    (@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,12,28203,1,30000,0,0,0,1,0,0,0,0,0,0,0, 'Lurking Basilisk - Gorged Lurking Basilisk'),
    (@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Lurking Basilisk - Despawn');

  16. The Following User Says Thank You to TeraPatrick For This Useful Post:
  17. #9
    Achernar_Altair's Avatar
    Join Date
    Mar 2007
    Location
    Kamar, Masjid, Kantor n Warnet, g jauh2 dah dari situ
    Posts
    877
    Points
    1,872.78
    Thanks: 15 / 131 / 30

    Default [SQL]Fix for Uldum NPC Spawn, Quest, Obsidium Spawn, Mobs damage, Tolvir and Hall of Origination

    Saya Mau Share 7 SQL Script buat berbagai Fix


    Description :
    This SQL script allows the player to do all the quests without error, some of them are simply hacked to be auto completed. This script also spawns all the missing NPCs that are managed by phases. It gives damage to all the mobs that didn’t do any damage before (The damage is probably not exact but it’s a start). It also allows you to complete the Lost City dungeon and the Halls of origination dungeon and do the quests in those dungeons. Since Uldum is the only zone that really works now for levels 80 to 84, I’ve reduced the quest requirement level to 80 so any players 80 and + can go there and do the quests. I’ve also added many obsidium mines everywhere in Uldum because none of them are spawned anywhere right now in 4.3.4. None of those fixes were sent to Trinity because they are not Blizzlike so you are the only ones to get them.

    Reference : here

    Spoiler untuk :
    Code:
    -- Fix : Harrison Jones
    DELETE FROM creature WHERE guid = 600009;
    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 (
    600009, 46978, 1, 1, 1, 0, 0, -10411.9, -231.985, 336.596, 4.56465, 300, 0, 0, 774900, 0, 0, 0, 0, 0);
    
    -- Fix : Salhet
    DELETE FROM creature WHERE guid = 600010;
    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 (
    600010, 46883, 1, 1, 1, 0, 1, -9982.77, -1240.29, 42.1056, 4.02258, 300, 0, 0, 44679, 4169, 0, 0, 0, 0);
    
    -- Fix : Salhet V2
    DELETE FROM creature WHERE guid = 600011;
    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 (
    600011, 48022, 1, 1, 1, 0, 0, -10362.1, -845.127, 129.238, 5.09071, 300, 0, 0, 84, 0, 0, 0, 0, 0);
    
    -- Fix quest 27923: Smoke in their eyes
    SET @SPELL := 88646; 
    SET @GAMEOBJ_REWARD := 206682; 
    SET @GAMEOBJ := 206682;
    UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` = @GAMEOBJ; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @GAMEOBJ AND `source_type`=1; 
    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 
    (@GAMEOBJ,1,0,1,8,0,100,1,@SPELL,0,0,0,33,@GAMEOBJ_REWARD,0,0,0,0,0,7,0,0,0,0,0,0,0,'Bale of Hay - On Spell Hit - Give credit for quest 27923'),
    (@GAMEOBJ,1,1,0,61,0,100,1,0,0,0,0,41,2000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bale of Hay - Despawn after 2 second'); 
    
    -- Sand Covered Heiroglyphs
    UPDATE gameobject_template SET flags = 0 WHERE entry = 205874;
    
    -- Uldum Survivor
    UPDATE creature_template SET type = 4, type_flags = 0, faction_A = 834, faction_H = 834, IconName = '' WHERE entry = 45715;
    
    -- Trooper Uniform
    DELETE FROM `creature_loot_template` WHERE `entry` = 47220 AND `item` = 62789;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (47220, 62789, -100, 1, 0, 1, 1);
    
    -- Quest - 27905 - Tailgunner! - Autocomplete
    update quest_template set flags = 8, RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0 WHERE id = 27905;
    
    -- Quest - 27993 - Take it to 'Em! - Autocomplete
    update quest_template set flags = 8, RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0 WHERE id = 27993;
    
    -- Quest - 27922 - Traitors! - Autocomplete
    update quest_template set flags = 65536 WHERE id = 27922;
    
    -- Quest - 28501 - The Defense of Nahom - Autocomplete
    update quest_template set flags = 65536 WHERE id = 28501;
    
    -- Fix : Itesh
    DELETE FROM creature WHERE guid = 600012;
    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 (
    600012, 49943, 657, 1, 1, 0, 0, -328.098, 9.0766, 626.979, 2.59785, 300, 0, 0, 5971, 0, 0, 0, 0, 0);
    
    -- Fix : Grand Vizier Ertan
    DELETE FROM creature WHERE guid = 600013;
    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 (
    600013, 43878, 657, 1, 1, 0, 0, -721.686, 5.20662, 635.672, 5.4999, 300, 0, 0, 450000, 225100, 0, 0, 0, 0);
    
    -- Elaborate Disc
    UPDATE gameobject_template SET flags = 0 WHERE entry = 205266;
    
    -- Decrepit Skeleton
    UPDATE gameobject_template SET flags = 0 WHERE entry = 205540;
    
    -- Tol'Vir Grave
    UPDATE gameobject_template SET flags = 0 WHERE entry = 207409;
    
    -- Fix : Siamat
    DELETE FROM creature WHERE guid = 600014;
    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 (
    600014, 44819, 755, 1, 1, 0, 0, -10985.4, -1369.11, 10.807, 2.34673, 300, 0, 0, 2074850, 32585, 0, 0, 0, 0);
    
    -- Uldum - MinLevel = 80
    UPDATE quest_template SET minlevel = 80 WHERE minlevel = 83;
    
    -- Tormented Tomb-Robber, needs to be hostile
    UPDATE creature_template SET faction_A = 834, faction_H = 834 WHERE entry = 45765;
    
    -- Fix : Harrison Jones
    DELETE FROM creature WHERE guid = 600015;
    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 (
    600015, 45180, 1, 1, 1, 0, 0, -9210.26, -1561.57, 65.4522, 0.0129464, 300, 0, 0, 774900, 0, 0, 0, 0, 0);
    
    -- Quest - 27922 - Traitors! - Autocomplete
    update quest_template set flags = 65536 WHERE id = 27922;
    
    -- Quest 27196 - On to Something
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0 WHERE id = 27196;
    
    -- Quest 27511 - The Thrill of Discovery
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 27511;
    
    -- Quest 27141 - Premature Explosionation
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 27141;
    
    -- Quest 27431 - Tipping the balance
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 27431;
    
    -- Quest 27624 - After the fall
    DELETE FROM `gameobject_loot_template` WHERE `entry` = 34760 AND `item` = 61975;
    DELETE FROM `gameobject_loot_template` WHERE `entry` = 34760 AND `item` = 61044;
    DELETE FROM `gameobject_loot_template` WHERE `entry` = 34760 AND `item` = 61977;
    INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (34760, 61975, -100, 1, 0, 1, 1),
    (34760, 61044, -100, 1, 0, 1, 1),
    (34760, 61977, -100, 1, 0, 1, 1);
    
    -- Quest 27669 Do the honors
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 27669;
    
    -- Quest #27541 Lessons From  the Past
    DELETE FROM `creature_loot_template` WHERE `entry` = 45874 AND `item` = 61929;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (45874, 61929, -100, 1, 0, 1, 1);
    
    -- Schnottz Scout, needs to be hostile
    UPDATE creature_template SET modelid1 = 34892, faction_A = 834, faction_H = 834, gossip_menu_id = 0, npcflag = 0, unit_flags2 = 2048, unit_flags = 0, dynamicflags = 0, type = 7, type_flags = 0, lootid = 45874, VehicleId = 0  WHERE entry = 45874;
    UPDATE creature SET curhealth = 50 WHERE id = 45874;
    
    -- Colossus of the moon, needs to be hostile
    UPDATE creature_template SET faction_A = 834, faction_H = 834 WHERE entry = 46042;
    
    -- Colossus of the Sun, needs to be hostile
    UPDATE creature_template SET faction_A = 834, faction_H = 834 WHERE entry = 46041;
    
    -- Fix : Harrison Jones
    DELETE FROM creature WHERE guid = 600016;
    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 (
    600016, 45296, 1, 1, 1, 0, 0, -9186, -1556.51, -172.559, 6.26872, 300, 0, 0, 774900, 0, 0, 0, 0, 0);
    
    -- Fix : Harrison Jones
    DELETE FROM creature WHERE guid = 600017;
    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 (
    600017, 44860, 1, 1, 1, 0, 0, -8952.47, -1549.9, 94.4543, 3.15462, 300, 0, 0, 105950, 0, 0, 0, 0, 0);
    
    -- Fix : Harrison Jones
    DELETE FROM creature WHERE guid = 600018;
    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 (
    600018, 48034, 1, 1, 1, 0, 0, -9426.06, -1511.32, 66.7761, 1.43803, 300, 0, 0, 105950, 0, 0, 0, 0, 0);
    
    -- Fix : Colossus of the moon
    DELETE FROM creature WHERE id = 46042;
    DELETE FROM creature WHERE guid = 600019;
    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 (
    600019, 46042, 1, 1, 1, 0, 0, -9588.57, -115.241, 97.2698, 2.58863, 300, 0, 0, 107362, 0, 0, 0, 0, 0);
    
    -- Fix : Colossus of the sun
    DELETE FROM creature WHERE id = 46041;
    DELETE FROM creature WHERE guid = 600020;
    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 (
    600020, 46041, 1, 1, 1, 0, 0, -9719.56, -12.2935, 87.062, 4.15156, 300, 0, 0, 107362, 0, 0, 0, 0, 0);
    
    -- Titanic Guardian, needs to be hostile
    UPDATE creature_template SET faction_A = 834, faction_H = 834, gossip_menu_id = 0, npcflag = 0, unit_flags = 0, unit_flags2 = 0, dynamicflags = 0, type = 6, type_flags = 0, lootid = 47032, VehicleId = 0  WHERE entry = 47032;
    
    -- Quest 28277 - Salhet the tactician
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28277;
    
    -- Quest 27778 - Wacking the Wisbon
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 27778;
    
    -- Quest 27779 - Gnomebliteration
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 27779;
    
    -- Quest 28250 - Theiving little puckers
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28250;
    
    -- Quest #27541 Lessons From  the Past
    DELETE FROM `creature_loot_template` WHERE `entry` = 45949 AND `item` = 61376;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (45949, 61376, -100, 1, 0, 1, 1);
    
    -- Creature 50401 - Titan Mechanism
    DELETE FROM creature WHERE guid = 600021;
    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 (
    600021, 50401, 1, 1, 1, 0, 0, -10414.6, -382.534, 223.749, 3.43355, 300, 0, 0, 4979, 0, 0, 0, 0, 0);
    
    -- Update all creature damage for standard mobs
    UPDATE creature_template SET mindmg = 1000.666, maxdmg = 1400.666, attackpower = 1550.666, minrangedmg = 750.666, maxrangedmg = 1100.666, rangedattackpower = 500.666 WHERE mindmg = 0 AND minlevel in (82, 83) AND rank = 0;
    UPDATE creature_template SET mindmg = 1200.666, maxdmg = 1600.666, attackpower = 1750.666, minrangedmg = 900.666, maxrangedmg = 1300.666, rangedattackpower = 650.666 WHERE mindmg = 0 AND minlevel in (84, 85) AND rank = 0;
    UPDATE creature_template SET mindmg = 2500.666, maxdmg = 3200.666, attackpower = 3500.666, minrangedmg = 1800.666, maxrangedmg = 2600.666, rangedattackpower = 1000.666 WHERE mindmg = 0 AND minlevel in (86, 87) AND rank = 0;
    UPDATE creature_template SET mindmg = 5000.666, maxdmg = 6400.666, attackpower = 7000.666, minrangedmg = 4000.666, maxrangedmg = 5500.666, rangedattackpower = 2000.666 WHERE mindmg = 0 AND minlevel in (88, 89, 90) AND rank = 0;
    
    -- Update all creature damage for elite mobs
    UPDATE creature_template SET mindmg = 4000.666, maxdmg = 6000.666, attackpower = 6000.666, minrangedmg = 3000.666, maxrangedmg = 5000.666, rangedattackpower = 5000.666 WHERE mindmg = 0 AND minlevel in (82, 83) AND rank in (1, 2, 4);
    UPDATE creature_template SET mindmg = 5000.666, maxdmg = 7500.666, attackpower = 7500.666, minrangedmg = 4000.666, maxrangedmg = 6000.666, rangedattackpower = 6000.666 WHERE mindmg = 0 AND minlevel in (84, 85) AND rank in (1, 2, 4);
    UPDATE creature_template SET mindmg = 10000.666, maxdmg = 15000.666, attackpower = 15000.666, minrangedmg = 8000.666, maxrangedmg = 12000.666, rangedattackpower = 12000.666 WHERE mindmg = 0 AND minlevel in (86, 87) AND rank in (1, 2, 4);
    UPDATE creature_template SET mindmg = 20000.666, maxdmg = 30000.666, attackpower = 30000.666, minrangedmg = 16000.666, maxrangedmg = 24000.666, rangedattackpower = 24000.666 WHERE mindmg = 0 AND minlevel in (88, 89, 90) AND rank in (1, 2, 4);
    
    -- Update all creature damage for boss mobs
    UPDATE creature_template SET mindmg = 10000.666, maxdmg = 14000.666, attackpower = 15500.666, minrangedmg = 7500.666, maxrangedmg = 11000.666, rangedattackpower = 5000.666 WHERE mindmg = 0 AND minlevel in (82, 83) AND rank = 3;
    UPDATE creature_template SET mindmg = 12000.666, maxdmg = 16000.666, attackpower = 17500.666, minrangedmg = 9000.666, maxrangedmg = 13000.666, rangedattackpower = 6500.666 WHERE mindmg = 0 AND minlevel in (84, 85) AND rank = 3;
    UPDATE creature_template SET mindmg = 25000.666, maxdmg = 32000.666, attackpower = 35000.666, minrangedmg = 18000.666, maxrangedmg = 26000.666, rangedattackpower = 10000.666 WHERE mindmg = 0 AND minlevel in (86, 87) AND rank = 3;
    UPDATE creature_template SET mindmg = 50000.666, maxdmg = 64000.666, attackpower = 70000.666, minrangedmg = 40000.666, maxrangedmg = 55000.666, rangedattackpower = 20000.666 WHERE mindmg = 0 AND minlevel in (88, 89, 90) AND rank = 3;
    
    -- Creature 47159 - Commander Schnottz
    DELETE FROM creature WHERE guid = 600022;
    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 (
    600022, 47159, 1, 1, 1, 0, 0, -10679.4, 927.368, 26.2312, 3.30002, 300, 0, 0, 4913, 4454, 0, 0, 0, 0);
    
    -- Fix Quest : Make yourself useful
    UPDATE quest_template SET requiredNpcOrGo1 = 47291 WHERE Id = 27969;
    
    -- Creature 47201 - Desert Fox
    DELETE FROM creature WHERE guid = 600023;
    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 (
    600023, 47201, 1, 1, 1, 0, 0, -10961.3, -264.239, 9.30777, 1.19514, 300, 0, 0, 61733, 0, 0, 0, 0, 0);
    UPDATE creature_template SET faction_A = 1881, faction_H = 1881, lootID = 47201 WHERE entry = 47201;
    DELETE FROM `creature_loot_template` WHERE `entry` = 47201 AND `item` = 62777;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (47201, 62777, -100, 1, 0, 1, 1);
    
    -- Quest 27990 - Battlezone
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 27990;
    
    -- Quest 27950 - Gobbles!
    update quest_template set RequiredNpcOrGo1 = 47255, RequiredNpcOrGoCount1 = 1, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, flags = 8 WHERE id = 27950;
    update creature_template SET faction_A = 188, faction_H = 188 WHERE entry = 47255;
    DELETE FROM creature_involvedrelation WHERE id = 47159 AND quest = 27950;
    INSERT INTO creature_involvedrelation (id, quest) VALUES (47159, 27950);
    
    -- Quest 28187 - Missed Me By Zhat Much!
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28187;
    
    -- Quest 28267 - Firing Squad
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28267;
    
    -- Sullah
    update creature_template_addon set auras = '' where entry = 48203;
    
    -- Quest 28274 Two Tents
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28274;
    
    -- Creature 47940 - Commander Schnottz
    DELETE FROM creature WHERE guid = 600024;
    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 (
    600024, 47940, 1, 1, 1, 0, 0, -10670.7, 928.714, 26.3814, 3.30779, 300, 0, 0, 77490, 4454, 0, 0, 0, 0);
    
    -- Creature 47255 - Gobbles
    DELETE FROM creature WHERE guid = 600025;
    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 (
    600025, 47255, 1, 1, 1, 0, 0, -10697.9, 928.023, 26.6558, 0.122994, 300, 0, 0, 42, 0, 0, 0, 0, 0);
    
    -- Creature 47940 - Commander Schnottz
    DELETE FROM creature WHERE guid = 600026;
    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 (
    600026, 47972, 1, 1, 1, 0, 0, -10637.1, 1042.14, 25.7543, 1.87441, 300, 0, 0, 77490, 4454, 0, 0, 0, 0);
    
    -- Creature 47980 - Captain Cork
    DELETE FROM creature WHERE guid = 600027;
    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 (
    600027, 47980, 1, 1, 1, 0, 0, -10880.9, 901.513, 18.6547, 2.92681, 300, 0, 0, 64496, 0, 0, 0, 0, 0);
    
    -- Creature 48162 - Harrison Jones
    DELETE FROM creature WHERE guid = 600028;
    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 (
    600028, 48162, 1, 1, 1, 0, 0, -10514.3, 991.328, 43.6857, 1.21731, 300, 0, 0, 774900, 0, 0, 0, 0, 0);
    
    -- Creature 48186 - Harrison Jones
    DELETE FROM creature WHERE guid = 600029;
    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 (
    600029, 48186, 1, 1, 1, 0, 0, -8342.79, 768.189, 152.434, 2.52106, 300, 0, 0, 774900, 0, 0, 0, 0, 0);
    
    -- Creature 48431 - Sullah
    DELETE FROM creature WHERE guid = 600030;
    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 (
    600030, 48431, 1, 1, 1, 0, 0, -8929.04, 606.946, 151.224, 2.6035, 300, 0, 0, 774900, 0, 0, 0, 0, 0);
    
    -- Fix Quest : Unlimited Potential, kill Cavorting Pygmy
    UPDATE quest_template SET requiredNpcOrGo1 = 51217 WHERE Id = 28351;
    
    -- Fix Quest : Camel Tow, kill Wild Camel
    UPDATE quest_template SET requiredNpcOrGo1 = 51193 WHERE Id = 28352;
    
    -- Quest 28367 Shroud of the Makers
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28367;
    
    -- Quest 28403 Bad Datas
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28403;
    
    -- Titanic Guardian, needs to be hostile
    UPDATE creature_template SET faction_A = 834, faction_H = 834, gossip_menu_id = 0, npcflag = 0, unit_flags = 0, unit_flags2 = 0, dynamicflags = 0, type = 6, type_flags = 0, lootid = 48437, VehicleId = 0  WHERE entry = 48437;
    
    -- Creature 48528 - Harrison Jones
    DELETE FROM creature WHERE guid = 600031;
    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 (
    600031, 48528, 1, 1, 1, 0, 0, -8864.83, 202.366, 147.252, 1.03807, 300, 0, 0, 774900, 0, 0, 0, 0, 0);
    
    -- Creature 48558 - Harrison Jones
    DELETE FROM creature WHERE guid = 600032;
    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 (
    600032, 48558, 1, 1, 1, 0, 0, -8987.55, 27.5256, -17.96, 0.244821, 300, 0, 0, 774900, 0, 0, 0, 0, 0);
    
    -- Creature 48437 - Titanic Guardian
    DELETE FROM creature WHERE guid = 600033;
    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 (
    600033, 48437, 1, 1, 1, 0, 0, -9013.09, -38.655, -21.7553, 1.02628, 300, 0, 0, 232470, 0, 0, 0, 0, 0);
    
    -- Spawn some Obsidium Deposit in Uldum since it cannot be found elsewhere
    DELETE FROM gameobject WHERE guid >= 600000 AND guid <= 6000049;
    INSERT INTO gameobject (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES 
    (600000, 202736, 1, 1, 1, -9002.94, 182.64, 150.3, 4.67, 0, 0, 0, 1, 120, 255, 1),
    (600001, 202736, 1, 1, 1, -9429.87, 126.24, 128.23, 4.05, 0, 0, 0, 1, 120, 255, 1),
    (600002, 202736, 1, 1, 1, -8313.52, -124.97, 234.44, 0.91, 0, 0, 0, 1, 120, 255, 1),
    (600003, 202736, 1, 1, 1, -8458.81, 280.66, 155.78, 3.13, 0, 0, 0, 1, 120, 255, 1),
    (600004, 202736, 1, 1, 1, -8406.92, 470.12, 185.02, 3, 0, 0, 0, 1, 120, 255, 1),
    (600005, 202736, 1, 1, 1, -8512.67, 886.44, 169.94, 3.25, 0, 0, 0, 1, 120, 255, 1),
    (600006, 202736, 1, 1, 1, -8753.66, 436.44, 304.45, 4.06, 0, 0, 0, 1, 120, 255, 1),
    (600007, 202736, 1, 1, 1, -9333.35, 802.27, 241.67, 1.58, 0, 0, 0, 1, 120, 255, 1),
    (600008, 202736, 1, 1, 1, -9546.42, 363.92, 148.76, 4.73, 0, 0, 0, 1, 120, 255, 1),
    (600009, 202736, 1, 1, 1, -9748.28, 813.22, 172.23, 4.98, 0, 0, 0, 1, 120, 255, 1),
    (600010, 202736, 1, 1, 1, -10093.42, 1057.98, 148.91, 1.62, 0, 0, 0, 1, 120, 255, 1),
    (600011, 202736, 1, 1, 1, -10420.59, 1429.38, 108.21, 1.69, 0, 0, 0, 1, 120, 255, 1),
    (600012, 202736, 1, 1, 1, -10953.10, 335.46, 10.65, 5.45, 0, 0, 0, 1, 120, 255, 1),
    (600013, 202736, 1, 1, 1, -10652.84, -225.95, 150.35, 0.09, 0, 0, 0, 1, 120, 255, 1),
    (600014, 202736, 1, 1, 1, -10269.03, -222.40, 279.87, 4.04, 0, 0, 0, 1, 120, 255, 1),
    (600015, 202736, 1, 1, 1, -10424.06, -761.48, 223.03, 3.33, 0, 0, 0, 1, 120, 255, 1),
    (600016, 202736, 1, 1, 1, -11042.39, -934.00, 189.40, 3.71, 0, 0, 0, 1, 120, 255, 1),
    (600017, 202736, 1, 1, 1, -10770.16, -1669.88, 11.55, 5.59, 0, 0, 0, 1, 120, 255, 1),
    (600018, 202736, 1, 1, 1, -10343.87, -1320.03, 46.93, 5.64, 0, 0, 0, 1, 120, 255, 1),
    (600019, 202736, 1, 1, 1, -10814.50, -1956.98, 169.30, 2.57, 0, 0, 0, 1, 120, 255, 1),
    (600020, 202736, 1, 1, 1, -10972.22, -2246.19, 159.77, 2.07, 0, 0, 0, 1, 120, 255, 1),
    (600021, 202736, 1, 1, 1, -10552.54, -2634.84, 7.21, 1.24, 0, 0, 0, 1, 120, 255, 1),
    (600022, 202736, 1, 1, 1, -10042.26, -2393.39, 18.75, 1.25, 0, 0, 0, 1, 120, 255, 1),
    (600023, 202736, 1, 1, 1, -9516.30, -1894.27, 111.72, 1.48, 0, 0, 0, 1, 120, 255, 1),
    (600024, 202736, 1, 1, 1, -9103.53, -1811.35, 130.24, 1.81, 0, 0, 0, 1, 120, 255, 1),
    (600025, 202736, 1, 1, 1, -8625.56, -1571.99, 184.07, 5.60, 0, 0, 0, 1, 120, 255, 1),
    (600026, 202736, 1, 1, 1, -8507.99, -1112.86, 317.04, 2.73, 0, 0, 0, 1, 120, 255, 1),
    (600027, 202736, 1, 1, 1, -8691.88, -555.73, 188.20, 1.03, 0, 0, 0, 1, 120, 255, 1),
    (600028, 202736, 1, 1, 1, -9795.72, -1416.99, 65.49, 0.55, 0, 0, 0, 1, 120, 255, 1),
    (600029, 202736, 1, 1, 1, -9920.16, -56.54, 60.39, 6.13, 0, 0, 0, 1, 120, 255, 1),
    (600030, 202736, 1, 1, 1, -10050.48, 426.73, 29.31, 6.09, 0, 0, 0, 1, 120, 255, 1),
    (600031, 202736, 1, 1, 1, -10332.19, 868.59, 57.48, 1.55, 0, 0, 0, 1, 120, 255, 1);
    
    -- Quest 28497 Fire From the Sky
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28497;
    
    -- Quest 28736 Fire From the Sky (Daily)
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28736;
    
    -- Obsidian Colossus, needs to be hostile
    UPDATE creature_template SET faction_A = 834, faction_H = 834, gossip_menu_id = 0, npcflag = 0, unit_flags = 0, unit_flags2 = 0, dynamicflags = 0, type = 6, type_flags = 0, lootid = 46646, VehicleId = 0  WHERE entry = 46646;
    
    -- Creature 48621 - Sullah
    DELETE FROM creature WHERE guid = 600034;
    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 (
    600034, 48621, 1, 1, 1, 0, 0, -9095.27, -162.778, 142.436, 4.18738, 300, 0, 0, 774900, 0, 0, 0, 0, 0);
    
    -- Creature 48698 - Harrison Jones
    DELETE FROM creature WHERE guid = 600035;
    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 (
    600035, 48698, 1, 1, 1, 0, 0, -8260.17, -120.064, 320.205, 2.6205, 300, 0, 0, 774900, 0, 0, 0, 0, 0);
    
    -- Creature 47158 - Harrison Jones
    DELETE FROM creature WHERE guid = 600036;
    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 (
    600036, 47158, 1, 1, 1, 0, 0, -8676.51, 208.714, 338.857, 4.98852, 300, 0, 0, 774900, 0, 0, 0, 0, 0);
    
    -- Quest 28612 Harrison Jones and the temple of Uldum
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28612;
    
    -- Quest 28622 Three if by Air
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28622;
    
    -- Quest 28633 The Coffer of Promises
    update quest_template set RequiredItemId1 = 0, RequiredItemCount1 = 0 WHERE id = 28633;
    
    -- Quest 27707 Neferset Prison
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 27707;
    DELETE FROM creature_involvedrelation WHERE id = 46136 AND quest = 27707;
    INSERT INTO creature_involvedrelation (id, quest) VALUES (46136, 27707);
    
    -- Tahet, needs to be hostile
    UPDATE creature_template SET faction_A = 834, faction_H = 834, gossip_menu_id = 0, npcflag = 0, unit_flags = 0, unit_flags2 = 0, dynamicflags = 0, type = 6, type_flags = 0, lootid = 46496, VehicleId = 0  WHERE entry = 46496;
    
    -- All the Scarabs from Obelish of the Stars
    update creature_template_addon set auras = '' where entry = 46129;
    update creature_template_addon set auras = '' where entry = 46128;
    update creature_template_addon set auras = '' where entry = 46127;
    update creature_template_addon set auras = '' where entry = 46126;
    update creature_template_addon set auras = '' where entry = 46129;
    update creature_template_addon set auras = '' where entry = 46128;
    update creature_template_addon set auras = '' where entry = 46127;
    delete from creature_loot_template where entry IN (46126, 46127, 46128, 46129);
    update creature_template set lootid = 0 where entry IN (46126, 46127, 46128, 46129);
    
    -- Quest 27627 - Just a fancy coackroaches
    DELETE FROM creature_involvedrelation WHERE id = 45296 AND quest = 27627;
    INSERT INTO creature_involvedrelation (id, quest) VALUES (45296, 27627);
    DELETE FROM creature_questrelation WHERE id = 45296 AND quest = 27627;
    INSERT INTO creature_questrelation (id, quest) VALUES (45296, 27627);
    UPDATE quest_template SET flags = 8 WHERE id = 27627;
    
    -- Quest 28486 Salhet's Gambit
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28486;
    
    -- Quest 27940 - Dirty Birds
    DELETE FROM creature_involvedrelation WHERE id = 49248 AND quest = 27940;
    INSERT INTO creature_involvedrelation (id, quest) VALUES (49248, 27940);
    DELETE FROM creature_questrelation WHERE id = 49248 AND quest = 27940;
    INSERT INTO creature_questrelation (id, quest) VALUES (49248, 27940);
    UPDATE quest_template SET flags = 8 WHERE id = 27940;
    
    -- Quest 27187 - Mangy Hiena
    DELETE FROM creature_involvedrelation WHERE id = 47959 AND quest = 27187;
    INSERT INTO creature_involvedrelation (id, quest) VALUES (47959, 27187);
    DELETE FROM creature_questrelation WHERE id = 47959 AND quest = 27187;
    INSERT INTO creature_questrelation (id, quest) VALUES (47959, 27187);
    UPDATE quest_template SET flags = 8 WHERE id = 27187;
    
    -- Many creatures and quest givers
    DELETE FROM creature WHERE guid >= 600037 and guid <= 600057;
    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 
    (600037, 49151, 1, 1, 1, 0, 0, -8837.39, 371.465, 352.934, 4.16777, 300, 0, 0, 774900, 0, 0, 0, 0, 0),
    (600038, 49204, 1, 1, 1, 0, 0, -9300.06, 422.546, 242.795, 1.5476, 300, 0, 0, 77490, 0, 0, 0, 0, 0),
    (600039, 49203, 1, 1, 1, 0, 0, -9296.86, 422.451, 242.796, 1.66296, 300, 0, 0, 774900, 0, 0, 0, 0, 0),
    (600040, 49248, 1, 1, 1, 0, 0, -10811.5, -335.035, 4.64437, 2.56615, 300, 0, 0, 77490, 0, 0, 0, 0, 0),
    (600041, 49351, 1, 1, 1, 0, 0, -10812, -337.177, 4.92718, 2.88548, 300, 0, 0, 77490, 0, 0, 0, 0, 0),
    (600042, 46135, 1, 1, 1, 0, 1, -9755.11, -913.391, 57.1899, 3.83736, 300, 0, 0, 53681, 0, 0, 0, 0, 0),
    (600043, 47959, 1, 1, 1, 0, 0, -9433.15, -965.101, 111.012, 3.13838, 300, 0, 0, 53681, 0, 0, 0, 0, 0),
    (600044, 46129, 1, 1, 1, 0, 0, -9116.53, -1550.11, -170.91, 3.1305, 300, 0, 0, 26841, 0, 0, 0, 0, 0),
    (600045, 49345, 1, 1, 1, 0, 0, -10737.2, -827.863, 91.0212, 2.81632, 300, 0, 0, 44679, 4169, 0, 0, 0, 0),
    (600046, 48428, 1, 1, 1, 0, 0, -9030.37, -19.1494, 143.419, 3.24829, 300, 0, 0, 2324700, 4454, 0, 0, 0, 0),
    (600047, 47967, 1, 1, 1, 0, 0, -10663.7, 1091.6, 25.3099, 3.72291, 300, 0, 0, 30951, 3994, 0, 0, 0, 0),
    (600048, 46129, 1, 1, 1, 0, 0, -9143.27, -1517.37, -170.91, 3.7111, 300, 0, 0, 26841, 0, 0, 0, 0, 0),
    (600049, 46127, 1, 1, 1, 0, 0, -9191.42, -1632.6, -172.559, 6.01232, 300, 0, 0, 26841, 0, 0, 0, 0, 0),
    (600050, 49523, 1, 1, 1, 0, 1, -8260.83, -123.878, 320.42, 2.76469, 300, 0, 0, 5971, 0, 0, 0, 0, 0),
    (600051, 44833, 1, 1, 1, 0, 1, -8927.28, -2257.67, 8.87805, 1.68657, 300, 0, 0, 35967, 0, 0, 0, 0, 0),
    (600052, 46873, 1, 1, 1, 0, 1, -10995.1, -1251.59, 13.2429, 3.11599, 300, 0, 0, 35967, 0, 0, 0, 0, 0),
    (600053, 39788, 644, 1, 1, 0, 1, -499.103, 193.208, 66.4808, 3.12196, 300, 0, 0, 2074850, 0, 0, 0, 0, 0),
    (600054, 39587, 644, 1, 1, 0, 1, -505.425, 72.4414, 81.8417, 1.559, 300, 0, 0, 1659880, 300000, 0, 0, 0, 0),
    (600055, 39731, 644, 1, 1, 0, 1, -505.502, -49.6127, 81.843, 1.56292, 300, 0, 0, 1659880, 0, 0, 0, 0, 0),
    (600056, 39732, 644, 1, 1, 0, 1, -504.208, -274.005, 141.074, 1.57865, 300, 0, 0, 1659880, 32585, 0, 0, 0, 0),
    (600057, 39378, 644, 1, 1, 0, 1, -507.757, -695.087, 139.966, 1.57175, 300, 0, 0, 2074850, 0, 0, 0, 0, 0);
    
    -- Quest 27003 Easy Money
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 27003;
    
    -- Instance mobs needs to be selectable, no script so they can fight correctly and no vehicle so they move ok
    UPDATE creature_template SET unit_flags = 32832, ScriptName = '', VehicleId = 0 WHERE entry = 40808;
    UPDATE creature_template SET unit_flags = 32832, ScriptName = '', VehicleId = 0 WHERE entry = 40787;
    UPDATE creature_template SET unit_flags = 32832, ScriptName = '', VehicleId = 0 WHERE entry = 40311;
    UPDATE creature_template SET unit_flags = 32832, ScriptName = '', VehicleId = 0 WHERE entry = 39788;
    UPDATE creature_template SET unit_flags = 32832, ScriptName = '', VehicleId = 0 WHERE entry = 39731;
    UPDATE creature_template SET unit_flags = 32832, ScriptName = '', VehicleId = 0 WHERE entry = 44577;
    UPDATE creature_template SET unit_flags = 32832, ScriptName = '', VehicleId = 0 WHERE entry = 39378;
    
    -- Quest  Penetrating their defenses
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 28746;



    Status : Tested by Me for NPC Harrison Jones Spawn


    Code2 yang saya kasih ini masih belom Final, masih akan diupdate lagi sama creatornya, tapi untuk sementara membantu banget buat leveling di Uldum, secara available Cata Zone cuma Uldum, dan banyak yang stuck di 84 karena quest di Uldum udah abis, sisa yang bug2 dan quest dengan loot
    Last edited by Achernar_Altair; 29-04-13 at 13:15.
    Quote Originally Posted by Aluna Sagita
    Having Crush On Me Isn't Categorized As Pedophilia
    Spoiler untuk Warcraft Books :

  18. The Following 2 Users Say Thank You to Achernar_Altair For This Useful Post:
  19. #10
    Achernar_Altair's Avatar
    Join Date
    Mar 2007
    Location
    Kamar, Masjid, Kantor n Warnet, g jauh2 dah dari situ
    Posts
    877
    Points
    1,872.78
    Thanks: 15 / 131 / 30

    Default [SQL]Cataclysm Mobs Loot

    Description :
    It’s a script that gives loot to all mobs for Cataclysm, which many of those don’t have in the latest trinity core. It’s currently being reviewed by the trinity team but since it’s so big it might take a lot of time for them to test it. It fixes tons of drop quests.

    Reference :here

    Code :Download

    Kode Panjang banget jadi g ane paste disini, ud berapa kali tak paste cuma jadi error, bkin ngehang Chrome ane --'a


    Status : Tested di repack saya, and work nice
    Quote Originally Posted by Aluna Sagita
    Having Crush On Me Isn't Categorized As Pedophilia
    Spoiler untuk Warcraft Books :

  20. The Following User Says Thank You to Achernar_Altair For This Useful Post:
  21. #11
    Achernar_Altair's Avatar
    Join Date
    Mar 2007
    Location
    Kamar, Masjid, Kantor n Warnet, g jauh2 dah dari situ
    Posts
    877
    Points
    1,872.78
    Thanks: 15 / 131 / 30

    Default [SQL]Various Fixes From Trinity Forum

    Desciption :
    Many fixes are posted on the trinity forums but not all of them are pushed into the master build. These are a few that I’ve kept that are quite useful, especially the one to prevent crashes in the Argent Tournament zone.

    Reference :here

    Code :

    Spoiler untuk :
    Code:
    -- Sentinel Hill Guard - Remove incorrect auras
    UPDATE creature_template_addon SET auras = '' WHERE entry = 42407;
    
    -- Argent Tournament Emotes
    UPDATE `creature_addon` SET `emote`=010 WHERE `emote`=094; -- STATE_DANCE
    UPDATE `creature_addon` SET `emote`=027 WHERE `emote`=044; -- STATE_READYUNARMED
    UPDATE `creature_addon` SET `emote`=029 WHERE `emote`=025; -- STATE_POINT(DNR)
    UPDATE `creature_addon` SET `emote`=064 WHERE `emote`=462; -- STATE_STUN
    UPDATE `creature_addon` SET `emote`=068 WHERE `emote`=016; -- STATE_KNEEL
    UPDATE `creature_addon` SET `emote`=069 WHERE `emote`=432; -- STATE_USESTANDING
    UPDATE `creature_addon` SET `emote`=193 WHERE `emote`=050; -- STATE_SPELLPRECAST
    UPDATE `creature_addon` SET `emote`=214 WHERE `emote`=213; -- STATE_READYRIFLE
    UPDATE `creature_addon` SET `emote`=233 WHERE `emote`=467; -- STATE_WORK_MINING
    UPDATE `creature_addon` SET `emote`=234 WHERE `emote`=466; -- STATE_WORK_CHOPWOOD
    UPDATE `creature_addon` SET `emote`=253 WHERE `emote`=021; -- STATE_APPLAUD
    UPDATE `creature_addon` SET `emote`=333 WHERE `emote`=045; -- STATE_READY1H
    UPDATE `creature_addon` SET `emote`=376 WHERE `emote`=048; -- STATE_READYBOW
    UPDATE `creature_addon` SET `emote`=379 WHERE `emote`=380; -- STATE_FISHING
    UPDATE `creature_addon` SET `emote`=392 WHERE `emote`=011; -- STATE_LAUGH
    UPDATE `creature_addon` SET `emote`=400 WHERE `emote`=401; -- STATE_DANCESPECIAL
    UPDATE `creature_addon` SET `emote`=416 WHERE `emote`=402; -- STATE_CUSTOM_SPELL_01
    UPDATE `creature_addon` SET `emote`=417 WHERE `emote`=403; -- STATE_CUSTOM_SPELL_02
    UPDATE `creature_addon` SET `emote`=418 WHERE `emote`=007; -- STATE_EAT
    UPDATE `creature_addon` SET `emote`=419 WHERE `emote`=405; -- STATE_CUSTOM_SPELL_04
    UPDATE `creature_addon` SET `emote`=420 WHERE `emote`=404; -- STATE_CUSTOM_SPELL_03
    UPDATE `creature_addon` SET `emote`=421 WHERE `emote`=406; -- STATE_CUSTOM_SPELL_05
    UPDATE `creature_addon` SET `emote`=428 WHERE `emote`=381; -- STATE_LOOT
    UPDATE `creature_addon` SET `emote`=451 WHERE `emote`=477; -- STATE_SPECIALUNARMED
    UPDATE `creature_template_addon` SET `emote`=010 WHERE `emote`=094; -- STATE_DANCE
    UPDATE `creature_template_addon` SET `emote`=027 WHERE `emote`=044; -- STATE_READYUNARMED
    UPDATE `creature_template_addon` SET `emote`=029 WHERE `emote`=025; -- STATE_POINT(DNR)
    UPDATE `creature_template_addon` SET `emote`=064 WHERE `emote`=462; -- STATE_STUN
    UPDATE `creature_template_addon` SET `emote`=068 WHERE `emote`=016; -- STATE_KNEEL
    UPDATE `creature_template_addon` SET `emote`=069 WHERE `emote`=432; -- STATE_USESTANDING
    UPDATE `creature_template_addon` SET `emote`=193 WHERE `emote`=050; -- STATE_SPELLPRECAST
    UPDATE `creature_template_addon` SET `emote`=214 WHERE `emote`=213; -- STATE_READYRIFLE
    UPDATE `creature_template_addon` SET `emote`=233 WHERE `emote`=467; -- STATE_WORK_MINING
    UPDATE `creature_template_addon` SET `emote`=234 WHERE `emote`=466; -- STATE_WORK_CHOPWOOD
    UPDATE `creature_template_addon` SET `emote`=253 WHERE `emote`=021; -- STATE_APPLAUD
    UPDATE `creature_template_addon` SET `emote`=333 WHERE `emote`=045; -- STATE_READY1H
    UPDATE `creature_template_addon` SET `emote`=376 WHERE `emote`=048; -- STATE_READYBOW
    UPDATE `creature_template_addon` SET `emote`=379 WHERE `emote`=380; -- STATE_FISHING
    UPDATE `creature_template_addon` SET `emote`=392 WHERE `emote`=011; -- STATE_LAUGH
    UPDATE `creature_template_addon` SET `emote`=400 WHERE `emote`=401; -- STATE_DANCESPECIAL
    UPDATE `creature_template_addon` SET `emote`=416 WHERE `emote`=402; -- STATE_CUSTOM_SPELL_01
    UPDATE `creature_template_addon` SET `emote`=417 WHERE `emote`=403; -- STATE_CUSTOM_SPELL_02
    UPDATE `creature_template_addon` SET `emote`=418 WHERE `emote`=007; -- STATE_EAT
    UPDATE `creature_template_addon` SET `emote`=419 WHERE `emote`=405; -- STATE_CUSTOM_SPELL_04
    UPDATE `creature_template_addon` SET `emote`=420 WHERE `emote`=404; -- STATE_CUSTOM_SPELL_03
    UPDATE `creature_template_addon` SET `emote`=421 WHERE `emote`=406; -- STATE_CUSTOM_SPELL_05
    UPDATE `creature_template_addon` SET `emote`=428 WHERE `emote`=381; -- STATE_LOOT
    UPDATE `creature_template_addon` SET `emote`=451 WHERE `emote`=477; -- STATE_SPECIALUNARMED
    
    -- Update the game object template so these items are selectable
    UPDATE `gameobject_template` SET `flags`=0 WHERE `entry` IN (55, 56, 61, 259, 261, 2083, 2688, 2701, 4141, 7510, 7923, 32569, 131474, 138492, 142151, 152097, 176392, 179485, 179517, 179880, 180025, 180503, 181698, 181748, 184300, 184825, 185165, 186585, 188085, 190777, 191760, 191761, 191766, 192060, 195676, 201742, 202135, 202264, 202335, 202697, 202701, 202706, 202712, 202714, 202859, 203134, 203140, 204817, 205207, 205874, 207104, 207125, 207406, 207407, 207408, 207409, 207410, 207411, 207412, 208420, 208549, 208550, 208825);
    UPDATE `gameobject_template` SET `flags`=32 WHERE `entry` IN (2702, 187565, 188419, 190535, 190602, 190657, 190917, 192079, 192080, 192524, 195497, 195517, 195600, 202613, 202759, 202916, 202975, 203301, 203305, 203395, 204959, 205350, 206585);


    Status : Tested for Argent Tournament only in my repack, work nice, sisanya blom
    Quote Originally Posted by Aluna Sagita
    Having Crush On Me Isn't Categorized As Pedophilia
    Spoiler untuk Warcraft Books :

  22. The Following User Says Thank You to Achernar_Altair For This Useful Post:
  23. #12
    Achernar_Altair's Avatar
    Join Date
    Mar 2007
    Location
    Kamar, Masjid, Kantor n Warnet, g jauh2 dah dari situ
    Posts
    877
    Points
    1,872.78
    Thanks: 15 / 131 / 30

    Default [SQL]Fix For Main Quests

    Description :
    This script fixes lots of quests everywhere but mostly in the Dun Morogh, Loch Modan, Wetlands, Arathi Highlands, The Hinterlands, Dustwallow Marsh, Westfall, Dusk Woods, Winterspring, Tanaris and Ice Crown. Most of the fixes are legit but some of them simply hack the quest so it can be completed. More than half of those fixes are already posted or being reviewed by the trinity team.

    Reference :here

    Code :

    Spoiler untuk :
    Code:
    -- *** FIXES FOR DUN MOROGH ***
    
    -- Quest #24475 fix : All the Other Stuff.  Add the quest loot to the timber wolf, young wolf and boar
    DELETE FROM `creature_loot_template` WHERE `entry` = 708 AND `item` = 49747;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (708, 49747, -39, 1, 0, 1, 1);
    DELETE FROM `creature_loot_template` WHERE `entry` = 705 AND `item` = 49748;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (705, 49748, -64, 1, 0, 1, 1);
    DELETE FROM `creature_loot_template` WHERE `entry` = 704 AND `item` = 49748;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (704, 49748, -70, 1, 0, 1, 1);
    
    
    -- Quest #24486 fix : Make Hay While the Sun Shines.  Add the Priceless Rockjaw Artifact loot to the Rockjaw Scavenger so you can complete the quest
    DELETE FROM `creature_loot_template` WHERE `entry` = 37105 AND `item` = 49751;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (37105, 49751, -90, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 37105 WHERE `entry` = 37105; 
    
    
    -- Quest #384 fix: Adding the tender boar meat to the crag boar, the 41% rate is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 1125 AND `item` = 60496;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (1125, 60496, -41, 1, 0, 1, 1);
    -- Quest #384 fix: Last gossip_menu_id was 1297 but it was preventing players from trading with the innkeeper and setting their heartstone in that region
    UPDATE `creature_template` SET `gossip_menu_id` = 0 WHERE `entry` = 1247; 
    
    
    -- Quest #25997 fix: Adding Dark Iron Attack Plans
    DELETE FROM `creature_loot_template` WHERE `entry` = 6124 AND `item` = 56264;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (6124, 56264, -100, 1, 0, 1, 1);
    
    
    -- Quest #412 Operation Recombobulation - fix: Adding the Gyromechanic Gear, the drop rate is from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 41146 AND `item` = 3084;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (41146, 3084, -91, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 41146 WHERE `entry` = 41146; 
    
    
    
    -- *** FIXES FOR LOCH MODAN ***
    
    -- Quest #26845 fix: Adding the Foreman Sharpsneer's Head
    DELETE FROM `creature_loot_template` WHERE `entry` = 44198 AND `item` = 60404;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (44198, 60404, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 44198 WHERE `entry` = 44198; 
    
    
    -- Quest #26842 fix: Adding Mosshide Ear
    DELETE FROM `creature_loot_template` WHERE `entry` = 44162 AND `item` = 60402;
    DELETE FROM `creature_loot_template` WHERE `entry` = 44161 AND `item` = 60402;
    DELETE FROM `creature_loot_template` WHERE `entry` = 45384 AND `item` = 60402;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (44162, 60402, -100, 1, 0, 1, 1),
    (44161, 60402, -100, 1, 0, 1, 1),
    (45384, 60402, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 44162 WHERE `entry` = 44162; 
    UPDATE `creature_template` SET `lootid` = 44161 WHERE `entry` = 44161; 
    UPDATE `creature_template` SET `lootid` = 45384 WHERE `entry` = 45384; 
    
    
    -- Quest #26928 fix: Adding Murloc Scent Gland, the drop rates are from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 44176 AND `item` = 60511;
    DELETE FROM `creature_loot_template` WHERE `entry` = 44292 AND `item` = 60511;
    DELETE FROM `creature_loot_template` WHERE `entry` = 45401 AND `item` = 60511;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (44176, 60511, -45, 1, 0, 1, 1),
    (44292, 60511, -38, 1, 0, 1, 1),
    (45401, 60511, -30, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 44176 WHERE `entry` = 44176; 
    UPDATE `creature_template` SET `lootid` = 44292 WHERE `entry` = 44292; 
    UPDATE `creature_template` SET `lootid` = 45401 WHERE `entry` = 45401; 
    
    
    -- Quest #26929 fix: Adding Intact Crocolisk Jaw, the 44% drop rates is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 1693 AND `item` = 57131;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (1693, 57131, -44, 1, 0, 1, 1);
    
    
    -- Quest #26860 fix: Adding Bear Rump, the 56% drop rates is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 1186 AND `item` = 60497;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (1186, 60497, -56, 1, 0, 1, 1);
    
    
    -- Quest #27031 Wing Nut - fix: Adding the Pristine Flight Feather, the 34% drop rate is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 44628 AND `item` = 60792;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) 
    VALUES (44628, 60792, -34, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 44628 WHERE `entry` = 44628; 
    
    
    -- Quest #27028 Hornet Hunting - fix: Adding the Glassy Hornet Wing, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 44620 AND `item` = 60754;
    DELETE FROM `creature_loot_template` WHERE `entry` = 45402 AND `item` = 60754;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (44620, 60754, -41, 1, 0, 1, 1),
    (45402, 60754, -32, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 44620 WHERE `entry` = 44620; 
    UPDATE `creature_template` SET `lootid` = 45402 WHERE `entry` = 45402; 
    
    
    -- Quest #27030 Foxtails by the handful - fix: Adding the Fluffy Fox Tail, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 44635 AND `item` = 60755;
    DELETE FROM `creature_loot_template` WHERE `entry` = 45380 AND `item` = 60755;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (44635, 60755, -81, 1, 0, 1, 1),
    (45380, 60755, -53, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 44635 WHERE `entry` = 44635; 
    UPDATE `creature_template` SET `lootid` = 45380 WHERE `entry` = 45380; 
    
    
    
    -- *** FIXES FOR THE WETLANDS ***
    
    -- Quest #25800 When Life Gives You Crabs - fix: Adding the Meaty Crawler Claw, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 44116 AND `item` = 56013;
    DELETE FROM `creature_loot_template` WHERE `entry` = 41295 AND `item` = 56013;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (44116, 56013, -43, 1, 0, 1, 1),
    (41295, 56013, -36, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 44116 WHERE `entry` = 44116; 
    UPDATE `creature_template` SET `lootid` = 41295 WHERE `entry` = 41295;
    
    
    -- Quest #25723 Thresh Out of Luck - fix: Adding the Threshadon Chunk, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 41137 AND `item` = 55232;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (41137, 55232, -94, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 41137 WHERE `entry` = 41137; 
    
    
    -- Quest #25849 When Archaeology Attacks - fix: Adding the Fossilized Bone, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 41388 AND `item` = 56083;
    DELETE FROM `creature_loot_template` WHERE `entry` = 44226 AND `item` = 56083;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (41388, 56083, -68, 1, 0, 1, 3),
    (44226, 56083, -5, 1, 0, 1, 3);
    UPDATE `creature_template` SET `lootid` = 41388 WHERE `entry` = 41388; 
    UPDATE `creature_template` SET `lootid` = 44226 WHERE `entry` = 44226; 
    
    
    -- Quest #25853 Tooling Around - fix: Adding the Archaeologist's Tools
    DELETE FROM `gameobject_loot_template` WHERE `entry` = 29626 AND `item` = 56082;
    INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (29626, 56082, -100, 1, 0, 1, 1);
    
    
    
    -- *** FIXES FOR THE HINTERLANDS ***
    
    -- Quest #26490 (Alliance) & #26283 (Horde) Prime Slime - fix: Adding the Direglob Sample
    DELETE FROM `creature_loot_template` WHERE `entry` = 42592 AND `item` = 58082;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (42592, 58082, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 42592 WHERE `entry` = 42592; 
    
    
    
    -- *** FIXES FOR NPC TRAINERS ***
    
    -- Fix the fishing trainers so the players can train beyond 75.  356 is the correct skill ID for fishing.
    UPDATE `npc_trainer` SET `reqskill` = 356 WHERE `reqskill` = 365 AND `entry` = 200302;
    
    
    
    -- *** FIXES FOR DARKSHORE ***
    
    -- Quest #13521 Buzzbox 413 - fix: Adding the Corrupted Tide Crawler Flesh, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 32935 AND `item` = 44863;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (32935, 44863, -40, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 32935 WHERE `entry` = 32935; 
    -- Quest #13521 Buzzbox 413 - fix: create the quest reward giver, the Buzzbox 413
    DELETE FROM `gameobject_template` WHERE `entry` = 194105;
    INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `size`, `data1`) VALUES (194105, 2, 356, 'Buzzbox 413', 1, 9477);
    DELETE FROM `gameobject` WHERE `guid` = 194105 AND `id` = 2040;
    INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, 
    `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES 
    (194105, 2040, 0, 1, 1, -935.522, -3939.23, 147.561, 2.60444, 0, 0, 0.96415, 0.265358, 300, 0, 1);
    
    
    -- Quest #13528 Buzzbox 723 - fix: Adding the Corrupted Thistle Bear Guts, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 33905 AND `item` = 44913;
    DELETE FROM `creature_loot_template` WHERE `entry` = 33009 AND `item` = 44913;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (33905, 44913, -35, 1, 0, 1, 1),
    (33009, 44913, -32, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 33905 WHERE `entry` = 33905; 
    UPDATE `creature_template` SET `lootid` = 33009 WHERE `entry` = 33009; 
    
    
    -- Quest #13513 On the Brink - fix: Adding the Shatterspear Amulet, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 32860 AND `item` = 44942;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (32860, 44942, -83, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 32860 WHERE `entry` = 32860; 
    
    
    -- Quest #13844 The Looting of Althalaxx - fix: create the Charred Book game object and its loot
    DELETE FROM `gameobject_template` WHERE `entry` = 194787;
    INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `castBarCaption`, `flags`, `size`, `questItem1`, `data0`, `data1`) VALUES 
    (194787, 3, 2530, 'Charred Book', 'Examining', 4, 1, 45944, 43, 24124);
    DELETE FROM `gameobject_loot_template` WHERE `entry` = 24124 AND `item` = 45944;
    INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (24124, 45944, -100, 1, 0, 1, 1);
    
    
    -- Quest #13554 A Cure In The Dark - fix: Adding the Foul Ichor, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 33021 AND `item` = 44966;
    DELETE FROM `creature_loot_template` WHERE `entry` = 33022 AND `item` = 44966;
    DELETE FROM `creature_loot_template` WHERE `entry` = 33020 AND `item` = 44966;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (33021, 44966, -35, 1, 0, 1, 1),
    (33022, 44966, -34, 1, 0, 1, 1),
    (33020, 44966, -20, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 33021 WHERE `entry` = 33021; 
    UPDATE `creature_template` SET `lootid` = 33022 WHERE `entry` = 33022; 
    UPDATE `creature_template` SET `lootid` = 33020 WHERE `entry` = 33020; 
    
    
    
    -- *** FIXES FOR DUN MOROGH - GNOME STARTING ZONE ***
    
    -- Change the NPC: Torben Zapblast for SmartAI so he can use scripts like teleports, change the Icon and Flag so he can speak single gossip
    UPDATE creature_template SET AIName = 'SmartAI', IconName = 'Speak', type_flags = 134221824 WHERE entry = 46293;
    -- Assign the gossip menu to Torben Zapblast
    DELETE FROM gossip_menu WHERE entry = 12104 AND text_id = 16995;
    INSERT INTO gossip_menu (entry, text_id) VALUES (12104, 16995);
    -- Update the gossip menu option to show the gossip option to leave gnomeragan
    UPDATE gossip_menu_option SET option_id = 1, npc_option_npcflag = 1 WHERE menu_id = 12104 AND id = 1;
    -- Create the telelport smart script so gnomes can exit their starting location
    DELETE FROM smart_scripts WHERE entryorguid = 46293;
    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 (46293, 0, 1, 0, 62, 0, 100, 0, 12104, 1, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, -5201.2856, 477.5454, 388.471, 5.2577, 'Teleport');
    
    
    -- Quest #26264 What's Left Behind - fix: Adding the Recovered Possession, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 42184 AND `item` = 57987;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (42184, 57987, -89, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 42184 WHERE `entry` = 42184; 
    
    
    -- Quest #26285 Get Me Explosives Back! - fix: Adding the Stolen Powder Keg, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 42221 AND `item` = 58202;
    DELETE FROM `creature_loot_template` WHERE `entry` = 42222 AND `item` = 58202;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (42221, 58202, -95, 1, 0, 1, 1),
    (42222, 58202, -86, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 42221 WHERE `entry` = 42221; 
    UPDATE `creature_template` SET `lootid` = 42222 WHERE `entry` = 42222; 
    
    
    
    -- *** FIXES FOR THE WETLANDS ***
    
    
    -- Quest #25722 Sedimentary, My Dear - fix: Adding the Flood Sediment Sample
    DELETE FROM `gameobject_loot_template` WHERE `entry` = 29569 AND `item` = 55231;
    INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (29569, 55231, -100, 1, 0, 1, 1);
    
    
    -- Quest #25726 A Dumpy Job - fix: Adding the Dumpy Level, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 41145 AND `item` = 55234;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (41145, 55234, -9, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 41145 WHERE `entry` = 41145; 
    
    
    -- Quest #25727 Drungeld Glowerglare - fix: Adding the Glowerglare's Beard
    DELETE FROM `creature_loot_template` WHERE `entry` = 41151 AND `item` = 55988;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (41151, 55988, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 41151 WHERE `entry` = 41151; 
    
    
    
    -- *** FIXES FOR THE SOUTERN BARRENS ***
    
    
    -- Quest #24824 The Disturbed Earth - fix: Adding the Gargantapid's Poison Gland, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 37553 AND `item` = 50385;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (37553, 50385, -39, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 37553 WHERE `entry` = 37553; 
    
    
    
    -- *** FIXES FOR TANARIS ***
    
    
    -- Quest #25522 Gargantapid - fix: Adding the Gargantapid's Poison Gland
    DELETE FROM `creature_loot_template` WHERE `entry` = 40581 AND `item` = 54855;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (40581, 54855, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 40581 WHERE `entry` = 40581; 
    
    
    -- Quest #25521 I'm With Scorpid - fix: Adding the Duneclaw Stinger. the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 40656 AND `item` = 54856;
    DELETE FROM `creature_loot_template` WHERE `entry` = 40717 AND `item` = 54856;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (40656, 54856, -49, 1, 0, 1, 1),
    (40717, 54856, -48, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 40656 WHERE `entry` = 40656; 
    UPDATE `creature_template` SET `lootid` = 40717 WHERE `entry` = 40717; 
    
    
    -- Quest #24931 Gazer Tag - fix: Adding the Ocular Crystal, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 5420 AND `item` = 51793;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (5420, 51793, -40, 1, 0, 1, 1);
    
    
    
    -- *** FIXES FOR WINTERSPRING ***
    
    
    -- Quest #28530 Scalding Signs - fix: Adding the Suspicious Green Sludge, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 48767 AND `item` = 64449;
    DELETE FROM `creature_loot_template` WHERE `entry` = 48768 AND `item` = 64449;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (48767, 64449, -44, 1, 0, 1, 1),
    (48768, 64449, -41, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 48767 WHERE `entry` = 48767; 
    UPDATE `creature_template` SET `lootid` = 48768 WHERE `entry` = 48768; 
    
    
    -- Quest #28625 Chop Chop - fix: Adding the Fresh-Cut Frostwood
    DELETE FROM `creature_loot_template` WHERE `entry` = 48952 AND `item` = 64587;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (48952, 64587, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 48952 WHERE `entry` = 48952; 
    
    
    -- Quest #28610 Rubble Trouble - fix: Adding the Prime Rubble Chunk, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 48960 AND `item` = 64586;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (48960, 64586, -71, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 48960 WHERE `entry` = 48960; 
    
    
    -- Quest #28837 Altered Beasts - fix: Adding the Mana-Addled Brain, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 49161 AND `item` = 66052;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (49161, 66052, -42, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 49161 WHERE `entry` = 49161; 
    
    
    -- Quest #28537 In Pursuit of Shades - fix: Adding the Shard of the Spiritspeaker
    DELETE FROM `creature_loot_template` WHERE `entry` = 48678 AND `item` = 64463;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (48678, 64463, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 48678 WHERE `entry` = 48678; 
    
    
    -- Quest #28540 Doin' De E'ko Magic - fix: Adding the Rimepelt's Heart
    DELETE FROM `creature_loot_template` WHERE `entry` = 48765 AND `item` = 64465;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (48765, 64465, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 48765 WHERE `entry` = 48765; 
    
    
    -- Quest #28631 The Perfect Horns - fix: Adding the Icewhomp's Pristine Horns, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 49235 AND `item` = 64664;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (49235, 64664, -57, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 49235 WHERE `entry` = 49235; 
    
    
    -- Quest #28840 Winterwater - fix: Adding the Winterwater, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 50251 AND `item` = 65903;
    DELETE FROM `creature_loot_template` WHERE `entry` = 50250 AND `item` = 65903;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (50251, 65903, -28, 1, 0, 1, 1),
    (50250, 65903, -24, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 50251 WHERE `entry` = 50251; 
    UPDATE `creature_template` SET `lootid` = 50250 WHERE `entry` = 50250; 
    
    
    -- Quest #28518 Legacy of the High Elves - fix: Adding the Memory of Zin-Malor
    DELETE FROM `creature_loot_template` WHERE `entry` = 48740 AND `item` = 64441;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (48740, 64441, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 48740 WHERE `entry` = 48740; 
    
    
    -- Quest #28479 The Ruins of Kel'Theril - fix: spawn the creature that gives the quest, the creature data is from Skyfire
    DELETE FROM creature WHERE guid = 307142;
    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 (
    307142, 48658, 1, 1, 1, 36232, 0, 6543.91, -4110.53, 663.446, 0.366519, 
    300, 0, 0, 1962, 1982, 0, 0, 0, 0);
    
    
    -- Quest Descendants of the Highborn - fix: spawn the creature that gives the quest
    DELETE FROM creature WHERE guid = 600000;
    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 (
    600000, 48659, 1, 1, 1, 36232, 0, 6545.68, -4113.53, 663.78, 0.366519, 
    300, 0, 0, 1962, 1982, 0, 0, 0, 0);
    
    
    -- Quest Descendants of the High Elves - fix: spawn the creature that gives the quest
    DELETE FROM creature WHERE guid = 600001;
    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 (
    600001, 48660, 1, 1, 1, 36232, 0, 6543.32, -4106.79, 662.95, 0.366519, 
    300, 0, 0, 1962, 1982, 0, 0, 0, 0);
    
    
    
    -- *** FIXES FOR THE WAILING CAVERNS
    
    
    -- Fix : Wailing Caverns - Add Lord Pythas
    DELETE FROM creature WHERE guid = 600002;
    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 (
    600002, 3670, 43, 1, 1, 0, 0, -49.2486, 372.728, -59.5564, 3.51933, 300, 0, 0, 10825, 1470, 0, 0, 0, 0);
    
    
    
    -- *** FIXES FOR ASHENVALE ***
    
    
    -- Quest #25607 Ze Gnomecorder - fix: Adding the Filthy Goblin Technology, the drop % is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 34590 AND `item` = 55144;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (34590, 55144, -55, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 34590 WHERE `entry` = 34590; 
    
    -- Quest #13979 The Goblin Braintrust - fix: Adding the Sploder's Head
    DELETE FROM `creature_loot_template` WHERE `entry` = 34591 AND `item` = 46768;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (34591, 46768, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 34591 WHERE `entry` = 34591; 
    
    
    
    -- *** FIXES FOR THE BLASTED LANDS ***
    
    
    -- Quest #26159 (Alliance) & #25685 (Horde) The First Step - fix: Adding the Snickerfang Hyena Blood, the drop rate is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 5985 AND `item` = 55826;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) 
    VALUES (5985, 55826, -69, 1, 0, 1, 1);
    -- Quest #26159 (Alliance) & #25685 (Horde) The First Step - fix: Adding the Redstone Basilisk Blood, the drop rate is from wowhead
    DELETE FROM `creature_loot_template` WHERE `entry` = 5990 AND `item` = 55827;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) 
    VALUES (5990, 55827, -64, 1, 0, 1, 1);
    
    
    -- Quest #26172 (Alliance) & #25690 (Horde) A Bloodmage's Gotta Eat Too - fix: Adding the Ashmane Steak, the drop rate is from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 5992 AND `item` = 55828;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (5992, 55828, -29, 1, 0, 1, 1);
    
    
    -- Quest #25716 Cultists at our Doorstep - fix: Adding the Intact Shadowsworn Spell Focus, the drop rate is from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 42297 AND `item` = 57134;
    DELETE FROM `creature_loot_template` WHERE `entry` = 42296 AND `item` = 57134;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (42297, 57134, -78, 1, 0, 1, 1),
    (42296, 57134, -71, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 42297 WHERE `entry` = 42297; 
    UPDATE `creature_template` SET `lootid` = 42296 WHERE `entry` = 42296; 
    
    
    -- Quest #26165 (Alliance) & #25692 (Horde) The Vile Blood of Demons - fix: Adding the Vile Demonic Blood, the drop rate is from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 6011 AND `item` = 55991;
    DELETE FROM `creature_loot_template` WHERE `entry` = 41253 AND `item` = 55991;
    DELETE FROM `creature_loot_template` WHERE `entry` = 6010 AND `item` = 55991;
    DELETE FROM `creature_loot_template` WHERE `entry` = 41166 AND `item` = 55991;
    DELETE FROM `creature_loot_template` WHERE `entry` = 41165 AND `item` = 55991;
    DELETE FROM `creature_loot_template` WHERE `entry` = 41164 AND `item` = 55991;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (6011, 55991, -36, 1, 0, 1, 1),
    (41253, 55991, -33, 1, 0, 1, 1),
    (6010, 55991, -32, 1, 0, 1, 1),
    (41166, 55991, -16, 1, 0, 1, 1),
    (41165, 55991, -16, 1, 0, 1, 1),
    (41164, 55991, -11, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 6011 WHERE `entry` = 6011; 
    UPDATE `creature_template` SET `lootid` = 41253 WHERE `entry` = 41253; 
    UPDATE `creature_template` SET `lootid` = 6010 WHERE `entry` = 6010; 
    UPDATE `creature_template` SET `lootid` = 41166 WHERE `entry` = 41166; 
    UPDATE `creature_template` SET `lootid` = 41165 WHERE `entry` = 41165; 
    UPDATE `creature_template` SET `lootid` = 41164 WHERE `entry` = 41164; 
    
    
    
    -- *** FIXES FOR ELWYNN FOREST ***
    
    
    -- Quest #26389 Blackrock Invasion - fix: Adding the Blackrock Orc Weapon
    DELETE FROM `creature_loot_template` WHERE `entry` = 42937 AND `item` = 58361;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) 
    VALUES (42937, 58361, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 42937 WHERE `entry` = 42937; 
    
    
    -- Quest #26152 Wanted: James Clark - fix: Adding the James Clark's Head
    DELETE FROM `creature_loot_template` WHERE `entry` = 13159 AND `item` = 57122;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) 
    VALUES (13159, 57122, -100, 1, 0, 1, 1);
    
    
    -- Quest #86 Pie for Billy - fix: Adding the Tender Boar Meat, the drop rates are from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 113 AND `item` = 60401;
    DELETE FROM `creature_loot_template` WHERE `entry` = 524 AND `item` = 60401;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (113, 60401, -21, 1, 0, 1, 1),
    (524, 60401, -12, 1, 0, 1, 1);
    
    
    
    -- *** FIXES FOR DUSK WOOD ***
    
    
    -- Quest #26707 A Deadly Vine - fix: Adding the Corpseweed, the drop rates are from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 43732 AND `item` = 60204;
    DELETE FROM `creature_loot_template` WHERE `entry` = 45785 AND `item` = 60204;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (43732, 60204, -89, 1, 0, 1, 1),
    (45785, 60204, -56, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 43732 WHERE `entry` = 43732; 
    UPDATE `creature_template` SET `lootid` = 45785 WHERE `entry` = 45785; 
    
    
    -- Quest #26677 Ghoulish Effigy - fix: Adding the Ghoul Rib, the drop rates are from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 1270 AND `item` = 884;
    DELETE FROM `creature_loot_template` WHERE `entry` = 570 AND `item` = 884;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (1270, 884, -72, 1, 0, 1, 1),
    (570, 884, -6, 1, 0, 1, 1);
    
    
    -- Quest #26620 Seasoned Wolf Kabobs - fix: Adding the Wolf Skirt Steak, the drop rates are from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 43704 AND `item` = 60989;
    DELETE FROM `creature_loot_template` WHERE `entry` = 521 AND `item` = 60989;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (43704, 60989, -31, 1, 0, 1, 1),
    (521, 60989, -31, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 43704 WHERE `entry` = 43704; 
    
    
    -- Quest #26623 Dusky Crab Cakes - fix: Adding the Dusky Lump, the drop rates is from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 217 AND `item` = 60988;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (217, 60988, -40, 1, 0, 1, 1);
    
    
    -- Quest Delivery to Master Harris, Remove Aura so Oliver Harris is shown
    UPDATE creature_template_addon SET auras = '' WHERE entry = 43730;
    
    
    -- Monster Marl Wormthorn must be changed so players can fight him
    UPDATE creature_template SET faction_A = 90, faction_H = 90, unit_flags = 0, type_flags = 0, type = 3 WHERE entry = 42334;
    
    
    
    -- *** FIXES FOR WESTFALL ***
    
    
    -- Quest #26230 Feast or Famine - fix: Adding the Coyote Tail, the drop rates is from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 834 AND `item` = 57787;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (834, 57787, -49, 1, 0, 1, 1);
    
    
    -- Quest #26347 Keeper of the Flame - fix: Adding the Chasm Ooze, the drop rates is from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 42669 AND `item` = 58204;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (42669, 58204, -89, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 42669 WHERE `entry` = 42669; 
    
    
    -- Quest #26286 In Defense of Westfall - fix: Adding the Chasm Ooze, the drop rates is from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 124 AND `item` = 58111;
    DELETE FROM `creature_loot_template` WHERE `entry` = 452 AND `item` = 58111;
    DELETE FROM `creature_loot_template` WHERE `entry` = 501 AND `item` = 58111;
    DELETE FROM `creature_loot_template` WHERE `entry` = 54373 AND `item` = 58111;
    DELETE FROM `creature_loot_template` WHERE `entry` = 54372 AND `item` = 58111;
    DELETE FROM `creature_loot_template` WHERE `entry` = 54371 AND `item` = 58111;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (124, 58111, -8, 1, 0, 1, 1),
    (452, 58111, -7, 1, 0, 1, 1),
    (501, 58111, -7, 1, 0, 1, 1),
    (54373, 58111, -6, 1, 0, 1, 1),
    (54372, 58111, -5, 1, 0, 1, 1),
    (54371, 58111, -5, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 54373 WHERE `entry` = 54373; 
    UPDATE `creature_template` SET `lootid` = 54372 WHERE `entry` = 54372; 
    UPDATE `creature_template` SET `lootid` = 54371 WHERE `entry` = 54371; 
    
    
    -- Quest #26241 Westfall Stew - fix: Adding the Goretusk Flank, the drop rates is from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 157 AND `item` = 57788;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (157, 57788, -61, 1, 0, 1, 1);
    -- Quest #26241 Westfall Stew - fix: Adding the Stringy Fleshripper Meat, the drop rates is from wow head
    DELETE FROM `creature_loot_template` WHERE `entry` = 1109 AND `item` = 57786;
    DELETE FROM `creature_loot_template` WHERE `entry` = 199 AND `item` = 57786;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (1109, 57786, -56, 1, 0, 1, 1),
    (199, 57786, -55, 1, 0, 1, 1);
    
    
    -- Fix : Add Flight Master Zaldaan
    DELETE FROM creature WHERE guid = 600003;
    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 (
    600003, 43991, 530, 1, 1, 0, 0, -4127.32, -12523.2, 44.232, 2.3876, 300, 0, 0, 18423, 0, 0, 0, 0, 0);
    
    
    -- Monster Shatterhorn must be changed so players can fight him
    UPDATE creature_template SET unit_flags = 0, type_flags = 0 WHERE entry = 24178;
    
    
    -- Monster Alystros the Verdant Keeper must be changed so players can fight him
    UPDATE creature_template SET unit_flags = 0, type_flags = 0 WHERE entry = 27249;
    
    
    
    -- *** FIXES FOR THE WETLANDS ***
    
    
    -- Fix the quest chain for quests 25723, 25725 & 25735 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 25723 WHERE `Id` = 25725;
    UPDATE `quest_template` SET `PrevQuestId` = 25725 WHERE `Id` = 25735;
    
    
    -- Quest #25725 Fenbush Berries - fix: Adding the Handful of Fenberries
    DELETE FROM `gameobject_loot_template` WHERE `entry` = 29571 AND `item` = 55233;
    INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (29571, 55233, -100, 1, 0, 1, 1);
    
    
    
    -- *** FIXES FOR DUN MOROGH ***
    
    
    -- Fix the quest chain for quests 25997, 25998, 26078, 26085, 26094, 26102 & 26112 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 25997 WHERE `Id` = 25998;
    UPDATE `quest_template` SET `PrevQuestId` = 25998 WHERE `Id` = 26078;
    UPDATE `quest_template` SET `PrevQuestId` = 26078 WHERE `Id` = 26085;
    UPDATE `quest_template` SET `PrevQuestId` = 26085 WHERE `Id` = 26094;
    UPDATE `quest_template` SET `PrevQuestId` = 26094 WHERE `Id` = 26102;
    UPDATE `quest_template` SET `PrevQuestId` = 26102 WHERE `Id` = 26112;
    
    
    -- Fix : Add Captain Beld
    DELETE FROM creature WHERE guid = 600004;
    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 (
    600004, 6124, 0, 1, 1, 0, 0, -5920.47, -2034.25, 400.749, 3.21401, 300, 0, 0, 297, 0, 0, 0, 0, 0);
    
    
    -- Fix quest 433: The Public Servant
    SET @SPELL := 77819; 
    SET @NPC := 41671; 
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` = @NPC; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC 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 
    (@NPC,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@NPC,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Trapped Miner - On spell hit - Give kill credit for quest 433'), 
    (@NPC,0,1,0,61,0,100,1,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Trapped Miner - Despawn after 1 seconds'); 
    
    
    
    -- *** FIXES FOR LOCH MODAN ***
    
    
    -- Fix the quest chain for quests 26845, 26864, 26927, 26928 & 26868 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26845 WHERE `Id` = 26864;
    UPDATE `quest_template` SET `PrevQuestId` = 26864 WHERE `Id` = 26927;
    UPDATE `quest_template` SET `PrevQuestId` = 26927 WHERE `Id` = 26928;
    UPDATE `quest_template` SET `PrevQuestId` = 26928 WHERE `Id` = 26868;
    
    
    -- Fix the quest chain for quests 13636, 26843 & 26844 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 13636 WHERE `Id` = 26843;
    UPDATE `quest_template` SET `PrevQuestId` = 26843 WHERE `Id` = 26844;
    
    
    
    -- *** FIXES FOR ELWYNN FOREST ***
    
    
    -- Fix the quest chain for quests 26393, 26394, 26395 & 26396 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26393 WHERE `Id` = 26394;
    UPDATE `quest_template` SET `PrevQuestId` = 26394 WHERE `Id` = 26395;
    UPDATE `quest_template` SET `PrevQuestId` = 26395 WHERE `Id` = 26396;
    
    
    -- Fix the quest chain for quests 26688, 26689, 26690 & 26691 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26688 WHERE `Id` = 26689;
    UPDATE `quest_template` SET `PrevQuestId` = 26689 WHERE `Id` = 26690;
    UPDATE `quest_template` SET `PrevQuestId` = 26690 WHERE `Id` = 26691;
    
    
    
    -- *** FIXES FOR DUSKWOOD ***
    
    
    -- Fix the quest chain for quests 26653, 26652, 26654, 26655, 26660, 26661, 26676, 26680, 26677, 26681 & 26727 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26653 WHERE `Id` = 26652;
    UPDATE `quest_template` SET `PrevQuestId` = 26652 WHERE `Id` = 26654;
    UPDATE `quest_template` SET `PrevQuestId` = 26654 WHERE `Id` = 26655;
    UPDATE `quest_template` SET `PrevQuestId` = 26655 WHERE `Id` = 26660;
    UPDATE `quest_template` SET `PrevQuestId` = 26660 WHERE `Id` = 26661;
    UPDATE `quest_template` SET `PrevQuestId` = 26661 WHERE `Id` = 26676;
    UPDATE `quest_template` SET `PrevQuestId` = 26676 WHERE `Id` = 26680;
    UPDATE `quest_template` SET `PrevQuestId` = 26680 WHERE `Id` = 26677;
    UPDATE `quest_template` SET `PrevQuestId` = 26677 WHERE `Id` = 26681;
    UPDATE `quest_template` SET `PrevQuestId` = 26681 WHERE `Id` = 26727;
    
    
    -- Fix the quest chain for quests 26683, 26684 & 26685 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26683 WHERE `Id` = 26684;
    UPDATE `quest_template` SET `PrevQuestId` = 26684 WHERE `Id` = 26685;
    
    
    -- Fix the quest chain for quests 26666, 26667, 26669. 26670, 26671, 26672 & 26674 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26666 WHERE `Id` = 26667;
    UPDATE `quest_template` SET `PrevQuestId` = 26667 WHERE `Id` = 26669;
    UPDATE `quest_template` SET `PrevQuestId` = 26669 WHERE `Id` = 26670;
    UPDATE `quest_template` SET `PrevQuestId` = 26670 WHERE `Id` = 26671;
    UPDATE `quest_template` SET `PrevQuestId` = 26671 WHERE `Id` = 26672;
    UPDATE `quest_template` SET `PrevQuestId` = 26672 WHERE `Id` = 26674;
    
    
    
    -- *** FIXES FOR WETLANDS ***
    
    
    -- NO UPLOAD - Fix the quest chain for quests 26137, 25395, 25770, 25721, 25727, 25733, 25777 & 25780 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26137 WHERE `Id` = 25395;
    UPDATE `quest_template` SET `PrevQuestId` = 25395 WHERE `Id` = 25770;
    UPDATE `quest_template` SET `PrevQuestId` = 25770 WHERE `Id` = 25721;
    UPDATE `quest_template` SET `PrevQuestId` = 25721 WHERE `Id` = 25727;
    UPDATE `quest_template` SET `PrevQuestId` = 25727 WHERE `Id` = 25733;
    UPDATE `quest_template` SET `PrevQuestId` = 25733 WHERE `Id` = 25777;
    UPDATE `quest_template` SET `PrevQuestId` = 25777 WHERE `Id` = 25780;
    
    
    -- Fix the quest chain for quests 25722, 25726 & 25734 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 25722 WHERE `Id` = 25726;
    UPDATE `quest_template` SET `PrevQuestId` = 25726 WHERE `Id` = 25734;
    
    
    -- Fix the quest chain for quests 25802, 25803, 25804 & 25805 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 25802 WHERE `Id` = 25803;
    UPDATE `quest_template` SET `PrevQuestId` = 25803 WHERE `Id` = 25804;
    UPDATE `quest_template` SET `PrevQuestId` = 25804 WHERE `Id` = 25805;
    
    
    -- Fix the quest chain for quests 26980, 25864 & 25865 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26980 WHERE `Id` = 25864;
    UPDATE `quest_template` SET `PrevQuestId` = 25864 WHERE `Id` = 25865;
    
    
    -- Correct the Half-Buried Barrel, the Damaged Crate and the Sealed Barrel 
    -- so they can be selectable and they can give their quests.  Previous flags entry was 4
    UPDATE gameobject_template SET flags = 0 WHERE entry = 261;
    UPDATE gameobject_template SET flags = 0 WHERE entry = 142151;
    UPDATE gameobject_template SET flags = 0 WHERE entry = 259;
    
    
    -- Quest #25865 The Mosshide Job - fix: Adding the Ironforge Ingot
    DELETE FROM `creature_loot_template` WHERE `entry` = 41390 AND `item` = 56088;
    DELETE FROM `creature_loot_template` WHERE `entry` = 41391 AND `item` = 56088;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (41390, 56088, -75, 1, 0, 1, 1),
    (41391, 56088, -75, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 41390 WHERE `entry` = 41390; 
    UPDATE `creature_template` SET `lootid` = 41391 WHERE `entry` = 41391; 
    
    
    -- NO UPLOAD - Fix the quest chain for quests 25866, 25867 & 25868 so they follow the chain correctly
    UPDATE `quest_template` SET `NextQuestIDChain` = 25867 WHERE `Id` = 25866;
    UPDATE `quest_template` SET `NextQuestIDChain` = 25868 WHERE `Id` = 25867;
    UPDATE `quest_template` SET `PrevQuestId` = 25866 WHERE `Id` = 25867;
    UPDATE `quest_template` SET `PrevQuestId` = 25867 WHERE `Id` = 25868;
    
    
    -- Quest #25867 Gnoll Escape - fix: Adding the Trapper's Key
    DELETE FROM `creature_loot_template` WHERE `entry` = 41409 AND `item` = 56081;
    DELETE FROM `creature_loot_template` WHERE `entry` = 44225 AND `item` = 56081;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (41409, 56081, -100, 1, 0, 1, 1),
    (44225, 56081, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 41409 WHERE `entry` = 41409; 
    UPDATE `creature_template` SET `lootid` = 44225 WHERE `entry` = 44225; 
    
    
    -- NO UPLOAD Quest #25865 Gnoll Escape - Autocomplete
    update quest_template set flags = 65536 WHERE id = 25867;
    
    
    -- Fix the quest chain for quests 25856 & 25857 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 25856 WHERE `Id` = 25857;
    
    
    -- Fix the quest chain for quests 25854 & 25855 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 25854 WHERE `Id` = 25855;
    
    
    -- Fix the quest chain for quests 25939 & 26196 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 25939 WHERE `Id` = 26196;
    
    
    -- Quest #25856 Crocolisk Hides - fix: Adding the Marshy Crocolisk Hide
    DELETE FROM `creature_loot_template` WHERE `entry` = 41419 AND `item` = 56087;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (41419, 56087, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 41419 WHERE `entry` = 41419; 
    
    
    -- Quest #25857 Hunting Horrorjaw - fix: Adding the Horrorjaw's Hide
    DELETE FROM `creature_loot_template` WHERE `entry` = 41420 AND `item` = 56089;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (41420, 56089, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 41420 WHERE `entry` = 41420; 
    
    
    -- Fix the quest chain for quests 25926 & 25927 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 25926 WHERE `Id` = 25927;
    
    
    -- Fix the quest chain for quests 26327, 26127, 26128 & 26139 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26327 WHERE `Id` = 26127;
    UPDATE `quest_template` SET `PrevQuestId` = 26127 WHERE `Id` = 26128;
    UPDATE `quest_template` SET `PrevQuestId` = 26128 WHERE `Id` = 26139;
    
    
    -- Fix the quest chain for quests 13639, 309 & 13650 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 13639 WHERE `Id` = 309;
    UPDATE `quest_template` SET `PrevQuestId` = 309 WHERE `Id` = 13650;
    
    
    -- NO UPLOAD Quest #13650 Keep Your Hands Off The Goods! - Autocomplete
    update quest_template set flags = 65536 WHERE id = 13650;
    
    
    -- NO UPLOAD Quest #25939 For Peat's Sake - Autocomplete
    update quest_template set flags = 65536 WHERE id = 25939;
    
    
    -- NO UPLOAD Quest #26531  - Autocomplete
    update quest_template set flags = 65536 WHERE id = 26868;
    
    
    -- NO UPLOAD Quest #26531 Summoning Shadra - Autocomplete
    update quest_template set flags = 134217736, method = 2, RequiredNpcOrGo1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGo3 = 0, 
    RequiredNpcOrGoCount1 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGoCount3 = 0, RequiredSourceItemId4 = 0, 
    RequiredSourceItemCount4 = 0 WHERE id = 26531;
    update quest_template set flags = 134217736, method = 2, RequiredNpcOrGo1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGo3 = 0, 
    RequiredNpcOrGoCount1 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGoCount3 = 0, RequiredSourceItemId4 = 0, 
    RequiredSourceItemCount4 = 0 WHERE id = 26532;
    
    
    -- ARATI + LOCH + WETLANDS
    
    
    -- Fix the quest chain for quests 26981, 25849, 26189 & 26195 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26981 WHERE `Id` = 25849;
    UPDATE `quest_template` SET `PrevQuestId` = 25849 WHERE `Id` = 26189;
    UPDATE `quest_template` SET `PrevQuestId` = 26189 WHERE `Id` = 26195;
    
    -- Fix the quest chain for quests 26035, 26036, 26037 & 26038 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26035 WHERE `Id` = 26036;
    UPDATE `quest_template` SET `PrevQuestId` = 26036 WHERE `Id` = 26037;
    UPDATE `quest_template` SET `PrevQuestId` = 26037 WHERE `Id` = 26038;
    
    -- Fix the quest chain for quests 26113, 26110 & 26114 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26113 WHERE `Id` = 26110;
    UPDATE `quest_template` SET `PrevQuestId` = 26110 WHERE `Id` = 26114;
    
    -- Fix the quest chain for quests 26528, 26529, 26530, 26531 & 26532 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26528 WHERE `Id` = 26529;
    UPDATE `quest_template` SET `PrevQuestId` = 26529 WHERE `Id` = 26530;
    UPDATE `quest_template` SET `PrevQuestId` = 26530 WHERE `Id` = 26531;
    UPDATE `quest_template` SET `PrevQuestId` = 26531 WHERE `Id` = 26532;
    
    -- Fix the quest chain for quests 26641 & 26643 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26641 WHERE `Id` = 26643;
    
    -- Quest #26528 The Eye of Shadra - fix: Adding the Eye of Shadra
    DELETE FROM `gameobject_loot_template` WHERE `entry` = 30439 AND `item` = 58282;
    INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (30439, 58282, -100, 1, 0, 1, 1);
    
    -- Quest #26530 The Shell of Shadra - fix: Adding the Shell of Shadra
    DELETE FROM `creature_loot_template` WHERE `entry` = 42919 AND `item` = 58779;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (42919, 58779, -100, 1, 0, 1, 1);
    UPDATE `creature_template` SET `lootid` = 42919 WHERE `entry` = 42919; 
    
    
    
    -- NEW FIXES 2013-02-18
    
    
    -- Fix the quest chain for quests 27775 & 27775 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 27775 WHERE `Id` = 27776;
    
    
    -- Fix the quest chain for quests 27823 & 27824 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 27823 WHERE `Id` = 27824;
    
    
    -- Fix the quest chain for quests 26961 & 13647 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26961 WHERE `Id` = 13647;
    
    
    -- Fix the quest chain for quests 27031, 27032, 27033, 27034, 27035 & 27074 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 27031 WHERE `Id` = 27032;
    UPDATE `quest_template` SET `PrevQuestId` = 27032 WHERE `Id` = 27033;
    UPDATE `quest_template` SET `PrevQuestId` = 27033 WHERE `Id` = 27034;
    UPDATE `quest_template` SET `PrevQuestId` = 27034 WHERE `Id` = 27035;
    UPDATE `quest_template` SET `PrevQuestId` = 27035 WHERE `Id` = 27074;
    
    
    -- Fix the quest chain for quests 27036 & 27037 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 27036 WHERE `Id` = 27037;
    
    
    -- Fix the quest chain for quests 27025 & 27026 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 27025 WHERE `Id` = 27026;
    
    
    -- Fix the quest chain for quests 25841 & 25882 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 25841 WHERE `Id` = 25882;
    
    
    -- Fix the quest chain for quests 27078, 27115 & 27116 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 27078 WHERE `Id` = 27115;
    UPDATE `quest_template` SET `PrevQuestId` = 27115 WHERE `Id` = 27116;
    
    
    -- Quest #27823 A Dwarf's Got Needs - fix: Adding the Shadowstout
    DELETE FROM `creature_loot_template` WHERE `entry` IN (2739, 2740) AND `item` = 62510;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (2739, 62510, -90, 1, 0, 1, 2),
    (2740, 62510, -90, 1, 0, 1, 2);
    
    
    -- NO UPLOAD Zul Drak fix object
    UPDATE gameobject_template SET flags = 0 WHERE entry = 190535;
    UPDATE gameobject_template SET flags = 0 WHERE entry = 187565;
    
    
    -- NO UPLOAD - It's Raid Night Every Night - Autocomplete
    update quest_template set flags = 65536 WHERE id = 25932;
    
    -- NO UPLOAD - Rams on the Lam - Autocomplete
    update quest_template set flags = 65536 WHERE id = 25905;
    
    -- NO UPLOAD - Entombed in Ice - Autocomplete
    update quest_template set flags = 65536 WHERE id = 25978;
    
    -- NO UPLOAD - Strike from Above - Autocomplete
    update quest_template set flags = 65536 WHERE id = 25841;
    
    
    -- Fix quest 28868: The View from Down Here
    SET @SPELL := 93773; 
    SET @NPC := 41251; 
    SET @NPC_REWARD := 50606; 
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` = @NPC; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC 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 
    (@NPC,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@NPC_REWARD,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Frostmane Builder - On spell hit - Give kill credit for quest 28868'), 
    (@NPC,0,1,0,61,0,100,1,0,0,0,0,41,3000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Frostmane Builder - Despawn after 3 seconds'); 
    
    
    -- Fix quest 25867: Gnoll Escape
    SET @NPC := 41438; 
    SET @GAMEOBJ := 203282;
    UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` = @GAMEOBJ; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @GAMEOBJ AND `source_type`=1; 
    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 
    (@GAMEOBJ,1,0,0,70,0,100,0,2,0,0,0,33,@NPC,0,0,0,0,0,7,0,0,0,0,0,0,0,'Gnoll Cage - On activate - Give credit for quest 25867');
    
    
    -- Fix : Add Magistrix Nizara
    DELETE FROM creature WHERE guid = 600005;
    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 (
    600005, 50484, 530, 1, 1, 0, 0, 9348.69, -7171.92, 13.559, 3.13816, 300, 0, 0, 3052, 0, 0, 0, 0, 0);
    
    
    
    -- FIXES FOR 2013-02-20
    
    
    -- Fix the quest chain for quests 24469 & 24470 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 24469 WHERE `Id` = 24470;
    
    
    -- Fix the quest chain for quests 24474 & 24475 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 24474 WHERE `Id` = 24475;
    
    
    -- Fix the quest chain for quests 24487 & 182 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 24487 WHERE `Id` = 182;
    
    
    -- Fix the quest chain for quests 24477 & 24486 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 24477 WHERE `Id` = 24486;
    
    
    -- Fix the quest chain for quests 218 & 24490 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 218 WHERE `Id` = 24490;
    
    
    -- Fix the quest chain for quests 24491 & 24492 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 24491 WHERE `Id` = 24492;
    
    
    -- NO UPLOAD - Trolling for information - Autocomplete
    update quest_template set flags = 65536 WHERE id = 24489;
    
    
    -- Fix : Add Milo Geartwinge
    DELETE FROM creature WHERE guid = 600006;
    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 (
    600006, 37113, 0, 1, 1, 0, 0, -6246.15, 305.387, 383.81, 3.02356, 300, 0, 0, 42, 0, 0, 0, 0, 0);
    
    
    -- FIXES FOR 2013-02-22
    
    
    -- Old gossip menu was 900
    UPDATE creature_template SET gossip_menu_id = 0 WHERE name = 'Alchemist Pestlezugg';
    
    -- OLD VALUE : 11777
    UPDATE creature_template SET gossip_menu_id = 0 WHERE name = 'Brolan Galebeard';
    
    -- OLD VALUE : 7470
    UPDATE creature_template SET gossip_menu_id = 0 WHERE name = 'Laando';
    
    -- OLD VALUE : 12032
    UPDATE creature_template SET gossip_menu_id = 0 WHERE name = 'Janice Myers';
    
    -- Fix quest 25792: Pushing Forward
    SET @SPELL := 77314; 
    SET @NPC := 41202; 
    SET @NPC_REWARD := 41202; 
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` = @NPC; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC 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 
    (@NPC,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@NPC_REWARD,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Constriction Totem - On spell hit - Give kill credit for quest 25792'), 
    (@NPC,0,1,0,61,0,100,1,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Constriction Totem - Despawn after 1 second'); 
    
    
    -- Fix : Add Hogger
    DELETE FROM creature WHERE guid = 600007;
    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 (
    600007, 46254, 34, 1, 1, 0, 0, 156.204, 106.446, -35.1895, 2.65891, 300, 0, 0, 23456, 0, 0, 0, 0, 0);
    
    
    -- Fix quest 14108: Get Kraken!
    SET @SPELL := 66588; 
    SET @NPC := 34925; 
    SET @NPC_REWARD := 35009; 
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` = @NPC; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC 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 
    (@NPC,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@NPC_REWARD,0,0,0,0,0,7,0,0,0,0,0,0,0, 'North Sea Kraken - On spell hit - Give kill credit for quest 14108'),
    (@NPC,0,1,0,61,0,100,1,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'North Sea Kraken - Despawn after 1 second'); 
    UPDATE creature SET spawntimesecs = 20 WHERE id = 34925;
    
    
    -- Fix : Argent Tournament
    DELETE FROM creature WHERE guid = 600008;
    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 (
    600008, 34965, 571, 1, 1, 0, 0, 10180.1, 1182.51, 76.2133, 6.13811, 300, 0, 0, 10080, 8814, 0, 0, 0, 0);
    
    
    -- Previous Value was 768
    UPDATE creature_template SET unit_flags = 0 where entry = 41202;
    
    -- NO UPLOAD - Kharanos Report - Autocomplete
    update quest_template set flags = 65536 WHERE id = 313;
    
    -- NO UPLOAD - The Fight Continues - Autocomplete
    update quest_template set flags = 65536 WHERE id = 26208;
    
    -- NO UPLOAD - A Job for the multi bot - Autocomplete
    update quest_template set flags = 65536 WHERE id = 26205;
    
    -- NO UPLOAD - 26364 - Down with Crushcog! - Autocomplete
    update quest_template set flags = 65536 WHERE id = 26364;
    
    -- NO UPLOAD - 28002 - Crisis Management - Autocomplete
    update quest_template set flags = 65536 WHERE id = 28002;
    
    -- NO UPLOAD - 27926 - Eastern Hospitality - Autocomplete
    update quest_template set flags = 65536 WHERE id = 27926;
    
    -- NO UPLOAD - 28134 - Impending Retribution - Autocomplete
    update quest_template set flags = 65536 WHERE id = 28134;
    
    
    -- NO UPLOAD - Missing in action is out
    UPDATE `quest_template` SET `PrevQuestId` = 26285 WHERE `Id` = 26318;
    update quest_template set Level = 90, MinLevel = 90 WHERE id = 26284;
    
    -- NO UPLOAD - Quest 26318 - Finishin' the job
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0 WHERE id = 26318;
    
    -- NO UPLOAD - Decontamination - Autocomplete
    update quest_template set flags = 134217736, Level = 90, MinLevel = 90, method = 0, RequiredNpcOrGo1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGo3 = 0, 
    RequiredNpcOrGoCount1 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGoCount3 = 0, RequiredSourceItemId4 = 0, 
    RequiredSourceItemCount4 = 0 WHERE id = 27635;
    
    
    -- FIXES FOR 2013-03-02
    
    
    -- Fix quest 27671: See to the Survivors
    SET @SPELL := 86264; 
    SET @NPC := 46268; 
    SET @NPC_REWARD := 46268; 
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` = @NPC; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC 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 
    (@NPC,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@NPC_REWARD,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Survivor - On spell hit - Give kill credit for quest 27671'),
    (@NPC,0,1,0,61,0,100,1,0,0,0,0,41,2000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Survivor - Despawn after 2 seconds'); 
    
    
    -- Fix quest 14077: The Light's Mercy
    SET @SPELL := 66390; 
    SET @NPC := 34852; 
    SET @NPC_REWARD := 34852; 
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` = @NPC; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC 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 
    (@NPC,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@NPC_REWARD,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Slain Tualiq Villager - On spell hit - Give kill credit for quest 14077'),
    (@NPC,0,1,0,61,0,100,1,0,0,0,0,41,2000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Slain Tualiq Villager - Despawn after 2 seconds'); 
    
    
    -- Fix quest 14107: The Fate Of The Fallen
    SET @SPELL := 66719; 
    SET @NPC := 32149; 
    SET @NPC_REWARD := 35055; 
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` = @NPC; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC 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 
    (@NPC,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@NPC_REWARD,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Fallen Hero''s Spirit - On spell hit - Give kill credit for quest 14107'), 
    (@NPC,0,1,0,61,0,100,1,0,0,0,0,41,2000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fallen Hero''s Spirit - Despawn after 2 second'); 
    
    
    -- Fix the quest chain for quests 26208, 26566, 26222 & 26205 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26208 WHERE `Id` = 26566;
    UPDATE `quest_template` SET `PrevQuestId` = 26566 WHERE `Id` = 26222;
    UPDATE `quest_template` SET `PrevQuestId` = 26222 WHERE `Id` = 26205;
    
    
    -- Fix the quest chain for quests 26318, 26329 & 26331 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26318 WHERE `Id` = 26329;
    UPDATE `quest_template` SET `PrevQuestId` = 26329 WHERE `Id` = 26331;
    
    
    -- Fix the quest chain for quests 26339, 26342 & 26364 so they follow the chain correctly
    UPDATE `quest_template` SET `PrevQuestId` = 26339 WHERE `Id` = 26342;
    UPDATE `quest_template` SET `PrevQuestId` = 26342 WHERE `Id` = 26364;
    
    
    -- Fix quest 26333: No Tanks!
    SET @SPELL := 79751; 
    SET @NPC := 42224; 
    SET @NPC_REWARD := 42224; 
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` = @NPC; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC 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 
    (@NPC,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@NPC_REWARD,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Repaired Mechano-Tank - On spell hit - Give kill credit for quest 26333'), 
    (@NPC,0,1,0,61,0,100,1,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Repaired Mechano-Tank - Despawn after 1 second'); 
    
    -- Fix quest 26342: Paint It Black
    SET @SPELL := 79781; 
    SET @NPC := 42291; 
    SET @NPC_REWARD := 42796; 
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` = @NPC; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC 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 
    (@NPC,0,0,0,8,0,100,0x01,@SPELL,0,0,0,33,@NPC_REWARD,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Crushcog Sentry-Bot - On spell hit - Give kill credit for quest 26342');
    
    -- NO UPLOAD Quest 309 - Protecting the shipment - Hide the quest
    update quest_template set minlevel = 12, RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, flags = 8 WHERE id = 309;
    DELETE FROM creature_involvedrelation WHERE id = 1344 AND quest = 309;
    DELETE FROM creature_questrelation WHERE id = 2057 AND quest = 309;
    INSERT INTO creature_involvedrelation (id, quest) VALUES (1344, 309);
    
    -- *** Arathi Highlands ***
    
    -- Calamoth Ashbeard, needs to be hostile and quest needs to be corrected
    UPDATE creature_template SET faction_A = 834, faction_H = 834, gossip_menu_id = 0, npcflag = 0, unit_flags = 0, unit_flags2 = 0, dynamicflags = 0, type = 6, type_flags = 0, lootid = 0, VehicleId = 0, minlevel = 25, maxlevel = 25 WHERE entry = 41522;
    UPDATE quest_template SET RequiredNpcOrGo1 = 41522, RequiredNpcOrGoCount1 = 1, flags = 8 WHERE id = 26128;
    
    -- spawn the creature to kill: Calamoth Ashbeard
    DELETE FROM creature WHERE guid = 600100;
    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 
    (600100, 41522, 0, 1, 1, 0, 0, -2406.29, -2502.62, 85.2471, 3.16075, 300, 0, 0, 1633, 0, 0, 0, 0, 0);
    
    -- Correct the game objects so they can start / end quests.  Previous flags entry was 4
    UPDATE gameobject_template SET flags = 0 WHERE entry = 138492;
    UPDATE gameobject_template SET flags = 0 WHERE entry = 2701;
    UPDATE gameobject_template SET flags = 0 WHERE entry = 2702;
    UPDATE gameobject_template SET flags = 0 WHERE entry = 2688;
    UPDATE gameobject_template SET flags = 0 WHERE flags = 4 AND entry = 2713;
    UPDATE gameobject_template SET flags = 0 WHERE flags = 4 AND entry = 156561;
    UPDATE gameobject_template SET flags = 0 WHERE flags = 4 AND entry = 203734;
    
    -- Quest 26049 The Princess Unleashed, spawn the princess
    DELETE FROM creature WHERE guid = 600101;
    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 
    (600101, 2755, 0, 1, 1, 0, 0, -918.028, -3085.14, 49.5206, 4.05761, 300, 0, 0, 4278, 4449, 0, 0, 0, 0);
    
    -- Farmer Fulbrow and investigator and westfall, Remove Aura so the NPCs are shown
    UPDATE creature_template_addon SET auras = '' WHERE entry = 237;
    UPDATE creature_template_addon SET auras = '' WHERE entry = 42308;
    
    -- Fix Griphon Master Gyll so you can catch a ride
    UPDATE creature_template SET gossip_menu_id = 0 WHERE name = 'Gyll';
    
    -- *** FIXES FOR THE HINTERLANDS ***
    
    -- Fix Deathstalker invader so they are hostile with the correct level
    UPDATE creature_template SET minlevel = 34, maxlevel = 34, faction_A = 14, faction_H = 14 WHERE entry = 43541;
    
    -- Spawn the missing mobs in the hinterlands
    DELETE FROM creature WHERE guid >= 600102 AND guid <= 600116;
    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 
    (600102, 42877, 0, 1, 1, 0, 0, -761.733, -3792.48, 233.808, 0.529536, 300, 0, 0, 1856, 963, 0, 0, 0, 0),
    (600103, 43541, 0, 1, 1, 0, 0, 310.838, -2875.65, 114.012, 1.51989, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600104, 43541, 0, 1, 1, 0, 0, 350.967, -2869.36, 116.369, 2.15605, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600105, 43541, 0, 1, 1, 0, 0, 315.207, -2826.22, 118.527, 4.89709, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600106, 43541, 0, 1, 1, 0, 0, 271.373, -2832.83, 113.39, 3.32237, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600107, 43541, 0, 1, 1, 0, 0, 260.59, -2867.65, 112.466, 4.74787, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600108, 43541, 0, 1, 1, 0, 0, 203.365, -2888.53, 104.737, 3.92713, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600109, 43541, 0, 1, 1, 0, 0, 188.762, -2836.73, 107.796, 1.67696, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600110, 43541, 0, 1, 1, 0, 0, 184.941, -2772.89, 112.761, 0.561695, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600111, 43541, 0, 1, 1, 0, 0, 208.201, -2699.09, 114.982, 0.306441, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600112, 43541, 0, 1, 1, 0, 0, 232.921, -2718.45, 115.608, 4.54367, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600113, 43541, 0, 1, 1, 0, 0, 213.378, -2737.37, 123.371, 5.35655, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600114, 43541, 0, 1, 1, 0, 0, 260.68, -2804.7, 123.369, 2.18747, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600115, 43541, 0, 1, 1, 0, 0, 352.812, -2789.69, 120.521, 4.04886, 300, 0, 0, 1163, 0, 0, 0, 0, 0),
    (600116, 43541, 0, 1, 1, 0, 0, 377.425, -2870.29, 124, 2.48592, 300, 0, 0, 1163, 0, 0, 0, 0, 0);
    
    -- Quest #27626 fix : The Highvale Documents.  Add the quest loot
    DELETE FROM `creature_loot_template` WHERE `entry` = 43541 AND `item` = 61972;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (43541, 61972, -33, 1, 0, 1, 1);
    DELETE FROM `creature_loot_template` WHERE `entry` = 43541 AND `item` = 61973;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (43541, 61973, -33, 1, 0, 1, 1);
    DELETE FROM `creature_loot_template` WHERE `entry` = 43541 AND `item` = 61974;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (43541, 61974, -33, 1, 0, 1, 1);
    
    -- Quest #26485 fix : Snapjaws, Lad!  Add the Snapjaw Gizzard loot.
    DELETE FROM `creature_loot_template` WHERE `entry` = 2505 AND `item` = 58867;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (2505, 58867, -75, 1, 0, 1, 1);
    
    -- Quest #26517 fix : Summit of Fate.  Add the Spider Idol loot.
    DELETE FROM `creature_loot_template` WHERE `entry` = 42879 AND `item` = 58228;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (42879, 58228, -100, 1, 0, 1, 1);
    
    -- Quest #26517 fix : Skittering Spiderling.  Add the Skittering Spiderling loot.
    UPDATE `creature_template` SET `lootid` = 42689 WHERE `entry` = 42689; 
    DELETE FROM `creature_loot_template` WHERE `entry` = 42689 AND `item` = 58120;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (42689, 58120, -100, 1, 0, 1, 1);
    
    -- Quest #26521 - Faces of Evil.  Autocomplete
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0 WHERE id = 26521;
    
    -- Quest #26546 - Razorbeak friends, do not allow the player to do this quest so the other one in the multi select must be picked
    update quest_template set Level = 90, MinLevel = 90 WHERE id = 26546;
    
    -- Class quest cannot be done so we hide them
    update quest_template set Level = 90, MinLevel = 90 WHERE Title = 'Steady Shot';
    update quest_template set Level = 90, MinLevel = 90 WHERE Title = 'Charge';
    
    -- This quest doesn't work at all and leads to other bugged quests so we hide it
    update quest_template set Level = 90, MinLevel = 90 WHERE Title = 'The Ultrasafe Personnel Launcher';
    DELETE FROM creature_questrelation WHERE quest = 25839;
    
    
    -- *** FIXES FOR DUSTWALLOW MARSH START ***
    
    -- Spawn the missing NPCs and mobs
    DELETE FROM creature WHERE guid >= 600900 and guid <= 600999;
    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 
    (600900, 23569, 1, 1, 1, 0, 0, -2624.62, -4324.21, -4.12782, 2.13231, 120, 0, 0, 1093, 1142, 0, 0, 0, 0),
    (600901, 23864, 1, 1, 1, 0, 0, -2949.91, -3838.37, 31.6737, 5.4217, 120, 0, 0, 2100, 1097, 0, 0, 0, 0),
    (600902, 23786, 1, 1, 1, 0, 0, -4322.74, -3318.35, 34.2538, 3.56029, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600903, 23786, 1, 1, 1, 0, 0, -4318.54, -3283.16, 35.2718, 4.12578, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600904, 23786, 1, 1, 1, 0, 0, -4345.25, -3346.99, 35.0398, 2.11517, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600905, 23786, 1, 1, 1, 0, 0, -4365.17, -3339.13, 34.6981, 6.1207, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600906, 23786, 1, 1, 1, 0, 0, -4371.41, -3323.9, 34.423, 0.677881, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600907, 23786, 1, 1, 1, 0, 0, -4350.28, -3298.56, 34.4633, 5.20178, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600908, 23786, 1, 1, 1, 0, 0, -4320.83, -3334.2, 34.858, 1.83241, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600909, 23786, 1, 1, 1, 0, 0, -4351.73, -3275.65, 46.0588, 6.27777, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600910, 23786, 1, 1, 1, 0, 0, -4377.52, -3258.85, 36.8154, 5.56698, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600911, 23786, 1, 1, 1, 0, 0, -4322.74, -3235.25, 34.3069, 4.88761, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600912, 23786, 1, 1, 1, 0, 0, -4296.48, -3265.25, 39.2565, 5.28816, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600913, 23786, 1, 1, 1, 0, 0, -4268.19, -3291.33, 36.0869, 3.49745, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600914, 23786, 1, 1, 1, 0, 0, -4265.67, -3353.87, 35.5403, 5.76725, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600915, 23786, 1, 1, 1, 0, 0, -4309.62, -3379.01, 35.741, 3.32467, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600916, 23786, 1, 1, 1, 0, 0, -4345.55, -3398.22, 41.3398, 0.760337, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600917, 23786, 1, 1, 1, 0, 0, -4381.86, -3397.67, 40.4038, 2.81415, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600918, 23786, 1, 1, 1, 0, 0, -4385.25, -3379.14, 35.0424, 3.76056, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600919, 23786, 1, 1, 1, 0, 0, -4403.99, -3285.61, 34.1143, 5.02112, 120, 0, 0, 1829, 0, 0, 0, 0, 0),
    (600920, 23789, 1, 1, 1, 0, 0, -4695.37, -3718.68, 49.8744, 0.630793, 120, 0, 0, 2536, 1332, 0, 0, 0, 0),
    (600921, 39946, 1, 1, 1, 0, 0, -4459.39, -538.637, 6.28171, 6.12464, 120, 0, 0, 2769, 0, 0, 0, 0, 0), -- Missing NPC in Feralas
    (600922, 23941, 1, 1, 1, 0, 0, -4030.23, -4979.88, 7.78167, 5.35889, 120, 0, 0, 2100, 1097, 0, 0, 0, 0), -- Gavis Greyshield
    (600923, 23928, 1, 1, 1, 0, 0, -4244.28, -3940.02, -12.1534, 5.64557, 120, 0, 0, 1336, 0, 0, 0, 0, 0); -- Lurking Shark
    
    -- spawn some the tool kit and Secondhand Diving Gear game objects
    DELETE FROM gameobject WHERE guid >= 600900 AND guid <= 600999;
    INSERT INTO gameobject (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES 
    (600900, 186273, 1, 1, 1, -2668.82, -4213.75, 0.534, 0, 0, 0, 0, 1, 120, 0, 1),
    (600901, 186272, 1, 1, 1, -2679.64, -4279.25, 3.622, 0, 0, 0, 0, 1, 120, 0, 1);
    
    -- Quest #27237 Recover the Cargo! - Autocomplete
    update quest_template set SpecialFlags = 0, RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 27237;
    
    -- Quest #27239 Survey Alcaz Island - Autocomplete
    update quest_template set Flags = 65536, SpecialFlags = 0, RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 27239;
    
    -- Update the flag so the loose dirt game object can give its quests
    UPDATE gameobject_template SET flags = 0 WHERE entry = 20985;
    
    -- Quest #27188 What's Haunting Witch Hill?, change to the correct mob for the kill
    UPDATE quest_template SET RequiredNpcOrGo1 = 23554 WHERE id = 27188;
    
    -- Update Zelfrax so he can be attacked
    UPDATE creature_template SET unit_flags = 32768, unit_flags2 = 2048, npcflag = 0, faction_A = 834, faction_H = 834, lootid = 23864 WHERE entry = 23864;
    
    -- Fix quest 27245: Prisoners of the Grimtotems
    SET @NPC := 23720; 
    SET @GAMEOBJ := 186287;
    UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` = @GAMEOBJ; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @GAMEOBJ AND `source_type`=1; 
    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 
    (@GAMEOBJ,1,0,0,70,0,100,0,2,0,0,0,33,@NPC,0,0,0,0,0,7,0,0,0,0,0,0,0,'Blackhoof Cage - On activate - Give credit for quest 27245');
    
    -- Update the blackhoof cage game object so it closes back after 60 seconds
    UPDATE gameobject_template SET data2 = 60000 WHERE entry = 186287;
    
    -- Update Balos Jacken so alliance players can get and complete its quests
    UPDATE creature_template SET faction_A = 1077, faction_H = 1077 WHERE entry = 5089;
    
    -- Update the item quests for Horde only
    UPDATE quest_template SET RequiredRaces = 690 WHERE Id IN (27254, 27255, 27256, 27257, 27260, 27244, 27259);
    
    -- Quest #25479 To New Thalanaar - Autocomplete
    update quest_template set SpecialFlags = 0, RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 25479;
    
    -- Quest #27212 Discrediting the Deserters - Autocomplete
    update quest_template set SpecialFlags = 0, RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 27212;
    
    -- Quest #27336 The Grimtotem Weapon - Set the correct monster for kills
    update quest_template set RequiredNpcOrGo1 = 4344 where id = 27336;
    
    -- Quest #27429 Raze Direhorn Post! - Autocomplete
    update quest_template set SpecialFlags = 0, RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 27429;
    
    -- Quest #27291 Peace at Last - Autocomplete
    update quest_template set SpecialFlags = 0, RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 27291;
    
    -- *** FIXES FOR DUSTWALLOW MARSH END ***
    
    
    -- *** FIXES FOR TANARIS START ***
    
    -- Quest #25112 - Butcherbot, change the NPC to get the correct kill ID
    UPDATE quest_template SET RequiredNpcOrGo1 = 5419 WHERE Id = 25112;
    
    -- Quest #25111 - Scavengers Scavenged, change the NPC to get the correct kill ID
    UPDATE quest_template SET RequiredNpcOrGo1 = 5429 WHERE Id = 25111;
    
    -- Quest #25115 - Blisterpaw Butchery, change the NPC to get the correct kill ID
    UPDATE quest_template SET RequiredNpcOrGo1 = 5426 WHERE Id = 25115;
    
    -- Quest #24951 - A Great Idea, change the NPC to get the correct kill ID
    UPDATE quest_template SET RequiredNpcOrGo1 = 5451 WHERE Id = 24951;
    
    -- Quest #24933 Chicken of the Desert - Add the loot to the NPC
    DELETE FROM `creature_loot_template` WHERE `entry` = 5427 AND `item` = 51778;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (5427, 51778, -75, 1, 0, 1, 1);
    
    -- Quest #24953 Just Trying to Kill some bugs - Autocomplete
    update quest_template set SpecialFlags = 0, RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 24953;
    
    -- Spawn the missing NPCs and mobs
    DELETE FROM creature WHERE guid >= 601000 and guid <= 601099;
    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 
    (601000, 39059, 1, 1, 1, 0, 0, -9753.16, -3671.49, 10.8148, 1.89824, 120, 0, 0, 126, 0, 0, 0, 0, 0), -- Kelsey Steelspark
    (601001, 39077, 1, 1, 1, 0, 0, -9845.54, -2791.35, 14.7329, 0.0211303, 120, 0, 0, 4276, 0, 0, 0, 0, 0), -- Antechamber Guardian
    (601002, 38704, 1, 1, 1, 0, 0, -7945.33, -5272.32, 0.727369, 1.70194, 120, 0, 0, 126, 0, 0, 0, 0, 0), -- Kelsey Steelspark
    (601003, 38968, 1, 1, 1, 0, 0, -7453.27, -2881.41, 6.58566, 5.98627, 120, 0, 0, 3000, 0, 0, 0, 0, 0), -- Mazoga
    (601004, 40712, 209, 1, 1, 0, 0, 1232.28, 838.796, 8.88742, 6.09942, 120, 0, 0, 1294, 3801, 0, 0, 0, 0); -- Mazoga Spirit
    
    -- Quest #25063 Terrapination - Add the loot to the NPC
    DELETE FROM `creature_loot_template` WHERE `entry` = 5431 AND `item` = 52282;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (5431, 52282, -75, 1, 0, 1, 1);
    
    -- Update the item quests for Horde only
    UPDATE quest_template SET RequiredRaces = 690 WHERE Id IN (25107, 24905);
    
    -- Update the item quests for Alliance only
    UPDATE quest_template SET RequiredRaces = 1101 WHERE Id IN (25421);
    
    -- NPC Mazoga, remove aura so the NPC will be visible
    UPDATE creature_template_addon SET auras = '' WHERE entry = 38927;
    
    -- Quest #25021 Blood to Thrive - Add the loot to the NPC
    DELETE FROM `creature_loot_template` WHERE `entry` IN (5646, 5647, 5645) AND `item` = 52064;
    INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
    (5646, 52064, -90, 1, 0, 1, 1),
    (5647, 52064, -90, 1, 0, 1, 1),
    (5645, 52064, -90, 1, 0, 1, 1);
    
    -- Monster Mazoga must be changed so players can fight him
    UPDATE creature_template SET faction_A = 90, faction_H = 90 WHERE entry = 38968;
    
    -- Quest #25032 - Secrets in the Oasis, change the NPC to get the correct kill ID
    UPDATE quest_template SET RequiredNpcOrGo1 = 38968 WHERE Id = 25032;
    
    -- NPC Kelsey Steelspark, remove aura so the NPC will be visible
    UPDATE creature_template_addon SET auras = '' WHERE entry = 38535;
    
    -- NPC Steamwheedle Survivor must be changed so players can fight him
    UPDATE creature_template SET faction_A = 90, faction_H = 90 WHERE entry = 38571;
    
    -- Quest #24910 & 25050 - Rocket Rescue, change the NPC to get the correct kill ID
    UPDATE quest_template SET RequiredNpcOrGo1 = 38571 WHERE Id IN (24910, 25050);
    
    -- *** FIXES FOR TANARIS END ***



    Status :Not yet tested by me
    Quote Originally Posted by Aluna Sagita
    Having Crush On Me Isn't Categorized As Pedophilia
    Spoiler untuk Warcraft Books :

  24. The Following User Says Thank You to Achernar_Altair For This Useful Post:
  25. #13
    Achernar_Altair's Avatar
    Join Date
    Mar 2007
    Location
    Kamar, Masjid, Kantor n Warnet, g jauh2 dah dari situ
    Posts
    877
    Points
    1,872.78
    Thanks: 15 / 131 / 30

    Default [SQL]Fix For All Quest Chains

    Description :
    This script fixes all the quest chains from Cataclysm. This prevents a lot of “You don’t meet the requirement for this quest” errors. It recreates the quest chains based on wowhead data and gives a way better questing experience to your players. This script is also being reviewed by Trinity right now.

    Reference : here


    Code : Download


    seperti Cata Mobs Loot, very long script jadi g bisa dipost disini


    Status : Not yet tested by me
    Quote Originally Posted by Aluna Sagita
    Having Crush On Me Isn't Categorized As Pedophilia
    Spoiler untuk Warcraft Books :

  26. The Following User Says Thank You to Achernar_Altair For This Useful Post:
  27. #14
    Achernar_Altair's Avatar
    Join Date
    Mar 2007
    Location
    Kamar, Masjid, Kantor n Warnet, g jauh2 dah dari situ
    Posts
    877
    Points
    1,872.78
    Thanks: 15 / 131 / 30

    Default [SQL]Kezan Fix

    Description :
    his script corrects all the quests and allow the player to leave the island on the last quest on the dock. The last quest shows the destruction of Kezan cutscene and teleport the player to the Durotar docks since the Lost Isles are not yet implemented. This script only works with a recent core or repack.

    Reference : here

    Code :

    Spoiler untuk :
    Code:
    -- Quest 14125 - Name: 447 - Remove the last objective, it cannot be done
    update quest_template set RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0 WHERE id = 14125;
    
    -- change partygoers so they can be attacked
    update creature_template set faction_A = 7, faction_H = 7, npcflag = 2, unit_flags = 32768 WHERE entry = 35175;
    
    -- change defiant troll so they can be attacked
    update creature_template set faction_A = 7, faction_H = 7, npcflag = 2, unit_flags = 32768 WHERE entry = 34830;
    
    -- kajamite chunk needs to be selectable
    update gameobject_template set flags = 0, data14 = 0 where entry = 195492;
    
    -- spawn some kajamite chunk 
    DELETE FROM gameobject WHERE guid >= 600200 AND guid <= 600214;
    INSERT INTO gameobject (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES 
    (600200, 195492, 648, 1, 1, -8490.12, 1142.11, 41.02, 0.66, 0, 0, 0, 1, 120, 255, 1),
    (600201, 195492, 648, 1, 1, -8506.02, 1178.39, 46.18, 0.71, 0, 0, 0, 1, 120, 255, 1),
    (600202, 195492, 648, 1, 1, -8522.49, 1223.33, 52.94, 0.28, 0, 0, 0, 1, 120, 255, 1),
    (600203, 195492, 648, 1, 1, -8489.81, 1252.36, 54.14, 4.43, 0, 0, 0, 1, 120, 255, 1),
    (600204, 195492, 648, 1, 1, -8455.17, 1157.93, 39.74, 5.80, 0, 0, 0, 1, 120, 255, 1),
    (600205, 195492, 648, 1, 1, -8452.51, 1175.44, 41.11, 4.03, 0, 0, 0, 1, 120, 255, 1),
    (600206, 195492, 648, 1, 1, -8430.61, 1215.54, 45.90, 3.72, 0, 0, 0, 1, 120, 255, 1),
    (600207, 195492, 648, 1, 1, -8426.38, 1165.03, 40.36, 2.63, 0, 0, 0, 1, 120, 255, 1),
    (600208, 195492, 648, 1, 1, -8410.07, 1154.99, 39.40, 0.54, 0, 0, 0, 1, 120, 255, 1),
    (600209, 195492, 648, 1, 1, -8362.90, 1154.08, 34.93, 4.62, 0, 0, 0, 1, 120, 255, 1),
    (600210, 195492, 648, 1, 1, -8347.58, 1112.10, 30.12, 2.41, 0, 0, 0, 1, 120, 255, 1),
    (600211, 195492, 648, 1, 1, -8371.38, 1118.47, 33.71, 0.52, 0, 0, 0, 1, 120, 255, 1),
    (600212, 195492, 648, 1, 1, -8504.54, 1087.44, 42.45, 0.47, 0, 0, 0, 1, 120, 255, 1),
    (600213, 195492, 648, 1, 1, -8495.78, 1063.05, 41.92, 2.31, 0, 0, 0, 1, 120, 255, 1),
    (600214, 195492, 648, 1, 1, -8533.05, 1043.69, 41.82, 1.07, 0, 0, 0, 1, 120, 255, 1);
    
    -- Quest 14071 - Rolling with my homies - Autocomplete
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0 WHERE id = 14071;
    
    -- Many creatures and quest givers
    DELETE FROM creature WHERE guid >= 600200 and guid <= 600299;
    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 
    (600200, 37602, 648, 1, 1, 0, 0, -8420.62, 1323.53, 102.038, 1.65794, 300, 0, 0, 102, 0, 0, 0, 0, 0),
    (600201, 35175, 648, 1, 1, 0, 1, -8467.6, 1324.62, 102.534, 2.62398, 300, 0, 0, 42, 0, 0, 0, 0, 0),
    (600202, 35175, 648, 1, 1, 0, 1, -8474.85, 1321.88, 102.154, 1.92497, 300, 0, 0, 42, 0, 0, 0, 0, 0),
    (600203, 35175, 648, 1, 1, 0, 1, -8486.15, 1322.25, 102.154, 1.44588, 300, 0, 0, 42, 0, 0, 0, 0, 0),
    (600204, 35175, 648, 1, 1, 0, 1, -8497.07, 1327.94, 102.533, 0.32276, 300, 0, 0, 42, 0, 0, 0, 0, 0),
    (600205, 35175, 648, 1, 1, 0, 1, -8497.73, 1342.75, 102.533, 0.279563, 300, 0, 0, 42, 0, 0, 0, 0, 0),
    (600206, 35175, 648, 1, 1, 0, 1, -8497.57, 1357.1, 102.533, 6.23288, 300, 0, 0, 42, 0, 0, 0, 0, 0),
    (600207, 35175, 648, 1, 1, 0, 1, -8487.21, 1363.22, 102.53, 5.22365, 300, 0, 0, 42, 0, 0, 0, 0, 0),
    (600208, 35175, 648, 1, 1, 0, 1, -8479.27, 1364.05, 102.531, 4.61104, 300, 0, 0, 42, 0, 0, 0, 0, 0),
    (600209, 35175, 648, 1, 1, 0, 1, -8467.81, 1356.75, 102.533, 3.71176, 300, 0, 0, 42, 0, 0, 0, 0, 0),
    (600210, 35175, 648, 1, 1, 0, 1, -8467.66, 1341.05, 102.533, 3.4251, 300, 0, 0, 42, 0, 0, 0, 0, 0),
    (600211, 35200, 648, 1, 1, 0, 1, -8444.64, 1340.78, 102.002, 3.857, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600212, 35200, 648, 1, 1, 0, 1, -8445.51, 1353.78, 101.928, 3.29152, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600213, 35200, 648, 1, 1, 0, 1, -8445.72, 1374.4, 102.768, 3.50358, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600214, 35200, 648, 1, 1, 0, 1, -8455.26, 1391.18, 102.968, 3.96303, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600215, 35200, 648, 1, 1, 0, 1, -8475.27, 1392.01, 102.571, 4.61491, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600216, 35200, 648, 1, 1, 0, 1, -8499.42, 1392.79, 102.21, 4.96049, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600217, 35200, 648, 1, 1, 0, 1, -8519, 1391.07, 102.743, 5.65164, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600218, 35200, 648, 1, 1, 0, 1, -8524.82, 1363.91, 102.142, 6.24069, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600219, 35200, 648, 1, 1, 0, 1, -8526.93, 1342, 102.028, 0.0988784, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600220, 35200, 648, 1, 1, 0, 1, -8526.15, 1317.45, 102.213, 0.4955, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600221, 35200, 648, 1, 1, 0, 1, -8510.64, 1291.76, 101.89, 1.75214, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600222, 35200, 648, 1, 1, 0, 1, -8480.61, 1289.95, 102.468, 1.56757, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600223, 35200, 648, 1, 1, 0, 1, -8455.49, 1298.95, 101.955, 2.12519, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600224, 39615, 648, 1, 1, 0, 1, -8423.62, 1362.23, 116.861, 1.52837, 300, 0, 0, 49130, 44540, 0, 0, 0, 0),
    (600225, 35234, 648, 1, 1, 0, 1, -8097.45, 1570.77, 8.84087, 3.19722, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600226, 35234, 648, 1, 1, 0, 1, -8154.83, 1570.24, 19.0756, 2.23118, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600227, 35234, 648, 1, 1, 0, 1, -8096.53, 1642.24, 9.48048, 3.15795, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600228, 35234, 648, 1, 1, 0, 1, -8156.75, 1643.09, 19.4997, 4.00225, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600229, 35234, 648, 1, 1, 0, 1, -8216.33, 1644.18, 32.7282, 5.55341, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600230, 35234, 648, 1, 1, 0, 1, -8210.08, 1574.66, 31.6483, 4.76801, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600231, 35234, 648, 1, 1, 0, 1, -8253.1, 1525.72, 42.4036, 4.1122, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600232, 35234, 648, 1, 1, 0, 1, -8299.83, 1528.15, 45.3876, 5.00756, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600233, 35234, 648, 1, 1, 0, 1, -8339.14, 1521.18, 48.9719, 5.75922, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600234, 35234, 648, 1, 1, 0, 1, -8356.66, 1503.76, 46.2434, 0.0218828, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600235, 35234, 648, 1, 1, 0, 1, -8318.76, 1464.9, 45.473, 0.414589, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600236, 35234, 648, 1, 1, 0, 1, -8276.08, 1441.55, 39.5472, 1.33743, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600237, 35234, 648, 1, 1, 0, 1, -8227.05, 1457.38, 39.6306, 3.18704, 300, 0, 0, 71, 0, 0, 0, 0, 0),
    (600238, 36403, 648, 1, 1, 0, 1, -7885.63, 1833.63, 4.32754, 3.10701, 300, 0, 0, 49130, 44540, 0, 0, 134250496, 0);
    
    
    -- Quest 24502 - Necessary Roughness - Autocomplete
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0 WHERE id = 24502;
    DELETE FROM creature_involvedrelation WHERE id = 37106 AND quest = 24502;
    INSERT INTO creature_involvedrelation (id, quest) VALUES (37106, 24502);
    
    -- Quest 28414 - Fourth and Goal - Autocomplete
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0 WHERE id = 28414;
    
    -- Quest 14122 - The Great Bank Heist - Autocomplete
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 14122;
    
    -- Quest 26712 - Off to the bank - Hide quest, it's duplicated
    update quest_template set Level = 90, MinLevel = 90 WHERE id = 26711;
    update quest_template set Level = 1, MinLevel = 1 WHERE id = 26712;
    
    -- Quest 14110 - The new you - Autocomplete, the vendors don't sell the items
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 14110;
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 14109;
    
    -- Quest 14109 - The new you - Hide quest, it's duplicated
    update quest_template set Level = 90, MinLevel = 90 WHERE id = 14110;
    update quest_template set Level = 1, MinLevel = 1 WHERE id = 14109;
    
    -- Quest 14123, the 3 game objects needs to be selectable to get the items from them and complete the quest
    update gameobject_template set flags = 0, data0 = 43, data14 = 0, data3 = 1  where entry = 195515; -- Maldy's Falcon 
    update gameobject set id = 195515 where id = 195522;
    update gameobject_template set flags = 0, data0 = 43, data14 = 0, data3 = 1 where entry = 195516; -- The Goblin Lisa
    update gameobject set id = 195516 where id = 195523;
    update gameobject_template set flags = 0, data0 = 43, data14 = 0, data3 = 1 where entry = 195518; -- The Ultimate Bomb
    update gameobject set id = 195518 where id = 195524;
    
    -- Change the NPC so the quest can be completed correctly
    update creature_involvedrelation set id = 39615 where id = 35222 and quest = 14116;
    update creature_involvedrelation set id = 36403 where id = 35222 and quest = 14126;
    update creature_template set npcflag = 3 where entry in (39615, 36403);
    
    -- Quest #14126 - Life Saving - When the quest ends, warp to Durotar
    SET @NPC := 36403; 
    SET @QUEST := 14126;
    UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` = @NPC; 
    DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC 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 
    (@NPC, 0, 0, 0, 20, 0, 100, 0, @QUEST, 0, 0, 0, 62, 1, 0, 0, 0, 0, 0, 0, 8, 0, 0, 1440.86, -5019.81, 12.03, 1.68, 'Teleport to Durotar');



    Status : Not yet tested by me
    Quote Originally Posted by Aluna Sagita
    Having Crush On Me Isn't Categorized As Pedophilia
    Spoiler untuk Warcraft Books :

  28. The Following User Says Thank You to Achernar_Altair For This Useful Post:
  29. #15
    Achernar_Altair's Avatar
    Join Date
    Mar 2007
    Location
    Kamar, Masjid, Kantor n Warnet, g jauh2 dah dari situ
    Posts
    877
    Points
    1,872.78
    Thanks: 15 / 131 / 30

    Default [SQL]Death Knights Fix for Quest dan Runeforge

    Description :
    This script corrects all the Runeforge for Death Knights in Ebon Hold. It also fixes the starting quest chains so players can start Death Knights, do the starting area quests, gain the DK quest bonus and play normally after that.

    Reference : here

    Code :

    Spoiler untuk :
    Code:
    -- Update the runeforge object with a valid display ID
    UPDATE gameobject_template SET displayid = 299 WHERE entry = 190557;
    
    -- Creates the invisible runeforge objects in both ebon hold (map 609 and 0)
    SET @GUID := 600700;
    DELETE FROM gameobject WHERE guid >= @GUID AND guid <= @GUID+14;
    INSERT INTO gameobject (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES 
    (@GUID, 190557, 609, 1, 1, 2493.37, -5642.43, 420.649, 2.16421, 0, 0, 0.882948, 0.469471, 120, 0, 1),
    (@GUID+1, 190557, 609, 1, 1, 2509.31, -5560.39, 420.65, -2.55402, 0, 0, -0.957154, 0.289578, 120, 0, 1),
    (@GUID+2, 190557, 609, 1, 1, 2427.28, -5544.45, 420.65, -0.983229, 0, 0, -0.47205, 0.881572, 120, 0, 1),
    (@GUID+3, 190557, 609, 1, 192, 2426.39, -5543.21, 420.64, -0.99, 0, 0, 0, 1, 120, 0, 1),
    (@GUID+4, 190557, 609, 1, 35, 2426.39, -5543.21, 420.64, -0.99, 0, 0, 0, 1, 120, 0, 1),
    (@GUID+5, 190557, 609, 1, 192, 2493.57, -5642.81, 420.64, 2.15, 0, 0, 0, 1, 120, 0, 1),
    (@GUID+6, 190557, 609, 1, 4, 2493.57, -5642.81, 420.64, 2.15, 0, 0, 0, 1, 120, 0, 1),
    (@GUID+7, 190557, 609, 1, 192, 2509.47, -5560.17, 420.64, -2.55, 0, 0, 0, 1, 120, 0, 1),
    (@GUID+8, 190557, 609, 1, 35, 2493.57, -5642.81, 420.64, 2.15, 0, 0, 0, 1, 120, 0, 1),
    (@GUID+9, 190557, 609, 1, 4, 2509.47, -5560.17, 420.64, -2.55, 0, 0, 0, 1, 120, 0, 1),
    (@GUID+10, 190557, 609, 1, 35, 2509.47, -5560.17, 420.64, -2.55, 0, 0, 0, 1, 120, 0, 1),
    (@GUID+11, 190557, 609, 1, 4, 2426.39, -5543.21, 420.64, -0.99, 0, 0, 0, 1, 120, 0, 1),
    (@GUID+12, 190557, 0, 1, 1, 2427.28, -5544.45, 420.65, -0.983229, 0, 0, -0.47205, 0.881572, 120, 0, 1),
    (@GUID+13, 190557, 0, 1, 1, 2509.31, -5560.39, 420.65, -2.55402, 0, 0, -0.957154, 0.289578, 120, 0, 1),
    (@GUID+14, 190557, 0, 1, 1, 2493.37, -5642.43, 420.649, 2.16421, 0, 0, 0.882948, 0.469471, 120, 0, 1);
    
    -- Quest 12779, An End to All Things - Autocomplete
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 12779;
    
    -- Many creatures and quest givers
    DELETE FROM creature WHERE id = 29110;
    DELETE FROM creature WHERE guid >= 600300 and guid <= 600399;
    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 
    (600300, 29110, 609, 1, 1, 0, 0, 2312.04, -5741.28, 153.918, 3.82047, 300, 0, 0, 27890000, 0, 0, 0, 0, 0),
    (600301, 29488, 609, 1, 128, 0, 0, 2350.32, -5693.07, 382.239, 4.40647, 300, 0, 0, 5066, 0, 0, 0, 0, 0),
    (600302, 31084, 0, 1, 256, 0, 1, 2376.85, -5649.96, 382.437, 3.76597, 300, 0, 0, 11156000, 2129000, 0, 0, 134218496, 0),
    (600303, 29480, 0, 1, 256, 0, 0, 2349.73, -5665.52, 382.241, 3.88324, 300, 0, 0, 232470, 0, 0, 0, 0, 0),
    (600304, 29110, 609, 1, 128, 0, 0, 2349.65, -5667.98, 382.242, 3.77423, 300, 0, 0, 27890000, 0, 0, 0, 0, 0),
    (600305, 29488, 609, 1, 128, 0, 0, 2324.85, -5658.95, 382.241, 3.57788, 300, 0, 0, 4906, 0, 0, 0, 0, 0),
    (600306, 29501, 609, 1, 128, 0, 0, 2400.32, -5726.76, 153.923, 5.36891, 300, 0, 0, 5066, 0, 0, 0, 0, 0);
    
    -- Quest 12801, The Light of Dawn - Autocomplete
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 12801;
    
    -- Quest 13166, The battle for the Ebon Hold
    update quest_template set RequiredNpcOrGo1 = 0, RequiredNpcOrGoCount1 = 0, RequiredNpcOrGo2 = 0, RequiredNpcOrGoCount2 = 0, RequiredNpcOrGo3 = 0, RequiredNpcOrGoCount3 = 0, RequiredNpcOrGo4 = 0, RequiredNpcOrGoCount4 = 0, RequiredItemId1 = 0, RequiredItemCount1 = 0, RequiredItemId2 = 0, RequiredItemCount2 = 0, RequiredItemId3 = 0, RequiredItemCount3 = 0, RequiredItemId4 = 0, RequiredItemCount4 = 0 WHERE id = 13166;
    
    -- Quest 12698, Stop the chain there, it doesn't work very well
    update quest_template set Level = 90, MinLevel = 90 WHERE id = 12698;
    update quest_template set NextQuestIdChain = 0 where NextQuestIdChain = 12698;



    Status : Not yet tested by me



    That's all for now, sisanya belakangan


    semoga aja kepake biar bisa cepet seneng2 dan mata saya g bete lihat keluhan ini itu di ingame -_-'a
    Quote Originally Posted by Aluna Sagita
    Having Crush On Me Isn't Categorized As Pedophilia
    Spoiler untuk Warcraft Books :

  30. The Following User Says Thank You to Achernar_Altair For This Useful Post:
Page 1 of 7 12345 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •