[WIP] Sunwell Plateau trash mobs SAI

Conversion from EventAI to SAI of Sunwell Plateau trash mobs

– SmartAI for Sunwell Plateau trash mobs - Conversion from EventAI

– Sunwell Radiance Aura
SET @SPELL_SUNWELL_RADIANCE := 45769;

– 25363, Sunblade Cabalist
SET @ENTRY := 25363;
SET @SPELL_IGNITE_MANA := 46543;
SET @SPELL_SHADOW_BOLT := 47248;
SET @SPELL_SUMMON_IMP := 46544;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Cabalist - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,20000,20000,20000,30000,11,@SPELL_IGNITE_MANA,0,0,0,0,0,6,0,0,0,0,0,0,0,‘Sunblade Arch Mage - Cast Ignite Mana’),
(@ENTRY,0,2,0,0,0,100,0,5000,5000,15000,20000,11,@SPELL_SHADOW_BOLT,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Sunblade Arch Mage - Cast Shadow Bolt’),
(@ENTRY,0,3,0,1,0,100,1,1000,1000,1000,1000,11,@SPELL_SUMMON_IMP,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Scout - Summon Imp OOC’);

– 25367, Sunblade Arch Mage
SET @ENTRY := 25367;
SET @SPELL_ARCANE_EXPLOSION := 46553;
SET @SPELL_FROST_NOVA := 46555;
SET @SPELL_BLINK := 46573;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Arch Mage - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,10000,10000,25000,45000,11,@SPELL_ARCANE_EXPLOSION,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Sunblade Arch Mage - Cast Arcane Explosion’),
(@ENTRY,0,2,0,0,0,25,0,5000,5000,20000,20000,11,@SPELL_FROST_NOVA,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Sunblade Arch Mage - Cast Frost Nova’),
(@ENTRY,0,3,0,0,0,100,0,20000,20000,30000,30000,11,@SPELL_BLINK,0,0,0,0,0,5,0,0,0,0,0,0,0,‘Sunblade Arch Mage - Cast Blink’); – Target should be self?

– 25368, Sunblade Slayer
SET @ENTRY := 25368;
SET @SPELL_SHOOT := 47001;
SET @SPELL_SLAYING_SHOT := 46557;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Slayer - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,10000,10000,15000,20000,11,@SPELL_SHOOT,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Sunblade Slayer - Cast Shoot’),
(@ENTRY,0,2,0,0,0,100,0,25000,25000,25000,25000,11,@SPELL_SLAYING_SHOT,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Sunblade Slayer - Cast Slaying Shot’);

– 25369, Sunblade Vindicator
SET @ENTRY := 25369;
SET @SPELL_CLEAVE := 46559;
SET @SPELL_MORTAL_STRIKE := 39171;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Vindicator - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,5000,5000,15000,30000,11,@SPELL_CLEAVE,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Sunblade Vindicator - Cast Cleave’),
(@ENTRY,0,2,0,0,0,100,0,35000,35000,25000,30000,11,@SPELL_MORTAL_STRIKE,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Sunblade Vindicator - Cast Mortal Strike’);

– 25370, Sunblade Dusk Priest
SET @ENTRY := 25370;
SET @SPELL_MIND_FLY := 46562;
SET @SPELL_SW_PAIN := 46560;
SET @SPELL_FEAR := 46561;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Dusk Priest - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,5000,5000,15000,30000,11,@SPELL_MIND_FLY,0,0,0,0,0,5,0,0,0,0,0,0,0,‘Sunblade Dusk Priest - Cast Mind Fly’),
(@ENTRY,0,2,0,0,0,100,0,35000,35000,25000,30000,11,@SPELL_SW_PAIN,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Sunblade Dusk Priest - Cast Shadow Word: Pain’),
(@ENTRY,0,3,0,2,0,100,0,0,50,15000,15000,11,@SPELL_FEAR,0,0,0,0,0,5,0,0,0,0,0,0,0,‘Sunblade Dusk Priest - At 50% HP cast Fear’);

