DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • July 20, 2019, 04:56:42 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Different kind of casino  (Read 2752 times)
0 Members and 1 Guest are viewing this topic.
MrFixIt
Guest
« on: May 08, 2004, 09:52:36 AM »

<?php
/*

attingboro.php
Based on the outhouse.php

This adds a different kind of casino for your users to use.

In datadase table accounts add:
gambles int 11 default 5 not null

On newday.php (this sets amount of uses) add:
$session['user']['gambles']=5;

Link to attingboro.php from where ever. (Default is village.php)

Current Winnings Percents:
Gems=4%
Gold=7%
Forest Fights=6%
Maximum Hitpoints=2%
Gambles=3%
Charm=8%
Favor=5%

*/
require_once "common.php";
checkday();

$giveagem = 1;
$givegempercent = 4;
$gemminimum = 1;
$gemmaximum = 100;
 
$giveagold = 1;
$givegoldpercent = 7;
$goldminimum = 1;
$goldmaximum = 100;

$giveaturn = 1;
$giveturnpercent = 6;
$turnminimum = 1;
$turnmaximum = 100;

$giveamax = 1;
$givemaxpercent = 2;
$maxminimum = 1;
$maxmaximum = 100;

$giveagamble = 1;
$givegamblepercent = 3;
$gambleminimum = 1;
$gamblemaximum = 100;

$giveacharm = 1;
$givecharmpercent = 8;
$charmminimum = 1;
$charmmaximum = 100;

$giveafav = 1;
$givefavpercent = 5;
$favminimum = 1;
$favmaximum = 100;

page_header("Attingboro Casino");
$player=$session['user']['name'];
$left=$session['user']['gambles'];
addcommentary();
switch($HTTP_GET_VARS[op])
{
case "":
addnav("Gamble Now","attingboro.php?op=gamble");
addnav("","attingboro.php?op=gamble");
output("`@`c`bCasino Lobby`b`c`@ `n`n`&Welcome $player to the Attingboro Casino.`& `@You can gamble $left more times today.`@");
output("`n`n`&House Rules:`n`nVery simple, you pay one hundred gold to take a chance on random rewards.`nYou never know what might happen because you can win multiple items at the same time.`&
`n`n`2Prizes:
`n`nGems
`nGold
`nForest Fights
`nMaximum Hitpoints
`nMore Gambles
`nCharm Points
`nFavor with Ramius`2");
output("`n`n<a href='attingboro.php?op=gamble'>Gamble Now</a>",true);
break;

case "gamble":
if ($session['user']['gold']>=100){
if ($session['user']['gambles']>=1){
$session['user']['gold']-=100;
$session['user']['gambles']-=1;
output("`n`nPlease try again.`n`n");
addnav("Casino Lobby","attingboro.php");

if ($giveagem == 1){
$givegemtemp = e_rand($gemminimum, $gemmaximum);
if ($givegemtemp <= $givegempercent){
$session['user']['gems']+=1;
debuglog("gained 1 gem at the Attingboro Casino.");
output("`&You won a gem!!`n`n");
addnews($session['user']['name']."  won a gem at the Attingboro Casino.");
}
}

if ($giveagold == 1){
$givegoldtemp = e_rand($goldminimum, $goldmaximum);
if ($givegoldtemp <= $givegoldpercent){
$session['user']['gold']+=200;
debuglog("gained 200 gold at the Attingboro Casino.");
output("`&You won 200 gold!! `n`n");
addnews($session['user']['name']."  won a few gold at the Attingboro Casino.");
}
}

if ($giveaturn == 1){
$giveturntemp = e_rand($turnminimum, $turnmaximum);
if ($giveturntemp <= $giveturnpercent){
$session['user']['turns']+=1;
debuglog("gained 1 turn at the Attingboro Casino.");
output("`&You won a forest fight!! `n`n");
addnews($session['user']['name']."  just got an extra turn at the Attingboro Casino.");
}
}

if ($giveamax == 1){
$givemaxtemp = e_rand($maxminimum, $maxmaximum);
if ($givemaxtemp <= $givemaxpercent){
$session['user']['maxhitpoints']+=1;
debuglog("gained maximumhitpoints at the Attingboro Casino.");
output("`&You won 1 maximum hitpoint!!`n");
addnews($session['user']['name']."  just got an extra hitpoint at the Attingboro Casino.");
}
}


if ($giveagamble == 1){
$givegambletemp = e_rand($gambleminimum, $gamblemaximum);
if ($givegambletemp <= $givegamblepercent){
$session['user']['gambles']+=1;
debuglog("gained a gamble at the Attingboro Casino.");
output("`&You won another chance to gamble!!`n`n");
}
}

if ($giveacharm == 1){
$givecharmtemp = e_rand($charmminimum, $charmmaximum);
if ($givecharmtemp <= $givecharmpercent){
$session['user']['charm']+=1;
debuglog("gained charm at the Attingboro Casino.");
output("`&You gained some charm!!`n`n");
addnews($session['user']['name']."  just got extra charm at the Attingboro Casino.");
}
}

if ($giveafav == 1){
$givefavtemp = e_rand($favminimum, $favmaximum);
if ($givefavtemp <= $givefavpercent){
$session['user']['deathpower']+=10;
debuglog("gained favor at the Attingboro Casino.");
output("`&You gained 10 favor with Ramius.`n");
addnews($session['user']['name']."  just got extra favor points at the Attingboro Casino.");
}
}

}
else{
output("`@You're done for today, come back tomorrow.`n");
}
}
else {
output("Umm...I think you need gold to gamble.");
}
break;
}
addnav("Return to Village","village.php");
page_footer();
?>
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
102 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search