Ok..here's a better start.
I use HeidiSQL, but I imagine Navicat has a similar feature.
Open Notepad directly, don't create a new text file and open it.
Click save and name this something like MobFix.sql - anything is fine as long as you use the .sql extension
(I'll speak from using HeidiSQL since that's what I'm working from.)
Goto the first table in the backup database that you want info from. Select all of the affected rows that you want to copy. Usually click the first, then scrolling down to the last and then, holding <shift>, click again, will select the entire series between. You may have to sort by the 'zone' field so the data is continuous.
Richt-click somewhere inside the selected region and select -> Copy Data -> Copy selected rows as SQL.
This will copy all of the selected data to the clipboard parsed into an SQL format.
Now, paste this into the Notepad file that you created. Press <enter> twice to put a separator in.
Now, repeat this for the other tables that you want info from..don't forget the spacer lines between pastes.
Once you get all of the tables' information, save it, and make a backup copy because we're going to make some changes to it and the back-up will save us if we make a mistake that we can't fix.
This should be all of the needed info. Before you source this in, there are a lot of changes that need to be made.
If you notice, the beginning of each statement begins with 'INSERT.' If you insert this into your game database, you will either create an entire new row of duplicate entries (possibly messing up any key-references), or you will get an error saying that the row already exists.
We're going to have to change this for each row, and for each table. Don't fret though, Notepad is simple, but its replace function works just fine.
I have to log for the night..got a storm coming in... If anyone can help on changing this from an insert to an update, please feel free to do so. Here's an example of a 'Spawn2' entry:
INSERT INTO `spawn2` (`id`, `spawngroupID`, `zone`, `version`, `x`, `y`, `z`, `heading`, `respawntime`, `variance`, `pathgrid`, `_condition`, `cond_value`, `enabled`, `animation`) VALUES (1, 541, 'crushbone', 0, 387.000000, 3.000000, -13.750000, 158.000000, 640, 64, 0, 0, 1, 1, 0);
We need a replace 'this' with 'that' type fix so the entire file can be easily updated and used to fix a zone's mob/npc tables. (i.e., replace 'INSERT' with 'UPDATE', though that won't work.)
Thanks!
|