– 25371, Sunblade Dawn Priest
SET @ENTRY := 25371;
SET @SPELL_HOLY_NOVA := 46564;
SET @SPELL_HOLYFORM := 46565;
SET @SPELL_RENEW := 46563;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Dawn Priest - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,60,0,20000,20000,30000,40000,11,@SPELL_HOLY_NOVA,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Dawn Priest - Cast Holy Nova’),
(@ENTRY,0,2,0,4,0,100,0,0,0,0,0,11,@SPELL_HOLYFORM,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Dawn Priest - Cast Holyform on aggro’),
(@ENTRY,0,3,0,14,0,100,0,50000,20,30000,30000,11,@SPELL_RENEW,0,0,0,0,0,7,0,0,0,0,0,0,0,‘Sunblade Dawn Priest - Cast Renew on Friendly Targets’),
(@ENTRY,0,4,0,2,0,100,0,0,30,20000,20000,11,@SPELL_RENEW,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Dawn Priest - Cast Renew on self’);

– 25372, Sunblade Scout
SET @ENTRY := 25372;
SET @SUNBLADE_PROTECTOR_ENTRY = 25507;
SET @SPELL_ACTIVATE_SUNBLADE_PROTECTOR := 46475;
SET @SPELL_SINISTER_STRIKE := 46558;
SET @SPELL_STEALTH_DETECTION := 18950;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Scout - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,1,0,100,1,1000,1000,1000,1000,11,@SPELL_STEALTH_DETECTION,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Scout - Aura Stealth Detection OOC’),
(@ENTRY,0,2,0,0,0,100,1,5000,5000,30000,40000,11,@SPELL_ACTIVATE_SUNBLADE_PROTECTORE,0,0,0,0,0,9,@SUNBLADE_PROTECTOR_ENTRY,0,25,0,0,0,0,‘Sunblade Scout - Activate Sunwell Protector’), – Not really sure on how this spell should work
(@ENTRY,0,3,0,0,0,100,0,10000,10000,10000,25000,11,@SPELL_SINISTER_STRIKE,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Sunblade Scout - Cast Sinister Strike’);

– 25373, Shadowsword Soulbinder
SET @ENTRY := 25373;
SET @SPELL_CURSE_EXAUSTION := 46434;
SET @SPELL_FLASH_OF_DARKNESS := 46442;
SET @SPELL_SUMMON_INFERNAL := 46229;
SET @SPELL_SUMMON_FELGUARD := 46241;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Shadowsword Soulbinder - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,5000,5000,20000,35000,11,@SPELL_FLASH_OF_DARKNESS,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Shadowsword Soulbinder - Cast Mind Fly’),
(@ENTRY,0,2,0,0,0,100,0,15000,15000,25000,30000,11,@SPELL_CURSE_EXAUSTION,0,0,0,0,0,5,0,0,0,0,0,0,0,‘Shadowsword Soulbinder - Cast Shadow Word: Pain’),
(@ENTRY,0,3,0,4,0,30,0,0,0,0,0,11,@SPELL_SUMMON_INFERNAL,0,0,0,0,0,5,0,0,0,0,0,0,0,‘Shadowsword Soulbinder - Summon Blazing Infernal on aggro’),
(@ENTRY,0,4,0,4,0,30,0,0,0,0,0,11,@SPELL_SUMMON_FELGUARD,0,0,0,0,0,5,0,0,0,0,0,0,0,‘Shadowsword Soulbinder - Summon Felguard Slayer on aggro’);

– 25483, Shadowsword Manafiend
SET @ENTRY := 25483;
SET @SPELL_ARCANE_EXPLOSION := 46457;
SET @SPELL_DRAIN_MANA := 46453;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Shadowsword Manafiend - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,10000,10000,10000,30000,11,@SPELL_ARCANE_EXPLOSION,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Shadowsword Manafiend - Cast Arcane Explosion’),
(@ENTRY,0,2,0,3,0,100,0,0,10,5000,5000,11,@SPELL_DRAIN_MANA,0,0,0,0,0,6,0,0,0,0,0,0,0,‘Shadowsword Manafiend - Cast Drain Mana if mana is low’);

– 25484, Shadowsword Assassin
SET @ENTRY := 25484;
SET @SPELL_SHADOWSTEP := 46463;
SET @SPELL_STEALTH := 34189;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Shadowsword Assassin - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,1,0,100,1,1000,1000,1000,1000,11,@SPELL_STEALTH,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Shadowsword Assassin - Aura Stealth OOC’),
(@ENTRY,0,2,0,0,0,100,0,15000,15000,45000,55000,11,@SPELL_SHADOWSTEP,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Shadowsword Assassin - Cast Shadowstep’);

