Legendary Tales Official Website
News Search:
Home · Articles · Downloads · Discussion Forum · Old Forums (read only) · RegisterAugust 28 2008 04:47:09
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
Mini-Games
Sure your making a major game, but how about a small respite? Mini-games are good fun, and you can even gamble in them. They take place in an NPC dialogue, and are ready to be copy+pasted into an NPC.

-- Game 1 -- Hunter --
var self_square = Global("self_square") = 1;
var foe_square = Global("foe_square") = 9;
var deer_square = Global("deer_square") = 5;

function OnDialog(){
Echo("~"+Self.Name+"~<>: Well hello. Do you enjoy a game of Hunter?");
ClearOptions();
AddOption(0,"I certainly do","Echo(\"~"+Self.Name+"~<>: Then lets play a game of it. I shall now flip a coin to decide who has the first turn. Crowns, I will, Castles, you will.\");","6");
AddOption(0,"I don't know how to play","Echo(\"~"+Self.Name+"~<>: Its simple really. We play on a board three by three board with our pieces on it. You, me, and theres a magical deer piece but we cannot see the deer. We maneuvre, in turns, one space in the cardinal directions a turn. The deer moves too, but never into us. We have to hunt and catch the deer. The person who catches it wins. So, care to play?\");","3,4,5");
AddOption(0,"I don't care for it","Echo(\"~"+Self.Name+"~<>: That is certainly a shame. I do enjoy playing it.\");","");
AddOption(3,"Now I know, I'll play","Echo(\"~"+Self.Name+"~<>: Good, now I have to flip a coin, if it lands on Crowns I take first turn, but if its Castles you will.\")","6");
AddOption(4,"It seems too hard","Echo(\"~"+Self.Name+"~<>: When you get into it its easier but okay.\");","");
AddOption(5,"A little more depth on the board","Echo(\"~"+Self.Name+"~<>: Like I said, three by three. Top left corner, 1. Top right corner, 3. Middle left, 4, and so on. Got the layout? You start in square 1, me in square 9, and the deer in square 5. Whoever wins the coin toss goes fist, then the other second, the deer moves third.\");","3,4");
AddOption(6,"Flip...","flip();","");
ProcessOptions();
}

function flip(){
if(Rnd(1,2) == 1){
Echo("~"+Self.Name+"~<>: Its Crowns. I'll begin then...");
foe_hunt("first");
Global("hunter_first") = 0;
}
else{
Echo("~"+Self.Name+"~<>: Its Castles. Move...");
hunt("first");
Global("hunter_first") = 1;
}
}

function foe_moved(direction){
Echo("~Your opponent has moved ~<>~"+direction+"~<>~ to square number ~<>~"+foe_square+"~<>~.~<>\n");
}

function foe_hunt(turn){
if(turn == "first"){
foe_move(hunt);
}
else{
foe_move(deer_move);
}
}

