Page 1 of 1
A cool idea for shop.php
Posted: Fri Jan 01, 2010 1:42 am
by ZeroComp
Don't like the prices? Barter!!!!!
in shop.php add at the bottom <a href='barter.php'</a>
barter.php so far
Code: Select all
<?php
include_once 'connect.php'
session_start()
<center> echo "Give me an offer"
<input type='number' 'name=offer' size='11'>
after that I'm figuring how to make the variable offer but here is the if function that you can change the number for the max offer
if($offer <100;)
{
echo "Thats to low."
}
else;
{
echo"I'll take it."
}
Re: A cool idea for shop.php
Posted: Tue Jan 12, 2010 5:47 pm
by Joey
Cool

Re: A cool idea for shop.php
Posted: Tue Jan 12, 2010 5:55 pm
by Jackolantern
You would probably want to add a bit more to the barter system than just a simple If-Else construct, because once players figure out the amount he is deciding on, they will always offer him the lowest amount possible. What if it was randomized for each player when they start bartering, and if the player tries to go too low, the shop will not sell to them for a certain period of time? That way there is a risk in asking for lower prices.
Re: A cool idea for shop.php
Posted: Tue Jan 12, 2010 6:34 pm
by jpoisson
Yea JOLantern is right. You want to make the bartering price item specific. So you would go by %'s and then you can add a skill that actually can affect the % that a player can barter off of an Item.
Re: A cool idea for shop.php
Posted: Tue Jan 12, 2010 8:09 pm
by hallsofvallhalla
normally you would use a barter skill for this but since we dont have one lets just use some rands
quick and dirty version
Code: Select all
$randmod = rand(0,20);
$minprice = $iteminfo3['price'] / $randmod;
$minprice = $iteminfo3['price'] - $minprice;
if ($_GET['offer'] >= $minprice)
{
echo "He accepts your offer!"
}
else
{
echo "No way pal!!";
}
Re: A cool idea for shop.php
Posted: Wed Jan 13, 2010 3:47 am
by ZeroComp
Yeah after revising it I was thinking about putting a rand() in there but I didn't think of a actual "barter skill" so if I had a barter skill would i do a
if ($barterSkill==3)// just keep putting the rand() lower and lower right?