@ My "mass change old world zone mob" suggestion, I wrote this code: (NOTE: I did this in like an hour? and is likely buggy and I don't think the changes even work yet, but a rough draft)
Code: Select all
<?php
echo "Loading variables... ";
$dbhost="localhost";
$dbname="peq";
$dbuser="root";
$dbpasswd="apasswordhere";
$curzone = 'powater'; //Change this to the shortname of the zone you want to modify. You can visit http://www.eqemulator.net/wiki/wikka.php?wakka=ZoneIDList for a short name list.
$minlevel = 65; //This is the min level of mobs in the zone to search for/change
$maxlevel = 70; //This is the max level of mobs in the zone to search for/change
//These are default values for attributes not specified below per level.
$mob[0]['hp'] = 30000;
$mob[0]['mindmg'] = 500;
$mob[0]['maxdmg'] = 800;
$mob[0]['flags'] = 'SERMCNIDf';
$mob[0]['accuracy'] = 0;
$mob[0]['attackspeed'] = -22;
//level 65 mob stats, based on Councilor Icelok http://thehiddenforest.dyndns.org/npc.php?id=129038
$tmp = 65;
$mob[$tmp]['hp'] = 25000;
$mob[$tmp]['mindmg'] = 400;
$mob[$tmp]['maxdmg'] = 800;
//level 66 mob stats, based on Councilor Deynekn http://thehiddenforest.dyndns.org/npc.php?id=129036
$tmp = 66;
$mob[$tmp]['hp'] = 30000;
$mob[$tmp]['mindmg'] = 500;
$mob[$tmp]['maxdmg'] = 1000;
$mob[$tmp]['flags'] = 'SERMCNIDf';
//level 67 mob stats, based on Councilor Darakor http://thehiddenforest.dyndns.org/npc.php?id=129043
$tmp = 67;
$mob[$tmp]['hp'] = 35000;
$mob[$tmp]['mindmg'] = 600;
$mob[$tmp]['maxdmg'] = 1100;
$mob[$tmp]['flags'] = 'SERMCNIDf';
//level 68 mob stats, using the formula above to base it.
$tmp = 68;
$mob[$tmp]['hp'] = 40000;
$mob[$tmp]['mindmg'] = 700;
$mob[$tmp]['maxdmg'] = 1300;
$mob[$tmp]['flags'] = 'SERMCNIDf';
//level 69 mob stats
$tmp = 69;
$mob[$tmp]['hp'] = 45000;
$mob[$tmp]['mindmg'] = 800;
$mob[$tmp]['maxdmg'] = 1400;
$mob[$tmp]['flags'] = 'SERMCNIDf';
//level 70 mob stats, using elite temple guard http://thehiddenforest.dyndns.org/npc.php?id=162026
$tmp = 70;
$mob[$tmp]['hp'] = 50000;
$mob[$tmp]['mindmg'] = 800;
$mob[$tmp]['maxdmg'] = 1500;
$mob[$tmp]['flags'] = 'SERMCNIDf';
//level 71 mob stats
$tmp = 71;
$mob[$tmp]['hp'] = 52000;
$mob[$tmp]['mindmg'] = 900;
$mob[$tmp]['maxdmg'] = 1600;
$mob[$tmp]['flags'] = 'SERMCNIDf';
//level 72 mob stats, using guardian of zek template
$tmp = 72;
$mob[$tmp]['hp'] = 54000;
$mob[$tmp]['mindmg'] = 800;
$mob[$tmp]['maxdmg'] = 1400;
$mob[$tmp]['flags'] = 'SERMCNIDf';
//level 73 mob stats, using imperial guard http://thehiddenforest.dyndns.org/npc.php?id=162002
$tmp = 73;
$mob[$tmp]['hp'] = 56000;
$mob[$tmp]['mindmg'] = 800;
$mob[$tmp]['maxdmg'] = 1400;
$mob[$tmp]['flags'] = 'SERMCNIDf';
//level 74 mob stats, using guardian of zek template
$tmp = 74;
$mob[$tmp]['hp'] = 58000;
$mob[$tmp]['mindmg'] = 800;
$mob[$tmp]['maxdmg'] = 1400;
$mob[$tmp]['flags'] = 'SERMCNIDf';
//level 75 mob stats, using guardian of zek template
$tmp = 75;
$mob[$tmp]['hp'] = 60000;
$mob[$tmp]['mindmg'] = 800;
$mob[$tmp]['maxdmg'] = 1400;
$mattackspeed[$tmp] = 1400;
$maccuracy[$tmp] = 1400;
$mob[$tmp]['flags'] = 'SERMCNIDf';
echo "<font color='green'>OK!</font><br>\n";
//*SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS LINE!*
$confirm = 0; //this is a var that gets set to 1 if you click link on bottom of report generated.
if (isset($_GET['confirm']) && $_GET['confirm']==1) $confirm = 1;
echo "Database connect... ";
mysql_connect($dbhost,$dbuser,$dbpasswd);
@mysql_select_db($dbname) or die( "Unable to select database.");
echo "<font color='green'>OK!</font><br>\n";
echo "Checking if zone '$curzone' exists.. ";
$query = "SELECT * FROM `zone` WHERE `short_name`='$curzone';";
$result=mysql_query($query);
if (!$result) die("No, it does not exist (".mysql_error().")");
echo "<font color='green'>OK!</font><br>\n";
echo "Generating report...<br>\n";
for ($curlevel = $minlevel; $curlevel <= $maxlevel; $curlevel++)
{
//Clean up non-set variable defaults for current level.
if (!isset($mob[$curlevel]['hp'])) $mob[$curlevel]['hp'] = $mhp[0];
if (!isset($mob[$curlevel]['mindmg'])) $mob[$curlevel]['mindmg'] = $mob[0]['mindmg'];
if (!isset($mob[$curlevel]['maxdmg'])) $mob[$curlevel]['maxdmg'] = $mob[0]['maxdmg'];
if (!isset($mob[$curlevel]['attackspeed'])) $mob[$curlevel]['attackspeed'] = $mob[0]['attackspeed'];
if (!isset($mob[$curlevel]['accuracy'])) $mob[$curlevel]['accuracy'] = $mob[0]['accuracy'];
if (!isset($mob[$curlevel]['flags'])) $mob[$curlevel]['flags'] = $mob[0]['flags'];
//Clean up non-set variables for boss flag (+3 levels)
if (!isset($mob[($curlevel+3)]['hp'])) $mob[($curlevel+3)]['hp'] = $mhp[0];
if (!isset($mob[($curlevel+3)]['mindmg'])) $mob[($curlevel+3)]['mindmg'] = $mob[0]['mindmg'];
if (!isset($mob[($curlevel+3)]['maxdmg'])) $mob[($curlevel+3)]['maxdmg'] = $mob[0]['maxdmg'];
if (!isset($mob[($curlevel+3)]['attackspeed'])) $mob[($curlevel+3)]['attackspeed'] = $mob[0]['attackspeed'];
if (!isset($mob[($curlevel+3)]['accuracy'])) $mob[($curlevel+3)]['accuracy'] = $mob[0]['accuracy'];
if (!isset($mob[($curlevel+3)]['flags'])) $mob[($curlevel+3)]['flags'] = $mob[0]['flags'];
//Do a query on current monsters of zone of X level.
$query = "SELECT DISTINCT n.id, n.name, n.level, n.merchant_id, n.hp, n.mindmg, n.maxdmg, n.npcspecialattks, n.aggroradius, n.accuracy, n.attack_speed
FROM npc_types n
INNER JOIN spawnentry se on n.id = se.npcID
INNER JOIN spawn2 s on se.spawngroupID = s.spawngroupID
WHERE s.zone = '$curzone' AND n.level = $curlevel;"; // AND n.hp < ({$mob[$curlevel]['hp']}+1);";
$result=mysql_query($query);
if (!$result) die("Error on NPC Select Query (".mysql_error().")");
if (mysql_num_rows($result)==0) echo "There are no level $curlevel spawned mobs in $curzone.<br>\n";
else //at least 1 result
{
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{ //Go through each result
if ($row['hp'] < $mob[$curlevel]['hp'])
{ //If mob has less HP than
$tmplevel = $curlevel;
$newhp = $mob[$tmplevel]['hp']; //Set new HP to the HP of template, it's greater than mob's HP.
}
else
{ //Mob has more HP than our template.. Likely boss? Use 3+ levels.
echo "(BOSS?) ";
$tmplevel = $curlevel+3; //Use +3 level template for comparisons.
if ($row['hp'] < $mob[$tmplevel]['hp']) $newhp = $mob[$tmplevel]['hp']; //If template level + 3 has more HP, set it to that.
else $newhp = $row['hp']; //Otherwise, keep the mob's HP.
}
//Now go through, if our template has greater values, use that data, otherwise keep original mob data.
if ($row['mindmg'] > $mob[$tmplevel]['mindmg']) $newmindmg = $row['mindmg'];
else $newmindmg = $mob[$tmplevel]['mindmg'];
if ($row['maxdmg'] > $mob[$tmplevel]['maxdmg']) $newmaxdmg = $row['maxdmg'];
else $newmaxdmg = $mob[$tmplevel]['maxdmg'];
if ($row['accuracy'] > $mob[$tmplevel]['accuracy']) $newaccuracy = $row['accuracy'];
else $newaccuracy = $mob[$tmplevel]['accuracy'];
if ($row['attack_speed'] > $mob[$tmplevel]['attackspeed']) $newattackspeed = $row['attack_speed'];
else $newattackspeed = $mob[$tmplevel]['attackspeed'];
echo "Level {$row['level']} {$row['name']} ({$row['id']}) will be changed, HP: {$row['hp']} -> $newhp, MinDMG: {$row['mindmg']} -> $newmindmg, MaxDMG: {$row['maxdmg']} -> $newmaxdmg, Accuracy: {$row['accuracy']} -> $newaccuracy, Attack Speed: {$row['attack_speed']} -> $newattackspeed <br>\n";
if ($confirm)
{ // Do the changes!
$query = "UPDATE `npc_types` SET hp = '$newhp', mindmg = '$newmindmg', maxdmg = '$newmaxdmg', accuracy = '$newaccuracy', attackspeed = '$newattackspeed' WHERE id = '{$row['id']}';";
$result=mysql_query($query);
if (!$result) echo ("Error on NPC UPDATE Query ($query), Error: ".mysql_error()."");
}
} //end while $row
} //end else numresults
} //end curlevel loop
echo "<font color='red'>Review the above modifications and click <a href='./zoneconvert.php?confirm=1'>DO THE CHANGES</a> to have them apply.</font><br>\n";
It spits out something like this:
Loading variables... OK!
Database connect... OK!
Checking if zone 'powater' exists.. OK!
Generating report...
Level 65 a_great_white_shark (216000) will be changed, HP: 15248 -> 25000, MinDMG: 345 -> 400, MaxDMG: 654 -> 800, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 65 a_large_hammerhead_shark (216031) will be changed, HP: 17528 -> 25000, MinDMG: 345 -> 400, MaxDMG: 654 -> 800, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 65 a_triloun_gatherer (216001) will be changed, HP: 19808 -> 25000, MinDMG: 345 -> 400, MaxDMG: 654 -> 800, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 65 a_triloun_keeper (216012) will be changed, HP: 19808 -> 25000, MinDMG: 345 -> 400, MaxDMG: 654 -> 800, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 65 a_triloun_diviner (216017) will be changed, HP: 19808 -> 25000, MinDMG: 345 -> 400, MaxDMG: 654 -> 800, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 65 a_greater_swordfish (216013) will be changed, HP: 18668 -> 25000, MinDMG: 345 -> 400, MaxDMG: 654 -> 800, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 65 a_greater_barracuda (216018) will be changed, HP: 17528 -> 25000, MinDMG: 345 -> 400, MaxDMG: 654 -> 800, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 65 a_greater_pirahna (216025) will be changed, HP: 16388 -> 25000, MinDMG: 345 -> 400, MaxDMG: 654 -> 800, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 65 a_greater_sea_turtle (216026) will be changed, HP: 17528 -> 25000, MinDMG: 345 -> 400, MaxDMG: 654 -> 800, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 65 a_greater_frog (216032) will be changed, HP: 17528 -> 25000, MinDMG: 345 -> 400, MaxDMG: 654 -> 800, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 65 a_triloun_champion (216002) will be changed, HP: 19808 -> 25000, MinDMG: 345 -> 400, MaxDMG: 654 -> 800, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 66 a_deepwater_kraken (216023) will be changed, HP: 16548 -> 30000, MinDMG: 345 -> 500, MaxDMG: 654 -> 1000, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 66 an_anglerfish (216024) will be changed, HP: 18828 -> 30000, MinDMG: 345 -> 500, MaxDMG: 654 -> 1000, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 67 a_greater_deepwater_kraken (216003) will be changed, HP: 18991 -> 35000, MinDMG: 450 -> 600, MaxDMG: 1103 -> 1103, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 67 a_greater_anglerfish (216011) will be changed, HP: 17851 -> 35000, MinDMG: 450 -> 600, MaxDMG: 1103 -> 1103, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 67 a_regrua_guardian (216005) will be changed, HP: 30391 -> 35000, MinDMG: 450 -> 600, MaxDMG: 1103 -> 1103, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 68 a_hraquis_mystic (216007) will be changed, HP: 27137 -> 40000, MinDMG: 450 -> 700, MaxDMG: 1103 -> 1300, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 68 a_hraquis_hunter (216008) will be changed, HP: 24857 -> 40000, MinDMG: 450 -> 700, MaxDMG: 1103 -> 1300, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 68 a_hraquis_magus (216009) will be changed, HP: 25997 -> 40000, MinDMG: 450 -> 700, MaxDMG: 1103 -> 1300, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 68 a_hraquis_scout (216010) will be changed, HP: 24857 -> 40000, MinDMG: 450 -> 700, MaxDMG: 1103 -> 1300, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 68 a_hraquis_faith_warden (216022) will be changed, HP: 30557 -> 40000, MinDMG: 450 -> 700, MaxDMG: 1103 -> 1300, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 68 a_regrua_sentry (216004) will be changed, HP: 30557 -> 40000, MinDMG: 450 -> 700, MaxDMG: 1103 -> 1300, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 68 a_regrua_defender (216006) will be changed, HP: 30557 -> 40000, MinDMG: 450 -> 700, MaxDMG: 1103 -> 1300, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
(BOSS?) Level 68 Frenzied_Anglerfish (216092) will be changed, HP: 52190 -> 52190, MinDMG: 450 -> 900, MaxDMG: 1103 -> 1600, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
(BOSS?) Level 68 Gigadon (216037) will be changed, HP: 53357 -> 53357, MinDMG: 450 -> 900, MaxDMG: 1103 -> 1600, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
(BOSS?) Level 68 Razorfin (216056) will be changed, HP: 64410 -> 64410, MinDMG: 450 -> 900, MaxDMG: 1103 -> 1600, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
(BOSS?) Level 68 Hammertooth (216095) will be changed, HP: 55774 -> 55774, MinDMG: 450 -> 900, MaxDMG: 1103 -> 1600, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
(BOSS?) Level 68 An_Enormous_Frog (216093) will be changed, HP: 66034 -> 66034, MinDMG: 450 -> 900, MaxDMG: 1103 -> 1600, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
(BOSS?) Level 68 Monstrous_Sea_Turtle (216038) will be changed, HP: 65897 -> 65897, MinDMG: 450 -> 900, MaxDMG: 1103 -> 1600, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
Level 68 Ferocious_Barracuda (216091) will be changed, HP: 38975 -> 40000, MinDMG: 450 -> 700, MaxDMG: 1103 -> 1300, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
(BOSS?) Level 68 Swordfang (216050) will be changed, HP: 70457 -> 70457, MinDMG: 450 -> 900, MaxDMG: 1103 -> 1600, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
(BOSS?) Level 68 Triloun_Egg_Keeper (216051) will be changed, HP: 64757 -> 64757, MinDMG: 450 -> 900, MaxDMG: 1103 -> 1600, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
(BOSS?) Level 68 Regrua_Protector (216097) will be changed, HP: 96845 -> 96845, MinDMG: 450 -> 900, MaxDMG: 1103 -> 1600, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
There are no level 69 spawned mobs in powater.
(BOSS?) Level 70 an_ancient_regrua_sentinel (216021) will be changed, HP: 100000 -> 100000, MinDMG: 689 -> 800, MaxDMG: 2000 -> 2000, Accuracy: 0 -> 0, Attack Speed: -25 -> -22
(BOSS?) Level 70 #Guardian_of_Coirnav (216049) will be changed, HP: 92000 -> 92000, MinDMG: 734 -> 800, MaxDMG: 1402 -> 1402, Accuracy: 0 -> 0, Attack Speed: -25 -> -22
(BOSS?) Level 70 Hraquis_Chieftain (216045) will be changed, HP: 77064 -> 77064, MinDMG: 494 -> 800, MaxDMG: 1059 -> 1400, Accuracy: 0 -> 0, Attack Speed: -25 -> -22
(BOSS?) Level 70 Hraquis_Arch_Magus (216096) will be changed, HP: 74315 -> 74315, MinDMG: 655 -> 800, MaxDMG: 1249 -> 1400, Accuracy: 0 -> 0, Attack Speed: -22 -> -22
(BOSS?) Level 70 Savage_Deepwater_Kraken (216054) will be changed, HP: 65664 -> 65664, MinDMG: 574 -> 800, MaxDMG: 1095 -> 1400, Accuracy: 0 -> 0, Attack Speed: -25 -> -22
(BOSS?) Level 70 Triloun_Warder (216098) will be changed, HP: 96816 -> 96816, MinDMG: 781 -> 800, MaxDMG: 1204 -> 1400, Accuracy: 0 -> 0, Attack Speed: -24 -> -22
Level 70 Furious_Deepwater_Kraken (216075) will be changed, HP: 47880 -> 50000, MinDMG: 457 -> 800, MaxDMG: 892 -> 1500, Accuracy: 0 -> 0, Attack Speed: -25 -> -22
(BOSS?) Level 70 Regrua_Overlord (216053) will be changed, HP: 122664 -> 122664, MinDMG: 836 -> 836, MaxDMG: 1356 -> 1400, Accuracy: 0 -> 0, Attack Speed: -25 -> -22
Review the above modifications and click DO THE CHANGES to have them apply.
It shows a "before -> after" of what's being modified, and does a basic check to see if the mob is potentially a boss, and increasing stats to +3 the level of the mob in that case of the template (while retaining the original level).
I can add to it to modify more stats as you want, or check for more conditions to determine to change a value or not, but considering how much it streamlines tweaking previous mobs I think it's pretty handy for at least getting them reopened for grinding.