well, im using this script at halion:
-- Halion
DELETE FROM creature_ai_scripts_custom WHERE creature_id IN(39863);
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 11, 0, 100, 30, 0, 0, 0, 0, 35, 1, 0, 0, 34, 1, 0, 0, 22, 0, 0, 0, 'Halion - On Spawn');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 4, 0, 100, 30, 0, 0, 0, 0, 38, 0, 0, 0, 1, -131186, 0, 0, 34, 1, 1, 0, 'Halion - On Aggro');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 4, 0, 100, 30, 0, 0, 0, 0, 22, 0, 0, 0, 11, 78243, 0, 23, 39, 200, 0, 0, 'Halion - On Aggro');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 6, 0, 100, 30, 0, 0, 0, 0, 34, 1, 3, 0, 1, -131187, 0, 0, 0, 0, 0, 0, 'Halion - On Death');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 5, 0, 100, 31, 0, 0, 0, 0, 1, -131188, -131189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - On Kill');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 10, 0, 100, 31, 0, 100, 60000, 90000, 1, -131191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - On LOS');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 7, 0, 100, 30, 0, 0, 0, 0, 34, 1, 2, 0, 0, 0, 0, 0, 22, 0, 0, 0, 'Halion - On Evade');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 0, 100, 31, 480000, 480000, 480000, 480000, 11, 47008, 0, 23, 1, -131190, 0, 0, 0, 0, 0, 0, 'Halion - Enrage 8 Minutes');
-- Cleave & Tail Lash
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 0, 100, 31, 22000, 36000, 26000, 32000, 11, 74524, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Cleave');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 0, 100, 31, 9000, 16000, 9000, 16000, 11, 74531, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Tail Lash');
-- Phase 1
-- Flame Breath
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 3, 9000, 16000, 10000, 11000, 11, 74525, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Flame Breath N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 9, 9000, 16000, 10000, 11000, 11, 74525, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Flame Breath H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 5, 9000, 16000, 10000, 11000, 11, 74527, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Flame Breath N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 17, 9000, 16000, 10000, 11000, 11, 74527, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Flame Breath H25');
-- Meteor Strike
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 3, 9000, 16000, 16000, 22000, 12, 239863, 5, 120000, 1, -131192, 0, 0, 0, 0, 0, 0, 'Halion - Meteor Strike N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 9, 9000, 16000, 12000, 18000, 12, 239863, 5, 120000, 1, -131192, 0, 0, 0, 0, 0, 0, 'Halion - Meteor Strike H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 5, 9000, 16000, 16000, 22000, 12, 239863, 5, 120000, 1, -131192, 0, 0, 0, 0, 0, 0, 'Halion - Meteor Strike N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 17, 9000, 16000, 12000, 18000, 12, 239863, 5, 120000, 1, -131192, 0, 0, 0, 0, 0, 0, 'Halion - Meteor Strike H25');
-- Fiery Combustion
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 3, 9000, 16000, 6000, 9000, 11, 74562, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Fiery Combustion N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 9, 9000, 16000, 5000, 6000, 11, 74562, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Fiery Combustion H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 5, 9000, 16000, 6000, 9000, 11, 74562, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Fiery Combustion N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 62, 100, 17, 9000, 16000, 5000, 6000, 11, 74562, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Fiery Combustion H25');
-- Switch to phase 2 at 75% hp
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 2, 62, 100, 31, 75, 1, 1000, 1000, 22, 1, 0, 0, 1, -131194, 0, 0, 0, 0, 0, 0, 'Halion - Switch to phase2 at 75p');
-- Phase 2
-- Dark Breath
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 3, 9000, 16000, 10000, 11000, 11, 74806, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Dark Breath N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 9, 9000, 16000, 10000, 11000, 11, 74806, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Dark Breath H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 5, 9000, 16000, 10000, 11000, 11, 75954, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Dark Breath N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 17, 9000, 16000, 10000, 11000, 11, 75954, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Dark Breath H25');
-- Dusk Shroud
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 3, 9000, 16000, 16000, 22000, 11, 75484, 1, 4, 1, -131193, 0, 0, 0, 0, 0, 0, 'Halion - Dusk Shroud N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 9, 9000, 16000, 12000, 18000, 11, 75484, 1, 4, 1, -131193, 0, 0, 0, 0, 0, 0, 'Halion - Dusk Shroud H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 5, 9000, 16000, 16000, 22000, 11, 75485, 1, 4, 1, -131193, 0, 0, 0, 0, 0, 0, 'Halion - Dusk Shroud N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 17, 9000, 16000, 12000, 18000, 11, 75485, 1, 4, 1, -131193, 0, 0, 0, 0, 0, 0, 'Halion - Dusk Shroud H25');
-- Soul Consumption
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 3, 9000, 16000, 6000, 9000, 11, 74792, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Soul Consumption N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 9, 9000, 16000, 5000, 6000, 11, 74792, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Soul Consumption H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 5, 9000, 16000, 6000, 9000, 11, 74792, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Soul Consumption N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 61, 100, 17, 9000, 16000, 5000, 6000, 11, 74792, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Soul Consumption H25');
-- Switch to phase 3 at 50% hp
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 2, 61, 100, 31, 50, 1, 1000, 1000, 22, 2, 0, 0, 1, -131195, 0, 0, 0, 0, 0, 0, 'Halion - Switch to phase3 at 50p');
-- Phase 3
-- Flame Breath
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 3, 9000, 21000, 20000, 21000, 11, 74525, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Flame Breath N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 9, 9000, 21000, 20000, 21000, 11, 74525, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Flame Breath H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 5, 9000, 21000, 20000, 21000, 11, 74527, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Flame Breath N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 17, 9000, 21000, 20000, 21000, 11, 74527, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Flame Breath H25');
-- Meteor Strike
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 3, 9000, 16000, 18000, 28000, 12, 239863, 5, 120000, 1, -131192, 0, 0, 0, 0, 0, 0, 'Halion - Meteor Strike N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 9, 9000, 16000, 16000, 22000, 12, 239863, 5, 120000, 1, -131192, 0, 0, 0, 0, 0, 0, 'Halion - Meteor Strike H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 5, 9000, 16000, 18000, 28000, 12, 239863, 5, 120000, 1, -131192, 0, 0, 0, 0, 0, 0, 'Halion - Meteor Strike N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 17, 9000, 16000, 16000, 22000, 12, 239863, 5, 120000, 1, -131192, 0, 0, 0, 0, 0, 0, 'Halion - Meteor Strike H25');
-- Fiery Combustion
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 3, 9000, 21000, 9000, 12000, 11, 74562, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Fiery Combustion N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 9, 9000, 21000, 6000, 9000, 11, 74562, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Fiery Combustion H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 5, 9000, 21000, 9000, 12000, 11, 74562, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Fiery Combustion N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 17, 9000, 21000, 6000, 9000, 11, 74562, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Fiery Combustion H25');
-- Dark Breath
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 3, 9000, 21000, 20000, 21000, 11, 74806, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Dark Breath N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 9, 9000, 21000, 20000, 21000, 11, 74806, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Dark Breath H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 5, 9000, 21000, 20000, 21000, 11, 75954, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Dark Breath N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 17, 9000, 21000, 20000, 21000, 11, 75954, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Dark Breath H25');
-- Dusk Shroud
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 3, 9000, 21000, 22000, 26000, 11, 75484, 1, 4, 1, -131193, 0, 0, 0, 0, 0, 0, 'Halion - Dusk Shroud N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 9, 9000, 21000, 18000, 12000, 11, 75484, 1, 4, 1, -131193, 0, 0, 0, 0, 0, 0, 'Halion - Dusk Shroud H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 5, 9000, 21000, 22000, 26000, 11, 75485, 1, 4, 1, -131193, 0, 0, 0, 0, 0, 0, 'Halion - Dusk Shroud N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 17, 9000, 21000, 18000, 12000, 11, 75485, 1, 4, 1, -131193, 0, 0, 0, 0, 0, 0, 'Halion - Dusk Shroud H25');
-- Soul Consumption
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 3, 9000, 21000, 9000, 12000, 11, 74792, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Soul Consumption N10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 9, 9000, 21000, 6000, 9000, 11, 74792, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Soul Consumption H10');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 5, 9000, 21000, 9000, 12000, 11, 74792, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Soul Consumption N25');
REPLACE INTO creature_ai_scripts_custom VALUES
(NULL, 39863, 0, 59, 100, 17, 9000, 21000, 6000, 9000, 11, 74792, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 'Halion - Soul Consumption H2');
if halion has less than 32mill hp, it works perfectly, if he has more, he is skipping those phases until the x% percentage value gets under 32mill...
so if i set his hp to 64 mill, then any event_t_hp will immediatly passed which points some hp value over 32mill... so a 40% would work, but 60% would be immediatly passed...