function foe_move(next){
if(foe_square == 1){
if(Rnd(1,2) == 1){
foe_square = 4;
foe_moved("south");
}
else{
foe_square = 2;
foe_moved("east");
}
if(foe_square == deer_square){
Echo("~Your opponent has hunted the deer!~<>");
defeat();
}
else{
next();
}
}
else if(foe_square == 2){
if(Rnd(1,3) == 1){
foe_square = 5;
foe_moved("south");
}
else if(Rnd(1,3) == 2){
foe_square = 3;
foe_moved("east");
}
else{
foe_square = 1;
foe_moved("west");
}
if(foe_square == deer_square){
Echo("~Your opponent has hunted the deer!~<>");
defeat();
}
else{
next();
}
}
else if(foe_square == 3){
if(Rnd(1,2) == 1){
foe_square = 6;
foe_moved("south");
}
else{
foe_square = 2;
foe_moved("west");
}
if(foe_square == deer_square){
Echo("~Your opponent has hunted the deer!~<>");
defeat();
}
else{
next();
}
}
else if(foe_square == 4){
if(Rnd(1,3) == 1){
foe_square = 7;
foe_moved("south");
}
else if(Rnd(1,3) == 2){
foe_square = 1;
foe_moved("north");
}
else{
foe_square = 5;
foe_moved("east");
}
if(foe_square == deer_square){
Echo("~Your opponent has hunted the deer!~<>");
defeat();
}
else{
next();
}
}
else if(foe_square == 5){
if(Rnd(1,4) == 1){
foe_square = 8;
foe_moved("south");
}
else if(Rnd(1,4) == 2){
foe_square = 2;
foe_moved("north");
}
else if(Rnd(1,4) == 3){
foe_square = 6;
foe_moved("east");
}
else{
foe_square = 4;
foe_moved("west");
}
if(foe_square == deer_square){
Echo("~Your opponent has hunted the deer!~<>");
defeat();
}
else{
next();
}
}
else if(foe_square == 6){
if(Rnd(1,3) == 1){
foe_square = 3;
foe_moved("north");
}
else if(Rnd(1,3) == 2){
foe_square = 9;
foe_moved("south");
}
else{
foe_square = 5;
foe_moved("west");
}
if(foe_square == deer_square){
Echo("~Your opponent has hunted the deer!~<>");
defeat();
}
else{
next();
}
}
else if(foe_square == 7){
if(Rnd(1,2) == 1){
foe_square = 4;
foe_moved("north");
}
else{
foe_square = 8;
foe_moved("east");
}
if(foe_square == deer_square){
Echo("~Your opponent has hunted the deer!~<>");
defeat();
}
else{
next();
}
}
else if(foe_square == 8){
if(Rnd(1,3) == 1){
foe_square = 7;
foe_moved("west");
}
else if(Rnd(1,3) == 2){
foe_square = 5;
foe_moved("north");
}
else{
foe_square = 9;
foe_moved("east");
}
if(foe_square == deer_square){
Echo("~Your opponent has hunted the deer!~<>");
defeat();
}
else{
next();
}
}
else if(foe_square == 9){
if(Rnd(1,2) == 1){
foe_square = 8;
foe_moved("west");
}
else{
foe_square = 6;
foe_moved("north");
}
if(foe_square == deer_square){
Echo("~Your opponent has hunted the deer!~<>");
defeat();
}
else{
next();
}
}
else{
}
}

function hunt(turn){
if(turn == "first"){
Global("turn") == true;
move();
}
else{
Global("turn") == false;
move();
}
}

function move_south(){
self_square = self_square + 3;
Echo("~You have moved ~<>~south~<>~ to square number ~<>~"+self_square+"~<>~.~<>");
if(self_square == deer_square){
Echo("~You have hunted the deer!~<>");
victory();
}
else{
if(Global("turn") == true){
foe_hunt("second");
}
else{
deer_move();
}
}
}
function move_north(){
self_square = self_square - 3;
Echo("~You have moved ~<>~north~<>~ to square number ~<>~"+self_square+"~<>~.~<>");
if(self_square == deer_square){
Echo("~You have hunted the deer!~<>");
victory();
}
else{
if(Global("turn") == true){
foe_hunt("second");
}
else{
deer_move();
}
}
}
function move_east(){
self_square = self_square + 1;
Echo("~You have moved ~<>~east~<>~ to square number ~<>~"+self_square+"~<>~.~<>");
if(self_square == deer_square){
Echo("~You have hunted the deer!~<>");
victory();
}
else{
if(Global("turn") == true){
foe_hunt("second");
}
else{
deer_move();
}
}
}
function move_west(){
self_square = self_square - 1;
Echo("~You have moved ~<>~west~<>~ to square number ~<>~"+self_square+"~<>~.~<>");
if(self_square == deer_square){
Echo("~You have hunted the deer!~<>");
victory();
}
else{
if(Global("turn") == true){
foe_hunt("second");
}
else{
deer_move();
}
}
}

