[Completed][WIP] SAI for Crust Burster

Someone test please

[CODE]-- SAI for Crust Burster
SET @ENTRY := 16844;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
UPDATE creature SET spawndist=20,MovementType=1 WHERE id=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@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,1,1,0,100,1,0,0,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - OOC - Cast Submerge Visual’),
(@ENTRY,0,1,0,61,0,100,1,0,0,0,0,18,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - OOC - Set Unselectable and Unattackable Flags’),
(@ENTRY,0,2,3,0,0,100,1,0,0,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Remove Submerge Visual’),
(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Remove Unselectable and Unattackable Flags’),
(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Prevent Combat Movement’),
(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Set Phase 1’),
(@ENTRY,0,6,7,0,1,100,0,1000,1000,2100,4500,11,31747,1,0,0,0,0,2,0,0,0,0,0,0,0,‘Crust Burster - Combat - Cast Poison (Phase 1)’),
(@ENTRY,0,7,0,61,1,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - Combat - Prevent Combat Movement (Phase 1)’),
(@ENTRY,0,8,0,0,1,100,0,20400,20400,45000,50000,11,32738,1,0,0,0,0,2,0,0,0,0,0,0,0,‘Crust Burster - Combat - Cast Bore (Phase 1)’),
(@ENTRY,0,9,10,9,1,100,0,20,60,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Cast Submerge Visual (Phase 1)’),
(@ENTRY,0,10,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Set Phase 2 (Phase 1)’),
(@ENTRY,0,11,12,9,2,100,0,0,8,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 0 - 8 Yards - Remove Submerge Visual (Phase 2)’),
(@ENTRY,0,12,13,61,2,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - Combat - Prevent Combat Movement (Phase 2)’),
(@ENTRY,0,13,14,61,2,100,0,0,8,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 0 - 8 Yards - Remove Unselectable and Unattackable Flags (Phase 2)’),
(@ENTRY,0,14,0,61,2,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Set Phase 1 (Phase 2)’);

– SAI for Marading Crust Burster
SET @ENTRY := 16857;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
UPDATE creature SET spawndist=20,MovementType=1 WHERE id=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@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,1,1,0,100,1,0,0,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - OOC - Cast Submerge Visual’),
(@ENTRY,0,1,0,61,0,100,1,0,0,0,0,18,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - OOC - Set Unselectable and Unattackable Flags’),
(@ENTRY,0,2,3,0,0,100,1,0,0,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Remove Submerge Visual’),
(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Remove Unselectable and Unattackable Flags’),
(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Prevent Combat Movement’),
(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Set Phase 1’),
(@ENTRY,0,6,7,0,1,100,0,1000,1000,2100,4500,11,31747,1,0,0,0,0,2,0,0,0,0,0,0,0,‘Crust Burster - Combat - Cast Poison (Phase 1)’),
(@ENTRY,0,7,0,61,1,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - Combat - Prevent Combat Movement (Phase 1)’),
(@ENTRY,0,8,0,0,1,100,0,20400,20400,45000,50000,11,32738,1,0,0,0,0,2,0,0,0,0,0,0,0,‘Crust Burster - Combat - Cast Bore (Phase 1)’),
(@ENTRY,0,9,10,9,1,100,0,20,60,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Cast Submerge Visual (Phase 1)’),
(@ENTRY,0,10,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Set Phase 2 (Phase 1)’),
(@ENTRY,0,11,12,9,2,100,0,0,8,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 0 - 8 Yards - Remove Submerge Visual (Phase 2)’),
(@ENTRY,0,12,13,61,2,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - Combat - Prevent Combat Movement (Phase 2)’),
(@ENTRY,0,13,14,61,2,100,0,0,8,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 0 - 8 Yards - Remove Unselectable and Unattackable Flags (Phase 2)’),
(@ENTRY,0,14,0,61,2,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Set Phase 1 (Phase 2)’);[/sql]
[/CODE]

Need this tested.

No Movment once Combat Starts, they submerge when you leave melee range and are not AOE agroable.

This was converted from EAI. I just replaced the submerged spell that was there with the correct one. Combat AI will need tuning.

Updated. Allow combat movement at 20 - 60 yards added. Needs testing.

