Want something applied? viewtopic.php?f=66&t=37106
Trinity Core's page on waypoint_data: https://trinitycore.atlassian.net/wiki/ ... point_data
Concept:
You create certain waypoints: A, B & C. The creature moves from A to B, B to C and C to A. You can have as many waypoints as you wish. This is used by patrolling NPCs, which will take the same path endlessly. Do not use this for escort like NPCs.
Attributes in the waypoint_data table: *Bolded are most important*
- id - Unlike the other guides, we now want the unique identification of the NPC, the GUID. It's also multiplied by 10.
- point - Incremented for every waypoint you have. It starts at 1.
- positon_x/y/z - The coordinate in x, y and z directions
- orientation - If you want the NPC to turn in a certain direction. i.e. North would be 0, while South would be pi (3.14...).
- delay - If you want to have the NPC wait a bit before moving, you can add a delay in milliseconds (1000 ms = 1 s).
- move_type - How it should move between the points. Maybe you want the NPC to run between two points? 0 = walk, 1 run, 2 = fly.
- action - Maybe you want the create to do something special? Maybe an emote, a spell cast or whatever you desire.
- action_chance - Chance for the action to occur. Uncertain if this refers to the action or the waypoint, but most of the time, it's left at 100 %.
Code: Select all
.npc info - Show information about the creature. You need to retrieve the DB GUID, as you will add that in the SQL for the id field.
Code: Select all
.gps - Show information about the location you're standing at. You need to find the cordinates (x, y, z) that you add to every waypoint. MAKE SURE YOU DON'T TARGET ANYTHING WHEN USING THE COMMAND.
Template
* With this template, you do only have to set NPC_GUID and the X, Y & Z cordinates.
Code: Select all
SET @GUID := NPC_GUID;
SET @PATH := @GUID * 10;
UPDATE `creature` SET `MovementType`=2 WHERE `guid`=@GUID;
DELETE FROM `creature_addon` WHERE `guid`=@GUID;
INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@GUID,@PATH,0,0,1,0, '');
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
(@PATH, 1, X, Y, Z, 0, 0, 0 ,0, 100, 0),
(@PATH, 2, X, Y, Z, 0, 0, 0, 0, 100, 0),
(@PATH, 3, X, Y, Z, 0, 0, 0, 0, 100, 0);
Please feel free to ask questions if you have any. Also, if there's something you feel like is missing or is wrong, let me know!