Would it be ok to add an option 8, for example, to Smartscripts for scripting creatures OOC?
Add the option 8 id to the creature like we do with waypoints.
add an action to SAI “Load Path” so the core loads path and doesn’t do next command until path ends.
So we could have a script like this:
– Pathing for Niluut : 48581
SET @GUID := 12345678;
SET @PATH1 := @GUID *10;
SET @PATH2 := @GUID *10 + 1;
– Niluut pathing SAI
UPDATE creature
SET pathscript
=@GUID,position_x
=6029.4,position_y
=-876.596,position_z
=415.2376 WHERE guid
=@GUID;
UPDATE creature_template
SET AIName
=“SmartAI” WHERE entry
=48581;
DELETE FROM smart_scripts
WHERE entryorguid
=@GUID AND source_type
=8;
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,8,0,0,0,0,100,0,1000,1000,1000,1000,119,@PATH1,0,0,0,0,0,1,0,0,0,0,0,0,0,“Niluut - Pathscript - Load first half of path”),
(@GUID,8,1,0,0,0,100,0,1000,1000,1000,1000,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0,“Niluut - Pathscript - Set Emotestate 69”),
(@GUID,8,2,0,0,0,100,0,5000,5000,5000,5000,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,“Niluut - Pathscript - Set Emotestate 0”),
(@GUID,8,3,0,0,0,100,0,1000,1000,1000,1000,119,@PATH2,0,0,0,0,0,1,0,0,0,0,0,0,0,“Niluut - Pathscript - Load last half of path”),
(@GUID,8,4,0,0,0,100,0,1000,1000,1000,1000,66,0,0,0,0,0,0,8,0,0,0,0,0,0,1.029744,“Niluut - Pathscript - Set Orientation”),
(@GUID,8,5,0,0,0,100,0,40000,40000,40000,40000,120,0,0,0,0,0,0,1,0,0,0,0,0,0,0,“Niluut - Pathscript - Restart script”);
– Niluut waypoints
DELETE FROM waypoints
WHERE entry
IN (@PATH1,@PATH2);
INSERT INTO waypoints
(entry
,pointid
,position_x
,position_y
,position_z
,point_comment
) VALUES
– First half
(@PATH1,1,6031.205,-878.377,416.1823,“Niluut entry: 48581”),
(@PATH1,2,6033.955,-881.877,419.1823,“Niluut entry: 48581”),
(@PATH1,3,6037.455,-883.377,420.1823,“Niluut entry: 48581”),
(@PATH1,4,6040.455,-881.127,421.6823,“Niluut entry: 48581”),
(@PATH1,5,6043.455,-878.377,424.4323,“Niluut entry: 48581”),
(@PATH1,6,6044.955,-875.877,424.6823,“Niluut entry: 48581”),
(@PATH1,7,6042.455,-872.627,424.6823,“Niluut entry: 48581”),
(@PATH1,8,6038.455,-868.877,424.6823,“Niluut entry: 48581”),
(@PATH1,9,6040.455,-865.627,424.6823,“Niluut entry: 48581”),
(@PATH1,10,6042.51,-867.158,424.6270,“Niluut entry: 48581”),
– Second half
(@PATH2,1,6039.245,-867.6795,424.6825,“Niluut entry: 48581”),
(@PATH2,2,6039.245,-870.1795,424.6825,“Niluut entry: 48581”),
(@PATH2,3,6044.495,-874.6795,424.6825,“Niluut entry: 48581”),
(@PATH2,4,6044.745,-876.6795,424.6825,“Niluut entry: 48581”),
(@PATH2,5,6043.245,-878.6795,423.9325,“Niluut entry: 48581”),
(@PATH2,6,6039.245,-881.9295,420.4325,“Niluut entry: 48581”),
(@PATH2,7,6037.495,-883.6795,420.1825,“Niluut entry: 48581”),
(@PATH2,8,6034.495,-881.4295,419.1825,“Niluut entry: 48581”),
(@PATH2,9,6029.980,-877.7010,415.2380,“Niluut entry: 48581”),
(@PATH2,10,6029.40,-876.5960,415.2376,“Niluut entry: 48581”);