Q: Sai Phasing

Hello, So I started doing SQL SAI scripts but I do have some questions which I don’t think the wiki answered.

What defines the phases ? I know there is a table called event_phase_masks but what defines the % that the phase will occure ?

For instance how do I set that the mob will go into phase 2 at 77% ?

  1. http://www.trinityco…ting-questions/ This is the place you should put these questions in, and I’m sure there’s already a question about phases there.

  2. That would be with the SMART_ACTION_SET_EVENT_PHASE (22) triggered by SMART_EVENT_HEALT_PCT. So it would look like this:

SET @NPC := XXX; UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = @NPC; DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC; 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,2,0,100,0,77,77,0,0,22,1,0,0,0,0,0,0,0,0,0,0,0,0,0,'NPC - On 77% HP - Set Phase 2');[/SQL]
3. You should take a look at Malcrom’s SAI tutorial, every basic aspect is explained there.

Next time try searching a bit more on the forums before you make a new topic about it, I’m sure you’d find more than one result about this.