PDA

View Full Version : [PetzVB v2] Improving PetzVB v2... (battle options and more!)


xmorpher
05-26-2005, 10:00 PM
IMPROVING BATTLES

I modified my petzVB (https://vborg.vbsupport.ru/showthread.php?t=64058&highlight=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:
// 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:
// 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:
// 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:
// 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:
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:

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:
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:
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
:)

yinyang
05-28-2005, 12:45 AM
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.

Osterling
05-28-2005, 05:38 PM
seriously... i am with yinyang

xmorpher
05-29-2005, 01:21 AM
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

xmorpher
05-29-2005, 01:32 AM
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:
$addexp=$battle[TURN]+$pet2[LVL]+3;
$pet1[EXP]=$pet1[EXP]+$addexp;
if ($pet1[EXP]>100) { $pet1[EXP]=100; }
Replace it with:
//$addexp=$battle[TURN]+$pet2[LVL]+3;
//$pet1[EXP]=$pet1[EXP]+$addexp;
if ($pet1[EXP]>100) { $pet1[EXP]=100; }
Then find this:
$addexp=$battle[TURN]+$pet1[LVL]+3;
$pet2[EXP]=$pet2[EXP]+$addexp;
if ($pet2[EXP]>100) { $pet2[EXP]=100; }
and replace it with:
//$addexp=$battle[TURN]+$pet1[LVL]+3;
//$pet2[EXP]=$pet2[EXP]+$addexp;
if ($pet2[EXP]>100) { $pet2[EXP]=100; }
that's all
:)

xmorpher
05-29-2005, 07:35 AM
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:
$DB_site->query("
DELETE FROM " . TABLE_PREFIX . "petz_inventory WHERE ID='$itemid'
");
add below:
// <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... :)

xmorpher
06-02-2005, 05:11 PM
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

xmorpher
06-06-2005, 10:15 PM
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:
eval('$petzbody = "' . fetch_template('petz_battle') . '";');
Replace it with:

// <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:
<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:
<br>
<small>
<if condition="$userid==$pet1[OWNER]">
$pet1_items
<else />
$pet1_items_guest
</if>
</small>

Then find:
<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:
<br>
<small>
<if condition="$userid==$pet2[OWNER]">
$pet2_items
<else />
$pet2_items_guest
</if>
</small>

You're Done
:)

Yukino_AE
08-04-2005, 08:21 PM
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?

xmorpher
08-05-2005, 03:08 AM
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
:)

angelicGrace
08-05-2005, 05:15 PM
Dude you so totaly rock. I have lots of members that are loyal pet owners, but would never dream of battleing them. The ablity to gain experience by just taking care of them loyaly rocks. Gonna have to add this one when i have a few moment to get on my server.

xmorpher
08-27-2005, 03:57 PM
ADD A SOUND EFFECT WHEN IS YOUR TURN
This is a small modification to add a background sound
that indicates when is YOUR TURN TO ATTACK

It's useful because sometimes you are in a battle
but you are browsing other web pages too,
and you can forget that you are in a battle or you won't have to
constantly check if it's your turn or not...

so, here is the modification:
edit the template: petz_battle
find the code:
<if condition="$player1==182">
replace it with:
<if condition="$player1==182">
<EMBED SRC=$vboptions[bburl]/turn_01.mp3 width=0 height=0 autostart=true loop=0>

then find the code:
<if condition="$player2==182">
and replace it with:
<if condition="$player2==182">
<EMBED SRC=$vboptions[bburl]/turn_01.mp3 width=0 height=0 autostart=true loop=0>

That's all

Download the sound file from this post, you have 3 available sound options,
rename to "turn_01.mp3" the file you want to use...

upload the sound "turn_01.mp3" to your forum root directory
(where is stored the petz.php file)

Enjoy it!


:)

tuanluu
08-31-2005, 08:57 AM
Thanks very much I love this site

maggymagus
06-30-2008, 01:29 AM
hey! this is great! ill try it now!, thx

maggymagus
06-30-2008, 05:52 AM
thx a lot!