[CODE]SET @RAY := 22181;
SET @SPELL := 40856;
SET @WRAY := 23343;
SET @FORCECAST := 40917;
SET @AURA := 40926;
– Templates
UPDATE creature_template
SET AIName
=‘SmartAI’ WHERE entry
IN (@RAY,@WRAY);
– Text
DELETE FROM creature_text
WHERE entry
=@RAY;
INSERT INTO creature_text
(entry
,groupid
,id
,text
,type
,language
,probability
,emote
,duration
,sound
,comment
) VALUES
(@RAY,1,0,‘The Aether Ray appears ready to be wrangled.’,16,0,100,1,0,0,‘Aether Ray - From 30% health to 0% and once - Text emote’);
– SAI
DELETE FROM smart_scripts
WHERE source_type
=0 AND entryorguid
IN (@RAY,@WRAY);
DELETE FROM smart_scripts
WHERE source_type
=9 AND entryorguid
=@RAY*100;
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
(@RAY,0,0,0,2,0,100,0x01,0,30,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Aether Ray - At 30% Health - Emote’),
(@RAY,0,1,0,8,0,100,0x01,@SPELL,0,0,0,80,@RAY*100,1,1,0,0,0,1,0,0,0,0,0,0,0,‘Aether Ray - On spell “Wrangling Rope” 40856 hit - Start script’),
(@RAY100,9,0,1,0,0,100,0,5000,5000,0,0,11,@FORCECAST,2,0,0,0,0,7,0,0,0,0,0,0,0,‘Aether Ray - Cast “Wrangle Aether Rays: Character Force Cast” 40917,then link to despawn’),
(@RAY100,9,1,61,0,0,100,0,0,0,0,0,41,500,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Aether Ray - Despawn after 500 ms’),
(@WRAY,0,0,1,54,0,100,0x01,0,0,0,0,11,@AURA,0x03,0,0,0,0,7,0,0,0,0,0,0,0,‘Wrangled Aether Ray - Cast “Wrangle Aether Rays: Wrangling Rope Channel” 40926 on summoner’),
(@WRAY,0,1,2,61,0,100,0x01,0,0,0,0,33,@WRAY,0,0,0,0,0,7,0,0,0,0,0,0,0,‘Wrangled Aether Ray - Give kill credit to summoner’),
(@WRAY,0,2,3,61,0,100,0x01,0,0,0,0,41,120000,0,0,0,0,0,7,0,0,0,0,0,0,0,‘Wrangled Aether Ray - Despawn after 2 minutes’);-- ,
– (@WRAY,0,3,0,61,0,0,100,0x01,0,0,0,0,33,@WRAY,0,0,0,0,0,23,0,0,0,0,0,0,0,‘Wrangled Aether Ray - Follow summoner’); – Not yet done, don’t understand it.
– Conditions
DELETE FROM conditions
WHERE SourceTypeOrReferenceId
=17 AND SourceEntry
=@SPELL;
DELETE FROM conditions
WHERE SourceTypeOrReferenceId
=18 AND SourceEntry
=32698;
INSERT INTO conditions
(SourceTypeOrReferenceId
,SourceGroup
,SourceEntry
,ElseGroup
,ConditionTypeOrReference
,ConditionValue1
,ConditionValue2
,ConditionValue3
,ErrorTextId
,ScriptName
,Comment
) VALUES
(17,0,@SPELL,0,20,30,0,0,0,‘’,‘Spell 40856 Wrangling Rope only target creature under 30% health’),
(18,0,32698,0,24,1,@RAY,0,0,‘’,‘Item 32698 Wrangling Rope only target 22181 Aether Ray’);[/sql]
Todo: understand SMART_ACTION_FOLLOW.
[/CODE]