[CODE]-- SAI for Crust Burster
SET @ENTRY := 16844;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
UPDATE creature SET spawndist=20,MovementType=1 WHERE id=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@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,1,1,0,100,1,0,0,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - OOC - Cast Submerge Visual’),
(@ENTRY,0,1,0,61,0,100,1,0,0,0,0,18,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - OOC - Set Unselectable and Unattackable Flags’),
(@ENTRY,0,2,3,0,0,100,1,0,0,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Remove Submerge Visual’),
(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Remove Unselectable and Unattackable Flags’),
(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Prevent Combat Movement’),
(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Set Phase 1’),
(@ENTRY,0,6,7,0,1,100,0,1000,1000,2100,4500,11,31747,1,0,0,0,0,2,0,0,0,0,0,0,0,‘Crust Burster - Combat - Cast Poison (Phase 1)’),
(@ENTRY,0,7,0,61,1,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - Combat - Prevent Combat Movement (Phase 1)’),
(@ENTRY,0,8,0,0,1,100,0,20400,20400,45000,50000,11,32738,1,0,0,0,0,2,0,0,0,0,0,0,0,‘Crust Burster - Combat - Cast Bore (Phase 1)’),
(@ENTRY,0,9,10,9,1,100,0,20,60,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Cast Submerge Visual (Phase 1)’),
(@ENTRY,0,10,11,61,1,100,0,0,0,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Allow Combat Movement (Phase 1)’),
(@ENTRY,0,11,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Set Phase 2 (Phase 1)’),
(@ENTRY,0,12,13,9,2,100,0,0,8,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 0 - 8 Yards - Remove Submerge Visual (Phase 2)’),
(@ENTRY,0,13,14,61,2,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - Combat - Prevent Combat Movement (Phase 2)’),
(@ENTRY,0,14,15,61,2,100,0,0,8,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 0 - 8 Yards - Remove Unselectable and Unattackable Flags (Phase 2)’),
(@ENTRY,0,15,0,61,2,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Set Phase 1 (Phase 2)’);

– SAI for Marading Crust Burster
SET @ENTRY := 16857;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
UPDATE creature SET spawndist=20,MovementType=1 WHERE id=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@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,1,1,0,100,1,0,0,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - OOC - Cast Submerge Visual’),
(@ENTRY,0,1,0,61,0,100,1,0,0,0,0,18,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - OOC - Set Unselectable and Unattackable Flags’),
(@ENTRY,0,2,3,0,0,100,1,0,0,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Remove Submerge Visual’),
(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Remove Unselectable and Unattackable Flags’),
(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Prevent Combat Movement’),
(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - On Aggro - Set Phase 1’),
(@ENTRY,0,6,7,0,1,100,0,1000,1000,2100,4500,11,31747,1,0,0,0,0,2,0,0,0,0,0,0,0,‘Crust Burster - Combat - Cast Poison (Phase 1)’),
(@ENTRY,0,7,0,61,1,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - Combat - Prevent Combat Movement (Phase 1)’),
(@ENTRY,0,8,0,0,1,100,0,20400,20400,45000,50000,11,32738,1,0,0,0,0,2,0,0,0,0,0,0,0,‘Crust Burster - Combat - Cast Bore (Phase 1)’),
(@ENTRY,0,9,10,9,1,100,0,20,60,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Cast Submerge Visual (Phase 1)’),
(@ENTRY,0,10,11,61,1,100,0,0,0,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Allow Combat Movement (Phase 1)’),
(@ENTRY,0,11,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Set Phase 2 (Phase 1)’),
(@ENTRY,0,12,13,9,2,100,0,0,8,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 0 - 8 Yards - Remove Submerge Visual (Phase 2)’),
(@ENTRY,0,13,14,61,2,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - Combat - Prevent Combat Movement (Phase 2)’),
(@ENTRY,0,14,15,61,2,100,0,0,8,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 0 - 8 Yards - Remove Unselectable and Unattackable Flags (Phase 2)’),
(@ENTRY,0,15,0,61,2,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Crust Burster - At 20 - 60 Yards Range - Set Phase 1 (Phase 2)’);[/sql]
[/CODE]