[WIP] Dragonflayer Flamebinder SAI

Need to do combat AI.

[CODE]-- Add missing Dragonflayer Flamebinder
SET @GUID := XXXXXX;
DELETE FROM creature WHERE guid=@GUID;
INSERT INTO creature (guid,id,map,spawnMask,phaseMask,modelid,equipment_id,position_x,position_y,position_z,orientation,spawntimesecs,spawndist,currentwaypoint,curhealth,curmana,DeathState,MovementType) VALUES
(@GUID,27259,571,1,1,0,0,2885.91919,-2643.75781,84.73854,1.51843643,120,0,0,1,0,0,0);
– Dragonflayer Flamebinder SAI
SET @ENTRY := 27259; – NPC entry
SET @TARGET := 26785; – Directional Rune
SET @CAST := 48213; – Dragonflayer Crone Fire
SET @SPELL1 := 52208; – Flame Patch
SET @SPELL2 := 52209; – Incite Flames
UPDATE creature_template SET AIName= ‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE entryorguid IN (-@GUID,-107263,-107256,-107281,-107278,-107273);
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
(-@GUID,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@CAST,2,0,0,0,0,11,@TARGET,30,0,0,0,0,0,‘Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire’),
(-107263,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@CAST,2,0,0,0,0,11,@TARGET,30,0,0,0,0,0,‘Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire’),
(-107256,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@CAST,2,0,0,0,0,11,@TARGET,30,0,0,0,0,0,‘Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire’),
(-107281,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@CAST,2,0,0,0,0,11,@TARGET,30,0,0,0,0,0,‘Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire’),
(-107278,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@CAST,2,0,0,0,0,11,@TARGET,30,0,0,0,0,0,‘Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire’),
(-107273,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@CAST,2,0,0,0,0,11,@TARGET,30,0,0,0,0,0,‘Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire’);
– Fix Spell condition for Spell 48213 to only target Directional Rune
DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry=48213;
INSERT INTO conditions (SourceTypeOrReferenceId,SourceGroup,SourceEntry,ElseGroup,ConditionTypeOrReference,ConditionValue1,ConditionValue2,ConditionValue3,ErrorTextId,ScriptName,Comment) VALUES
(13,0,48213,0,18,1,23837,0,0,‘’,‘Spell 48213 targets only Directional Rune’);

– EAI to convert to SAI
insert into creature_ai_scripts (id, creature_id, event_type, event_inverse_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action1_type, action1_param1, action1_param2, action1_param3, action2_type, action2_param1, action2_param2, action2_param3, action3_type, action3_param1, action3_param2, action3_param3, comment) values
(2725901,27259,1,0,100,0,0,0,0,0,21,0,0,0,22,0,0,0,0,0,0,0,‘Dragonflayer Flamebinder - Prevent Combat Movement and Set Phase to 0 on Spawn’);
(2725902,27259,4,0,100,0,0,0,0,0,11,52209,1,0,23,1,0,0,0,0,0,0,‘Dragonflayer Flamebinder - Cast Incite Flames and Set Phase 1 on Aggro’);
(2725903,27259,9,5,100,1,0,40,3400,4800,11,52209,1,0,0,0,0,0,0,0,0,0,‘Dragonflayer Flamebinder - Cast Incite Flames (Phase 1)’);
(2725904,27259,3,5,100,0,7,0,0,0,21,1,0,0,23,1,0,0,0,0,0,0,‘Dragonflayer Flamebinder - Start Combat Movement and Set Phase 2 when Mana is at 7% (Phase 1)’);
(2725905,27259,9,5,100,0,35,80,0,0,21,1,0,0,0,0,0,0,0,0,0,0,‘Dragonflayer Flamebinder - Start Combat Movement at 35 Yards (Phase 1)’);
(2725906,27259,9,5,100,0,5,15,0,0,21,0,0,0,0,0,0,0,0,0,0,0,‘Dragonflayer Flamebinder - Prevent Combat Movement at 15 Yards (Phase 1)’);
(2725907,27259,9,5,100,0,0,5,0,0,21,1,0,0,0,0,0,0,0,0,0,0,‘Dragonflayer Flamebinder - Start Combat Movement Below 5 Yards (Phase 1)’);
(2725908,27259,3,3,100,1,100,15,100,100,23,-1,0,0,0,0,0,0,0,0,0,0,‘Dragonflayer Flamebinder - Set Phase 1 when Mana is above 15% (Phase 2)’);
(2725909,27259,0,0,100,1,8000,12000,16000,19000,11,52208,4,1,0,0,0,0,0,0,0,0,‘Dragonflayer Flamebinder - Cast Flame Patch’);[/sql]
[/CODE]

Nice! I figured out that you made a typo at the conditions - you made it target some random trigger NPC. /emoticons/default_wink.png

Thanks for learning me that I should read column names before even working with them. I never though of using SAI on GUID… =P

