Dark Nexus Rpg

By Ghost-writer on Nov 19, 2009

ehh just a little rpg i was making a while ago, i got the idea of a java script but i didnt completely get the idea from that so i didnt feel it was enough to give credit, if you want a link to the script just request and i will put it up, this is all in 1 window and you type /load, i tried to make the game as clear as possible and its not finished yet, there is NO diamond city, its just in the code.

on :load: {
  loadX
}
alias loadX {
  if ($?!"Do you want to load the game?") {
    write command.txt Commands are as fallowed
    write command.txt Forest- To enter the forest you type this.
    write command.txt Shop- To see the store and things you cannot afford type this!
    write command.txt Stats- To see your health and view your stats type this.
    write command.txt Town- To go back to town to heal or buy things type this.
    write command.txt Money- To view how much money you have, money and gold coins are different.
    write command.txt Sell- To sell items, you will usually get a hint the first time you get an item how to sell it.
    write command.txt Map-To see a list of places you can travel
    write command.txt Guide- For a guide/story line of the game type this, it will tell you excatly what to do.
    write command.txt All other commands are explained to you during the game.
    write guide.txt Welcome to the Guide, This will help you with the game, obviosly..
    write guide.txt First thing is first, you must enter the forest by typing "forest" in this window, to leave the forest type "town"
    write guide.txt Your current objective is to buy everything you can in the shop after killing ogres getting gold coins and levelling up to level 3-5
    write guide.txt once at level 5 and you have obtained a spellbook there will be a new route in the forest, whitch i cannot say the name of.
    write guide.txt once you go down this new route you will come to a river were you will verse a water troll
    write guide.txt after defeating this water troll the overpowering of magic will take you to a new place, whitch i can also not tell you the name of
    write guide.txt in this new place, they will have tons of new things whitch you can find out by visting there hero, they will also have a new place to start training against dragons etc. They will have new weaponry and other things
    write guide.txt after you get to this place you are suggested to enter the mine and get 1000 coal, after that you get a diamond sword and a new STRONG attack, the best in the game, after this there will be a diamond dragon whitch after you beat you will win the game, there will be tons of little journies along the way and iv only skimmed the game, good luck!
    window -e @Game
    startdark  
  }
}
on *:input:@Game: {
  if ($Readini(mirc.ini, mirc, commandchar) != $left($1,1)) {
    if ($account) {
      if ($1 == fight) && ($2 == hero) {
        if (!$readini(dark.ini, fight, monster)) {
          if ($readini(dark.ini, character, area) == alasgnia) {
            echo @game You have walked into the training facility and you run right to the master
            echo @Game you take out your $weapon and point it to the masters face, in return the master takes out a crystal
            echo @game the master drops the crystal and runs, The crystal starts glowing!
            echo @Game Oh no! its a diamond dragon! Defend yourself!
            echo @game your attacks are $attack
            inc %dragonhealth 50
            writeini dark.ini fight Health $calc(450 + %DragonHealth)
            writeini dark.ini Fight Monster Selestual Diamond Dragon
            writeini dark.ini fight Move SDD
            writeini dark.ini fight loss SDRL
          }
          else echo @game You are not in alasgnia to challange the hero
        }
        else echo @game You are already fighting somthing!
      }
      if ($1 == visit) && ($regex($lower($2-),hero|master) || ($1 == places)) {
        if ($readini(dark.ini, character, area) == alasgnia) {
          echo @game Welcome young warrior, to alasgnia. The place of many warriors.
          echo @game Here you can -Train-
          echo @game Enter Caves -Cave-
          echo @game Special make armour -Smith-
          echo @game Go to the new and improved shop -Shop-
          echo @game And once you think you are strong enough, Verse me, -Fight Hero-
          echo @game And if you beat me i shall give you a key to the next realm.
        }
        elseif ($readini(dark.ini, character, area) == town) {
          echo @game Welcome to the town novice.
          echo @game here you can go to the shop -Shop-
          echo @game you can journy into thy woodlands -Forest-
          echo @game and you can search for tha hidden alley!
          echo @game try getting a spellbook, thats when all the fun starts!
        }
        else echo @game You are not in a city or town!
      }
      if ($1 == mine) {
        if ($readini(dark.ini, character, area) == cave) {
          if (!$readini(dark.ini, fight, monster)) {
            var %chance $rand(1,5)
            if (%chance == 5) {
              echo @game you have started mining and hear somthing around the corner!
              echo @game ohh no! Its a dragon! Quick, defend yourself!
              echo @game your attacks are $attack            
              writeini dark.ini fight Health 200
              writeini dark.ini Fight Monster Dragon
              writeini dark.ini fight Move Dr
              writeini dark.ini fight loss DRL
              halt
            }
            else {
              var %x $rand(15,30)
              addini dark.ini character coal %x
              echo @game You start mining and end up getting %x coal! You now have $readini(dark.ini, character, coal) coal!
            }
          }
          else echo @game You are in a fight, you cannot mine!
        }
        else echo @game You are not in a cave, you cannot mine!
      }
      if (smith isin $1-) {
        if (!$2) {
          echo @game You want to learn to smith?
          echo @game First you need 4gems And 8gold, after that i can make gem armours for you!
          echo @game One of the finest there is! Here is a list.
          echo @game Diamond Sword - 900 gold - 1 diamond
          echo @Game Ruby Chestplate - 100 gold & 50 rubies
          echo @game Golden Chestplate - 50 gold
          echo @game 0,14Diamond14,1 - 1000 coal
          echo @game To make any of these you type !Smith Object
          echo @game You can buy gold from me for 100 a piece!
          echo @Game To get coal, go in the cave and type "mine"
        }
        if (diamond isin $1-) && (sword !isin $1-) {
          if ($readini(dark.ini, character, coal) >= 1000) {
            echo @game The smith takes all your coal and compresses it!
            echo @game You end up with 1 rock hard diamond!
            decini dark.ini character coal 1000
            writeini dark.ini character diamond 1
          }
          else echo @game You do not have enough coal! You require 1000!
        }
        if (diamond isin $1-) && (sword isin $1-) {
          if ($readini(dark.ini, character, gold) >= 900) {
            if ($readini(dark.ini, character, Diamond)) {
              echo @game You go to the smith with 900 gold and 1 diamond
              echo @game The smith gives you a diamond sword!
              decini dark.ini character diamond 1
              decini dark.ini character gold 900
              writeini dark.ini character weapon Diamond Sword
              writeini dark.ini character power 10
            }
            else echo @Game You do not have any diamonds!
          }
          else echo @game You do not have enough gold!
        }
        if (gold isin $1-) && ($regex($lower($1-),chest|armour)) {
          if ($readini(dark.ini, character, gold) >= 50) {
            if ($readini(dark.ini, character, armour) < 9) {
              echo @game You go to the smith with 100 gold and 50 rubies
              echo @game The smith gives you a gold chestplate!
              decini dark.ini character gold 50
              writeini dark.ini character basehealth 350
              writeini dark.ini character armour 9
            }
            else echo @game You armour is already better than this!
          }
          else echo @game You do not have enough gold!
        }
        if (ruby isin $1-) && ($regex($lower($1-),chest|armour)) {
          if ($readini(dark.ini, character, gold) >= 100) {
            if ($readini(dark.ini, character, ruby) >= 50) {
              if ($readini(dark.ini, character, armour) < 10) {
                echo @game You go to the smith with 100 gold and 50 rubies
                echo @game The smith gives you a ruby chestplate!
                decini dark.ini character gold 100
                decini dark.ini character ruby 50
                writeini dark.ini character basehealth 500
                writeini dark.ini character armour 10
              }
              else echo @game You armour is already better than this!
            }
            else echo @game You do not have enough rubies!
          }
          else echo @game You do not have enough gold!
        }
      }
      if ( $1 == cave) {
        if ($readini(dark.ini, character, area) == alasgnia) {
          echo @game You have entered the cave and fell down a deep passage! I dont think you will be able to get back up with out teleporting or dieing!
          echo @game Would you like to go North - South - West - East - Mine
          writeini dark.ini character area cave        
        }
        else echo @game $iif($readini(dark.ini, character, area) == cave,You are already in the cave $+ $chr(44) to leave type teleport alasgnia!, You are to far to enter the cave!)
      }
      if ($1 == train) {
        echo @Game You have entered a training facility and see warriors fighting!
        echo @game a warrior comes up to you and slashes towards your chest! Quick fight him!
        echo @game Your attacks are $attack
        writeini dark.ini fight Health 150
        writeini dark.ini Fight Monster Warrior
        writeini dark.ini fight Move WD
        writeini dark.ini fight loss WDL
      }
      if ($1 == money) {
        echo @game You have3 $bytes($readini(dark.ini, Character, Money),db) Dollars with you at the moment!
      }
      if (dark isin $1-) && ( alley isin $1-) && (tele !isin $1-) {
        if ($readini(dark.ini, spellbook, cast)) {
          if ($readini(dark.ini, character, area) == forest) {
            if (!$readini(dark.ini, fight, monster)) {
              echo @game You have went down the rechid dark alley and end up beside a river!
              echo @game Whitch way would you like to venture, North - South - East - West
              writeini dark.ini character area Dark Alley
            }
            else echo @game You are currently fighting a monster!
          }
          else echo @game You are not in the forest to go this direction!
        }
        else echo @game You are not high enough levelled to go down this alley!
      }
      if (Tele isin $1-) {
        if ($rune) {
          if (alley isin $2-) {
            echo @game You have teleported to the dark alley!
            writeini dark.ini character area dark Alley
            remini dark.ini fight
            writeini dark.ini character rune $calc($readini(dark.ini, character, rune) - 1)
            echo @game Whitch direction would you like to go?            
            halt        
          }
          if ($2 == town) {
            echo @game You have teleported to the town!
            writeini dark.ini character area town
            remini dark.ini fight
            writeini dark.ini character rune $calc($readini(dark.ini, character, rune) - 1)
            halt        
          }
          if ($2 == forest) {
            echo @game You have teleported to the forest!
            writeini dark.ini character area forest
            remini dark.ini fight
            writeini dark.ini character rune $calc($readini(dark.ini, character, rune) - 1)
            halt         
          }
          if ($2 == alasgnia) {
            echo @game You have teleported to the city alasgnia!
            writeini dark.ini character area alasgnia
            remini dark.ini fight
            writeini dark.ini character rune $calc($readini(dark.ini, character, rune) - 1)
            halt         
          }
          else { echo @game You cannot teleport there! You can only teleport to the town & Forest $iif($Readini(dark.ini, spellbook, cast),& Alasgnia & Dark alley) $+ ! | halt }        
        }
        else { echo @game You do not have any runes! | halt }
      }
      if (buy isin $1-) {
        if (gold isin $1-) {
          if ($2 isnum) {
            if ($readini(dark.ini, character, area) == alasgnia) {
              if ($money > $calc($2 * 100)) {
                addini dark.ini character gold $2
                decini dark.ini character money $calc($2 * 100)
                echo @Game You have bought $2 gold for $calc($2 * 100) dollars!
              }
              else echo @game You do not have enough money!
            }
            else echo @game You are not in alasgnia, the only place that sells these!
          }
          else echo @game Syntax - Buy <number> Gold
        }
        if (dragon isin $1-) && ( armour isin $1-) {
          if ($money > 25000) {
            echo @game You have purchased dragon armour!
            if (!$readini(dark.ini, character, Armour)) || ($readini(dark.ini, character, armour) < 3) {
              writeini dark.ini character armour 3
              writeini dark.ini character basehealth 250
            }
            else { echo @game You already have a better armour than this! | halt )
            }
            else { echo @game You do not have enough money for this! | halt }
          }
        }
        if (dragon isin $1-) && (sword isin $2-) {
          if ($money >= 15000) {
            if ($readini(dark.ini, character, power) < 5) {
              echo @game You have purchased a dragon sword!
              writeini dark.ini character power 5
              writeini dark.ini character weapon Dragon Sword
              decini dark.ini character money 15000
              echo @game You now have $bytes($readini(dark.ini, character, money),db) dollars left!
            }
            else { echo @Game You already have a better weapon than this! | halt }
          }
          else echo @game You do not have enough money to purchase this!
        }
        if (magic isin $1-) && (rune isin $1-) {
          if ($2 isnum) {
            if ($money >= $calc($2 * 100)) {
              decini dark.ini character money $calc($2 * 100)
              addini dark.ini character rune $2
              echo @game You have purchased $2 Magical runes!
              echo @game You now have $readini(dark.ini, character, rune) runes and $readini(dark.ini, character, money) dollars!
              halt          
            }
            else { echo @game You do not have enough money to buy this many runes! | halt }
          }
          else { echo @game The syntax is Buy <number> Magical runes | halt }
        }
        if (armour isin $1-) && (steel isin $1-) {
          if ($money >= 2500) {
            if (!$readini(dark.ini, character, Armour)) || ($readini(dark.ini, character, armour) < 2) {
              writeini dark.ini character armour 2
              writeini dark.ini character basehealth 150
              writeini dark.ini character money $calc($readini(dark.ini, character, money) - 2500)
              echo @game You have purchased steel armour for 2,500 dollars! You now have $money dollars!
            }
            else echo @game You already have better armour than this!
          }
          else echo @game You do not have enough money to buy this, You need 2,500 dollars, You only have $money dollars $+ !
        }
        if (magic isin $1-) && (sword isin $1-) {
          if ($money >= 5000) {
            if ($readini(dark.ini, character, power) < 3) {
              writeini dark.ini character power 3
              writeini dark.ini character weapon Magic Sword
              writeini dark.ini character money $calc($readini(dark.ini, character, money) - 5000)
              echo @game You have purchased a magical sword! You now have $money left!
              halt
            }
            else { echo @game You already have a better sword than this! | halt }
          }
          else { echo @game You do not have enough money to purchase this! | halt }
        }
        if (spell isin $1-) && (book isin $1-) {
          if ($money >= 2000) {
            if ($lv >= 5) {
              if (!$readini(dark.ini, SpellBook, Cast)) {
                var %x $gettok(Spark|Freeze|Darken|Inferno,$rand(1,4),124)
                writeini dark.ini spellbook cast Able
                writeini dark.ini spellbook %x Acquired
                writeini dark.ini character money $calc($readini(dark.ini, character, money) - 2000)
                echo @game You have purchased a spell book, and your first spell is %x $+  To use this spell just type it while in a battle
                echo @game You may now also teleport whitch will end any battle you have and bring you to town, you just have to have 1 magical rune!
              }
              else echo @game You already have the basic spell book, to get more spells kill wizards, they occasionally drop new spells.
            }
            else echo @game you are not a high enough level to wield this kind of magic! Try again at level 5!
          }
          else echo @game You do not have enough money to purchase this book, You need 2000 at least!
        }
      }
      if ($regex($lower($1),shop|store|market)) {
        if ($readini(dark.ini, character, area) == town) {
          echo @game Hello! Welcome to the store! How may i help you?
          echo @game in stock we currently have,
          echo @game 15Steel Armour14(09 $+ 2500 Dollars14)
          echo @game 12Magical Sword14(09 $+ 5000 dollars14)
          echo @game 4Spell Book14(09 $+ ? Dollars14)
          echo @game To buy any of these type !buy item $+ .
        }
        elseif ($readini(dark.ini, character, area) == alasgnia) {
          echo @game Hey there, welcome to the store of alasgnia, how may i server you?
          echo @game in stock we currently have,
          echo @game 6Magical runes14(09 $+ 100 Dollars 4<Per Rune>14)
          echo @Game 4Dragon Armour14,1(09 $+ 25,000 Dollars14)
          echo @Game 4Dragon sword14,1(09 $+ 15,000 Dollars14)
          echo @game To buy any of these type !buy Item.        
        }
        else echo @Game You are not in a town
      }
      if (comman isin $1) {
        echo @game <_-^Darkest Commands^-_>
        var %x 1
        while (%x < $calc($lines(command.txt) + 1)) {
          .timer 1 $calc(%x * 3) echo @game $read(command.txt, %x)
          inc %x        
        }
      }
      if (guid isin $1) {
        echo @game <_-^Darkest Guide^-_>
        var %x 1
        while (%x < $calc($lines(guide.txt) + 1)) {
          .timer 1 $calc(%x * 3) echo @game $read(guide.txt, %x)
          inc %x        
        }
      }
      if ($1 == map) mapout
      if (stat isin $1-) stats
      if ($1 == start) startdark
      if (fores isin $1-) {
        if ($Readini(dark.ini, character, area) != forest) {
          echo @game You have walked into the 3Forest $+ ! Whitch way would you like to go? North - South - East - West $iif($readini(dark.ini, spellbook, cast),-Dark Alley-)
          writeini dark.ini character area Forest
        }
        else {
          echo @game You are currently in the forest! To leave the forest you can type "Town"
        }
      }
      if (obliv isin $1-) {
        if ($Readini(dark.ini, spellbook, obliviate)) {
          if ($readini(dark.ini, fight, monster)) {
            if ($readini(dark.ini, character, rune) >= 5) {
              var %x $rand(30,50)
              writeini dark.ini character rune $calc($readini(dark.ini, character, rune) - 5)
              echo @game 8,1You cast the obliviate spell on the4 $Readini(dark.ini, fight, monster) 1,8dealing8,1 %x 1,8Damage!
              writeini dark.ini fight health $calc($readini(dark.ini, fight, health) - %x)
              if ($Readini(dark.ini, fight, health) <= 0) {
                unset %magic
                $readini(dark.ini, fight, loss)
                remini dark.ini fight
              }
              else {
                echo @game The $readini(dark.ini, fight, monster) has $readini(dark.ini, fight, health) health left! 
                $Readini(dark.ini, fight, move)
              }
            }
            else echo @game You do not have enough runes to cast this spell!
          }
          else echo @game You are not currently fighting any monsters!
        }
        else echo @game You do not have the obliviate spell!
      }
      if (Pyro isin $1-) {
        if ($readini(dark.ini, fight, monster)) {
          var %x $calc($readini(dark.ini, character, power) * $rand(1,5))
          inc %x $rand(15,19)
          echo @game 7You have slashed the8 $Readini(dark.ini, fight, monster) 7across the chest dealing8 %x 7Damage!
          writeini dark.ini fight health $calc($readini(dark.ini, fight, health) - %x)
          if ($Readini(dark.ini, fight, health) <= 0) {
            unset %magic
            $readini(dark.ini, fight, loss)
            remini dark.ini fight
          }
          else {
            echo @game The $readini(dark.ini, fight, monster) has $readini(dark.ini, fight, health) health left! 
            $Readini(dark.ini, fight, move)
          }
        }
        else echo @game You are not currently fighting any monsters!
      }
      if (diamond isin $1-) && (strike isin $1-) {
        if ($readini(dark.ini, fight, monster)) {
          var %x $calc($readini(dark.ini, character, power) * $rand(1,5))
          inc %x $rand(20,33)
          echo @game 0,14You have swung your diamond sword at the4 $Readini(dark.ini, fight, monster) 0,14spraying out diamonds 4dealing4 %x 0,14Damage!
          decini dark.ini fight health %x
          if ($Readini(dark.ini, fight, health) <= 0) {
            unset %magic
            $readini(dark.ini, fight, loss)
            remini dark.ini fight
          }
          else {
            echo @game The $readini(dark.ini, fight, monster) has $readini(dark.ini, fight, health) health left! 
            $Readini(dark.ini, fight, move)
          }
        }
      }
      if (punc isin $1-) {
        if ($readini(dark.ini, fight, monster)) {
          var %x $calc($readini(dark.ini, character, power) * $rand(1,5))
          inc %x $rand(10,13)
          echo @game 7You have punched the4 $Readini(dark.ini, fight, monster) 7in the $gettok(Face|Chest|Stomach|Liver,$rand(1,4),124) 4dealing4 %x 7Damage!
          decini dark.ini fight health %x
          if ($Readini(dark.ini, fight, health) <= 0) {
            unset %magic
            $readini(dark.ini, fight, loss)
            remini dark.ini fight
          }
          else {
            echo @game The $readini(dark.ini, fight, monster) has $readini(dark.ini, fight, health) health left! 
            $Readini(dark.ini, fight, move)
          }
        }
        else echo @game You are not currently fighting any monsters!
      }
      if ($regex($lower($1),spark|freeze|darken|inferno)) {
        if ($readini(dark.ini, spellbook, cast)) {        
          if ($readini(dark.ini, fight, monster)) {
            if ($readini(dark.ini, spellbook, $1)) {
              if ($readini(dark.ini, character, rune) >= 1) {
                writeini dark.ini character rune $calc($readini(dark.ini, character, rune) - 1)
                var %x $calc($readini(dark.ini, character, power) * $rand(1,5))
                inc %x $rand(10,25)
                echo @game 12You have used the $1 spell on the6 $Readini(dark.ini, fight, monster) 12dealing6 %x 12Damage!
                writeini dark.ini fight health $calc($readini(dark.ini, fight, health) - %x)
                if ($Readini(dark.ini, fight, health) <= 0) {
                  unset %magic
                  $readini(dark.ini, fight, loss)
                  remini dark.ini fight
                }
                else {
                  echo @game The $readini(dark.ini, fight, monster) has $readini(dark.ini, fight, health) health left! 
                  $Readini(dark.ini, fight, move)
                }
              }
              else echo @game You do not have enough runes to cast this spell!
            }
            else echo @game You do not have this spell bought yet!
          }
          else echo @game You are not currently fighting any monsters!
        }
        else echo @game You do not have a spellbook yet! You do not know how to tame this spell!
      }
      if (Dragon isin $1-) && (fang isin $1-) {
        if ($readini(dark.ini, fight, monster)) {
          var %x $calc($readini(dark.ini, character, power) * $rand(1,5))
          inc %x $rand(14,29)
          echo @game 12You have slashed the4 $Readini(dark.ini, fight, monster) 12with your sword 4and a dragon comes out 12dealing4 %x 12Damage!
          writeini dark.ini fight health $calc($readini(dark.ini, fight, health) - %x)
          if ($Readini(dark.ini, fight, health) <= 0) {
            unset %magic
            $readini(dark.ini, fight, loss)
            remini dark.ini fight
          }
          else {
            echo @game The $readini(dark.ini, fight, monster) has $readini(dark.ini, fight, health) health left! 
            $Readini(dark.ini, fight, move)
          }
        }
        else echo @game You are not currently fighting any monsters!
      }
      if (slas isin $1-) {
        if ($readini(dark.ini, fight, monster)) {
          var %x $calc($readini(dark.ini, character, power) * $rand(1,5))
          inc %x $rand(9,20)
          echo @game 15You have slashed the14 $Readini(dark.ini, fight, monster) 15with your14 sword 15dealing4 %x 14Damage!
          writeini dark.ini fight health $calc($readini(dark.ini, fight, health) - %x)
          if ($Readini(dark.ini, fight, health) <= 0) {
            unset %magic
            $readini(dark.ini, fight, loss)
            remini dark.ini fight
          }
          else {
            echo @game The $readini(dark.ini, fight, monster) has $readini(dark.ini, fight, health) health left! 
            $Readini(dark.ini, fight, move)
          }
        }
        else echo @game You are not currently fighting any monsters!
      }
      if (magic isin $1-) {
        if ($readini(dark.ini, fight, monster)) {
          if (%magic < 3) || (!%magic) {
            inc %magic
            var %x $calc($readini(dark.ini, character, power) * $rand(1,5))
            inc %x $rand(15,25)
            echo @game 12You have blasted the11 $Readini(dark.ini, fight, monster) 12with your11 magic 12dealing4 %x 12Damage!
            writeini dark.ini fight health $calc($readini(dark.ini, fight, health) - %x)
            if ($Readini(dark.ini, fight, health) <= 0) {
              unset %magic
              $readini(dark.ini, fight, loss)
              remini dark.ini fight
            }
            else {
              echo @game The $readini(dark.ini, fight, monster) has $readini(dark.ini, fight, health) health left! 
              $Readini(dark.ini, fight, move)
            }
          }
          else echo @game You have overused your magic for this fight!
        }
        else echo @game You are not fighting a monster!
      }
      if (sell isin $1-) {
        if (rub isin $1-) {
          if ($readini(dark.ini, character, area) == alasgnia) {
            if ($2 isnum) {
              if ($readini(dark.ini, character, ruby) >= $2) {
                echo @Game You have sold $2 rubies for $calc($2 * 500) dollars!
                addini dark.ini character money $calc($2 * 500)
                decini dark.ini character ruby $2              
              }
              else echo @game You do not have that many rubies!
            }
            else echo @game Syntax- Sell <Number> Rubies
          }
          else echo @game they only buy this in alasgnia!
        }
        if (gold isin $1-) {
          if ($2 isnum) {
            if ($readini(dark.ini, character, gold) >= $2) {
              if ($regex($lower($readini(dark.ini, character, area)),town|alasgnia)) {
                echo @game You have sold $2 golden coins for $calc($2 * 50) Dollars!
                writeini dark.ini character money $calc($readini(dark.ini, character, money) + $calc($2 * 50))
                writeini dark.ini character gold $calc($readini(dark.ini, character, gold) - $2)             
              }
              else aline 4 @game You are not in, You are in area: $Readini(dark.ini, character, area) $+ ! Journey to town to sell this.
            }
            else aline 4 @Game You do not have that much gold!
          }
          else aline 4 @game Syntax is Sell <Amount> Gold Coins
        }
      }
      if ($regex($lower($1-),heal|revive|replenish|rest)) && (fores !isin $1-) {
        if ($regex($lower($readini(dark.ini, character, area)),town|alasgnia)) {
          if (!$readini(dark.ini, fight, monster)) {
            heal
          }
          else echo @game You are currently in a fight, you cannot heal!
        }
        else echo @game You are not in town, how can you rest?
      }
      if (Town isin $1-) {
        if ($Readini(dark.ini, character, area) == forest) {
          if (!$readini(dark.ini, fight, monster)) {
            echo @game You have walked to the town!
            writeini dark.ini character area Town
          }
          else echo @game You are currently fighting a monster, you cant go to town!
        }
        else echo @game $iif($Readini(dark.ini, character, area) == town,You are already in the town!,You are to far from town to walk there!)
      }
      if ($regex($lower($1),north|south|east|west)/bi) {
        if (!$readini(dark.ini, fight, monster)) {
          if ($readini(dark.ini, character, area) == cave) {
            var %chance $rand(1,3)
            if (%chance == 3) {
              echo @game You have walked $1 and found a ruby on the floor!
              addini dark.ini character ruby 1
              halt
            }
            else {
              echo @game you have walked $1 and hear somthing around the corner!
              echo @game ohh no! Its a dragon! Quick, defend yourself!
              echo @game your attacks are $attack            
              writeini dark.ini fight Health 200
              writeini dark.ini Fight Monster Dragon
              writeini dark.ini fight Move Dr
              writeini dark.ini fight loss DRL
              halt
            }
          }
          if ($readini(dark.ini, character, area) == dark alley) {
            echo @game You have walked $1 and you come across a swamp demon!
            echo @game it approaches you with a thick grin! Fight it, quick!
            echo @game your attacks are $attack            
            writeini dark.ini fight Health 185
            writeini dark.ini Fight Monster Swamp Demon
            writeini dark.ini fight Move SD
            writeini dark.ini fight loss SDL
          }
          elseif ($readini(dark.ini, character, area) == forest) {
            var %chance $iif($lv < 3,$rand(1,3),$rand(1,5))
            if (%chance == 1) {
              var %amount $rand(2,10)
              writeini dark.ini character Gold $calc($readini(dark.ini, character, Gold) + %amount)
              echo @game You have travelled $1 And found %amount gold coins on the floor! You pick it up and go on walking!
              if (!$Readini(dark.ini, Tips, Goldcoin)) {
                noop $tip(Dark,Dark Game Tip,To sell gold coins go to town and type @sell <Amount> Gold coins!,10)
                $iif($?!"Do you want me to remind you of this again?",writeini dark.ini Tips Goldcoin 1)
              }          
            }
            if (%chance == 2) {
              echo @game You walk $1 and out comes a ogre! Quick, fight it!
              echo @game your attacks are $attack
              writeini dark.ini fight Health 100
              writeini dark.ini Fight Monster Ogre
              writeini dark.ini fight Move Ogre
              writeini dark.ini fight loss OGL
            }
            if (%chance == 3) {
              echo @game You walk $1 and out comes a bird! It flies away.
            }
            if (%chance > 3) {
              echo @game You walk $1 and you see a shadow
              echo @game Oh no! Its a Dark Wizard, You must now fight it!
              echo @game your attacks are $attack
              writeini dark.ini fight Health 125
              writeini dark.ini Fight Monster Dark Wizard
              writeini dark.ini fight Move Wizard
              writeini dark.ini fight loss Wzl
            }
          }
          else echo @game You are not in an area you can use this command in!
        }
        else echo @game You are currently fighting! You cannot move!
      }
    }
    if ($1 == start ) { startdark | halt }
    elseif (!$account) aline 4 @game You do not have an account yet! Type Start to get started!
  }
  else $strip($1-)
}
alias account {
  return $iif($ini(dark.ini, Character),$true,$false)
}
menu c* {
  DarkGame
  .Start Game: {
    if (!$account) {
      Window -e @game
      Startdark
    }
  }
  .Play Game: Window -e @Game 
}
alias startdark {
  window -e @Game
  .timer 1 1 echo @game So $nick $+ , You want to start the trilogy of a thousand heros! Be warned, this is harder than you think!
  .timer 1 5 echo @game first, i shall give you a steel blade and 500 dollars
  .timer 1 7 echo @game You will have to journy into the forest and kill ogres to be stronger and succesful!
  .timer 1 10 echo @game Come visit me when you are stronger, until then, good luck!
  .timer 1 12 echo @game Type "Commands" in this window for help.
  writeini dark.ini character money 500
  writeini dark.ini character weapon Steel
  writeini dark.ini character Power 1
  writeini dark.ini character xp 5
  writeini dark.ini character health 100
  writeini dark.ini character basehealth 100
  writeini dark.ini character area town
}
alias -l attack {
  var %x 14-7 Punch 14-12 Magic 14-
  if ($Readini(dark.ini, character, weapon) == Diamond Sword) var %x %x 15 Slash 14-
  if ($Readini(dark.ini, character, weapon) == Diamond Sword) var %x %x 0,14 Diamond Strike 14,1 -
  if ($Readini(dark.ini, character, weapon) == Dragon Sword) var %x %x 15 Slash 14-
  if ($Readini(dark.ini, character, weapon) == Dragon Sword) var %x %x 4,12 Dragon Fang 14,1 -
  if ($Readini(dark.ini, character, weapon) == steel) var %x %x 15 Slash 14-
  if ($Readini(dark.ini, character, weapon) == magic sword) var %x %x 15 Slash 14-
  if ($Readini(dark.ini, character, weapon) == magic sword) var %x %x 4 Pyro Blade 14-
  if ($Readini(dark.ini, spellbook, spark)) var %x %x 8Spark 14-
  if ($Readini(dark.ini, spellbook, Freeze)) var %x %x 11Freeze 14-
  if ($Readini(dark.ini, spellbook, Darken)) var %x %x 6Darken 14-
  if ($Readini(dark.ini, spellbook, Inferno)) var %x %x 4Inferno 14-
  if ($Readini(dark.ini, spellbook, obliviate)) var %x %x 4,8Obliviate 14-
  return %x
}
alias stats {
  window -e @game
  echo @game $str(-,12) 12Stats $str(-,12)
  echo @game You are 15- 12level4 $lv 15- 12Experience4 $readini(dark.ini, character, xp) 15- 
  echo @game Your current health:9 $readini(dark.ini, character, health)  
  echo @game Your current weapon is: $weapon
  echo @game You currently have items: $item
  echo @game Your current money amount:3 $bytes($money,db)
  echo @game You are currently in area: $upper($left($readini(dark.ini, character, area),1)) $+ $mid($readini(dark.ini, character, area),2,99)
  echo @game $str(-,12) 12Stats $str(-,12)
}
alias -l weapon {
  if ($readini(dark.ini, character, weapon) == steel) return 15Steel Sword
  if (magic isin $readini(dark.ini, character, weapon)) return 12Magical Sword
  if (dragon isin $readini(dark.ini, character, weapon)) return 4Dragon Sword
  if (Diamond isin $readini(dark.ini, character, weapon)) return 0,14Diamond Sword
}
alias -l item {
  Var %x 14-
  if ($readini(dark.ini, character, armour) == 2) var %x %x 15Steel Armour 14-
  if ($readini(dark.ini, character, armour) == 9) var %x %x 8Gold Armour 14-
  if ($readini(dark.ini, character, armour) == 10) var %x %x 4 Ruby Armour 14-
  if ($readini(dark.ini, character, armour) == 3) var %x %x 4Dragon Armour $+ $chr(32) $+ 14,1-
  if ($readini(dark.ini, spellbook, cast)) var %x %x 12Spell book 14-
  if ($readini(dark.ini, character, gold)) var %x %x 08 $+ $readini(dark.ini, character, gold) Gold Coins 14-
  if ($readini(dark.ini, character, Rune)) var %x %x 06 $+ $readini(dark.ini, character, Rune) Magical Runes 14-
  if ($readini(dark.ini, character, Rune)) var %x %x 04 $+ $readini(dark.ini, character, Ruby) Rubies 14-
  if ($readini(dark.ini, character, coal)) var %x %x 14 $+ $readini(dark.ini, character, coal) coal 14-
  if ($readini(dark.ini, character, diamond)) var %x %x 15 $+ $readini(dark.ini, character, diamond) diamond 14-
  return $iif($strip(%x) == -,None,%x)
}
alias lv {
  var %x 1
  var %B $readini(dark.ini, character, xp)
  if (%b > 50) inc %x
  if (%b > 99) inc %X
  if (%b > 150) inc %X
  if (%b > 250) inc %x
  if (%b > 400) inc %X
  if (%b > 675) inc %x
  if (%b > 925) inc %x
  if (%b > 1125) inc %x
  if (%b > 1135) set %x $decmr($calc(%b / 120))
  return %x
}
alias wizard {
  var %x $rand(8,35)
  echo @game 6The1,6 wizard 6,1has blasted you with its 1,6dark nexus6,1 spell dealing4 %x 6,1damage!
  writeini dark.ini character health $calc($Readini(dark.ini, character, health) - %x)
  if ($readini(dark.ini, character, health) <= 0) {
    var %b $rand(10,35)
    unset %magic
    remini dark.ini fight
    aline 4 @game You have died! You wake up in the town with %b Dollars missing!
    writeini dark.ini character area town
    writeini dark.ini character health $basehp
    writeini dark.ini character money $calc($readini(dark.ini, character, money) - %b)
  }
  else echo @game You have $readini(dark.ini, character, health) health left!
}
alias SD {
  var %chance $rand(1,3)
  if (%chance == 1) {
    var %x $rand(10,40)
    echo @Game 14The swamp demon has blasted you with12 Aqua Tide14 dealing12 %x 14Damage!
  }
  else {
    var %x $rand(5,15)
    echo @game 14The swamp demon has hit you with a 5wooden club14 dealing4 %x 14Damage!
  }
  writeini dark.ini character health $calc($Readini(dark.ini, character, health) - %x)
  if ($readini(dark.ini, character, health) <= 0) {
    var %b $rand(10,35)
    unset %magic
    remini dark.ini fight
    aline 4 @game You have died! You wake up in the town with %b Dollars missing!
    writeini dark.ini character area town
    writeini dark.ini character health $basehp
    writeini dark.ini character money $calc($readini(dark.ini, character, money) - %b)
  }
  else echo @game You have $readini(dark.ini, character, health) health left!
}