function move(){
if(self_square == 1){
ClearOptions();
AddOption(0,"Move south","move_south();","");
AddOption(0,"Move east","move_east();","");
AddOption(0,"Forfeit","defeat();","");
ProcessOptions();
}
else if(self_square == 2){
ClearOptions();
AddOption(0,"Move west","move_west();","");
AddOption(0,"Move south","move_south();","");
AddOption(0,"Move east","move_east();","");
AddOption(0,"Forfeit","defeat();","");
ProcessOptions();
}
else if(self_square == 3){
ClearOptions();
AddOption(0,"Move west","move_west();","");
AddOption(0,"Move south","move_south();","");
AddOption(0,"Forfeit","defeat();","");
ProcessOptions();
}
else if(self_square == 4){
ClearOptions();
AddOption(0,"Move north","move_north();","");
AddOption(0,"Move east","move_east();","");
AddOption(0,"Move south","move_south();","");
AddOption(0,"Forfeit","defeat();","");
ProcessOptions();
}
else if(self_square == 5){
ClearOptions();
AddOption(0,"Move north","move_north();","");
AddOption(0,"Move east","move_east();","");
AddOption(0,"Move south","move_south();","");
AddOption(0,"Move west","move_west();","");
AddOption(0,"Forfeit","defeat();","");
ProcessOptions();
}
else if(self_square == 6){
ClearOptions();
AddOption(0,"Move north","move_north();","");
AddOption(0,"Move west","move_west();","");
AddOption(0,"Move south","move_south();","");
AddOption(0,"Forfeit","defeat();","");
ProcessOptions();
}
else if(self_square == 7){
ClearOptions();
AddOption(0,"Move north","move_north();","");
AddOption(0,"Move east","move_east();","");
AddOption(0,"Forfeit","defeat();","");
ProcessOptions();
}
else if(self_square == 8){
ClearOptions();
AddOption(0,"Move north","move_north();","");
AddOption(0,"Move east","move_east();","");
AddOption(0,"Move west","move_west();","");
AddOption(0,"Forfeit","defeat();","");
ProcessOptions();
}
else if(self_square == 9){
ClearOptions();
AddOption(0,"Move north","move_north();","");
AddOption(0,"Move west","move_west();","");
AddOption(0,"Forfeit","defeat();","");
ProcessOptions();
}
else{
}
}

function defeat(){
Echo("~"+Self.Name+"~<>: Thanks for the game, come back soon.");
}

function victory(){
Echo("~"+Self.Name+"~<>: Your pretty good. Swing around any time and we can play again.");
}

function deer_move(){
if(Global("hunter_first") == 0){
deer();
foe_hunt("first");
}
else{
deer();
hunt("first");
}
}