– 25486, Shadowsword Vanquisher
SET @ENTRY := 25486;
SET @SPELL_CLEAVE := 46468;
SET @SPELL_MELT_ARMOR := 46469;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Shadowsword Vanquisher - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,10000,10000,20000,30000,11,@SPELL_CLEAVE,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Shadowsword Vanquisher - Cast Cleave’),
(@ENTRY,0,2,0,0,0,100,0,2000,2000,15000,45000,11,@SPELL_MELT_ARMOR,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Shadowsword Vanquisher - Cast Mortal Strike’);

– 25506, Shadowsword Lifeshaper
SET @ENTRY := 25506;
SET @SPELL_DRAIN_LIFE := 46466;
SET @SPELL_HEALTH_FUNNEL := 46467;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Shadowsword Lifeshaper - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,35000,35000,40000,70000,11,@SPELL_DRAIN_LIFE,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Shadowsword Lifeshaper - Cast Drain Life’),
(@ENTRY,0,2,0,14,0,100,0,75000,20,60000,60000,11,@SPELL_HEALTH_FUNNEL,0,0,0,0,0,7,0,0,0,0,0,0,0,‘Shadowsword Lifeshaper - Cast Health Funnel on Friendly Targets’);

– 25507, Sunblade Protector
SET @ENTRY := 25507;
SET @SPELL_FEL_LIGHTNING := 46480;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Protector - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,1,0,100,1,1000,1000,1000,1000,11,@SPELL_STEALTH_DETECTION,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Protector - Aura Stealth Detection OOC’),
(@ENTRY,0,2,0,0,0,100,0,10000,10000,15000,20000,11,@SPELL_FEL_LIGHTNING,0,0,0,0,0,5,0,0,0,0,0,0,0,‘Sunblade Protector - Cast Fel Lightning’);
– TODO: They should be called in combat by Sunblade Scout (via @SPELL_ACTIVATE_SUNBLADE_PROTECTOR). They also have some texts (http://www.wowhead.com/npc=25507)

– 25508, Shadowsword Guardian
SET @ENTRY := 25508;
SET @SPELL_BEAR_DOWN := 46239;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Shadowsword Guardian - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,5000,5000,20000,30000,11,@SPELL_BEAR_DOWN,0,0,0,0,0,6,0,0,0,0,0,0,0,‘Shadowsword Guardian - Cast Bear Down’);

– 25509, Priestess of Torment
SET @ENTRY := 25509;
SET @SPELL_WHIRLWIND := 46270;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Priestess of Torment - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,10000,10000,30000,45000,11,@SPELL_WHIRLWIND,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Priestess of Torment - Cast Whirlwind’);

– 25592, Doomfire Destroyer

SET @ENTRY := 25592;
SET @SPELL_DOOMFIRE_SHARD := 46306;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Doomfire Destroyer - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,0,0,1500,1500,11,@SPELL_DOOMFIRE_SHARD,0,0,0,0,0,5,0,0,0,0,0,0,0,‘Doomfire Destroyer - Cast Create Doomfire Shard’);

– 25593, Apocalypse Guard
SET @ENTRY := 25593;
SET @SPELL_CLEAVE := 40504;
SET @SPELL_CORRUPTING_STRIKE := 45029;
SET @SPELL_DEATH_COIL := 46283;
SET @SPELL_INFERNAL_DEFENSE := 46287;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Apocalypse Guard - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,15000,15000,20000,40000,11,@SPELL_CLEAVE,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Apocalypse Guard - Cast Cleave’),
(@ENTRY,0,2,0,0,0,100,0,25000,25000,25000,45000,11,@SPELL_CORRUPTING_STRIKE,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Apocalypse Guard - Cast Corrupting Strike’),
(@ENTRY,0,3,0,0,0,100,0,5000,5000,17000,37000,11,@SPELL_DEATH_COIL,0,0,0,0,0,5,0,0,0,0,0,0,0,‘Apocalypse Guard - Cast Death Coil’),
(@ENTRY,0,4,0,2,0,100,1,0,20,0,0,11,@SPELL_INFERNAL_DEFENSE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Apocalypse Guard - Cast Infernal Defense on self’);

– 25595, Chaos Gazer