alias ogre {
  var %x $rand(5,25)
  echo @game The ogre has hit you with a 5wooden club dealing4 %x Damage!
  writeini dark.ini character health $calc($Readini(dark.ini, character, health) - %x)
  if ($readini(dark.ini, character, health) <= 0) {
    var %b $rand(10,35)
    unset %magic
    remini dark.ini fight
    aline 4 @game You have died! You wake up in the town with %b Dollars missing!
    writeini dark.ini character area town
    writeini dark.ini character health $basehp
    writeini dark.ini character money $calc($readini(dark.ini, character, money) - %b)
  }
  else echo @game You have $readini(dark.ini, character, health) health left!
}
alias -l basehp {
  return $iif($readini(dark.ini, character, basehealth),$v1,100)
}
alias ogl {
  var %amount $rand(15,35)
  writeini dark.ini character Gold $calc($readini(dark.ini, character, Gold) + %amount)
  aline 11 @game You have defeated the ogre!
  echo @game You find %amount gold coins in its dead body!
  writeini dark.ini character xp $calc($Readini(dark.ini, character, xp) + $rand(5,25)) 
  if (!$Readini(dark.ini, Tips, Heal)) {
    noop $tip(Dark,Dark Game Tip,To heal you can go into the town and type "Heal" and to check your health type "stats" $+ $chr(44) I suggest you do this before any further fighting!,10,,,heal1)
    $iif($?!"Dont tell me this again",writeini dark.ini Tips Heal 1)
  }    
}
alias DR {
  var %chance $rand(1,2)
  if (%chance == 2) {
    var %x $rand(15,35)
    echo @game 14The dragon has breathed 4fire 14on you causing4 %x 14damage!
  }
  if (%chance == 1) {
    var %x $rand(5,15) 
    echo @game 14the dragon has 11flew14 by you slashing you across the11 $gettok(chest|face,$rand(1,2),124) 14causing11 %x 14damage!
  }
  writeini dark.ini character health $calc($Readini(dark.ini, character, health) - %x)
  if ($readini(dark.ini, character, health) <= 0) {
    var %b $rand(10,35)
    unset %magic
    remini dark.ini fight
    aline 4 @game You have died! You wake up in alasgnia with %b Dollars missing!
    writeini dark.ini character area alasgnia
    writeini dark.ini character health $basehp
    writeini dark.ini character money $calc($readini(dark.ini, character, money) - %b)
  }
  else echo @game You have $readini(dark.ini, character, health) health left!
}
alias sdd {
  var %chance $rand(1,2)
  if (%chance == 1) {
    var %x $rand(15,35)
    echo @game 0,14The 4,14Selestual Diamond Dragon 0,14has slashed you across the4,14 $gettok(chest|face|torso,$rand(1,3),124) 0,14with its diamond claws dealing4,14 %x 0,14Damage!
  }
  else {
    var %x $rand(25,50)
    echo @game 15,14The 4,14Selestual Diamond Dragon15,14 has blasted out razor sharp diamonds at you dealing4,14 %x 15,14damage!
  }
  writeini dark.ini character health $calc($Readini(dark.ini, character, health) - %x)
  if ($readini(dark.ini, character, health) <= 0) {
    var %b $rand(1000,3500)
    unset %magic
    remini dark.ini fight
    aline 4 @game You have died! You wake up in alasgnia with %b Dollars missing!
    writeini dark.ini character area alasgnia
    writeini dark.ini character health $basehp
    writeini dark.ini character money $calc($readini(dark.ini, character, money) - %b)
  }
  else echo @game You have $readini(dark.ini, character, health) health left!
}
alias Wd {
  var %x $rand(15,35)
  echo @game 14The warrior has slashed you across the $gettok(chest|face|torso,$rand(1,3),124) with his 4blood sword dealing4 %x Damage!
  writeini dark.ini character health $calc($Readini(dark.ini, character, health) - %x)
  if ($readini(dark.ini, character, health) <= 0) {
    var %b $rand(10,35)
    unset %magic
    remini dark.ini fight
    aline 4 @game You have died! You wake up in alasgnia with %b Dollars missing!
    writeini dark.ini character area alasgnia
    writeini dark.ini character health $basehp
    writeini dark.ini character money $calc($readini(dark.ini, character, money) - %b)
  }
  else echo @game You have $readini(dark.ini, character, health) health left!
}
alias sdrl {
  var %amount $rand(500,1000)
  var %ram $rand(1,4)
  writeini dark.ini character Gold $calc($readini(dark.ini, character, Gold) + %amount)
  addini dark.ini character diamond %ram
  aline 11 @game You have defeated the Selestual Diamond Dragon!
  echo @game You find %amount golden coins in the dragon corpse along with %ram diamonds!
  writeini dark.ini character xp $calc($Readini(dark.ini, character, xp) + $rand(35,75)) 
  if (!$readini(dark.ini, tips, dcity)) {
    noop $tip(Dark,Dark Game Tip,With enough diamonds you can teleport to diamond citidel! You just need about 10. Good luck! <Teleport Diamond City>,15,,,heal1)
    $iif($?!"Dont tell me this again",writeini dark.ini Tips dcity 1)
  }
}
alias Sdl {
  var %amount $rand(30,65)
  writeini dark.ini character Gold $calc($readini(dark.ini, character, Gold) + %amount)
  aline 11 @game You have defeated the swamp demon!
  echo @game You find %amount gold coins in its dead body!
  writeini dark.ini character xp $calc($Readini(dark.ini, character, xp) + $rand(25,45)) 
  echo @game With the magic seeping from the swamp demon you are overcome and wake up in a new town, Alasgnia, You can now teleport here!
  writeini dark.ini character area Alasgnia
  if (!$Readini(dark.ini, Tips, Alasgnia)) {
    noop $tip(Dark,Dark Game Tip,Welcome to alasgnia $+ $chr(44) The place of many warriors! They have an improved shop along with a bunch of stronger monsters in there caves whitch you can also teleport to! For help here type @visit hero,10,,,heal1)
    $iif($?!"Dont tell me this again",writeini dark.ini Tips alasgnia 1)
  }    
}
alias wzl {
  var %amount $rand(5,15)
  writeini dark.ini character Rune $calc($readini(dark.ini, character, Rune) + %amount)
  aline 11 @game You have defeated the wizard!
  echo @game You find %amount runes in its spell casting pouch!
  writeini dark.ini character xp $calc($Readini(dark.ini, character, xp) + $rand(15,45)) 
  if (!$Readini(dark.ini, Tips, Rune)) {
    noop $tip(Dark,Dark Game Tip,To use runes you need a spell book $+ $chr(44) every spell book spell requires 1 rune or more $+ $chr(44) To purchase a spell book you have to go to the store and have 2000 dollars!,10,,,heal1)
    $iif($?!"Dont tell me this again",writeini dark.ini Tips Rune 1)
  }   
  var %chance $rand(1,5)
  if (%chance < 3) {
    var %x $gettok(Spark|Freeze|Darken|Inferno|Obliviate,$rand(1,5),124)
    if (!$readini(dark.ini, spellbook, %x)) {    
      writeini dark.ini spellbook %x Acquired
      echo @game You have also found the %x spell!
    }
  }
}
alias wdl {
  var %amount $rand(40,100)
  writeini dark.ini character Gold $calc($readini(dark.ini, character, Gold) + %amount)
  aline 11 @game You have defeated the warrior!
  echo @game The warrior pays you %amount golden coins not to slay him!
  writeini dark.ini character xp $calc($Readini(dark.ini, character, xp) + $rand(35,75)) 
}
alias drl {
  var %amount $rand(40,100)
  var %ram $rand(5,14)
  writeini dark.ini character Gold $calc($readini(dark.ini, character, Gold) + %amount)
  addini dark.ini character ruby %ram
  aline 11 @game You have defeated the dragon!
  echo @game You find %amount golden coins in the dragon corpse along with %ram rubies!
  writeini dark.ini character xp $calc($Readini(dark.ini, character, xp) + $rand(35,75)) 
  if (!$readini(dark.ini, tips, ruby)) {
    noop $tip(Dark,Dark Game Tip,To use rubies you can either go to the blacksmith in alasgnia or sell them for 500 with the @sell <number> Rubie command.,15,,,heal1)
    $iif($?!"Dont tell me this again",writeini dark.ini Tips Ruby 1)
  }
}
alias heal1 {
  aline 12 @game You have left the forest and quickly healed!
  writeini dark.ini character area town
  heal
}
alias -l money {
  return $iif($readini(dark.ini, character, money),$v1,0)
}
alias heal {
  aline 12 @game You have rested and now have $basehp health!
  writeini dark.ini character health $iif($basehp,$v1,100)
}
alias -l rune {
  return $iif($readini(dark.ini, character, rune),$true,$false)
}
alias addini {
  if ($4) {
    writeini $1 $2 $3 $calc($readini($1, $2, $3) + $4)
  }
  else echo -a Insufficent paremeters!
}
alias decini {
  if ($4) {
    writeini $1 $2 $3 $calc($readini($1, $2, $3) - $4)
  }
  else echo -a Insufficent paremeters!
}
alias decmr {
  var %num $left($1,2)
  if ($chr(46) isin %num) { var %num $left($1,2) | return $remove(%num,$chr(46)) | halt }
  var %num $left($1,3)
  if ($chr(46) isin %num) { var %num $left($1,3) | return $remove(%num,$chr(46)) | halt }
  var %num $left($1,4)
  if ($chr(46) isin %num) { var %num $left($1,4) | return $remove(%num,$chr(46)) | halt }
  var %num $left($1,5)
  if ($chr(46) isin %num) { var %num $left($1,5) | return $remove(%num,$chr(46)) | halt }
  var %num $left($1,6)
  if ($chr(46) isin %num) { var %num $left($1,6) | return $remove(%num,$chr(46)) | halt }
  var %num $left($1,7)
  if ($chr(46) isin %num) { var %num $left($1,7) | return $remove(%num,$chr(46)) | halt }
  var %num $left($1,8)
  if ($chr(46) isin %num) { var %num $left($1,8) | return $remove(%num,$chr(46)) | halt }
  var %num $left($1,9)
  if ($chr(46) isin %num) { var %num $left($1,9) | return $remove(%num,$chr(46)) | halt }
  var %num $left($1,10)
  if ($chr(46) isin %num) { var %num $left($1,10) | return $remove(%num,$chr(46)) | halt }
  var %num $left($1,11)
  if ($chr(46) isin %num) { var %num $left($1,11) | return $remove(%num,$chr(46)) | halt }
}
alias mapout {
  aline @game You can currently visit places
  aline @game 15Town 14- 3Forest $iif($readini(dark.ini, spellbook, cast),14- 4 $+ $chr(44) $+ 12Alasgnia 14 $+ $chr(44) $+ 1- 1 $+ $chr(44) $+ 6Dark Alley )
}