[CODE]-- Add missing Dragonflayer Flamebinder and the trigger they cast their flames on
SET @GUID := 100000;
DELETE FROM creature WHERE guid=@GUID;
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
(@GUID,27259,571,1,1,25944,0,2885.91919,-2643.75781,84.73854,1.51843643,300,0,0,7952,7654,0,0,0,0);

– Dragonflayer Flamebinder SAI
SET @ENTRY := 27259;
SET @ENTRY_DIRECTIONAL_RUNE := 26785;
SET @SPELL_DRAGONFLAYER_CRONE_FIRE := 48213;
SET @SPELL_FLAME_PATCH := 52208;
SET @SPELL_INCITE_FLAMES := 52209;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
UPDATE creature_template SET unit_flags=33554944,flags_extra=130 WHERE entry=26785; – Directional Rune shouldn’t attack back…
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE entryorguid IN (-@GUID,-107263,-107256,-107281,-107278,-107273,@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
(-@GUID,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@SPELL_DRAGONFLAYER_CRONE_FIRE,2,0,0,0,0,11,@ENTRY_DIRECTIONAL_RUNE,30,0,0,0,0,0,“Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire”),
(-107263,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@SPELL_DRAGONFLAYER_CRONE_FIRE,2,0,0,0,0,11,@ENTRY_DIRECTIONAL_RUNE,30,0,0,0,0,0,“Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire”),
(-107256,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@SPELL_DRAGONFLAYER_CRONE_FIRE,2,0,0,0,0,11,@ENTRY_DIRECTIONAL_RUNE,30,0,0,0,0,0,“Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire”),
(-107281,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@SPELL_DRAGONFLAYER_CRONE_FIRE,2,0,0,0,0,11,@ENTRY_DIRECTIONAL_RUNE,30,0,0,0,0,0,“Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire”),
(-107278,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@SPELL_DRAGONFLAYER_CRONE_FIRE,2,0,0,0,0,11,@ENTRY_DIRECTIONAL_RUNE,30,0,0,0,0,0,“Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire”),
(-107273,0,0,0,1,0,100,0,1000,4000,3000,3000,11,@SPELL_DRAGONFLAYER_CRONE_FIRE,2,0,0,0,0,11,@ENTRY_DIRECTIONAL_RUNE,30,0,0,0,0,0,“Dragonflayer Flamebinder - OOC - Cast Dragonflayer Crone Fire”),
– Combat AI
(@ENTRY,0,0,0,1,0,100,1,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,“Dragonflayer Flamebinder - Out of Combat - Prevent Combat Movement”),
(@ENTRY,0,0,0,1,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,“Dragonflayer Flamebinder - On Spawn - Prevent Combat Movemenet”),
(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,11,@SPELL_INCITE_FLAMES,0,0,0,0,0,2,0,0,0,0,0,0,0,“Dragonflayer Flamebinder - On Aggro - Cast Incite Flames”),
(@ENTRY,0,2,0,4,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,“Dragonflayer Flamebinder - On Aggro - Set Phase 1”),
(@ENTRY,0,3,0,9,1,100,0,0,0,3500,4000,11,@SPELL_INCITE_FLAMES,0,0,0,0,0,2,0,0,0,0,0,0,0,“Dragonflayer Flamebinder - In Combat - Cast Incite Flames”),
(@ENTRY,0,4,0,9,1,100,1,8000,12000,16000,19000,11,@SPELL_FLAME_PATCH,1,0,0,0,0,2,0,0,0,0,0,0,0,“Dragonflayer Flamebinder - In Combat - Cast Incite Flames”),
(@ENTRY,0,5,0,3,1,100,0,0,7,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,“Dragonflayer Flamebinder - At 7% Mana - Allow Combat Movement”),
(@ENTRY,0,6,0,3,1,100,0,0,7,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,“Dragonflayer Flamebinder - At 7% Mana - Set Phase 2”),
(@ENTRY,0,7,0,9,1,100,0,35,80,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,“Dragonflayer Flamebinder - On Player Range - Allow Combat Movement”),
(@ENTRY,0,8,0,9,1,100,0,5,15,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,“Dragonflayer Flamebinder - On Player Range - Prevent Combat Movemet”),
(@ENTRY,0,9,0,9,1,100,0,0,5,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,“Dragonflayer Flamebinder - On Player Range - Allow Combat Movement”);

– Spell condition for Spell 48213 to only target Directional Rune
DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry=48213;
INSERT INTO conditions (SourceTypeOrReferenceId,SourceGroup,SourceEntry,ElseGroup,ConditionTypeOrReference,ConditionValue1,ConditionValue2,ConditionValue3,ErrorTextId,ScriptName,Comment) VALUES
(13,0,48213,0,18,1,26785,0,0,‘’,‘Spell 48213 targets only Directional Rune’);[/sql]

Only two problems remain:

  1. Neither of his spells cost mana, so he never reaches the 7% mana point…

  2. The flamebinders which are casting at the Directional Rune do not use any of the combat SAI. Normal-spawned Flamebinders do.

[/CODE]