function deer(){
if(deer_square == 1){
if(Rnd(1,2) == 1){
if(foe_square == 4|self_square == 4){
}
else{
deer_square = 4;
}
}
else{
if(foe_square == 2|self_square == 2){
}
else{
deer_square = 2;
}
}
}
else if(deer_square == 2){
if(Rnd(1,3) == 1){
if(foe_square == 5|self_square == 5){
}
else{
deer_square = 5;
}
}
else if(Rnd(1,3) == 2){
if(foe_square == 1|self_square == 1){
}
else{
deer_square = 1;
}
}
else{
if(foe_square == 3|self_square == 3){
}
else{
deer_square = 3;
}
}
}
else if(deer_square == 3){
if(Rnd(1,2) == 1){
if(foe_square == 6|self_square == 6){
}
else{
deer_square = 6;
}
}
else{
if(foe_square == 2|self_square == 2){
}
else{
deer_square = 2;
}
}
}
else if(deer_square == 4){
if(Rnd(1,3) == 1){
if(foe_square == 1|self_square == 1){
}
else{
deer_square = 1;
}
}
else if(Rnd(1,3) == 2){
if(foe_square == 5|self_square == 5){
}
else{
deer_square = 5;
}
}
else{
if(foe_square == 7|self_square == 7){
}
else{
deer_square = 7;
}
}
}
else if(deer_square == 5){
if(Rnd(1,4) == 1){
if(foe_square == 2|self_square == 2){
}
else{
deer_square = 2;
}
}
else if(Rnd(1,4) == 2){
if(foe_square == 8|self_square == 8){
}
else{
deer_square = 8;
}
}
else if(Rnd(1,4) == 3){
if(foe_square == 6|self_square == 6){
}
else{
deer_square = 6;
}
}
else{
if(foe_square == 4|self_square == 4){
}
else{
deer_square = 4;
}
}
}
else if(deer_square == 6){
if(Rnd(1,3) == 1){
if(foe_square == 3|self_square == 3){
}
else{
deer_square = 3;
}
}
else if(Rnd(1,3) == 2){
if(foe_square == 9|self_square == 9){
}
else{
deer_square = 9;
}
}
else{
if(foe_square == 5|self_square == 5){
}
else{
deer_square = 5;
}
}
}
else if(deer_square == 7){
if(Rnd(1,2) == 1){
if(foe_square == 4|self_square == 4){
}
else{
deer_square = 4;
}
}
else{
if(foe_square == 8|self_square == 8){
}
else{
deer_square = 8;
}
}
}
else if(deer_square == 8){
if(Rnd(1,3) == 1){
if(foe_square == 5|self_square == 5){
}
else{
deer_square = 5;
}
}
else if(Rnd(1,3) == 2){
if(foe_square == 9|self_square == 9){
}
else{
deer_square = 9;
}
}
else{
if(foe_square == 7|self_square == 7){
}
else{
deer_square = 7;
}
}
}
else if(deer_square == 9){
if(Rnd(1,2) == 1){
if(foe_square == 6|self_square == 6){
}
else{
deer_square = 6;
}
}
else{
if(foe_square == 8|self_square == 8){
}
else{
deer_square = 8;
}
}
}
else{
}
}
-- End Code --

-- Game 2 -- Stronghold --
var self_hp = Global("self_health");
var foe_hp = Global("foe_health");
var wager = Global("stronghold_wager");
var gambled = Global("stronghold_gambles");
var self_atk = Global("self_attack");
var foe_atk = Global("foe_attack");
var self_card = Global("$self_card");
var foe_card = Global("$foe_card");
var damage = Global("damage");

function OnDialog(){
Echo("~"+Self.Name+"~<>: Greetings! Care to play a game of Stronghold?");
ClearOptions();
AddOption(0,"How is it played?","Echo(\"~"+Self.Name+"~<>: Well its a card game you see. So we set the Strongholds health, then draw cards and compare them. The two forces clash, and if one wins, its left-over strength comes off the Strongholds health. So, would you like to play?\");","1,2");
AddOption(0,"Why not?","Echo(\"~"+Self.Name+"~<>: Why not indeed! So then, would you like to place a wager on this match?\");","3,4");
AddOption(0,"No thanks","Echo(\"~"+Self.Name+"~<>: Ahh well. Another time maybe.\");","");
AddOption(1,"Sure then","Echo(\"~"+Self.Name+"~<>: Good then. Care to place a wager on the match?\");","3,4");
AddOption(2,"No thanks","Echo(\"~"+Self.Name+"~<>: Ahh well. Come back if you ever do.\");","");
AddOption(3,"I like gambling, sure","gamble(true);","5,6,7");
AddOption(4,"No thanks","gamble(false);","5,6,7");
AddOption(5,"Stronghold health: Five","op1(5);","");
AddOption(6,"Stronghold health: Ten","op1(10);","");
AddOption(7,"Stronghold health: Fifteen","op1(15);","");
ProcessOptions();
}
function gamble(bool){
if(bool == false){
Echo("~"+Self.Name+"~<>: Ok then, its the game thats important I suppose.");
wager = 0;
gambled = bool;
}
else if(bool == true){
Echo("~"+Self.Name+"~<>: And what is the wager?");
wager = GetInput(4,"Coins","To wager...");
if(wager > PartyGold){
Echo("~"+Self.Name+"~<>: You can't bet more than you have. No bet then.");
gambled = false;
}
else if(wager == 0){
Echo("~"+Self.Name+"~<>: No bet then.");
gambled = false;
}
else if(wager == PartyGold){
Echo("~"+Self.Name+"~<>: Wow, feeling very lucky aren't you?");
gambled = true;
}
else{
Echo("~"+Self.Name+"~<>: Alright then. Lets set the health.");
gambled = false;
}
}
else{
}
}
function op1(hp){
self_hp = hp;
foe_hp = hp;
Echo("~"+Self.Name+"~<>: Ok then, lets play.");
op2();
}
function draw(){
var r = Rnd(1,5);
if(r == 1){
self_card = "infantry";
self_atk = 1;
}
else if(r == 2){
self_card = "archers";
self_atk = 2;
}
else if(r == 3){
self_card = "light cavalry";
self_atk = 3;
}
else if(r == 4){
self_card = "heavy cavalry";
self_atk = 4;
}
else if(r == 5){
self_card = "siege engine";
self_atk = 5;
}
else{
}
foe_draw();
Echo("~You have drawn "+self_card+" - "+self_atk+".~<>");
Echo("~Your foe has drawn "+foe_card+" - "+foe_atk+".~<>");
}
function strike(){
if(self_atk > foe_atk){
damage = self_atk - foe_atk;
foe_hp -= damage;
Echo("Your ~"+self_card+"~<> attack your foes ~"+foe_card+"~<> and defeat them!");
Echo("~Your health: "+self_hp+" -- Foe health: "+foe_hp+"~<>");
if(0 >= foe_hp){
victory();
}
else{
op2();
}
}
else if(self_atk == foe_atk){
Echo("Your ~"+self_card+"~<> attack your foes ~"+foe_card+"~<> but neither side can win.");
Echo("~Your health: "+self_hp+" -- Foe health: "+foe_hp+"~<>");
op2();
}
else if(foe_atk > self_atk){
damage = foe_atk - self_atk;
self_hp -= damage;
Echo("Your ~"+self_card+"~<> attack your foes ~"+foe_card+"~<> and are defeated!");
Echo("~Your health: "+self_hp+" -- Foe health: "+foe_hp+"~<>");
if(0 >= self_hp){
defeat();
}
else{
op2();
}
}
else{
}
}
function forfeit(){
if(gambled == true){
PartyGold -= wager;
Echo("~"+Self.Name+"~<>: Thanks for the game. I'll take that gold...");
}
else{
Echo("~"+Self.Name+"~<>: Thanks for the game. No bet, so keep your gold.");
}
}
function defeat(){
if(gambled == true){
PartyGold -= wager;
Echo("~"+Self.Name+"~<>: Thanks for the game. I'll take that gold...");
}
else{
Echo("~"+Self.Name+"~<>: Thanks for the game. No bet, so keep your gold.");
}
}
function victory(){
if(gambled == true){
PartyGold += wager;
Echo("~"+Self.Name+"~<>: Thanks for the game. Your pretty good, we should play agian sometime. Heres your winnings.");
}
else{
Echo("~"+Self.Name+"~<>: Thanks for the game. No bet, so I'll keep my gold.");
}
}
function op2(){
ClearOptions();
AddOption(0,"Continue...","","1,2");
AddOption(1,"Draw","draw();","3");
AddOption(2,"Forfeit","forfeit();","");
AddOption(3,"Strike!","strike();","");
ProcessOptions();
}
function foe_draw(){
var r = Rnd(1,5);
if(r == 1){
foe_card = "infantry";
foe_atk = 1;
}
else if(r == 2){
foe_card = "archers";
foe_atk = 2;
}
else if(r == 3){
foe_card = "light cavalry";
foe_atk = 3;
}
else if(r == 4){
foe_card = "heavy cavalry";
foe_atk = 4;
}
else if(r == 5){
foe_card = "siege engines";
foe_atk = 5;
}
else{
}
}
-- End Code --

-- Game 3 -- Swordmaster --
var foe_hp = Global("foe_hp");
var self_hp = Global("self_hp");
var wager = Global("wager");
function OnDialog(){
Echo("~"+Self.Name+"~<>: Would you like to play a game of Swordsmaster?");
ClearOptions();
AddOption(0,"How is it played?","Echo(\'~"+Self.Name+"~<>: Well, we flip a coin to see who strikes first. The striker chooses to strike high, low, or at the opponents middle. The defender chooses to block high, low or at the middle. Understand that so far?\');","1");
AddOption(0,"Lets play","Echo(\'~"+Self.Name+"~<>: Excellent. First, whats the wager?\');","3,4");
AddOption(0,"I'm too busy","","");
AddOption(1,"Yeah, go on...","Echo(\'~"+Self.Name+"~<>: Good. And if the defender guards where the attacker strikes, they parry and they become the attacker. A missed attack will result in a loss of one health. Ready to play?\');","2");
AddOption(2,"Sure, lets play...","Echo(\'~"+Self.Name+"~<>: Excellent. First, whats the wager?\');","3,4");
AddOption(3,"The wager is...","op1();","5,6");
AddOption(4,"Sorry, I dont gamble","Echo(\'~"+Self.Name+"~<>: Havent got much spirit eh? How about a game with no bet?\');","9,10");
AddOption(5,"Three","op3(3);","7,8");
AddOption(6,"Five","op3(5);","7,8");
AddOption(7,"I call Crowns","op4();","");
AddOption(8,"I call Castles","op4();","");
AddOption(9,"Ok then...","Echo(\'~"+Self.Name+"~<>: Excellent. Now, whats the health?\');","5,6");
AddOption(10,"No thanks","Echo(\'~"+Self.Name+"~<>: Still? Oh well, until we meet again.\');","");
ProcessOptions();
}
function op1(){
wager = GetInput(4,"Coins","To wager...");
if(PartyGold >= wager){
Echo("~"+Self.Name+"~<>: Alright then, lets put it in the pot. Second, whats the health?");
PartyGold -= wager;
Global("wagered") = true;
}
else if(wager == 0){
Echo("~"+Self.Name+"~<>: So we're not betting? Alright then...");
Global("wagered") = false;
}
else{
Echo("~"+Self.Name+"~<>: You can't bet that much. Tell you what, this game, no wager.");
Global("wagered") = false;
}
}
function op3(hp){
foe_hp = hp;
self_hp = hp;
Echo("~"+Self.Name+"~<>: Great the health is set. Now to flip a coin to see who strikes first.");
}
function op4(){
if(Rnd(1,2) == 1){
Echo("~"+Self.Name+"~<>: Damn! You got it right. Lets begin then...");
strike();
}
else{
Echo("~"+Self.Name+"~<>: Wrong guess. Lets begin.");
guard();
}
}
function strike(){
ClearOptions();
AddOption(0,"Strike high","strike_high();","");
AddOption(0,"Strike middle","strike_mid();","");
AddOption(0,"Strike low","strike_low();","");
AddOption(0,"Forfeit","","");
ProcessOptions();
}
function strike_high(){
if(Rnd(1,3) == 1){
Echo("~You strike high and they guard high.");
Echo("~Your strike is parried!~<>");
guard();
}
else if(Rnd(1,3) == 2){
Echo("~You strike high and they guard at the middle.~<>");
Echo("~Your strike slashes them!~<>");
foe_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(foe_hp == 0){
Echo("~You are victorius!~<>");
victory();
}
else{
strike();
}
}
else{
Echo("~You strike high and they guard low.~<>");
Echo("~Your strike slashes them!~<>");
foe_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(foe_hp == 0){
Echo("~You are victorius!~<>");
victory();
}
else{
strike();
}
}
}
function strike_mid(){
if(Rnd(1,3) == 1){
Echo("~You strike at their middle and they guard at the middle.");
Echo("~Your strike is parried!~<>");
guard();
}
else if(Rnd(1,3) == 2){
Echo("~You strike at their middle and they guard high.~<>");
Echo("~Your strike slashes them!~<>");
foe_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(foe_hp == 0){
Echo("~You are victorius!~<>");
victory();
}
else{
strike();
}
}
else{
Echo("~You strike at their middle and they guard low.~<>");
Echo("~Your strike slashes them!~<>");
foe_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(foe_hp == 0){
Echo("~You are victorius!~<>");
victory();
}
else{
strike();
}
}
}
function strike_low(){
if(Rnd(1,3) == 1){
Echo("~You strike low and they guard low.");
Echo("~Your strike is parried!~<>");
guard();
}
else if(Rnd(1,3) == 2){
Echo("~You strike low and they guard at the middle.~<>");
Echo("~Your strike slashes them!~<>");
foe_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(foe_hp == 0){
Echo("~You are victorius!~<>");
victory();
}
else{
strike();
}
}
else{
Echo("~You strike low and they guard high.~<>");
Echo("~Your strike slashes them!~<>");
foe_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(foe_hp == 0){
Echo("~You are victorius!~<>");
victory();
}
else{
strike();
}
}
}
function victory(){
Echo("~"+Self.Name+"~<>: Wow, your pretty good.");
if(Global("wagered") == true){
Echo("~"+Self.Name+"~<>: Enjoy your winnings.");
PartyGold += wager;
PartyGold += wager;
}
else{
Echo("~"+Self.Name+"~<>: We didn't bet, so no prize money.");
}
}
function guard(){
ClearOptions();
AddOption(0,"Guard high","guard_high();","");
AddOption(0,"Guard middle","guard_mid();","");
AddOption(0,"Guard low","guard_low();","");
AddOption(0,"Forfeit","Echo(\"~"+Self.Name+"~<>: You give in? Huh, thanks for the game and your gold then.\");","");
ProcessOptions();
}
function guard_high(){
if(Rnd(1,3) == 1){
Echo("~You guard high and they strike high.");
Echo("~You parry their strike!~<>");
strike();
}
else if(Rnd(1,3) == 2){
Echo("~You guard high and they strike at your middle.~<>");
Echo("~Their strike slashes you!~<>");
self_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(self_hp == 0){
Echo("~You are defeated!~<>");
defeat();
}
else{
guard();
}
}
else{
Echo("~You guard high and they strike low.~<>");
Echo("~Their strike slashes you!~<>");
self_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(self_hp == 0){
Echo("~You are defeated!~<>");
defeat();
}
else{
guard();
}
}
}
function guard_mid(){
if(Rnd(1,3) == 1){
Echo("~You guard at you middle and they strike at your middle.");
Echo("~You parry their strike!~<>");
strike();
}
else if(Rnd(1,3) == 2){
Echo("~You guard at your middle and they strike high.~<>");
Echo("~Their strike slashes you!~<>");
self_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(self_hp == 0){
Echo("~You are defeated!~<>");
defeat();
}
else{
guard();
}
}
else{
Echo("~You guard at your middle and they strike low.~<>");
Echo("~Their strike slashes you!~<>");
self_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(self_hp == 0){
Echo("~You are defeated!~<>");
defeat();
}
else{
guard();
}
}
}
function guard_low(){
if(Rnd(1,3) == 1){
Echo("~You guard low and they strike low.");
Echo("~You parry their strike!~<>");
strike();
}
else if(Rnd(1,3) == 2){
Echo("~You guard low and they strike at your middle.~<>");
Echo("~Their strike slashes you!~<>");
self_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(self_hp == 0){
Echo("~You are defeated!~<>");
defeat();
}
else{
guard();
}
}
else{
Echo("~You guard low and they strike high.~<>");
Echo("~Their strike slashes you!~<>");
self_hp -= 1;
Echo("Your health: "+self_hp+" -- Foe's health: "+foe_hp+"");
if(self_hp == 0){
Echo("~You are defeated!~<>");
defeat();
}
else{
guard();
}
}
}
function defeat(){
Echo("~"+Self.Name+"~<>: Haha! You can't beat the master. Come back soon.");
}
-- End Code --

