Version: , by Cyricx
Developer Last Online: Dec 2011
Version: Unknown
Rating:
Released: 02-16-2005
Last Update: Never
Installs: 0
No support by the author.
I've got a problem that I think is a bug due to everything else going perfect for the install.
Basically, if you make like certain armor or weapons usable by only one class type.
Someone can edit their character to that class, buy those items and then change their class to whatever else they want and they will still keep the items.
For example, if you made a plate armor that only warriors could use and mages could only use robes.
The mage player could edit their character to a warrior, buy the plate armor and then edit their character back to a mage and they'd keep the plate armor on :dead:
I haven't seen anything about this posted except for one person that hinted at having found a major bug but hasn't seen a thread about it.
Thinking this is the one he was referring too...
Any ideas on how to fix it?
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Armor (please note the difference between Armor and Shield type) are currently not being prohibited, yes.
The fix is hassle to test, so I didn't, but you feel free to test it for me.
File: battleupdate.php
Find (BOTH instances of):
PHP Code:
rpgrace,
Add BELOW:
PHP Code:
rpgtype,
Find:
PHP Code:
$defense = $DB_site->query_first("SELECT damage FROM " . TABLE_PREFIX . "rpg_items WHERE itemid='$opparmor[id]'");
if ($defense['damage'] > 0)
{
$armor = $armor + $defense['damage'];
}
Replace with:
PHP Code:
$defense = $DB_site->query_first("SELECT damage, type FROM " . TABLE_PREFIX . "rpg_items WHERE itemid='$opparmor[id]'");
if ($defense['damage'] > 0)
{
$opparmortype = explode(' ', $defense['type']);
if (in_array($opponent['rpgtype'], $opparmortype))
{
$armor = $armor + $defense['damage'];
}
}
IMPORTANT: To test this fix, do the following BEFORE doing the above:
Set $battledebug to 1 in battleupdate.php
Make yourself have armor your not supposed to have
Let both combatants have weapons they ARE supposed to have
Let your opponent attack you (thus having your illegal armor reduce the damage
Note down the second last Debug Variable under Damage Done
Apply the fix
Upload the file
Let your opponent attack you (thus in theory having the armor not count)
Compare the second last Debug Variable under Damage Done to the value you saw before
If the fix worked, the Armor should have no effect.
PS: I will add an error message like the "your weapon is for a different class" in v3.
Goddamit!
Ok guess I have tomorrow's work cut out for me then
I'll either edit this post or make a new reply
because Im gonna fuggen do this even if it's the last thing I do!