PDA

View Full Version : I wrecked pets... oops


bodi
09-30-2011, 09:17 PM
I was scaling my mobs hp/ac and stuff down and used the ... WHERE level > 50, so it debuffed all my mobs but now my pets are weak as shit. How can i fix it so that pet AC/HP stats are normal but mobs are weak. And now... after the fact, how can i fix it? I heard all pets are MOBID < 1000, but im not sure how to code it directly for them. Any help is appreciated.

Bodhi!

lerxst2112
09-30-2011, 10:25 PM
What is the exact query you used to change everything?

The easiest way to fix it is probably to drop that table and source it again then scale it more carefully.

bodi
10-01-2011, 09:00 AM
I used SET npc_types hp = level * 10 where level < 50

You can source in a single table? I have over 200 chars created on the server in 4 days , so I dont wanna wipe everyone.

Thanks for any help

lerxst2112
10-01-2011, 04:45 PM
Yes, you would need to open the large database file in something like Notepad++, find the statements you're interested in, save those into a different file, drop the existing table, then source that new file.

Since you used an absolute value like that instead of something like 25% of the original there's not really a formula that will get you back to how it was before you ran the query.

To do the same thing while excluding pets you could do something like:

SET npc_types hp = level * 10 where level < 50 && id NOT IN (SELECT npcid FROM pets);

Or, if you just wanted to try changing pets to a different multiplier, something like:

SET npc_types hp = level * 50 where level < 50 && id IN (SELECT npcid FROM pets);

As always, make backups, and run your queries with a select first to make sure you're going to hit the right rows.

Rhodan
10-01-2011, 05:31 PM
Don't forget that you can always source the default database into a different database on your machine. If you're "live" database is "peq" then create another database with "peqoffline". Once that's done and you've done all the updates etc you can do a dump and save an untouched but up to date database for emergencies.

Once that is done you can dump the untouched npc_types table, delete the npc_types from your live database then source in the untouched npc_types table.

Before I start making changes to a table I usually dump the table to disk. I also write every query into a text file so if I've done twenty changes then mess up all I have to do is drop the broken table, source in the untouched backup, then source in the text file with the successful queries to get back to where I was before I messed up. Total time lost is at most 5 minutes.

bodi
10-01-2011, 10:27 PM
what command would you use to set mob hp at 50% instead of set to level x5?
It would be nice to be able to just drop it by 25% or 50% of live but i didnt know the syntax

bodi
10-01-2011, 10:29 PM
I think the easiest thing to do is to source the original EQ mobs, then re-nerf them to 1/3 without affecting pets...

now if i only knew how to do that!
thanks for your wisdom so far!

lerxst2112
10-01-2011, 11:02 PM
hp = hp * .5

bodi
10-01-2011, 11:17 PM
ahh, i like it. so how would i reset the DB without losing characters on the server? mysql use peq source what...

Rhodan
10-02-2011, 04:35 PM
Start by setting up a new database but use a different name. Follow the same instructions you used to set up the original database just use something like "create database peqoffline;" then "use peqoffline;"

Once you've sourced in the database and updates you can dump the unmodified database to disk as a backup. from an MSDOS prompt you can type

c:/>mysqldump -uyourusername -pyourpassword peqoffline >pequnmodified.sql

That gives you an up to date copy that you can source in later (if needed) without having to apply all the updates again.

Next dump just the npc_types table so if you mess up you can drop npc_types table and source the table back in without having to do the entire database.

c:/>mysqldump -uyourusername -pyourpassword peqoffline npc_types >pequnmodified.sql


Now you can drop the second database since you have the sql files.

from a mysql console

drop database peqoffline;

now go to your main database and make a backup of that in case something goes horribly wrong. Use the same mysqldump command as above just change the database name.

Once that is done, drop the npc_types table from the mysql command prompt

drop table npc_types;

source in the unmodified table you dumped earlier.

source npctypes.sql;

THen everything should be back to the default NPCs and you can experiment away knowing you have an unmodified table backup in case anything goes wrong.

bodi
10-03-2011, 11:40 AM
you are a fucking genius...