» IMPORTANT BUG FIX!! 01-Jan-04
Since some of you have already started to modify your Arena Tickets etc, I'll try to post any script changes here (though I don't forsee many more after this - though I'm modifying the way monster stats are calculated at my forums, the calculations are not as universally applicable as those currently in the scripts and are more tailored to my classes/stats - hence, these changes are not in the script you've downloaded!)
1st January 2004 14:35GMT
This fix has not yet been added to the downloads. It is important that you add these fixes to the auctions and headquarters scripts ASAP to prevent an item duplication exploit! (thanks to seteo-bloke for finding this one!).
FIND: in shop_auctions.php, around line 403
//check they have the items!
$selectitemsamt = count($items);
sort($items);
for ($y = 0; $y < $selectitemsamt; $y++)
{
//make sure they have the items
if (substr_count($userdata[user_items],"ß".$items[$y]."Þ") < 1)
{message_die(GENERAL_MESSAGE, "You don't have enough ".$items[$y]."(s)!");}
REPLACE WITH:
//check they have the items!
$selectitemsamt = count($items);
sort($items);
$tempitems = $userdata['user_items'];
for ($y = 0; $y < $selectitemsamt; $y++)
{
//make sure they have the items
if (substr_count($tempitems,"ß".$items[$y]."Þ") < 1)
{message_die(GENERAL_MESSAGE, "You don't have enough ".$items[$y]."(s)!");}
else {$tempitems = substr_replace($tempitems, "", strpos($tempitems, "ß".$items[$y]."Þ"), strlen("ß".$items[$y]."Þ"));}
FIND: in headquarters.php, around line 436
//check they have the items
$selectitemsamt = count($itemselect);
sort($itemselect);
for ($y = 0; $y < $selectitemsamt; $y++)
{
//make sure they have the items
if (substr_count($userdata[user_items],"ß".$itemselect[$y]."Þ") < 1)
{message_die(GENERAL_MESSAGE, "You don't have enough ".$itemselect[$y]."(s)!<P><a href=\"".append_sid($hqfilename)."\">Back to Headquarters</a>");}
REPLACE WITH:
//check they have the items
$selectitemsamt = count($itemselect);
sort($itemselect);
$tempitems = $userdata[user_items];
for ($y = 0; $y < $selectitemsamt; $y++)
{
//make sure they have the items
if (substr_count($tempitems,"ß".$itemselect[$y]."Þ") < 1)
{message_die(GENERAL_MESSAGE, "You don't have enough ".$itemselect[$y]."(s)!<P><a href=\"".append_sid($hqfilename)."\">Back to Headquarters</a>");}
else {$tempitems = substr_replace($tempitems, "", strpos($tempitems, "ß".$itemselect[$y]."Þ"), strlen("ß".$itemselect[$y]."Þ"));}
6th November 2003 10:36GMT
Many thanks to A_Jelly_Doughnut for his hard work in making these mods DBAL-compliant (for those of you who don't know, it's a phpBB standard which must now be met in order to keep this mod's thread open at their forums!). Those of you who're already have the mod working don't need to change over, nothing vital has really changed.
19th September 2003 17:06GMT
I've fixed some of the instructions, no point in posting those changes here, since if you already have it installed, you don't need the instructions now ;) Have added some more to the Extras.txt file too, and the latest zip includes two new usable items - healing & detox spells for use outside of battle.
Fix for Arena Ticket/Boss Battle (user attacks weren't missing!)
FIND:
$miss == $missrate;
REPLACE WITH:
$miss = $missrate;
FIND:
{$u_damage = '0'; $userattack_text = "<b>".$username."</b> attacks the <b>".$monster."</b> with the <B>".$attackwith."</B>...<BR><BR>".$miss_reason."<BR><BR>";}
REPLACE WITH:
{$u_damage = '0'; $userattack_text = "<b>".$username."</b> attacks the <b>".$monster."</b> with the <B>".$attackwith."</B>...<BR><BR>".$u_missreason."<BR><BR>";}
Fix for Stockmarket (allowed users to 'steal' items O.o;;)
In shop_bs.php
FIND (within the if ($action == "buybulk") section)
if ($row['stock'] < 1)
{
message_die(GENERAL_MESSAGE, 'Item is out of Stock!');
}
AFTER, ADD:
if (($qtybuy == 0) || !is_numeric($qtybuy))
{
message_die(GENERAL_MESSAGE, 'You must select a quantity!');
}
FIND: (within the if ($action == "sellbulk") section)
if (!isset($item))
{
message_die(GENERAL_MESSAGE, 'No Item Chosen!');
}
AFTER, ADD:
if (($qtysell == 0) || !is_numeric($qtysell))
{
message_die(GENERAL_MESSAGE, 'You must select a quantity!');
}
Fix for Auctions (error when trying to message about an auction with ' in the title!)
In shop_auctions.php
FIND:
//if the auction is over and has a winner, send a message to the winning bidder
BEFORE, ADD:
$fixedtitle = str_replace("'", "\'", $row['title']);
FIND:
//SEND MSG TO SELLER TO NOTIFY PAID AUCTION
BEFORE, ADD:
$fixedtitle = str_replace("'", "\'", $row['title']);
FIND (all instances):
(".$row[title].")
REPLACE WITH:
(".$fixedtitle.")
1st August 2003 12:55GMT
Basically, all I've changed in the Arena Ticket this time is the following:
FIND:
{$equipped_text = '<b>'.$username.'</b> has equipped for battle</i>!<P>';}
REPLACE WITH:
{$equipped_text = '<b>'.$username.'</b> has equipped for battle</i>!<P>'; $armour_def = round($armour_def/3);}
This may help to stop the monsters from having an excessively high ATT stat, and stops the user's DEF from becoming excessively high from their armour. It should balance things out a little.
A small change was made to the Cauldron section of HQ, to prevent an error when users don't select any items:
FIND:
if ($action == 'CONFIRMCAULDRON')
{
AFTER, ADD:
if ($itemselect == "")
{message_die(GENERAL_MESSAGE, "You must select at least 2 items!<P><a href=\"".append_sid($hqfilename)."\">Back to Headquarters</a>");}
FIND:
if ($action == 'FINISHCAULDRON')
{
AFTER, ADD:
if ($items == "")
{message_die(GENERAL_MESSAGE, "You must select at least 2 items!<P><a href=\"".append_sid($hqfilename)."\">Back to Headquarters</a>");}
Also, the user victories/defeats/escapes were being carried over after a class change! To fix this:
FIND:
//set class & stats
$sql="update phpbb_users set user_att='$att',user_def='$def',user_hp='$hpmax',user_hpmax='$hpmax',user_mp='$mpmax',user_mpmax='$mpmax',user_class='$newclass',user_statlevel=1,user_points=user_points-$cost_train where username='$username'";
REPLACE WITH:
//set class & stats
$sql="update phpbb_users set user_att='$att',user_def='$def',user_hp='$hpmax',user_hpmax='$hpmax',user_mp='$mpmax',user_mpmax='$mpmax',user_class='$newclass',user_statlevel=1,user_points=user_points-$cost_train,user_victories=0,user_defeats=0,user_escapes=0 where username='$username'";
And a missing image was added to the zip.
In the Admin Panel, it seems I overlooked the fact that I'd included a section for modifying the user's bank details, but not everyone has the bank installed! I've fixed this in the admin_rpg_stats.php file, but if you've modified yours and just want to fix this:
FIND:
$sql2 = "select holding from phpbb_bank where name=$userinfo[user_id]";
if ( !($result2 = $db->sql_query($sql2)) )
{
message_die(GENERAL_MESSAGE, "Error getting bank holdings!");
}
$userbank = mysql_fetch_array($result2);
REPLACE WITH:
if (file_exists("admin_bank.php")) {
$sql2 = "select holding from phpbb_bank where name=$userinfo[user_id]";
if ( !($result2 = $db->sql_query($sql2)) )
{
message_die(GENERAL_MESSAGE, "Error getting bank holdings!");
}
$userbank = mysql_fetch_array($result2);
}
back to main page