Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[PetzVB v2] Improving PetzVB v2... (battle options and more!) Details »»
[PetzVB v2] Improving PetzVB v2... (battle options and more!)
Version: 1.00, by xmorpher xmorpher is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 05-26-2005 Last Update: Never Installs: 5
 
No support by the author.

IMPROVING BATTLES

I modified my petzVB to not increase the stats (HP, MHP, STR, DEF, AGI)
when you level up....
That way, your pet changes "phisically" (graphically)
but the stats stays fixed.

I did that change, because i had many users complaining about:
- Petz with higher levels killing weaker petz in just one attack
- Stronger Petz accepting challenges of weaker petz
- Stronger pets does not have opponents to challenge
(because with a small difference of 2-3 levels the battle is unbalanced)

Now,
- the new users can battle old users,
- the battles are more balanced and the number of
- active battles grew up a lot...
- the batlles resides on strategy and not on your level

FIXED STATS TO BALANCE BATTLES

If you want to make this change, find in petz.php:
Code:
// Level Up Petz Stats
	 $pet1[MHP]=$pet1[MHP]+$increase[MHP];
	 $pet1[STR]=$pet1[STR]+$increase[STR];
	 $pet1[DEF]=$pet1[DEF]+$increase[DEF];
	 $pet1[AGI]=$pet1[AGI]+$increase[AGI];
	 $pet1[EXP]=0;
	 // Store The Changes
	 $DB_site->query("
	 UPDATE " . TABLE_PREFIX . "petz_petz SET MHP='$pet1[MHP]' WHERE ID='$pet1[ID]'
	 ");
	 $DB_site->query("
	 UPDATE " . TABLE_PREFIX . "petz_petz SET STR='$pet1[STR]' WHERE ID='$pet1[ID]'
	 ");
	 $DB_site->query("
	 UPDATE " . TABLE_PREFIX . "petz_petz SET DEF='$pet1[DEF]' WHERE ID='$pet1[ID]'
	 ");
	 $DB_site->query("
	 UPDATE " . TABLE_PREFIX . "petz_petz SET AGI='$pet1[AGI]' WHERE ID='$pet1[ID]'
	 ");
and replace it with:
Code:
// Level Up Petz Stats
	 //$pet1[MHP]=$pet1[MHP]+$increase[MHP];
	 //$pet1[STR]=$pet1[STR]+$increase[STR];
	 //$pet1[DEF]=$pet1[DEF]+$increase[DEF];
	 //$pet1[AGI]=$pet1[AGI]+$increase[AGI];
	 $pet1[EXP]=0;
	 // Store The Changes
	 //$DB_site->query("
	 //UPDATE " . TABLE_PREFIX . "petz_petz SET MHP='$pet1[MHP]' WHERE ID='$pet1[ID]'
	 //");
	 //$DB_site->query("
	 //UPDATE " . TABLE_PREFIX . "petz_petz SET STR='$pet1[STR]' WHERE ID='$pet1[ID]'
	 //");
	 //$DB_site->query("
	 //UPDATE " . TABLE_PREFIX . "petz_petz SET DEF='$pet1[DEF]' WHERE ID='$pet1[ID]'
	 //");
	 //$DB_site->query("
	 //UPDATE " . TABLE_PREFIX . "petz_petz SET AGI='$pet1[AGI]' WHERE ID='$pet1[ID]'
	 //");
Then find:
Code:
// Level Up Petz Stats
	 $pet2[MHP]=$pet2[MHP]+$increase[MHP];
	 $pet2[STR]=$pet2[STR]+$increase[STR];
	 $pet2[DEF]=$pet2[DEF]+$increase[DEF];
	 $pet2[AGI]=$pet2[AGI]+$increase[AGI];
	 $pet2[EXP]=0;
	 // Store The Changes
	 $DB_site->query("
	 UPDATE " . TABLE_PREFIX . "petz_petz SET MHP='$pet2[MHP]' WHERE ID='$pet2[ID]'
	 ");
	 $DB_site->query("
	 UPDATE " . TABLE_PREFIX . "petz_petz SET STR='$pet2[STR]' WHERE ID='$pet2[ID]'
	 ");
	 $DB_site->query("
	 UPDATE " . TABLE_PREFIX . "petz_petz SET DEF='$pet2[DEF]' WHERE ID='$pet2[ID]'
	 ");
	 $DB_site->query("
	 UPDATE " . TABLE_PREFIX . "petz_petz SET AGI='$pet2[AGI]' WHERE ID='$pet2[ID]'
	 ");
and replace it with:
Code:
// Level Up Petz Stats
	 //$pet2[MHP]=$pet2[MHP]+$increase[MHP];
	 //$pet2[STR]=$pet2[STR]+$increase[STR];
	 //$pet2[DEF]=$pet2[DEF]+$increase[DEF];
	 //$pet2[AGI]=$pet2[AGI]+$increase[AGI];
	 $pet2[EXP]=0;
	 // Store The Changes
	 //$DB_site->query("
	 //UPDATE " . TABLE_PREFIX . "petz_petz SET MHP='$pet2[MHP]' WHERE ID='$pet2[ID]'
	 //");
	 //$DB_site->query("
	 //UPDATE " . TABLE_PREFIX . "petz_petz SET STR='$pet2[STR]' WHERE ID='$pet2[ID]'
	 //");
	 //$DB_site->query("
	 //UPDATE " . TABLE_PREFIX . "petz_petz SET DEF='$pet2[DEF]' WHERE ID='$pet2[ID]'
	 //");
	 //$DB_site->query("
	 //UPDATE " . TABLE_PREFIX . "petz_petz SET AGI='$pet2[AGI]' WHERE ID='$pet2[ID]'
	 //");
i also made the following changes:
- Set the default max HP = 150
Run the following Sql query in your database:
Code:
UPDATE `petz_petz` SET HP='150' WHERE 1;
UPDATE `petz_petz` SET MHP='150' WHERE 1;
- Balance better the pets, this way: STR+DEF+AGI=100
Dog-> (STR:40) + (DEF:30) + (AGI:30) = 100
Cat-> (STR:40) + (DEF:20) + (AGI:40) = 100
Snail-> (STR:15) + (DEF:60) + (AGI:25) = 100
Turtle-> (STR:20) + (DEF:70) + (AGI:10) = 100
Spider-> (STR:50) + (DEF:10) + (AGI:40) = 100
Run the following Sql queries in your database to reset the pet's stats:
Code:
UPDATE `petz_petz` SET STR='40' WHERE type='1';
UPDATE `petz_petz` SET DEF='30' WHERE type='1';
UPDATE `petz_petz` SET AGI='30' WHERE type='1';
 
UPDATE `petz_petz` SET STR='40' WHERE type='2';
UPDATE `petz_petz` SET DEF='20' WHERE type='2';
UPDATE `petz_petz` SET AGI='40' WHERE type='2';
 
UPDATE `petz_petz` SET STR='35' WHERE type='3';
UPDATE `petz_petz` SET DEF='40' WHERE type='3';
UPDATE `petz_petz` SET AGI='25' WHERE type='3';
 
UPDATE `petz_petz` SET STR='40' WHERE type='4';
UPDATE `petz_petz` SET DEF='40' WHERE type='4';
UPDATE `petz_petz` SET AGI='20' WHERE type='4';
 
UPDATE `petz_petz` SET STR='50' WHERE type='5';
UPDATE `petz_petz` SET DEF='10' WHERE type='5';
UPDATE `petz_petz` SET AGI='40' WHERE type='5';
RESET WIN/LOSS STATS
If you want to Reset the Win/Loss Stats, run this sql query:
Code:
UPDATE `petz_petz` SET LOSS='0' WHERE 1;
UPDATE `petz_petz` SET WIMPS='0' WHERE 1;
UPDATE `petz_petz` SET WINS='0' WHERE 1;
UNEQUIP ITEMS
If you modified the 'Str,Def,Agi' Stats, then you need to unequip
the items so they can change the new stats correctly.
just run this sql query:
Code:
UPDATE `petz_inventory` SET EQUIP='0' WHERE 1;
Finally, i would advise you, to not selling items that change
the 'MHP, Str, Def, Agi' Stats permanently,
but making those items equipmentables

That's it. The battles are now more balanced
and resides more on strategy than your level

Good Luck

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-28-2005, 12:45 AM
yinyang's Avatar
yinyang yinyang is offline
 
Join Date: May 2004
Location: Los Angeles
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

would it be possible for you to contact the originator and see if you can take over the hack? this hack was super popular on my boards once, but due to lack of updates and support, i took it down when i upgraded to 3.0.7.

since you've been doing some awesome addons and your ideas are exactly what this hack needs, it'd be cool if you can rerelease it.
Reply With Quote
  #3  
Old 05-28-2005, 05:38 PM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

seriously... i am with yinyang
Reply With Quote
  #4  
Old 05-29-2005, 01:21 AM
xmorpher's Avatar
xmorpher xmorpher is offline
 
Join Date: Feb 2004
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yinyang
would it be possible for you to contact the originator and see if you can take over the hack? this hack was super popular on my boards once, but due to lack of updates and support, i took it down when i upgraded to 3.0.7.

since you've been doing some awesome addons and your ideas are exactly what this hack needs, it'd be cool if you can rerelease it.
thanks, but i don't have the time to handle updates and support right now,
and besides, that it would not be fair with the original author of the hack.

However, i will share all the modifications, bug-fixes or tips that i think
that others can find useful...

for example, i'm trying to make these changes:
- Gain EXP (to Level-up) when Feeding your pet [since many active users enjoy taking care of their pets but does not likes to fight in the arena]
- Gain EXP when playing with other pets
- Use (healing) objects during battles
Reply With Quote
  #5  
Old 05-29-2005, 01:32 AM
xmorpher's Avatar
xmorpher xmorpher is offline
 
Join Date: Feb 2004
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

INFINITE EXPERIENCE BUG
There's a "bug" in the petz hack:
- If you are in the arena , copy the shorcut of the "ATTACK" action
- If you visit that link, it does not matters if is not your turn,
you can attack
- When it's not your turn, you can fail the attack BUT (and here's the bug) you gain Experience, so
If you are in a battle you can gain enough experience to raise many levels

I fixed that by doing this: (not increasing the EXP when the attack is 0)
File: petz.php

Find this code:
PHP Code:
$addexp=$battle[TURN]+$pet2[LVL]+3;
        
$pet1[EXP]=$pet1[EXP]+$addexp;
        if (
$pet1[EXP]>100) { $pet1[EXP]=100; } 
Replace it with:
PHP Code:
//$addexp=$battle[TURN]+$pet2[LVL]+3;
        //$pet1[EXP]=$pet1[EXP]+$addexp;
        
if ($pet1[EXP]>100) { $pet1[EXP]=100; } 
Then find this:
PHP Code:
$addexp=$battle[TURN]+$pet1[LVL]+3;
        
$pet2[EXP]=$pet2[EXP]+$addexp;
        if (
$pet2[EXP]>100) { $pet2[EXP]=100; } 
and replace it with:
PHP Code:
//$addexp=$battle[TURN]+$pet1[LVL]+3;
        //$pet2[EXP]=$pet2[EXP]+$addexp;
        
if ($pet2[EXP]>100) { $pet2[EXP]=100; } 
that's all
Reply With Quote
  #6  
Old 05-29-2005, 07:35 AM
xmorpher's Avatar
xmorpher xmorpher is offline
 
Join Date: Feb 2004
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Gain EXP (to Level-up) when Feeding your pet
[i made this since many active users enjoy taking care
of their pets but does not likes to fight in the arena]

edit the file: /forum/profile.php

find the code:
Code:
$DB_site->query("
	 DELETE FROM " . TABLE_PREFIX . "petz_inventory WHERE ID='$itemid'
	 ");
add below:
Code:
// <GAIN EXP> 
	if (abs($theitem[HNG]) >0) { $myaddexp= abs($theitem[HNG]/4.5) + rand(0,9); 
		 $myaddexp= round($myaddexp,0);		 
		 $petz[EXP]=$petz[EXP]+$myaddexp;
 
	 // Do The Levelling UP
	 if ($petz[EXP] >= 100) {
	 if ($petz[LVL]!=100) { $petz[LVL]=$petz[LVL]+1; }	 
	 $petz[EXP]=0;			
	 $DB_site->query("UPDATE " . TABLE_PREFIX . "petz_petz SET LVL='$petz[LVL]' WHERE ID='$petz[ID]'");
	 }
	 $DB_site->query("UPDATE " . TABLE_PREFIX . "petz_petz SET EXP='$petz[EXP]' WHERE ID='$petz[ID]'");	 
	} 
	 // </GAIN EXP>
easy...
Reply With Quote
  #7  
Old 06-02-2005, 05:11 PM
xmorpher's Avatar
xmorpher xmorpher is offline
 
Join Date: Feb 2004
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

there is another "Cheat"....
- If you have Health potions in your inventory purchased before a battle,
you can enter to your inventory (during a battle)
and use the health potions whenever you want...

Suggestion:
if this is possible, it should be possible to show the attack option:
"Use potion" if there's any present in your inventory... that would be nice/usefull
Reply With Quote
  #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
  #9  
Old 08-04-2005, 08:21 PM
Yukino_AE Yukino_AE is offline
 
Join Date: Jul 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

seriously. you are my hero. ^_^

you have so many cool ideas.

here's my question... is there any way you can pet your own pet?
Reply With Quote
  #10  
Old 08-05-2005, 03:08 AM
xmorpher's Avatar
xmorpher xmorpher is offline
 
Join Date: Feb 2004
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not directly....
but you can do this:
Create a shop item that increases the pleasure of the pet (1 or 2 points)
then edit the database and change the price to 1 or something cheap...
you can call it "play with your pet" or whatever you want
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:35 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04569 seconds
  • Memory Usage 2,339KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (16)bbcode_code
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete