View Single Post
  #8  
Old 06-06-2005, 10:15 PM
xmorpher's Avatar
xmorpher xmorpher is offline
 
Join Date: Feb 2004
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02256 seconds
  • Memory Usage 1,784KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete