Legendary Tales Official Website
News Search:
Home · Articles · Downloads · Discussion Forum · Old Forums (read only) · RegisterAugust 28 2008 04:47:37
Navigation
Home
Articles
Downloads
FAQ
Discussion Forum
Web Links
News
Contact Me
Screenshots
Search
Login
Username

Password

Save



Not a member yet?
Then register.

I forgot my password.

Why register?
Newsletter
Subscribe now to receive important news, game releases and site updates
Buy 3 Skulls only $9.99

Download a demo

Full version download immediately after purchase!

You can also use your credit card without a paypal account.

Visa Mastercard American Express Discover
Gambling Scripts
Gambling was a large occupation in medieval times, with the chance often to win a large sum of money. However, many people lost money, possessions, and even their lives to this vice. Here are three games, from then, and from today.

Dice:

function OnDialog(){
Echo("~Dice Man:~<> Hi, want a game of dice?");
AddOption(0,"Yes, I would","op1();","");
AddOption(0,"Sorry, no","","");
ProcessOptions();
}
function op1(){
Echo("~Dice Man:~<> For this game, I will throw two dice. You must guess what the result is to win. You have "+PartyGold+" gold pieces.");
var i=GetInput(4,"Bet","How much will you bet?");
var m=GetInput(4,"Dice","What do you think the dice result will be?");
var p=ThrowDice(2,6);
if(m>12){
Echo("~You must choose a number between 2 and 12 for your predicted dice result.~<>");
}
else if(m<2){
Echo("~You must choose a number between 2 and 12 for your predicted dice result.~<>");
}
else if(i>PartyGold){
Echo("~You cannot bet more than you have!~<>");
}
else if(i<1){
Echo("~You cannot bet no money!~<>");
}
else if(i>Maximum Bettage){
Echo("~You may only bet a maximum of (Insert maximum bettage here) gold pieces.~<>");
}
else if(m==p){
PartyGold-=i;
Echo("~Dice Man:~<> Well done! You won!");
PartyGold+=i*3;
}
else{
PartyGold-=i;
Echo("~Dice Man:~<> Sorry, you lost.");
}
}

Wheel of Fortune:

function OnDialog(){
Echo("~Wheel of Fortune man:~<> Would you like a game of wheel of fortune?");
AddOption(0,"Yes, Please","op1();","1,2,3,4");
AddOption(0,"No, thanks","","");
AddOption(1,"5gp","op5();","");
AddOption(2,"10gp","op6();","");
AddOption(3,"20gp","op7();","");
AddOption(4,"Sorry, changed my mind.","","");
ProcessOptions();
}
function op1(){
Echo("~Wheel of Fortune man:~<> How much will you bet?");
}
function op2(){
Echo("~Wheel of Fortune man:~<> For this game, I will spin a wheel. If it lands on 4 or 5, then you will win, if not you lose. Odds are 5:1");
PartyGold-=5;
var i=Rnd(1,5);
if(i==1){
Echo("~Wheel of Fortune man:~<> Sorry, you didn't win.");
}
else if(i==2){
Echo("~Wheel of Fortune man:~<> Sorry, you didn't win.");
}
else if(i==3){
Echo("~Wheel of Fortune man:~<> Sorry, you didn't win.");
}
else if(i==4){
Echo("~Wheel of Fortune man:~<> You won! Congratulations!");
PartyGold+=25;
}
else if(i==5){
Echo("~Wheel of Fortune man:~<> You won! Congratulations!");
PartyGold+=25;
}
else{
Echo("~Wheel of Fortune man:~<> The wheel of fortune appears to be broken.");
}
}
function op3(){
Echo("~Wheel of Fortune man:~<> For this game, I will spin a wheel. If it lands on 4 or 5, then you will win, if not you lose. Odds are 5:1");
PartyGold-=10;
var i=Rnd(1,5);
if(i=1){
Echo("~Wheel of Fortune man:~<> Sorry, you didn't win.");
}
else if(i==2){
Echo("~Wheel of Fortune man:~<> Sorry, you didn't win.");
}
else if(i==3){
Echo("~Wheel of Fortune man:~<> Sorry, you didn't win.");
}
else if(i==4){
Echo("~Wheel of Fortune man:~<> You won! Congratulations!");
PartyGold+=50;
}
else if(i==5){
Echo("~Wheel of Fortune man:~<> You won! Congratulations!");
PartyGold+=50;
}
else{
Echo("~Wheel of Fortune man:~<> The wheel of fortune appears to be broken.");
}
}
function op4(){
Echo("~Wheel of Fortune man:~<> For this game, I will spin a wheel. If it lands on 4 or 5, then you will win, if not you lose. Odds are 5:1");
PartyGold-=20;
var i=Rnd(1,5);
if(i=1){
Echo("~Wheel of Fortune man:~<> Sorry, you didn't win.");
}
else if(i==2){
Echo("~Wheel of Fortune man:~<> Sorry, you didn't win.");
}
else if(i==3){
Echo("~Wheel of Fortune man:~<> Sorry, you didn't win.");
}
else if(i==4){
Echo("~Wheel of Fortune man:~<> You won! Congratulations!");
PartyGold+=100;
}
else if(i==5){
Echo("~Wheel of Fortune man:~<> You won! Congratulations!");
PartyGold+=100;
}
else{
Echo("~Wheel of Fortune man:~<> The wheel of fortune appears to be broken.");
}
}
function op5(){
if(PartyGold<5){
Echo("~Wheel of Fortune man:~<> Sorry, but you do not have enough gold to place that bet.");
}
else{
op2();
}
}
function op6(){
if(PartyGold<10){
Echo("~Wheel of Fortune man:~<> Sorry, but you do not have enough gold to place that bet.");
}
else{
op3();
}
}
function op7(){
if(PartyGold<20){
Echo("~Wheel of Fortune man:~<> Sorry, but you do not have enough gold to place that bet.");
}
else{
op4();
}
}

Slot Machine:

function OnUse(){
AddOption(0,"Play the slot machine for 1gp","op2();","");
AddOption(0,"Don't play the slot machine","","");
ProcessOptions();
}
function op1(){
PartyGold-=1;
var i=Rnd(1,7)
var m=Rnd(1,7)
var p=Rnd(1,7)
if(i==m){
if(p==m){
PartyGold+=i*i*i;
Echo("~You won "+i*i*i+" gold pieces on the slots~<>");
}
else{
Echo("~You didn't win anything.~<>");
}
}
else{
Echo("~You didn't win anything.~<>");
}
}
function op2(){
if(PartyGold<1){
Echo("~You do not have enough money to play on the slot machine!");
}
else{
op1();
}
}
Comments
Throndir on June 21 2007 18:37:10
The three are great! It shows some of the things you can accomplish with random variables and scripting. Not to mention an interesting 'filler' for anyone's games.
Post Comment
Please Login to Post a Comment.
Ratings
Rating is available to Members only.

Please login or register to vote.

Awesome! Awesome! 0% [No Votes]
Very Good Very Good 67% [2 Votes]
Good Good 0% [No Votes]
Average Average 33% [1 Vote]
Poor Poor 0% [No Votes]
Play Online Now
Play Now
Requirements and info
Terms of Service
Privacy Policy
RSS Newsfeed
Shoutbox
You must login to post a message.

Throndir
21/08/2008 10:54
Then read this tutorial. http://h1.ripway.com/thro
ndir/Delete After Files/Tutorial.zip


Throndir
21/08/2008 10:51
It depends what you're trying to do. If you want to create a textbased game, download the engine and editor.

jfreak
20/08/2008 02:52
how do i begin smiley?

MrHelem
17/08/2008 15:22
Nevermind, got it figured out.

MrHelem
17/08/2008 04:13
Hey, can anyone tell me how to set up a custom skill so it uses mana? I scanned the tutorials and didn't find anything.

Throndir
10/08/2008 13:33
Or check out legendarytales.wikispaces
.com


Throndir
10/08/2008 13:09
Yes. Post in the forums with your problem.

critchell
09/08/2008 17:46
i need some help with a particular script which adds a new member to a party, can anyone help?

Throndir
05/08/2008 14:24
Legendarytales is a game engine and editor. You basically create textbased games, or hope for any other person to create an adventure so you could play it..

Delphinus
05/08/2008 10:17
You create. Check the 'Downloads' page.

Shoutbox Archive
Copyright www.legendarytales.com © 2001 - 2008

Terms Of Service Privacy Policy
eXTReMe Tracker