From 8fc07d443acb86ca436caa05b435c86ea6e9071d Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 11 May 2009 13:27:10 -0500 Subject: *Change waypoint data structure. Use creature db guid as path id. If a creature uses waypoint movement as default movement type, the path id should be DBGUID*10. For paths of script use, the path id should be DBGUID*10+1 ~ DBGUID*10+9. *Two sql queries are included. Converter is used to convert the existing path id to new path id. "...creature_add..." is used to change table structure. You can first run the converter, then run the other one. Or run the other one directly and get the new data from the db team. Because it may take hours to run the converter. *If you have custom data, you may need to run the converter. We suggest you use console to run it It is extremely slow to run the query. If you have multiple paths for a creature in your db, you need to do more work to convert it. However, if you know how to use multiple paths, you should already have more db knowledge than I do and you should know how to convert it. *There may be a faster query to convert the db. If you know, please tell us. I am no sql expert. *Backup your db first! *Thanks to X-Savior and subhuman_bob. --HG-- branch : trunk --- sql/updates/3257_world_creature_addon_(waypoint).sql | 2 ++ sql/updates/3257_world_waypoint_data_converter.sql | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 sql/updates/3257_world_creature_addon_(waypoint).sql create mode 100644 sql/updates/3257_world_waypoint_data_converter.sql (limited to 'sql') diff --git a/sql/updates/3257_world_creature_addon_(waypoint).sql b/sql/updates/3257_world_creature_addon_(waypoint).sql new file mode 100644 index 00000000000..1398baf1ccd --- /dev/null +++ b/sql/updates/3257_world_creature_addon_(waypoint).sql @@ -0,0 +1,2 @@ +ALTER TABLE creature_template_addon DROP COLUMN path_id; +ALTER TABLE creature_addon DROP COLUMN path_id; \ No newline at end of file diff --git a/sql/updates/3257_world_waypoint_data_converter.sql b/sql/updates/3257_world_waypoint_data_converter.sql new file mode 100644 index 00000000000..3533f948747 --- /dev/null +++ b/sql/updates/3257_world_waypoint_data_converter.sql @@ -0,0 +1,6 @@ +ALTER TABLE waypoint_data ADD COLUMN id_old int(10) unsigned NOT NULL default '0' COMMENT 'Creature GUID' AFTER wpguid; +UPDATE waypoint_data SET id_old=id; +UPDATE waypoint_data,creature_addon SET waypoint_data.id=creature_addon.guid*10 WHERE creature_addon.path_id > 0 AND creature_addon.path_id=waypoint_data.id_old; +UPDATE waypoint_data SET id = 1343801 WHERE id_old = 2084; +UPDATE waypoint_scripts SET datalong = 1343801 WHERE id = 515; +ALTER TABLE waypoint_data DROP COLUMN id_old; \ No newline at end of file -- cgit v1.2.3