Comments

Sign in to comment.
Cados   -  Mar 13, 2010

It's great but you should add spells that heal you and more monsters and a wider variety of weapons for people like me that have beaten the Diamond dragon. Also Nice fight with the Selestial Diamond Dragon. It was epic!

 Respond  
Priest   -  Jan 09, 2010

I love how indepth that is, Its kinda annoying too imo, How do you heal? Cause your guaranteed to die if you try going two battles in a row level 1.

 Respond  
jsg55   -  Nov 23, 2009

Very nice game Ghost, was nice simple and easy to learn the commands. Good job :)

 Respond  
Ghost-writer   -  Nov 20, 2009

Honestly if your having problems just type enter forest, after that the game gets self explanatory.

 Respond  
Testor   -  Nov 20, 2009

$Regex(String,/Match/i)
is case-insensitive (Matches a-zA-Z] incase you were wondering.

 Respond  
-XperTeeZ-   -  Nov 20, 2009

lol, I might be crazy, but I ain't dumb XD

I type /loadx and I get the welcome screen, the first weapons, stuff gets written in writeini.

[character]
health=100
...

But I cannot use any command :/

 Respond  
Ghost-writer   -  Nov 20, 2009

You didnt type /loadx -.- & testor thank you for the $regex help, i was looking for answers to that and im semi-new to regex :)

 Respond  
-XperTeeZ-   -  Nov 20, 2009

Also, I don't get any further from

"Type "Commands" in this window for help."

 Respond  
Testor   -  Nov 20, 2009

• Why are some aliases local, and some not? You should just make them all local aliases.
• Instead of $Regex($Lower(String),Match) why not just do $Regex(String,/Match/i)? :o.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.