-- smart scripts
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` IN 
(4076, 7327, 7328, 7329, 7332, 7335, 7337, 7341, 7342, 7344, 7345, 7346, 7347, 7348, 7352, 7353, 7354, 7358, 8567);
DELETE FROM `smart_scripts` WHERE `source_type` = 0 AND `entryorguid` IN 
(4076, 7327, 7328, 7329, 7332, 7335, 7337, 7341, 7342, 7344, 7345, 7346, 7347, 7348, 7352, 7353, 7354, 7358, 8567);
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`, `event_param5`, `event_param6`, 
`action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, 
`target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES 
--
(4076, 0, 0, 0, 4, 0, 100, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,                       'Roach - On Aggro - Flee For Assist (No Repeat)'),
(7327, 0, 0, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 6268, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                    'Withered Warrior - On Aggro - Cast Rushing Charge'),
(7327, 0, 1, 2, 2, 0, 100, 1, 0, 30, 0, 0, 0, 0, 11, 8599, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                   'Withered Warrior - In Combat - Between Health 0-30% - Cast Enrage (No Repeat'),
(7327, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                       'Withered Warrior - On Enrage - Say Line 0'),
(7328, 0, 0, 0, 9, 0, 100, 0, 3000, 7000, 6000, 11000, 0, 5, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,      'Withered Reaver - Within 0-5 Range - Cast Cleave'),
(7328, 0, 1, 2, 2, 0, 100, 1, 0, 30, 0, 0, 0, 0, 11, 8599, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                   'Withered Reaver - In Combat - Between Health 0-30% - Cast Enrage (No Repeat)'),
(7328, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                       'Withered Reaver - On Enrage - Say Line 0'),
(7329, 0, 0, 1, 2, 0, 100, 1, 0, 30, 0, 0, 0, 0, 11, 8599, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                   'Withered Quilguard - In Combat - Between Health 0-30% - Cast Enrage (No Repeat)'),
(7329, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                       'Withered Quilguard - On Enrage - Say Line 0'),
(7332, 0, 0, 0, 9, 0, 100, 0, 0, 1000, 2000, 2000, 5, 30, 11, 6660, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,         'Withered Spearhide - Within 5-30 Range - Cast Shoot'),
(7332, 0, 1, 0, 0, 0, 100, 0, 4000, 9000, 12000, 20000, 0, 0, 11, 11397, 0, 0, 0, 0, 0, 5, 30, 0, 0, 0, 0, 0, 0, 0,    'Withered Spearhide - Within 0-30 Range - Cast Diseased Shot'),
(7332, 0, 2, 3, 2, 0, 100, 1, 0, 30, 0, 0, 0, 0, 11, 8599, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                   'Withered Spearhide - In Combat - Between Health 0-30% - Cast Enrage (No Repeat)'),
(7332, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                       'Withered Spearhide - On Enrage - Say Line 0'),
(7332, 0, 4, 0, 2, 0, 100, 1, 0, 15, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,                      'Withered Spearhide - Between 0-15% Health - Flee For Assist (No Repeat)'),
(7335, 0, 0, 0, 0, 0, 100, 0, 0, 1000, 3000, 3500, 0, 0, 11, 9053, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,          'Deaths Head Geomancer - In Combat - Cast Fireball'),
(7335, 0, 1, 0, 0, 0, 100, 0, 4000, 13000, 18000, 29000, 0, 0, 11, 8814, 64, 0, 0, 0, 0, 5, 30, 0, 0, 0, 0, 0, 0, 0,   'Deaths Head Geomancer - Within 0-30 Range - Cast Flame Spike'),
(7335, 0, 2, 0, 0, 0, 100, 0, 2000, 16000, 12000, 25000, 0, 0, 11, 11436, 0, 0, 0, 0, 0, 5, 30, 0, 0, 0, 0, 0, 0, 0,   'Deaths Head Geomancer - Within 0-30 Range - Cast Slow'),
(7335, 0, 3, 0, 2, 0, 100, 1, 0, 15, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,                      'Deaths Head Geomancer - Between 0-15% Health - Flee For Assist'),
(7337, 0, 0, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 11445, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                   'Deaths Head Necromancer - On Aggro - Cast Bone Armor'),
(7337, 0, 1, 0, 1, 0, 100, 1, 1000, 1000, 0, 0, 0, 0, 11, 12420, 64, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,            'Deaths Head Necromancer - Out of Combat - Cast Summon Skeletal Servant (No Repeat)'),
(7337, 0, 2, 0, 0, 0, 100, 0, 4000, 13000, 18000, 29000, 0, 0, 11, 11443, 64, 0, 0, 0, 0, 5, 30, 0, 0, 0, 0, 0, 0, 0,  'Deaths Head Necromancer - Within 0-30 Range - Cast Cripple'),
(7337, 0, 3, 0, 0, 0, 100, 0, 0, 1000, 3000, 3500, 0, 0, 11, 9613, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,          'Deaths Head Necromancer - In Combat - Cast Shadow Bolt'),
(7337, 0, 4, 0, 2, 0, 100, 1, 0, 15, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,                      'Deaths Head Necromancer - Between 0-15% Health - Flee For Assist'),
(7341, 0, 0, 0, 0, 0, 100, 0, 0, 1000, 3000, 3500, 0, 0, 11, 9672, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,          'Skeletal Frostweaver - In Combat - Cast Frostbolt'),
(7342, 0, 0, 0, 0, 0, 100, 0, 0, 1000, 3000, 3500, 0, 0, 11, 9532, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,          'Skeletal Summoner - In Combat - Cast Lightning Bolt'),
(7342, 0, 1, 0, 0, 0, 100, 0, 6000, 8000, 20000, 30000, 0, 0, 11, 11980, 0, 0, 0, 0, 0, 21, 30, 0, 0, 0, 0, 0, 0, 0,   'Skeletal Summoner - Within 0-30 Range - Cast Curse of Weakness'),
(7342, 0, 2, 3, 0, 0, 100, 0, 10000, 15000, 40000, 40000, 0, 0, 11, 12258, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,   'Skeletal Summoner - In Combat - Cast Summon Shadowcaster'),
(7342, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                       'Skeletal Summoner - In Combat - Say Line 0'),
(7344, 0, 0, 0, 9, 0, 100, 0, 3000, 8000, 10000, 20000, 0, 5, 11, 11971, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,     'Splinterbone Warrior - In Combat - Cast Sunder Armor'),
(7345, 0, 0, 0, 0, 0, 100, 0, 0, 8000, 9000, 17000, 0, 0, 11, 12461, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0,         'Splinterbone Captain - Within 0-5 Range - Cast Backhand'),
(7345, 0, 1, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 9128, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                    'Splinterbone Captain - On Aggro - Cast Battle Shout'),
(7346, 0, 0, 0, 9, 0, 100, 0, 0, 11000, 13000, 23000, 0, 5, 11, 8078, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,        'Splinterbone Centurion - Within 0-5 Range - Cast Thunder Clap'),
(7347, 0, 0, 0, 1, 0, 100, 0, 1000, 1000, 90000, 90000, 0, 0, 11, 12539, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,    'Boneflayer Ghoul - Out of Combat - Cast Ghoul Rot'),
(7348, 0, 0, 0, 1, 0, 100, 0, 1000, 1000, 90000, 90000, 0, 0, 11, 12539, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,    'Thorn Eater Ghoul - Out of Combat - Cast Ghoul Rot'),
(7348, 0, 1, 0, 0, 0, 100, 0, 3000, 7000, 7000, 11000, 0, 0, 11, 12538, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0,      'Thorn Eater Ghoul - Within 0-5 Range - Cast Ravenous Claw'),
(7352, 0, 0, 0, 0, 0, 100, 0, 1000, 1000, 15000, 15000, 0, 0, 11, 12531, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,     'Frozen Soul - In Combat - Cast Chilling Touch'),
(7352, 0, 1, 0, 9, 0, 100, 0, 3000, 13000, 15000, 31000, 0, 5, 11, 12528, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,    'Frozen Soul - Within 0-5 Range - Cast Silence'),
(7353, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 12529, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                  'Freezing Spirit - On Reset - Cast Chilling Touch'),
(7353, 0, 1, 0, 106, 0, 100, 0, 3000, 13000, 15000, 31000, 0, 10, 11, 15532, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Freezing Spirit - Within 0-10 Range - Cast Frost Nova'),
(7354, 0, 0, 0, 37, 0, 70, 0, 0, 0, 0, 0, 0, 0, 41, 500, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                     'Ragglesnout - On AI Init - Despawn'),
(7354, 0, 1, 0, 0, 0, 100, 0, 0, 0, 3000, 4000, 0, 0, 11, 12471, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,            'Ragglesnout - In Combat - Cast Shadow Bolt'),
(7354, 0, 2, 0, 0, 0, 100, 0, 3000, 5000, 20000, 25000, 0, 0, 11, 11639, 0, 0, 0, 0, 0, 5, 30, 0, 0, 0, 0, 0, 0, 0,    'Ragglesnout - In Combat - Cast Shadow Word: Pain'),
(7354, 0, 3, 0, 0, 0, 100, 0, 9000, 13000, 15000, 20000, 0, 0, 11, 7645, 1, 0, 0, 0, 0, 6, 20, 0, 0, 0, 0, 0, 0, 0,    'Ragglesnout - In Combat - Cast Dominate Mind'),
(7354, 0, 4, 0, 74, 0, 100, 0, 0, 0, 12000, 16000, 40, 40, 11, 12039, 65, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0,       'Ragglesnout - Friendly between 0-40% Health - Cast Heal'),
--
(7358, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 12556, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                  'Amnennar the Coldbringer - On Reset - Cast Frost Armor'),
(7358, 0, 1, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                        'Amnennar the Coldbringer - On Aggro - Say Line 0'),
(7358, 0, 2, 0, 5, 0, 100, 0, 5000, 5000, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                  'Amnennar the Coldbringer - On Kill - Say Line 4'),
(7358, 0, 3, 0, 0, 0, 100, 0, 8000, 10000, 10000, 16000, 0, 0, 11, 13009, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,    'Amnennar the Coldbringer - In Combat - Cast Amnennars Wrath'),
(7358, 0, 4, 0, 0, 0, 100, 0, 0, 1000, 3000, 4000, 0, 0, 11, 15530, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,         'Amnennar the Coldbringer - In Combat - Cast Frostbolt'),
(7358, 0, 5, 0, 106, 0, 100, 0, 6000, 10000, 13000, 21000, 0, 10, 11, 15531, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amnennar the Coldbringer - In Combat - Cast Frost Nova'),
(7358, 0, 6, 0, 2, 0, 100, 1, 0, 70, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                       'Amnennar the Coldbringer - Health Between 0-70% - Say Line 3'),
(7358, 0, 7, 8, 2, 0, 100, 1, 0, 55, 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                       'Amnennar the Coldbringer - Health Between 0-55% - Say Line 5'),
(7358, 0, 8, 9, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                       'Amnennar the Coldbringer - Health Between 0-55% - Say Line 1'),
(7358, 0, 9, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 12642, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                  'Amnennar the Coldbringer - Health Between 0-55% - Cast Summon Frost Spectres'),
(7358, 0, 10, 11, 2, 0, 100, 1, 0, 30, 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                     'Amnennar the Coldbringer - Health Between 0-30% - Say Line 5'),
(7358, 0, 11, 12, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                     'Amnennar the Coldbringer - Health Between 0-30% - Say Line 1'),
(7358, 0, 12, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 12642, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                 'Amnennar the Coldbringer - Health Between 0-30% - Cast Summon Frost Spectres'),
(7358, 0, 13, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 9, 8585, 0, 100, 0, 0, 0, 0, 0,                 'Amnennar the Coldbringer - On Just Died - Despawn Frost Spectres'),
--
(8567, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 12627, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                  'Glutton - On Reset - Cast Disease Cloud'),
(8567, 0, 1, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                        'Glutton - On Aggro - Say Line 0'),
(8567, 0, 2, 0, 5, 0, 100, 0, 5000, 5000, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                  'Glutton - On Kill - Say Line 1'),
(8567, 0, 3, 4, 2, 0, 100, 1, 30, 50, 0, 0, 0, 0, 11, 12795, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                 'Glutton - Health Between 30-50% - Cast Frenzy'),
(8567, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                       'Glutton - On Frenzy - Say Line 2'),
(8567, 0, 5, 6, 2, 0, 100, 1, 0, 15, 0, 0, 0, 0, 11, 12795, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                  'Glutton - Health Between 0-15% - Cast Frenzy'),
(8567, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,                       'Glutton - On Frenzy - Say Line 3');
