USE HEALTH POTIONS DURING A BATTLE
This is a small change to show the health
potions you have in your inventory during a battle.
You can use them at any time if you already own them
(it does not counts as a regular TURN)
maybe in the future i change it to counts as a battle turn
and log it into the battle_log....
Edit File:
petz.php
Find this:
Code:
eval('$petzbody = "' . fetch_template('petz_battle') . '";');
Replace it with:
Code:
// <USE HEALTH POTIONS DURING A BATTLE MODIFICATION>
// Show Health Items - PET1
$result_inventory = $DB_site->query("
SELECT * FROM " . TABLE_PREFIX . "petz_inventory WHERE UID='$pet1[OWNER]' AND EQUIP='0'
");
$results = $DB_site->num_rows($result_inventory);
$inventoryitems=$results;
if ($results==0) {
// do nothing
$pet1_items ="No Potions Available";
$pet1_items_guest ="No Potions Available";
} else {$pet1_items = "Available Potions: ";
$pet1_items_guest = "Available Potions: ";
while (
$inventory = $DB_site->fetch_array($result_inventory)) {
$result_youritem = $DB_site->query("
SELECT * FROM " . TABLE_PREFIX . "petz_items WHERE ID='$inventory[IID]'
");
$youritems = $DB_site->fetch_array($result_youritem);
$youritems[NAME]=stripslashes($youritems[NAME]);
if ($youritems[HP]!=0) {
$pet1_items .= " <A href=\"profile.php?do=doitem&id=$inventory[ID]\" target=\"_blank\"><IMG SRC=\"images/petz/items/$youritems[IMG]\" width=16 height=16 border=0 ALT=\"$youritems[NAME]: Cures $youritems[HP] HP\"></A> ";
$pet1_items_guest .= " <IMG SRC=\"images/petz/items/$youritems[IMG]\" width=16 height=16 border=0 ALT=\"$youritems[NAME]: Cures $youritems[HP] HP\"> ";
}
} // end While
}
// Show Health Items - PET2
$result_inventory = $DB_site->query("
SELECT * FROM " . TABLE_PREFIX . "petz_inventory WHERE UID='$pet2[OWNER]' AND EQUIP='0'
");
$results = $DB_site->num_rows($result_inventory);
$inventoryitems=$results;
if ($results==0) {
// do nothing
$pet2_items ="No Potions Available";
$pet2_items_guest ="No Potions Available";
} else {$pet2_items = "Available Potions: ";
$pet2_items_guest = "Available Potions: ";
while ($inventory = $DB_site->fetch_array($result_inventory)) {
$result_youritem = $DB_site->query("
SELECT * FROM " . TABLE_PREFIX . "petz_items WHERE ID='$inventory[IID]'
");
$youritems = $DB_site->fetch_array($result_youritem);
$youritems[NAME]=stripslashes($youritems[NAME]);
if ($youritems[HP]!=0) {
$pet2_items .= " <A href=\"profile.php?do=doitem&id=$inventory[ID]\" target=\"_blank\"><IMG SRC=\"images/petz/items/$youritems[IMG]\" width=16 height=16 border=0 ALT=\"$youritems[NAME]: Cures $youritems[HP] HP\"></A> ";
$pet2_items_guest .= " <IMG SRC=\"images/petz/items/$youritems[IMG]\" width=16 height=16 border=0 ALT=\"$youritems[NAME]: Cures $youritems[HP] HP\"> "; }
} // end While
}
// </USE HEALTH POTIONS DURING A BATTLE MODIFICATION>
eval('$petzbody = "' . fetch_template('petz_battle') . '";');
Edit TEMPLATE:
petz_battle
Find this:
Code:
<if condition="$userid==$pet1[OWNER]">
<small>
<a href="$vboptions[bburl]/petz.php?do=arena&id=2&vb=$vb&op=4" config="Attack" >Surrender</a>
</small>
</if>
Add Below:
Code:
<br>
<small>
<if condition="$userid==$pet1[OWNER]">
$pet1_items
<else />
$pet1_items_guest
</if>
</small>
Then find:
Code:
<if condition="$userid==$pet2[OWNER]">
<small>
<a href="$vboptions[bburl]/petz.php?do=arena&id=2&vb=$vb&op=4" config="Attack" >Surrender</a>
</small>
</if>
add Bellow:
Code:
<br>
<small>
<if condition="$userid==$pet2[OWNER]">
$pet2_items
<else />
$pet2_items_guest
</if>
</small>
You're Done