Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Serverside Modding => Topic started by: Смердокрыл on November 18, 2015, 11:23:26 am
-
Basically, I need an npc (by guid) to walk to a certain point, when an event starts.
Script:
DELETE FROM `smart_scripts` WHERE (`entryorguid`=15737508 AND `source_type`=0);
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
(15737508, 0, 0, 1, 68, 0, 100, 0, 70, 0, 0, 0, 59, 0, , , , , , 1, , , , , , , , ""),
(15737508, 0, 1, , 68, 0, 100, 0, 70, , , , 69, 0, 0, 0, 0, , , 8, , , , 1632.454956, 226.362778, 62.593037, 1.057432, "");
Error:
[attachment=0:h2t6wxsv]smartaierror.jpg[/attachment:h2t6wxsv]
-
You can't just have a list of commas. Give a value for all fields you specified or specify less fields.
-
Thanks, the problem with execution is fixed. I also changed the guid in the script from 15737508 to -15737508, so its processed as a guid.
New script(s):
REPLACE 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 (15737508, 0, 0, 1, 68, 0, 100, 0, 70, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE 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 (15737508, 0, 1, 0, 68, 0, 100, 0, 70, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 1632.45, 226.363, 62.593, 1.05743, '');
Still, when I run the event (that triggers this smart script), the npc doesnt move.
-
Can anyone help? please
-
Ok, modcraft is dead
-
The only way I ever did a NPC moving is with way point commands.. Don't think that will help you much..
-
(-guid, 0, 0, 0, Eventid, 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, Xcoord, Ycoord, Zcoord, 0, 'comment');
And in your situation you should use
(-guid, 0, 0, 0, 68, 0, 0, 0, Eventid(from_database), 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, Xcoord, Ycoord, Zcoord, 0, 'comment');
You must write your creature's guid, EventID and coords. This should work.
-
Your script with ID 0 has link 1, which means that it will be triggered AFTER script with ID 1 will. I just hope you wanted it so. It doesn't matter in this case, I just wanted to make sure you know what link field is for.
About the rest, I am not sure how action you used works and would not use it at all, it seems to be pretty specific about what it is for:
PointId is called by SMART_EVENT_MOVEMENTINFORM. Continue this action with the TARGET_TYPE column. Use any target_type, and use target_x, target_y, target_z, target_o as the coordinates
Probably not something you wanted to use at all.
I would spawn waypoint path, use action 53 for making NPC follow waypoint path and would set canRepeat=0. If NPC won't stop at the end of waypoint path, you will need to add another script which will make it do so by using event 40 and action 55. The only flaw about this is that when NPC unloads from memory (if you didn't turn this option off in worldserver.conf, this happens whenever palyers don't have that zone loaded long enough), when server loads it back, it will appear at its spawn point, which means that it will be standing at one place, where it was before event occured. That might be unpleasant.
So, you may also want to add another script which will despawn NPC when it reaches end of waypoint path (action 41 should do) and will spawn a new one instead of it. Note that Blizzard does so during quest - questgivers, escorted NPCs and such tend to be despawned and then spawned again when they reach their targeted position. I doubt Blizzard does so without pretty good reason.