SET @ENTRY := 25595;
SET @SPELL_TENTACLE_SWEEP := 46290;
SET @SPELL_PETRIFY := 46288;
SET @SPELL_DRAIN_LIFE := 46291;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Chaos Gazer - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,15000,15000,15000,15000,11,@SPELL_TENTACLE_SWEEP,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Chaos Gazer - Cast Tentacle Sweep’),
(@ENTRY,0,2,0,0,0,100,0,20000,20000,30000,45000,11,@SPELL_PETRIFY,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Chaos Gazer - Cast Petrify’),
(@ENTRY,0,3,0,0,0,100,0,0,0,60000,60000,11,@SPELL_DRAIN_LIFE,0,0,0,0,0,6,0,0,0,0,0,0,0,‘Chaos Gazer - Cast Drain Life’);

– 25597, Oblivion Mage

SET @ENTRY := 25597;
SET @SPELL_FLAME_BUFFET := 46279;
SET @SPELL_POLYMORPH := 46280;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Oblivion Mage - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,15000,15000,25000,35000,11,@SPELL_FLAME_BUFFET,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Oblivion Mage - Cast Flame Buffet’),
(@ENTRY,0,2,0,0,0,100,0,20000,20000,20000,35000,11,@SPELL_POLYMORPH,0,0,0,0,0,6,0,0,0,0,0,0,0,‘Oblivion Mage - Cast Polymorph’);

– 25599, Cataclysm Hound

SET @ENTRY := 25599;
SET @SPELL_BREATH := 46292;
SET @SPELL_FRENZY := 47399;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Cataclysm Hound - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,15000,15000,20000,35000,11,@SPELL_BREATH,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Cataclysm Hound - Cast Cataclysm Breath’),
(@ENTRY,0,2,0,2,0,100,1,0,20,0,0,11,@SPELL_FRENZY,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Cataclysm Hound - Cast Frenzy on self’);

– 25851, Volatile Fiend
SET @ENTRY := 25851;
SET @SPELL_BURNING_DESTRUCTION := 47287;
SET @SPELL_BURNING_WINDS := 46308;
SET @SPELL_FELFIRE_FISSION := 45779;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Volatile Fiend - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,60,0,5000,5000,30000,40000,11,@SPELL_BURNING_DESTRUCTION,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Volatile Fiend - Cast Burning Destruction’),
(@ENTRY,0,2,0,4,0,100,0,0,0,0,0,11,@SPELL_BURNING_WINDS,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Volatile Fiend - Cast Burning Winds on aggro’),
(@ENTRY,0,3,0,0,0,100,0,15000,15000,25000,40000,11,@SPELL_FELFIRE_FISSION,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Volatile Fiend - Cast Felfire Fission’);

– 25867, Sunblade Dragonhawk
SET @ENTRY := 25867;
SET @SPELL_BREATH := 47251;
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY;
DELETE FROM smart_scripts WHERE 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,0,23,0,100,0,@SPELL_SUNWELL_RADIANCE,0,2000,2000,11,@SPELL_SUNWELL_RADIANCE,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sunblade Dragonhawk - Aura Sunwell Radiance not present - Add Aura Sunwell Radiance’),
(@ENTRY,0,1,0,0,0,100,0,7500,7500,20000,30000,11,@SPELL_BREATH,0,0,0,0,0,2,0,0,0,0,0,0,0,‘Sunblade Dragonhawk - Cast Flame Breath’);

Everything needs to be tested. Timers are from the previous EventAI.

Sunblade Protector must be fixed so that Sunblade Scout can call them in combat with this spell. Don’t know if a C++ script is needed for that.

Any feedback is welcome.

I don’t believe it’s possible to define @ENTRY more than once in one SQL file. Try setting @ENTRY1, @ENTRY2, etc.

spell_scripts: Holds scripts that can be activated by spells with effect SPELL_EFFECT_SCRIPT_EFFECT (77) or SPELL_EFFECT_DUMMY(3).

That might help you, tho I can’t doublecheck if the Sunblade Protectors are set rooted or something. (Sunblade Protector Activated - Spell - World of Warcraft)

However, If i’m correct, this is an EventAI table. Else you have SMART_SCRIPT_TYPE_SPELL (6), but according to Wiki, not yet implemented.

@Discover: Yes you can, the previous value will be erased. So if you need to keep the old valus, then use @ENTRY1, or @PROTECTOR, etc. Else, you can keep @ENTRY

I do it all the time. Very good SQL. Nice to see someone providing fixes like this. I’m watching you /emoticons/default_smile.png

Thanks /emoticons/default_smile.png From August maybe I will have more time to dedicate to the EventAI → SAI conversions…atm I like doing them in my spare time when I’m not studying ^^

I suggest this being applied. Looks great, follows standards and works like a train. =)