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):
Add BELOW:
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.
Thanks for helping me make this hack better
//peace