-- Game 4 -- High-Low -- By Whiz --
var Number = Rnd(1,100);
var Turns = 0;
var Guess = 0;
Remaining = 0;
Winnings = 0;

function OnDialog(){
Echo("~"+Self.Name+"~<>: Hello, in this jar are a number of beans. Guess the number and you will win that number of gold pieces, but it will cost you 20 gold to try.");
ClearOptions();
AddOption(0,"Try it","","1,2,3,4");
AddOption(0,"Maybe another time","","");
AddOption(1,"Guess in three attempts (triple winnings)","op1(3,3);","");
AddOption(2,"Guess in five attempts (double winnings)","op1(5,2);","");
AddOption(3,"Guess in seven attempts (single winnings)","op1(7,1);","");
AddOption(4,"Changed my mind","","");
ProcessOptions();
}
function op1(MaxTurns,Multiplier){
if(PartyGold >= 20){
PartyGold -= 20;
Echo("~"+Self.Name+"~<>: Lets begin!");
Echo("~CHEAT- THE NUMBER IS "+Number+"!~<>");
op2(MaxTurns,Multiplier);
}
else{
Echo("~"+Self.Name+"~<>: Sorry, but you don't have enough gold to play.");
}
}
function op2(MaxTurns,Multiplier){
if(Turns == 0){
Echo("~"+Self.Name+"~<>: Make a guess!");
Guess = GetInput(4,"Guess","What number do you think it is?");
if(Guess == Number){
Win(Multiplier);
Turns = MaxTurns;
}
else if(Guess > Number){
Echo("~"+Self.Name+"~<>: Too high!");
Turns++;
if(Turns == MaxTurns){
Lose();
}
else{
}
}
else if(Guess < Number){
Echo("~"+Self.Name+"~<>: Too low!");
Turns++;
if(Turns == MaxTurns){
Lose(Multiplier);
}
else{
}
}
else{
}
op2(MaxTurns,Multiplier);
}
else{
while(MaxTurns > Turns){
Remaining = MaxTurns - Turns;
Echo("~"+Self.Name+"~<>: Only "+Remaining+" turns left.");
Guess = GetInput(4,"Guess","What number do you think it is?");
if(Guess == Number){
Win(Multiplier);
Turns = MaxTurns;
}
else if(Guess > Number){
Echo("~"+Self.Name+"~<>: Too high!");
Turns++;
if(Turns == MaxTurns){
Lose();
}
else{
}
}
else if(Guess < Number){
Echo("~"+Self.Name+"~<>: Too low!");
Turns++;
if(Turns == MaxTurns){
Lose(Multiplier);
}
else{
}
}
else{
}
}
}
}
function Win(X){
PartyGold += Number * X;
Winnings = Number * X;
Echo("~"+Self.Name+"~<>: You won! You have gained "+Winnings+" gold!");
}
function Lose(){
Echo("~"+Self.Name+"~<>: Too bad! Better luck next time!");
}
-- End Code --
Comments
Falthrum on June 14 2008 16:21:16
This was very helpful, thank you very much. Any additional games would be GREAT smileysmileysmiley
Post Comment
Please Login to Post a Comment.
Ratings
Rating is available to Members only.

Please login or register to vote.

Awesome! Awesome! 67% [2 Votes]
Very Good Very Good 33% [1 Vote]
Good Good 0% [No Votes]
Average Average 0% [No Votes]
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