Advertisement
buttercheetah

Axium2

Dec 5th, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 59.65 KB | None | 0 0
  1. ::compbeg::
  2. local version = 1.1
  3. local component = require("component")
  4. local gpu = component.gpu
  5. local colors = require("colors")
  6. local width, height = gpu.getResolution()
  7. local text = "Project Axium"
  8. gpu.setBackground(0x000000)
  9. print("Project Axium V" .. version)
  10. os.sleep(1)
  11. health = tonumber(health)
  12. damage = tonumber(damage)
  13. ress = tonumber(ress)
  14. CordX = tonumber(CordX)
  15. CordZ = tonumber(CordZ)
  16. Tmove = tonumber(Tmove)
  17. coins = tonumber(coins)
  18. exp = tonumber(exp)
  19. nedexp = tonumber(nedexp)
  20. magicAff = tonumber(magicAff)
  21. maxmana = tonumber(maxmana)
  22. managen = tonumber(managen)
  23. town1X = tonumber(town1X)
  24. town1Z = tonumber(town1Z)
  25. town2X = tonumber(town2X)
  26. town2Z = tonumber(town2Z)
  27. town3X = tonumber(town3X)
  28. town3Z = tonumber(town3Z)
  29. town4X = tonumber(town4X)
  30. town4Z = tonumber(town4Z)
  31. town5X = tonumber(town5X)
  32. town5Z = tonumber(town5Z)
  33. town6X = tonumber(town6X)
  34. town6Z = tonumber(town6Z)
  35. town7X = tonumber(town7X)
  36. town7Z = tonumber(town7Z)
  37. town8X = tonumber(town8X)
  38. town8Z = tonumber(town8Z)
  39. town9X = tonumber(town9X)
  40. town9Z = tonumber(town9Z)
  41. town10X = tonumber(town10X)
  42. town10Z = tonumber(town10Z)
  43. town11X = tonumber(town11X)
  44. town11Z = tonumber(town11Z)
  45. town12X = tonumber(town12X)
  46. town12Z = tonumber(town12Z)
  47. town13X = tonumber(town13X)
  48. town13Z = tonumber(town13Z)
  49. town14X = tonumber(town14X)
  50. town14Z = tonumber(town14Z)
  51. BTtown1 = tonumber(BTtown1)
  52. BTtown2 = tonumber(BTtown2)
  53. BTtown3 = tonumber(BTtown3)
  54. BTtown4 = tonumber(BTtown4)
  55. BTtown5 = tonumber(BTtown5)
  56. BTtown6 = tonumber(BTtown6)
  57. BTtown7 = tonumber(BTtown7)
  58. BTtown8 = tonumber(BTtown8)
  59. BTtown9 = tonumber(BTtown9)
  60. BTtown10 = tonumber(BTtown10)
  61. BTtown11 = tonumber(BTtown11)
  62. BTtown12 = tonumber(BTtown12)
  63. BTtown13 = tonumber(BTtown13)
  64. BTtown14 = tonumber(BTtown14)
  65. storyC = tonumber(storyC)
  66. HfireR = tonumber(HfireR)
  67. HwaterR = tonumber(HwaterR)
  68. HairR = tonumber(HairR)
  69. HearthR = tonumber(HearthR)
  70. HvoidR = tonumber(HvoidR)
  71. HarcR = tonumber(HarcR)
  72. HcheekR = tonumber(HcheekR)
  73. HlightningR = tonumber(HlightningR)
  74. HmetalR = tonumber(HmetalR)
  75. HwoodR = tonumber(HwoodR)
  76. HaxiumR = tonumber(HaxiumR)
  77. potionN = tonumber(potionN)
  78. ::beg::
  79. os.execute("cls")
  80. local Cname = "error"
  81. local Chealth = 1
  82. local Cdamage = 1
  83. local option = 0
  84. local randoN = 0
  85. local chosenN = 0
  86. local endsceneC = math.random(0, 100)
  87. local runchance = math.random(1, 4)
  88. local Rmob = math.random(0, 100)
  89. local mobspawnC = math.random(0, 150)
  90. local dungenC = math.random(0, 200)
  91. local mobN = 1
  92. local TmobN = 0
  93. local Tcoin = 0
  94. local allowbattle = "true"
  95. local amrunning = "false"
  96. local attackfunctionran = "false"
  97. local canrun = "false"
  98. local Ctown = "error"
  99. local allowOattack = "true"
  100. local Cdead = "false"
  101. local admingohome = "false"
  102. local mana = 10
  103. local freezeing = 0
  104. local isdead = "false"
  105. local ruindefeated = "false"
  106. local chesthealth = 0
  107. local chestdamage = 0
  108. local TCdamage = 0
  109. local icebreak = 0
  110. local orandom = 0
  111. local isdeadd = "false"
  112. --mobs!
  113. local slimeN = "Slime"
  114. local slimeH = 10
  115. local slimeA = 1
  116. local bunnyN = "Bunny"
  117. local bunnyH = 15
  118. local bunnyA = 3
  119. local skeletonN = "Skeleton"
  120. local skeletonH = 25
  121. local skeletonA = 10
  122. local witchN = "Witch"
  123. local witchH = 20
  124. local witchA = 8
  125. local ghostN = "ghost"
  126. local ghostH = 3
  127. local ghostA = 15
  128. local babydN = "Baby Dragon"
  129. local babydH = 100
  130. local babydA = 50
  131. local undedwN = "Undead Warrior"
  132. local undedwH = 35
  133. local undedwA = 20
  134. local darkfairyN = "Dark Fairy"
  135. local darkfairyH = 20
  136. local darkfairyA = 10
  137. local ogreN = "Ogre"
  138. local ogreH = 40
  139. local ogreA = 10
  140. local banditN = "Bandit"
  141. local banditH = 20
  142. local banditA = 15
  143. local crabN = "Demonic Crab"
  144. local crabH = 30
  145. local crabA = 12
  146. local option2 = 0
  147. local option3 = 0
  148. local burning = 0
  149. --Functions!
  150. function randomm()
  151.     if nedexp <= 9 then
  152.         Rmob = Rmob / 2
  153.         if Rmob <= 40 then
  154.             Cname = slimeN
  155.             Chealth = slimeH
  156.             Cdamage = slimeA
  157.             CThealth = Chealth
  158.         elseif Rmob >= 41 and Rmob <= 70 then
  159.             Cname = bunnyN
  160.             Chealth = bunnyH
  161.             Cdamage = bunnyA
  162.             CThealth = Chealth
  163.         elseif Rmob <= 80 and Rmob >= 71 then
  164.             Cname = witchN
  165.             Chealth = witchH
  166.             Cdamage = witchA
  167.             CThealth = Chealth
  168.         elseif Rmob <= 98 and Rmob >= 81 then
  169.             Cname = ghostN
  170.             Chealth = ghostH
  171.             Cdamage = ghostA
  172.             CThealth = Chealth
  173.         elseif Rmob >= 99 then
  174.             Cname = babydN
  175.             Chealth = babydH
  176.             Cdamage = babydA
  177.             CThealth = Chealth
  178.         end
  179.     elseif nedexp <= 15 then
  180.         if Rmob <= 40 then
  181.             Cname = slimeN
  182.             Chealth = slimeH
  183.             Cdamage = slimeA
  184.             CThealth = Chealth
  185.         elseif Rmob >= 41 and Rmob <= 70 then
  186.             Cname = bunnyN
  187.             Chealth = bunnyH
  188.             Cdamage = bunnyA
  189.             CThealth = Chealth
  190.         elseif Rmob <= 80 and Rmob >= 71 then
  191.             Cname = witchN
  192.             Chealth = witchH
  193.             Cdamage = witchA
  194.             CThealth = Chealth
  195.         elseif Rmob <= 98 and Rmob >= 81 then
  196.             Cname = ghostN
  197.             Chealth = ghostH
  198.             Cdamage = ghostA
  199.             CThealth = Chealth
  200.         elseif Rmob >= 99 and Rmob <= 100 then
  201.             Cname = babydN
  202.             Chealth = babydH
  203.             Cdamage = babydA
  204.             CThealth = Chealth
  205.         elseif Rmob >= 101 and Rmob <= 120 then
  206.             Cname = skeletonN
  207.             Chealth = skeletonH
  208.             Cdamage = skeletonA
  209.             CThealth = Chealth
  210.         elseif Rmob >= 121 and Rmob <= 140 then
  211.             Cname = undedwN
  212.             Chealth = undedwH
  213.             Cdamage = undedwA
  214.             CThealth = Chealth
  215.         elseif Rmob >= 141 and Rmob <= 160 then
  216.             Cname = darkfairyN
  217.             Chealth = darkfairyH
  218.             Cdamage = darkfairyA
  219.             CThealth = Chealth
  220.         elseif Rmob >= 161 and Rmob <= 180 then
  221.             Cname = ogreN
  222.             Chealth = ogreH
  223.             Cdamage = ogreA
  224.             CThealth = Chealth
  225.         elseif Rmob >= 181 and Rmob <= 200 then
  226.             Cname = banditN
  227.             Chealth = banditH
  228.             Cdamage = banditA
  229.             CThealth = Chealth
  230.         end
  231.     elseif nedexp <= 25 then
  232.         if Rmob <= 40 then
  233.                 Cname = "Strong " .. slimeN
  234.                 Chealth = slimeH * 2
  235.                 Cdamage = slimeA * 2
  236.                 CThealth = Chealth
  237.             elseif Rmob >= 41 and Rmob <= 70 then
  238.                 Cname = "Strong " .. bunnyN
  239.                 Chealth = bunnyH * 2
  240.                 Cdamage = bunnyA * 2
  241.                 CThealth = Chealth
  242.             elseif Rmob <= 80 and Rmob >= 71 then
  243.                 Cname = "Strong " .. witchN
  244.                 Chealth = witchH * 2
  245.                 Cdamage = witchA * 2
  246.                 CThealth = Chealth
  247.             elseif Rmob <= 98 and Rmob >= 81 then
  248.                 Cname = "Strong " .. ghostN
  249.                 Chealth = ghostH * 2
  250.                 Cdamage = ghostA * 2
  251.                 CThealth = Chealth
  252.             elseif Rmob >= 99 and Rmob <= 100 then
  253.                 Cname = "Strong " .. babydN
  254.                 Chealth = babydH * 2
  255.                 Cdamage = babydA * 2
  256.                 CThealth = Chealth
  257.             elseif Rmob >= 101 and Rmob <= 120 then
  258.                 Cname = "Strong " .. skeletonN
  259.                 Chealth = skeletonH * 2
  260.                 Cdamage = skeletonA * 2
  261.                 CThealth = Chealth
  262.             elseif Rmob >= 121 and Rmob <= 140 then
  263.                 Cname = "Strong " .. undedwN
  264.                 Chealth = undedwH * 2
  265.                 Cdamage = undedwA * 2
  266.                 CThealth = Chealth
  267.             elseif Rmob >= 141 and Rmob <= 160 then
  268.                 Cname = "Strong " .. darkfairyN
  269.                 Chealth = darkfairyH * 2
  270.                 Cdamage = darkfairyA * 2
  271.                 CThealth = Chealth
  272.             elseif Rmob >= 161 and Rmob <= 180 then
  273.                 Cname = "Strong " .. ogreN
  274.                 Chealth = ogreH * 2
  275.                 Cdamage = ogreA * 2
  276.                 CThealth = Chealth
  277.             elseif Rmob >= 181 and Rmob <= 189 then
  278.                 Cname = "Strong " .. banditN
  279.                 Chealth = banditH * 2
  280.                 Cdamage = banditA * 2
  281.                 CThealth = Chealth
  282.             elseif Rmob >= 190 and Rmob <= 200 then
  283.                 if math.random(0, 10) == 1 then
  284.                     Cname = "The weak Jim Bob"
  285.                     Chealth = crabH / 2
  286.                     Cdamage = crabA / 2
  287.                     CThealth = Chealth
  288.                 else
  289.                     Cname = crabN
  290.                     Chealth = crabH
  291.                     Cdamage = crabA
  292.                     CThealth = Chealth
  293.                 end
  294.             end
  295.     else
  296.         if math.random(1, 10) <= 8 then
  297.             if Rmob <= 40 then
  298.                 Cname = "Strong " .. slimeN
  299.                 Chealth = slimeH * 4
  300.                 Cdamage = slimeA * 4
  301.                 CThealth = Chealth
  302.             elseif Rmob >= 41 and Rmob <= 70 then
  303.                 Cname = "Strong " .. bunnyN
  304.                 Chealth = bunnyH * 4
  305.                 Cdamage = bunnyA * 4
  306.                 CThealth = Chealth
  307.             elseif Rmob <= 80 and Rmob >= 71 then
  308.                 Cname = "Strong " .. witchN
  309.                 Chealth = witchH * 4
  310.                 Cdamage = witchA * 4
  311.                 CThealth = Chealth
  312.             elseif Rmob <= 98 and Rmob >= 81 then
  313.                 Cname = "Strong " .. ghostN
  314.                 Chealth = ghostH * 4
  315.                 Cdamage = ghostA * 4
  316.                 CThealth = Chealth
  317.             elseif Rmob >= 99 and Rmob <= 100 then
  318.                 Cname = "Strong " .. babydN
  319.                 Chealth = babydH * 4
  320.                 Cdamage = babydA * 4
  321.                 CThealth = Chealth
  322.             elseif Rmob >= 101 and Rmob <= 120 then
  323.                 Cname = "Strong " .. skeletonN
  324.                 Chealth = skeletonH * 4
  325.                 Cdamage = skeletonA * 4
  326.                 CThealth = Chealth
  327.             elseif Rmob >= 121 and Rmob <= 140 then
  328.                 Cname = "Strong " .. undedwN
  329.                 Chealth = undedwH * 4
  330.                 Cdamage = undedwA * 4
  331.                 CThealth = Chealth
  332.             elseif Rmob >= 141 and Rmob <= 160 then
  333.                 Cname = "Strong " .. darkfairyN
  334.                 Chealth = darkfairyH * 4
  335.                 Cdamage = darkfairyA * 4
  336.                 CThealth = Chealth
  337.             elseif Rmob >= 161 and Rmob <= 180 then
  338.                 Cname = "Strong " .. ogreN
  339.                 Chealth = ogreH * 4
  340.                 Cdamage = ogreA * 4
  341.                 CThealth = Chealth
  342.             elseif Rmob >= 181 and Rmob <= 189 then
  343.                 Cname = "Strong " .. banditN
  344.                 Chealth = banditH * 4
  345.                 Cdamage = banditA * 4
  346.                 CThealth = Chealth
  347.             elseif Rmob >= 190 and Rmob <= 200 then
  348.                 if math.random(0, 10) == 1 then
  349.                     Cname = "The weak Jim Bob"
  350.                     Chealth = crabH / 2
  351.                     Cdamage = crabA / 2
  352.                     CThealth = Chealth
  353.                 else
  354.                     Cname = crabN
  355.                     Chealth = crabH
  356.                     Cdamage = crabA
  357.                     CThealth = Chealth
  358.                 end
  359.             end
  360.         elseif math.random(1, 2) == 1 then
  361.             if Rmob <= 40 then
  362.                 Cname = slimeN
  363.                 Chealth = slimeH * 2
  364.                 Cdamage = slimeA * 2
  365.                 CThealth = Chealth
  366.             elseif Rmob >= 41 and Rmob <= 70 then
  367.                 Cname = bunnyN
  368.                 Chealth = bunnyH * 2
  369.                 Cdamage = bunnyA * 2
  370.                 CThealth = Chealth
  371.             elseif Rmob <= 80 and Rmob >= 71 then
  372.                 Cname = witchN
  373.                 Chealth = witchH * 2
  374.                 Cdamage = witchA * 2
  375.                 CThealth = Chealth
  376.             elseif Rmob <= 98 and Rmob >= 81 then
  377.                 Cname = ghostN
  378.                 Chealth = ghostH * 2
  379.                 Cdamage = ghostA * 2
  380.                 CThealth = Chealth
  381.             elseif Rmob >= 99 and Rmob <= 100 then
  382.                 Cname = babydN
  383.                 Chealth = babydH * 2
  384.                 Cdamage = babydA * 2
  385.                 CThealth = Chealth
  386.             elseif Rmob >= 101 and Rmob <= 120 then
  387.                 Cname = skeletonN
  388.                 Chealth = skeletonH * 2
  389.                 Cdamage = skeletonA * 2
  390.                 CThealth = Chealth
  391.             elseif Rmob >= 121 and Rmob <= 140 then
  392.                 Cname = undedwN
  393.                 Chealth = undedwH * 2
  394.                 Cdamage = undedwA * 2
  395.                 CThealth = Chealth
  396.             elseif Rmob >= 141 and Rmob <= 160 then
  397.                 Cname = darkfairyN
  398.                 Chealth = darkfairyH * 2
  399.                 Cdamage = darkfairyA * 2
  400.                 CThealth = Chealth
  401.             elseif Rmob >= 161 and Rmob <= 180 then
  402.                 Cname = ogreN
  403.                 Chealth = ogreH * 2
  404.                 Cdamage = ogreA * 2
  405.                 CThealth = Chealth
  406.             elseif Rmob >= 181 and Rmob <= 200 then
  407.                 Cname = banditN
  408.                 Chealth = banditH * 2
  409.                 Cdamage = banditA * 2
  410.                 CThealth = Chealth
  411.             end
  412.         else
  413.             if Rmob <= 40 then
  414.                 Cname = "Weak " .. slimeN
  415.                 Chealth = slimeH
  416.                 Cdamage = slimeA
  417.                 CThealth = Chealth
  418.             elseif Rmob >= 41 and Rmob <= 70 then
  419.                 Cname = "Weak " .. bunnyN
  420.                 Chealth = bunnyH
  421.                 Cdamage = bunnyA
  422.                 CThealth = Chealth
  423.             elseif Rmob <= 80 and Rmob >= 71 then
  424.                 Cname = "Weak " .. witchN
  425.                 Chealth = witchH
  426.                 Cdamage = witchA
  427.                 CThealth = Chealth
  428.             elseif Rmob <= 98 and Rmob >= 81 then
  429.                 Cname = "Weak " .. ghostN
  430.                 Chealth = ghostH
  431.                 Cdamage = ghostA
  432.                 CThealth = Chealth
  433.             elseif Rmob >= 99 and Rmob <= 100 then
  434.                 Cname = "Weak " .. babydN
  435.                 Chealth = babydH
  436.                 Cdamage = babydA
  437.                 CThealth = Chealth
  438.             elseif Rmob >= 101 and Rmob <= 120 then
  439.                 Cname = "Weak " .. skeletonN
  440.                 Chealth = skeletonH
  441.                 Cdamage = skeletonA
  442.                 CThealth = Chealth
  443.             elseif Rmob >= 121 and Rmob <= 140 then
  444.                 Cname = "Weak " .. undedwN
  445.                 Chealth = undedwH
  446.                 Cdamage = undedwA
  447.                 CThealth = Chealth
  448.             elseif Rmob >= 141 and Rmob <= 160 then
  449.                 Cname = "Weak " .. darkfairyN
  450.                 Chealth = darkfairyH
  451.                 Cdamage = darkfairyA
  452.                 CThealth = Chealth
  453.             elseif Rmob >= 161 and Rmob <= 180 then
  454.                 Cname = "Weak " .. ogreN
  455.                 Chealth = ogreH
  456.                 Cdamage = ogreA
  457.                 CThealth = Chealth
  458.             elseif Rmob >= 181 and Rmob <= 200 then
  459.                 Cname = "Weak " .. banditN
  460.                 Chealth = banditH
  461.                 Cdamage = banditA
  462.                 CThealth = Chealth
  463.             end
  464.         end
  465.     end
  466. end
  467. function attacks()
  468. Tdamage = 0
  469. print("what will you do")
  470. print("1) attack")
  471. print("2) run")
  472. ::attackstemp::
  473. option = io.read("*l")
  474. if option == nil then
  475.     goto attackstemp
  476. end
  477. if option == "1" then
  478.   print("select type of attack")
  479.   print("1) light")
  480.   print("2) heavy(takes 2 turns)")
  481.   print("3) magic")
  482.   if storyC >= 1 then
  483.     print("4) rune magic")
  484.   end
  485.   option2 = io.read("*l")
  486.   if option2 == "1" then
  487.     --attack chance
  488.     if math.random(0, 1000) <= 5 then
  489.       print("your attack missed")
  490.       os.sleep(2)
  491.     else
  492.         Chealth = Chealth - damage
  493.         print("attack successfull!")
  494.         os.sleep(0.5)
  495.         print("you do " .. damage .. " damage!")
  496.         Tdamage = Tdamage + damage
  497.         os.sleep(2)
  498.         if math.random(0, 100) <= 10 then
  499.             TCdamage = damage * math.random(0.5, 2)
  500.             print("The attack did more damage than expected!")
  501.             os.sleep(2)
  502.             print("you did an additional " .. TCdamage .. " damage!")
  503.             os.sleep(2)
  504.             Chealth = Chealth - TCdamage
  505.             Tdamage = Tdamage + TCdamage
  506.         end
  507.         if randoN >= 5 then
  508.             print("your sword suddenly became very light")
  509.             os.sleep(2)
  510.             print("you attack twice")
  511.             os.sleep(1)
  512.             print("you did an additional " .. damage .. " damage!")
  513.             os.sleep(2)
  514.             Chealth = Chealth - damage
  515.             Tdamage = Tdamage + damage
  516.         end
  517.     end
  518.   elseif option2 == "2" then
  519.     print("choose a number betwwen 1-10")
  520.     chosenN = io.read("*n")
  521.     if chosenN >= 11 then
  522.       print("error to high of number")
  523.       os.sleep(2)
  524.       print("for your insilence, your opponent will now attack")
  525.       os.sleep(2)
  526.       print("you should followed the rules")
  527.       os.sleep(1)
  528.       allowbattle = "false"
  529.     else
  530.         randoN = randoN - 2
  531.         chosenN = chosenN - randoN
  532.         if chosenN - chosenN == 0 then
  533.             print("")
  534.         else
  535.         chosenN = chosenN * -1
  536.         end
  537.         if chosenN >= 0 and chosenN <= 1 then
  538.             print("you swung you sword but did no damage!")
  539.             os.sleep(1)
  540.             print("instead you broke your wrist!")
  541.             print("-10 health!")
  542.             health = health - 10
  543.             os.sleep(2)
  544.         elseif chosenN >= 2 and chosenN <= 4 then
  545.             Tdamage = 1 * damage
  546.             print("you did " .. Tdamage .. " damage")
  547.         elseif chosenN >= 5 and chosenN <= 8 then
  548.             Tdamage = 2 * damage
  549.             print("you did " .. Tdamage .. " damage")
  550.         elseif chosenN >= 9 and chosenN <= 10 then
  551.             Tdamage = 3 * damage
  552.             print("you did " .. Tdamage .. " damage")
  553.         else
  554.             print("now thats alot of damage!")
  555.             Tdamage = 4 * damage
  556.             print("you did " .. Tdamage .. " damage")
  557.             os.sleep(3)
  558.         end
  559.     end
  560.     Chealth = Chealth - Tdamage
  561.   elseif option2 == "3" then
  562.     print("1) fireball -10 mana")
  563.     print("2) freeze -10 mana")
  564.     option3 = io.read("*l")
  565.     if option3 == "1" then
  566.         if mana <= 9 then
  567.             print("you dont have enugh mana!")
  568.             print("please wait to regain mana!")
  569.             os.sleep(3)
  570.             allowbattle = "false"
  571.         else
  572.             print("you cast fireball!")
  573.             os.sleep(1)
  574.             if Cname == ghostN then
  575.                 print("but nothing happens")
  576.                 mana = mana - 10
  577.             else
  578.                 burning = magicAff * 2
  579.                 print("the enemy wil burn for " .. burning .. " turns")
  580.                 print("you do " .. magicAff .. " damage")
  581.                 Chealth = Chealth - magicAff
  582.                 Tdamage = Tdamage + magicAff
  583.                 os.sleep(3)
  584.                 mana = mana - 10
  585.             end
  586.         end
  587.     elseif option3 == "2" then
  588.         if mana <= 9 then
  589.             print("you dont have enugh mana!")
  590.             print("please wait to regain mana!")
  591.             os.sleep(3)
  592.             allowbattle = "false"
  593.         else
  594.             print("you cast freeze!")
  595.             os.sleep(1)
  596.             if Cname == ghostN or Cname == "Strong " .. ghostN or Cname == "Weak " .. ghostN then
  597.                 print("but nothing happens")
  598.                 mana = mana - 10
  599.             else
  600.                 freezeing = magicAff * 2
  601.                 print("the enemy wil be frozen for " .. freezeing .. " turns")
  602.                 print("you do " .. magicAff / 2 .. " damage")
  603.                 Chealth = Chealth - magicAff / 2
  604.                 Tdamage = Tdamage + magicAff / 2
  605.                 os.sleep(3)
  606.                 mana = mana - 10
  607.             end
  608.         end
  609.     end
  610.   elseif option2 == "4" and storyC >= 1 then
  611.     print("1) Void rune")
  612.     if HwaterR == 1 then
  613.         print("2) water rune (requires 10 mana to perform succsesfully")
  614.     end
  615.     option3 = io.read("*l")
  616.     if option3 == "1" then
  617.         print("you summon a black hole")
  618.         os.sleep(3)
  619.         print("it damages you as well!")
  620.         os.sleep(3)
  621.         print("you take " .. health / 4 .. " damage!")
  622.         os.sleep(3)
  623.         print("The black hole eats the " .. Cname .. " for breakfast!")
  624.         os.sleep(4)
  625.         health = health - health / 4
  626.         Chealth = 0
  627.     elseif option3 == "2" and HwaterR == 1 then
  628.         if mana >= 10 then
  629.             print("you summon life stealing water")
  630.             os.sleep(3)
  631.             print("it heals you by " .. Cdamage / 2  .. " Health!")
  632.             os.sleep(3)
  633.             print("it damages the " .. Cname .. " by " .. Cdamage * 2)
  634.             health = health + Cdamage / 2
  635.             Chealth = Chealth - Cdamage * 2
  636.             Tdamage = Tdamage + Cdamage * 2
  637.             print("it costs 20 mana!")
  638.             mana = mana - 20
  639.         else
  640.             print("you soak the " .. Cname)
  641.             os.sleep(3)
  642.             print("it does nothing")
  643.         end
  644.     end
  645.   end
  646. elseif option == "2" then
  647.     amrunning = "true"
  648. elseif option == "adminOV" then
  649.     adminpanelf()
  650.     allowOattack = "false"
  651. else
  652. goto attackstemp
  653. end
  654. attackfunctionran = "true"
  655. end
  656. function prepbattle()
  657. canrun = "false"
  658. option = nil
  659. option2 = nil
  660. randoN = math.random(0, 10)
  661. runchance = math.random(1, 5)
  662. amrunning = "false"
  663. allowbattle = "true"
  664. attackfunctionran = "false"
  665. gpu.setBackground(0xff2020)
  666. end
  667. function slimecheck()
  668.     if Cname == slimeN or Cname == "Strong " .. Cname then
  669.         if math.random(1, 2) == 2 then
  670.             os.execute("cls")
  671.             print("The slime dropped a health potion")
  672.             print("would you like to use it?")
  673.             print("Y/n")
  674.             option2 = io.read("*l")
  675.             if option2 == "n" then
  676.                 print("thats to bad")
  677.             else
  678.                 print("you have healed " .. runchance * 10 .. " health!")
  679.                 health = health + runchance * 10
  680.                 os.sleep(2)
  681.             end
  682.         end
  683.     end
  684. end
  685. function runaway()
  686.     if Cname == babydN and randoN >= 1 then
  687.         print("the baby dragon breathes fire on you")
  688.         os.sleep(2)
  689.         print("-10 health")
  690.         os.sleep(1)
  691.         health = health - 10
  692.         canrun = "false"
  693.     elseif Cname == babydN then
  694.         print("you got away")
  695.         os.sleep(1)
  696.         print("somehow....")
  697.         os.sleep(3)
  698.         canrun = "true"
  699.     else
  700.         if math.random(0, 10) <= 1 then
  701.             os.execute("cls")
  702.             print("you have succsesfully ran away!")
  703.             os.sleep(2)
  704.             canrun = "true"
  705.         else
  706.             os.execute("cls")
  707.             print("you failed to run away!")
  708.             if runchance == 1 then
  709.                 print("while running away you stubbed your toe!")
  710.                 print("-" .. 1 / ress .. " health")
  711.                 health = health - 1 / ress
  712.                 os.sleep(2)
  713.             elseif runchance == 2 then
  714.                 print("while running away the " .. Cname .. " hit you from behind!")
  715.                 print("-" .. 2 / ress .. " health!")
  716.                 health = health - 2 / ress
  717.                 os.sleep(2)
  718.             elseif runchance == 3 then
  719.                 print("while running away you slip on a banna peal")
  720.                 print("-" .. 1 / ress .. " health")
  721.                 health = health - 1 / ress
  722.                 os.sleep(2)
  723.             elseif runchance == 4 then
  724.                 print("while running away you get distracted by a squirel")
  725.                 print("when you come to your senses " .. Cname .. " is right behind you!")
  726.                 os.sleep(3)
  727.             end
  728.             canrun = "false"
  729.             os.sleep(2)
  730.         end
  731.     end
  732. end
  733. function townf()
  734.     ::townbeg::
  735.     os.execute("cls")
  736.     print("you have entered the village of " .. Ctown)
  737.     print("what would you like to do?")
  738.     print("You currently have " .. coins .. " coins")
  739.     print("1) blacksmith")
  740.     print("2) go to a doctors")
  741.     print("3) visit a rune master")
  742.     print("4) goto village pond")
  743.     print("5) visit cartographer")
  744.     print("6) leave")
  745.     option = io.read("*l")
  746.     if option == "1" then
  747.         os.execute("cls")
  748.         print("You currently have " .. coins .. " coins")
  749.         print("what would you like to buy?")
  750.         print("1) weapon upgrades")
  751.         print("2) back")
  752.         option2 = io.read("*l")
  753.         if option2 == "1" then
  754.             print("that'l be 400 coins")
  755.             print("y/n")
  756.             option3 = io.read("*l")
  757.             if option3 == "y" then
  758.                 if coins >= 400 then
  759.                     print("alrighty then")
  760.                     os.sleep(2)
  761.                     coins = coins - 400
  762.                     damage = damage + 1
  763.                     print("You obtained a better weapon!")
  764.                     os.sleep(2)
  765.                     print("+1 damage")
  766.                     os.sleep(0.5)
  767.                     print("your damage is now " .. damage)
  768.                     os.sleep(3)
  769.                 else
  770.                     print("you aint got enugh lad, sorry")
  771.                     os.sleep(2)
  772.                 end
  773.             end
  774.             goto townbeg
  775.         elseif option2 == "2" then
  776.             goto townbeg
  777.         else
  778.             goto townbeg
  779.         end
  780.     elseif option == "2" then
  781.         os.execute("cls")
  782.         print("You currently have " .. coins .. " coins")
  783.         print("do you need some potions?")
  784.         print("im afraid their 200 coins a bottle")
  785.         print("y/n")
  786.         option2 = io.read("*l")
  787.         if option2 == "y" then
  788.             if coins >= 200 then
  789.                 print("commin right up")
  790.                 os.sleep(2)
  791.                 coins = coins - 200
  792.                 health = health + 20
  793.                 print("you drank the potion")
  794.                 os.sleep(2)
  795.                 print("you have gained 20 health!")
  796.                 os.sleep(1)
  797.                 print("your health is now " .. health)
  798.             else
  799.                 print("oh sorry, but you only have " .. coins)
  800.                 os.sleep(2)
  801.             end
  802.         elseif option2 == "n" then
  803.             goto townbeg
  804.         end
  805.         goto townbeg
  806.     elseif option == "3" then
  807.         os.execute("cls")
  808.         print("You currently have " .. coins .. " coins")
  809.         print("you came for runes, right?")
  810.         print("that'l be 800 coins")
  811.         print("hope that aint a problem")
  812.         print("y/n")
  813.         option2 = io.read("*l")
  814.         if option2 == "y" then
  815.             if coins >= 800 then
  816.                 print("whatever, heres your rune")
  817.                 os.sleep(3)
  818.                 print("as he is handing you the rune it begins to glow")
  819.                 os.sleep(2)
  820.                 print("the rune gives you +1 resistance")
  821.                 os.sleep(2)
  822.                 ress = ress + 1
  823.                 print("your resistance is now " .. ress)
  824.                 os.sleep(2)
  825.                 goto townbeg
  826.             else
  827.                 print("what are you trying to scam me with")
  828.                 print("only " .. coins .. " coins!?")
  829.                 print("get outa here!")
  830.                 os.sleep(4)
  831.                 goto townbeg
  832.             end
  833.         else
  834.             goto townbeg
  835.         end
  836.     elseif option == "4" then
  837.         if storyC == 1 then
  838.             storyP2()
  839.             goto townbeg
  840.         end
  841.         print("you walk toward the pond")
  842.         if canfish == 0 then
  843.             print("but theres nothing to do")
  844.             os.sleep(2)
  845.             print("you walk back to the village.")
  846.             goto townbeg
  847.         elseif canfish == 1 then
  848.             print("you can fish")
  849.         end
  850.         goto townbeg
  851.     elseif option == "5" then
  852.         ::villageteller::
  853.         print("You currently have " .. coins .. " coins")
  854.         os.execute("cls")
  855.         orandom = math.random(100, 300)
  856.         print("ill lead you to a village if ya give some money")
  857.         print("ill say " .. orandom .. " sound good?")
  858.         print("y/N")
  859.         option2 = io.read("*l")
  860.         if option2 == "y" then
  861.             print("ok then")
  862.             coins = coins - orandom
  863.             os.sleep(2)
  864.         else
  865.             goto townbeg
  866.         end
  867.         ::villagespin::
  868.         orandom = math.random(1, 14)
  869.         if orandom == 1 and BTtown1 == 0 then
  870.             print("the village of Nevo is at")
  871.             print("X = " .. town1X .. " Z = " .. town1Z)
  872.             BTtown1 = 1
  873.             os.sleep(2)
  874.         elseif orandom == 2 and BTtown2 == 0 then
  875.             print("the village of Zenus is at")
  876.             print("X = " .. town2X .. " Z = " .. town2Z)
  877.             BTtown2 = 1
  878.             os.sleep(2)
  879.         elseif orandom == 3 and BTtown3 == 0 then
  880.             print("the village of Cilum is at")
  881.             print("X = " .. town3X .. " Z = " .. town3Z)
  882.             BTtown3 = 1
  883.             os.sleep(2)
  884.         elseif orandom == 4 and BTtown4 == 0 then
  885.             print("the village of Bugendai is at")
  886.             print("X = " .. town4X .. " Z = " .. town4Z)
  887.             BTtown4 = 1
  888.             os.sleep(2)
  889.         elseif orandom == 5 and BTtown5 == 0 then
  890.             print("the village of Kuruma is at")
  891.             print("X = " .. town5X .. " Z = " .. town5Z)
  892.             BTtown5 = 1
  893.             os.sleep(2)
  894.         elseif orandom == 6 and BTtown6 == 0 then
  895.             print("the village of Tonbo is at")
  896.             print("X = " .. town6X .. " Z = " .. town6Z)
  897.             BTtown6 = 1
  898.             os.sleep(2)
  899.         elseif orandom == 7 and BTtown7 == 0 then
  900.             print("the village of Doragon is at")
  901.             print("X = " .. town7X .. " Z = " .. town7Z)
  902.             BTtown7 = 1
  903.             os.sleep(2)
  904.         elseif orandom == 8 and BTtown8 == 0 then
  905.             print("the village of Toripuru is at")
  906.             print("X = " .. town8X .. " Z = " .. town8Z)
  907.             BTtown8 = 1
  908.             os.sleep(2)
  909.         elseif orandom == 9 and BTtown9 == 0 then
  910.             print("the village of Pagu is at")
  911.             print("X = " .. town9X .. " Z = " .. town9Z)
  912.             BTtown9 = 1
  913.             os.sleep(2)
  914.         elseif orandom == 10 and BTtown10 == 0 then
  915.             print("the village of Topikia is at")
  916.             print("X = " .. town10X .. " Z = " .. town10Z)
  917.             BTtown10 = 1
  918.             os.sleep(2)
  919.         elseif orandom == 11 and BTtown11 == 0 then
  920.             print("the village of Gamen is at")
  921.             print("X = " .. town11X .. " Z = " .. town11Z)
  922.             BTtown11 = 1
  923.             os.sleep(2)
  924.         elseif orandom == 12 and BTtown12 == 0 then
  925.             print("the village of Kamu is at")
  926.             print("X = " .. town12X .. " Z = " .. town12Z)
  927.             BTtown12 = 1
  928.             os.sleep(2)
  929.         elseif orandom == 13 and BTtown13 == 0 then
  930.             print("the village of Kita is at")
  931.             print("X = " .. town13X .. " Z = " .. town13Z)
  932.             BTtown13 = 1
  933.             os.sleep(2)
  934.         elseif orandom == 14 and BTtown14 == 0 then
  935.             print("the village of Sarani is at")
  936.             print("X = " .. town14X .. " Z = " .. town14Z)
  937.             BTtown14 = 1
  938.             os.sleep(2)
  939.         else
  940.             os.sleep(1)
  941.             goto villagespin
  942.         end
  943.         goto townbeg
  944.     else
  945.         os.execute("cls")
  946.         print("what direction would you like to go?")
  947.         print("1) north -Z")
  948.         print("2) east +X")
  949.         print("3) south +Z")
  950.         print("4) west -X")
  951.         option = io.read("*l")
  952.         if option == "1" then
  953.             CordZ = CordZ - 1
  954.         elseif option == "2" then
  955.             CordX = CordX + 1
  956.         elseif option == "3" then
  957.             CordZ = CordZ + 1
  958.         elseif option == "4" then
  959.             CordX = CordX - 1
  960.         end
  961.     end
  962. end
  963. function oenemyattack()
  964.     if burning >= 1 then
  965.         print("the enemy is on fire! -" .. magicAff .. " health!")
  966.         os.sleep(2)
  967.         Chealth = Chealth - magicAff
  968.         burning = burning - 1
  969.         Tdamage = Tdamage + magicAff
  970.     end
  971.     if freezeing >= 1 then
  972.         if math.random(1, 10) == 1 then
  973.             icebreak = math.random(1, 5)
  974.             print("the " .. Cname .. " is struggling")
  975.             os.sleep(2)
  976.             if icebreak >= freezeing then
  977.                 print("the " .. Cname .. " broke out of the ice!")
  978.                 os.sleep(2)
  979.                 freezeing = 0
  980.             else
  981.                 print("the " .. Cname .. " broke a bit of the ice!")
  982.                 os.sleep(2)
  983.                 freezeing = freezeing - icebreak
  984.                 print("the ice will only hold for " .. freezeing .. " more turns")
  985.             end
  986.         else
  987.             print("the enemy is frozen!")
  988.             os.sleep(2)
  989.             print("the enemy cant attack!")
  990.             os.sleep(2)
  991.             print("the enemy got hurt by frostbite!")
  992.             os.sleep(2)
  993.             print("-1 health")
  994.             Chealth = Chealth - 1
  995.             freezeing = freezeing - 1
  996.             Tdamage = Tdamage + 1
  997.             allowOattack = "false"
  998.         end
  999.     end
  1000.     print("you did a total of " .. Tdamage .. " damage!")
  1001.     os.sleep(3)
  1002.     print("")
  1003.     if Chealth <= 0 then
  1004.         allowOattack = "false"
  1005.         Cdead = "true"
  1006.     end
  1007.     if allowOattack == "true" then
  1008.         print("The " .. Cname .. " is trying to attack ")
  1009.         os.sleep(2)
  1010.         if math.random(1, 4) <= 2 then
  1011.             print("The attack landed!")
  1012.             print(Cdamage / ress .. " damage!")
  1013.             health = health - Cdamage / ress
  1014.             os.sleep(3)
  1015.         else
  1016.             print("the attack failed!")
  1017.             os.sleep(1)
  1018.         end
  1019.     end
  1020. end
  1021. function randomrune()
  1022.     if math.random(0, 100) <= 1 then
  1023.         os.execute("cls")
  1024.         gpu.setBackground(0x0042b5)
  1025.         os.execute("cls")
  1026.         print("while leaving the battle field you stumble across a glowing rune")
  1027.         os.sleep(3)
  1028.         print("it feels like its calling to you....")
  1029.         os.sleep(3)
  1030.         print("do you take it?")
  1031.         print("Y/n")
  1032.         option = io.read("*l")
  1033.         if option == n then
  1034.             print("oof")
  1035.         else
  1036.             ress = ress + 1
  1037.             os.execute("cls")
  1038.             print("you reach for the glowing object")
  1039.             os.sleep(3)
  1040.             print("you can hear a humming sound comming from it")
  1041.             os.sleep(3)
  1042.             os.execute("cls")
  1043.             gpu.setBackground(0xb5001e)
  1044.             os.execute("cls")
  1045.             os.sleep(0.5)
  1046.             gpu.setBackground(0x000000)
  1047.             os.execute("cls")
  1048.             os.sleep(0.5)
  1049.             gpu.setBackground(0xb5001e)
  1050.             os.execute("cls")
  1051.             os.sleep(0.5)
  1052.             gpu.setBackground(0x000000)
  1053.             os.execute("cls")
  1054.             os.sleep(0.5)
  1055.             gpu.setBackground(0xb5001e)
  1056.             os.execute("cls")
  1057.             os.sleep(0.5)
  1058.             gpu.setBackground(0x000000)
  1059.             os.execute("cls")
  1060.             os.sleep(0.5)
  1061.             gpu.setBackground(0xb5001e)
  1062.             os.execute("cls")
  1063.             os.sleep(0.5)
  1064.             gpu.setBackground(0x000000)
  1065.             os.execute("cls")
  1066.             os.sleep(0.5)
  1067.             gpu.setBackground(0xb5001e)
  1068.             os.execute("cls")
  1069.             os.sleep(0.5)
  1070.             gpu.setBackground(0x000000)
  1071.             os.execute("cls")
  1072.             os.sleep(0.5)
  1073.             gpu.setBackground(0xffffff)
  1074.             os.execute("cls")
  1075.             os.sleep(2)
  1076.             gpu.setBackground(0x0042b5)
  1077.             os.execute("cls")
  1078.             print("your resistance has gone up!")
  1079.             os.sleep(5)
  1080.         end
  1081.     end
  1082. end
  1083. function skelcheck()
  1084.     if Cname == skeletonN or Cname == "Strong " .. skeletonN then
  1085.         if math.random(1, 4) == 2 then
  1086.             os.execute("cls")
  1087.             print("The Skeleton dropped a weapon upgrade")
  1088.             print("would you like to use it?")
  1089.             print("Y/n")
  1090.             option = io.read("*l")
  1091.             if option == "n" then
  1092.                 print("thats to bad")
  1093.             else
  1094.                 print("your damage has increased by 2!")
  1095.                 damage = damage + 1
  1096.                 os.sleep(2)
  1097.             end
  1098.         end
  1099.     end
  1100. end
  1101. function allchecks()
  1102.     slimecheck()
  1103.     randomrune()
  1104.     skelcheck()
  1105.     banditcheck()
  1106. end
  1107. function banditcheck()
  1108.     if Cname == banditN then
  1109.         print("The bandit had a bag of coins on him.")
  1110.         os.sleep(1)
  1111.         print("+100 coins")
  1112.         coins = coins + 100
  1113.         os.sleep(3)
  1114.     end
  1115. end
  1116. function adminpanelf()
  1117.     gpu.setBackground(0x000000)
  1118.     os.execute("cls")
  1119.     print("1) add exp")
  1120.     print("2) add damage")
  1121.     print("3) add health")
  1122.     print("4) add resistance")
  1123.     print("5) add magical affinity")
  1124.     print("6) add coins")
  1125.     print("7) change coords")
  1126.     print("8) add total move distance")
  1127.     print("9) change level")
  1128.     print("10) coords of all towns")
  1129.     print("11) make towns known")
  1130.     print("12) summon unicorn")
  1131.     print("13) back")
  1132.     option = io.read("*l")
  1133.     if option == "1" then
  1134.         print("how much?")
  1135.         option = io.read("*n")
  1136.         exp = exp + option
  1137.     elseif option == "2" then
  1138.         print("how much?")
  1139.         option = io.read("*n")
  1140.         damage = damage + option
  1141.     elseif option == "3" then
  1142.         print("how much")
  1143.         option = io.read("*n")
  1144.         health = health + option
  1145.     elseif option == "4" then
  1146.         print("how much?")
  1147.         print("hint: dont go crazy. max 10")
  1148.         option = io.read("*n")
  1149.         ress = ress + option
  1150.     elseif option == "5" then
  1151.         print("how much?")
  1152.         option = io.read("*n")
  1153.         magicAff = magicAff + option
  1154.     elseif option == "6" then
  1155.         print("how much?")
  1156.         option = io.read("*n")
  1157.         coins = coins + option
  1158.     elseif option == "7" then
  1159.         print("CordX =")
  1160.         option = io.read("*n")
  1161.         CordX = option
  1162.         print("CordZ =")
  1163.         option = io.read("*n")
  1164.         CordZ = option
  1165.     elseif option == "8" then
  1166.         print("how much?")
  1167.         option = io.read("*n")
  1168.         Tmove = Tmove + option
  1169.     elseif option == "9" then
  1170.         print("to what?")
  1171.         option = io.read("*n")
  1172.         nedexp = option
  1173.     elseif option == "10" then
  1174.         print("cento x = 100 z = 100")
  1175.         print("Nevo x = " .. town1X .. " z = " .. town1Z)
  1176.         print("Zenus x = " .. town2X .. " z = " .. town2Z)
  1177.         print("Cilum x = " .. town3X .. " z = " .. town3Z)
  1178.         print("Bugendai x = " .. town4X .. " z = " .. town4Z)
  1179.         print("Kuruma x = " .. town5X .. " z = " .. town5Z)
  1180.         print("Tonbo x = " .. town6X .. " z = " .. town6Z)
  1181.         print("Doragon x = " .. town7X .. " z = " .. town7Z)
  1182.         print("Toripuru x = " .. town8X .. " z = " .. town8Z)
  1183.         print("Pagu x = " .. town9X .. " z = " .. town9Z)
  1184.         print("Topikia x = " .. town10X .. " z = " .. town10Z)
  1185.         print("Gamen x = " .. town11X .. " z = " .. town11Z)
  1186.         print("Kamu x = " .. town12X .. " z = " .. town12Z)
  1187.         print("Kita x = " .. town13X .. " z = " .. town13Z)
  1188.         print("Sarani x = " .. town14X .. " z = " .. town14Z)
  1189.         print("")
  1190.         print("press enter when done")
  1191.         option2 = io.read("*l")
  1192.     elseif option == "11" then
  1193.         print("which one?")
  1194.         print("1) Nevo")
  1195.         print("2) Zenus")
  1196.         print("3) Cilum")
  1197.         print("4) Bugendai")
  1198.         print("5) Kuruma")
  1199.         print("6) Tonbo")
  1200.         print("7) Doragon")
  1201.         print("8) Toripuru")
  1202.         print("9) Pagu")
  1203.         print("10) Topikia")
  1204.         print("11) Gamen")
  1205.         print("12) Kamu")
  1206.         print("13) Kita")
  1207.         print("14) Sarani")
  1208.         option2 = io.read("*l")
  1209.         if option2 == "1" then
  1210.             BTtown1 = 1
  1211.         elseif option2 == "2" then
  1212.             BTtown2 = 1
  1213.         elseif option2 == "3" then
  1214.             BTtown3 = 1
  1215.         elseif option2 == "4" then
  1216.             BTtown4 = 1
  1217.         elseif option2 == "5" then
  1218.             BTtown5 = 1
  1219.         elseif option2 == "6" then
  1220.             BTtown6 = 1
  1221.         elseif option2 == "7" then
  1222.             BTtown7 = 1
  1223.         elseif option2 == "8" then
  1224.             BTtown8 = 1
  1225.         elseif option2 == "9" then
  1226.             BTtown9 = 1
  1227.         elseif option2 == "10" then
  1228.             BTtown10 = 1
  1229.         elseif option2 == "11" then
  1230.             BTtown11 = 1
  1231.         elseif option2 == "12" then
  1232.             BTtown12 = 1
  1233.         elseif option2 == "13" then
  1234.             BTtown13 = 1
  1235.         elseif option2 == "14" then
  1236.             BTtown14 = 1
  1237.         end
  1238.     elseif option == "12" then
  1239.         unicornC()
  1240.     elseif option == "13" then
  1241.         admingohome = "true"
  1242.     end
  1243. end
  1244. function adminmove()
  1245.     if nedexp <= 9 then
  1246.         print("which mob should appear next?")
  1247.         print("1) slime 2) bunny 3)witch")
  1248.         print("4) ghost 5) baby dragon")
  1249.         option2 = io.read("*l")
  1250.         if option2 == "1" then
  1251.             Rmob = 80
  1252.         elseif option2 == "2" then
  1253.             Rmob = 84
  1254.         elseif option2 == "3" then
  1255.             Rmob = 160
  1256.         elseif option2 == "4" then
  1257.             Rmob = 164
  1258.         elseif option2 == "5" then
  1259.             Rmob = 198
  1260.         end
  1261.         mobspawnC = 1
  1262.     else
  1263.         print("which mob should appear next?")
  1264.         print("1) slime 2) bunny 3) witch")
  1265.         print("4) ghost 5) baby dragon")
  1266.         print("6) skeleton 7) Undead warrior")
  1267.         print("8) Dark fairy 9) Ogre")
  1268.         print("10) bandit ")
  1269.         print("11) garentee dungen(only level 10 and up!)")
  1270.         print("12) garentee ruin(only level 10 and up!)")
  1271.         print("13) Crab (only level 10 and up!)")
  1272.         option2 = io.read("*l")
  1273.         if option2 == "1" then
  1274.             Rmob = 40
  1275.         elseif option2 == "2" then
  1276.             Rmob = 41
  1277.         elseif option2 == "3" then
  1278.             Rmob = 80
  1279.         elseif option2 == "4" then
  1280.             Rmob = 98
  1281.         elseif option2 == "5" then
  1282.             Rmob = 99
  1283.         elseif option2 == "6" then
  1284.             Rmob = 101
  1285.         elseif option2 == "7" then
  1286.             Rmob = 121
  1287.         elseif option2 == "8" then
  1288.             Rmob = 141
  1289.         elseif option2 == "9" then
  1290.             Rmob = 161
  1291.         elseif option2 == "10" then
  1292.             Rmob = 181
  1293.         elseif option2 == "13" then
  1294.             Rmob = 190     
  1295.         elseif option2 == "11" then
  1296.             dungenC = 1
  1297.         elseif option2 == "12" then
  1298.             dungenC = 2
  1299.         end
  1300.         mobspawnC = 1
  1301.     end
  1302. end
  1303. function attackstats()
  1304.     if mana <= maxmana - 1 then
  1305.         mana = mana + managen
  1306.     end
  1307.     if mana >= maxmana + 1 then
  1308.         mana = maxmana
  1309.     end
  1310.     TCdamage = 0
  1311.     icebreak = 0
  1312.     print(Cname .. " Has appeared")
  1313.     print("health = " .. Chealth)
  1314.     print("damage = " .. Cdamage)
  1315.     if burning >= 1 and freezeing >= 1 then
  1316.         print("FROSTBURN!")
  1317.     elseif burning >= 1 then
  1318.         print("BURNING!")
  1319.     elseif freezeing >= 1 then
  1320.         print("FROZEN!")
  1321.     end
  1322.     print("")
  1323.     print(name)
  1324.     print("health = " .. health)
  1325.     print("damage = " .. damage)
  1326.     print("mana: " .. mana .. " of " .. maxmana)
  1327.     print("")
  1328. end
  1329. function dungbossC()
  1330.     if math.random(1, 10) >= 5 then
  1331.         os.execute("cls")
  1332.         if randoN == 1 then
  1333.             print("so you defeated my minions huh?")
  1334.             os.sleep(4)
  1335.             print("I WILL MAKE YOU PAY!")
  1336.             os.sleep(1)
  1337.             print("[the ground begins to rumble as a big shadow starts to move in the distance]")
  1338.             os.sleep(4)
  1339.             randomm()
  1340.             Cname = "Huge " .. Cname
  1341.             Chealth = Chealth * 2
  1342.         elseif randoN == 2 then
  1343.             print("you dare cause so much ruckus?")
  1344.             os.sleep(4)
  1345.             print("i will kill you for waking me up!")
  1346.             os.sleep(4)
  1347.             randomm()
  1348.             Cname = "Mad " .. Cname
  1349.             Cdamage = Cdamage * 2
  1350.         else
  1351.             print("so what if you can kill my companions")
  1352.             os.sleep(4)
  1353.             print("that doesnt mean you wil make it out of here alive!")
  1354.             os.sleep(4)
  1355.             randomm()
  1356.             Cname = "Arrogant " .. Cname
  1357.             Cdamage = Cdamage * 1.5
  1358.             Chealth = Chealth * 1.5
  1359.         end
  1360.         ::bossB::
  1361.         prepbattle()
  1362.         os.execute("cls")
  1363.         deadcheck()
  1364.         attackstats()
  1365.         attacks()
  1366.         if amrunning == "true" then
  1367.             print("the monster wont allow it")
  1368.             os.sleep(2)
  1369.         end
  1370.         ::bossOB::
  1371.         if allowbattle == "false" then
  1372.             goto bossB
  1373.         end
  1374.         oenemyattack()
  1375.         if Cdead == "true" then
  1376.             goto bossEbattle
  1377.         end
  1378.         goto bossB
  1379.         ::bossEbattle::
  1380.         Cdead = "false"
  1381.         gpu.setBackground(0x949235)
  1382.         os.execute("cls")
  1383.         print("you defeted this " .. Cname)
  1384.         exp = exp + CThealth / 5
  1385.         print("you earned " .. exp .. " xp!")
  1386.         print("XP = " .. exp .. " of " .. nedexp)
  1387.         os.sleep(5)
  1388.         beatboss = "true"
  1389.     end
  1390. end
  1391. function deadcheck()
  1392.     if health <= 0 then
  1393.         gpu.setBackground(0xff0303)
  1394.         os.sleep(0.5)
  1395.         print("you have died!")
  1396.         os.sleep(2)
  1397.         print("thats sad")
  1398.         os.sleep(2)
  1399.         print("to load from last save type [launchAxium]")
  1400.         print("press enter to leave")
  1401.         option = io.read("*l")
  1402.         isdeadd = "true"
  1403.     end
  1404. end
  1405. function ruin()
  1406.     ::ruinstart::
  1407.     mobN = math.random(3, 10)
  1408.     TmobN = mobN
  1409.     os.execute("cls")
  1410.     print("you stumble across some ruins")
  1411.     print("you can see large golems protecting a chest")
  1412.     print("do you approach?")
  1413.     print("Y/n")
  1414.     option = io.read("*l")
  1415.     if option == "n" then
  1416.         print("you moved on, leaving the ruins behind")
  1417.         os.sleep(2)
  1418.     else
  1419.         ::RCheck::
  1420.         if mobN == 0 then
  1421.             Tcoin = TmobN * 20
  1422.             chesthealth = math.random(10, 50)
  1423.             chestdamage = math.random(2, 9)
  1424.             os.execute("cls")
  1425.             print("Congrats!")
  1426.             os.sleep(1)
  1427.             print("you beat the ruin!")
  1428.             os.sleep(1)
  1429.             print("you got " .. Tcoin .. " coins from monsters!")
  1430.             os.sleep(2)
  1431.             print("you open the chest in the center of the ruins")
  1432.             os.sleep(2)
  1433.             print("there are 1,000 coins and " .. chestdamage .. " damage upgrades!")
  1434.             os.sleep(2)
  1435.             print("and have healed " .. chesthealth .. " health")
  1436.             os.sleep(2)
  1437.             print("thats " .. Tcoin + 1000 .. " coins!")
  1438.             os.sleep(1)
  1439.             coins = coins + Tcoin
  1440.             coins = coins + 1000
  1441.             health = health + chesthealth
  1442.             damage = damage + chestdamage
  1443.             ruindefeated = "true"
  1444.         end
  1445.         burning = 0
  1446.         freezeing = 0
  1447.         if ruindefeated == "false" then
  1448.             Cname = "Gaurdian"
  1449.             Chealth = 70
  1450.             Cdamage = 10
  1451.             print("it looks like there are " .. mobN .. " " .. Cname .. "s")
  1452.             os.sleep(3)
  1453.             ::Rbattle::
  1454.             prepbattle()
  1455.             os.execute("cls")
  1456.             deadcheck()
  1457.             attackstats()
  1458.             attacks()
  1459.             if isdead == "true" then
  1460.                 goto Rend
  1461.             end
  1462.             if attackfunctionran == "false" then
  1463.                 goto Rbattle
  1464.             end
  1465.             if amrunning == "true" then
  1466.                 goto RAttackrun
  1467.             end
  1468.             ::Robattle::
  1469.             if burning >= 1 or freezeing >= 1 then
  1470.                 if math.random(1, 4) == 1 then
  1471.                     print("The golem is trying to cast [purify]")
  1472.                     os.sleep(2)
  1473.                     if math.random(1, 2) == 1 then
  1474.                         print("The golem succeeded!")
  1475.                         os.sleep(2)
  1476.                         freezeing = 0
  1477.                         burning = 0
  1478.                     else
  1479.                         print("the golem failed!")
  1480.                         os.sleep(2)
  1481.                     end
  1482.                     allowbattle = "false"
  1483.                 end
  1484.             end
  1485.             if allowbattle == "false" then
  1486.                 goto Rbattle
  1487.             end
  1488.             oenemyattack()
  1489.             if Cdead == "true" then
  1490.                 goto Rendbattle
  1491.             end
  1492.             goto Rbattle
  1493.             ::RAttackrun::
  1494.             runaway()
  1495.             if canrun == "true" then
  1496.                 goto Rend
  1497.             else
  1498.                 goto Robattle
  1499.             end
  1500.             ::Rendbattle::
  1501.             Cdead = "false"
  1502.             mobN = mobN - 1
  1503.             gpu.setBackground(0x949235)
  1504.             os.execute("cls")
  1505.             print("you defeted this " .. Cname)
  1506.             exp = exp + CThealth / 10
  1507.             print("you earned " .. CThealth / 10 .. " xp!")
  1508.             print("XP = " .. exp .. " of " .. nedexp)
  1509.             print("you wont level up until you defeat the ruin")
  1510.             os.sleep(5)
  1511.             allchecks()
  1512.             goto RCheck
  1513.         end
  1514.     end
  1515. ::Rend::
  1516. end
  1517. function storyF()
  1518.     if storyC == 0 and Ctown == "ellik" then
  1519.         os.execute("cls")
  1520.         gpu.setBackground(0xDDC86C)
  1521.         print("you walk into the village only to be immediately greeted by a stranger.")
  1522.         os.sleep(4)
  1523.         print("[?????] i havent seen you around here before.")
  1524.         os.sleep(3)
  1525.         print("[?????] and we dont get many visitors around here...")
  1526.         os.sleep(4)
  1527.         print("[?????] who are you?")
  1528.         os.sleep(2)
  1529.         print("")
  1530.         print("1) tell him your name")
  1531.         print("2) walk away")
  1532.         option = io.read("*l")
  1533.         if option == "1" then
  1534.             os.execute("cls")
  1535.             print("you walk into the village only to be immediately greeted by a stranger.")
  1536.             print("[?????] i havent seen you around here before.")
  1537.             print("[?????] and we dont get many visitors around here...")
  1538.             print("[?????] who are you?")
  1539.             os.sleep(2)
  1540.             print("[you] My name is " .. name)
  1541.             os.sleep(2)
  1542.             print("[you] and if i may ask, who are you?")
  1543.             os.sleep(3)
  1544.             print("[?????] My name is Chuck.")
  1545.             os.sleep(3)
  1546.             os.execute("cls")
  1547.             print("you walk into the village only to be immediately greeted by a stranger.")
  1548.             print("[Chuck] i havent seen you around here before.")
  1549.             print("[Chuck] and we dont get many visitors around here...")
  1550.             print("[Chuck] who are you?")
  1551.             print("[you] My name is " .. name)
  1552.             print("[you] and if i may ask, who are you?")
  1553.             print("[Chuck] My name is Chuck.")
  1554.             os.sleep(2)
  1555.             print("[Chuck] Im the rune master here in this village")
  1556.             os.sleep(3)
  1557.             print("[you] could you tell me where i am?")
  1558.             os.sleep(2)
  1559.             print("[you] i cant remember anything. I remember wanting to find some...")
  1560.             os.sleep(3)
  1561.             print("[you] something. i cant remember what it was")
  1562.             os.sleep(3)
  1563.             print("[Chuck] crystals?")
  1564.             os.sleep(2)
  1565.             print("[Chuck] maybe.... runes?")
  1566.             os.sleep(2)
  1567.             print("[you] Thats it!")
  1568.             os.sleep(2)
  1569.             print("[you] i wanted runes for something")
  1570.             os.sleep(2)
  1571.             print("[you] i cant remember what for..")
  1572.             os.sleep(3)
  1573.             print("[Chuck] Come, follow me to my lab.")
  1574.             os.sleep(1)
  1575.             print("you and chuck walk together toward his labortory")
  1576.             os.sleep(5)
  1577.             os.execute("cls")
  1578.             print("[Chuck] so you cant remeber anything huh?")
  1579.             os.sleep(3)
  1580.             print("[Chuck] ya know when if first encountered the void rune...")
  1581.             os.sleep(3)
  1582.             print("[Chuck] i was knocked out for a week! i couldnt remeber anything when i woke up")
  1583.             os.sleep(4)
  1584.             print("[Chuck] im still woking on remebering the-")
  1585.             os.sleep(3)
  1586.             os.execute("cls")
  1587.             gpu.setBackground(0x7F1EDB)
  1588.             os.execute("cls")
  1589.             os.sleep(4)
  1590.             gpu.setBackground(0x005050)
  1591.             os.execute("cls")
  1592.             print("Chuck is taken back, he has an exsaperated look on him")
  1593.             os.sleep(3)
  1594.             print("[Chuck] wha-what? its never done that before.")
  1595.             os.sleep(3)
  1596.             print("[Chuck] you must be very special")
  1597.             os.sleep(3)
  1598.             print("[Chuck] take this, i dont know why. i just feel like i should give it to you")
  1599.             os.sleep(5)
  1600.             print("[you] o-ok, thank you?")
  1601.             os.sleep(3)
  1602.             print("you take the glowing rune and put it in your pocket")
  1603.             os.sleep(3)
  1604.             os.execute("cls")
  1605.             print("[Chuck] you should check out the lake... you kinda stink")
  1606.             os.sleep(5)
  1607.         elseif option == "2" then
  1608.             print("you try to walk away but am blocked by guards")
  1609.             os.sleep(4)
  1610.             print("[?????] WHO ARE YOU!?")
  1611.             os.sleep(4)
  1612.             print("[you] M-My name is " .. name)
  1613.             os.sleep(2)
  1614.             print("[you] who are you?")
  1615.             os.sleep(3)
  1616.             print("[?????] My name is Chuck.")
  1617.             os.sleep(3)
  1618.             os.execute("cls")
  1619.             print("you walk into the village only to be immediately greeted by a stranger.")
  1620.             print("[Chuck] i havent seen you around here before.")
  1621.             print("[Chuck] and we dont get many visitors around here...")
  1622.             print("[Chuck] who are you?")
  1623.             print("[you] My name is " .. name)
  1624.             print("[you] and if i may ask, who are you?")
  1625.             print("[Chuck] My name is Chuck.")
  1626.             os.sleep(2)
  1627.             print("[Chuck] Im the rune master here in this village")
  1628.             os.sleep(3)
  1629.             print("[you] could you tell me where i am?")
  1630.             os.sleep(2)
  1631.             print("[you] i cant remember anything i remember wanting to find some...")
  1632.             os.sleep(3)
  1633.             print("[you] something. i cant remember what it was")
  1634.             os.sleep(3)
  1635.             print("[Chuck] crystals?")
  1636.             os.sleep(2)
  1637.             print("[Chuck] maybe.... runes?")
  1638.             os.sleep(2)
  1639.             print("[you] Thats it!")
  1640.             os.sleep(2)
  1641.             print("[you] i wanted runes for something")
  1642.             os.sleep(2)
  1643.             print("[you] i cant remeber what for..")
  1644.             os.sleep(3)
  1645.             print("[Chuck] Come, follow me to my lab.")
  1646.             os.sleep(1)
  1647.             print("you and chuck walk together toward his labortory")
  1648.             os.sleep(5)
  1649.             os.execute("cls")
  1650.             print("[Chuck] so you cant remeber anything huh?")
  1651.             os.sleep(3)
  1652.             print("[Chuck] ya know when if first encountered the void rune...")
  1653.             os.sleep(3)
  1654.             print("[Chuck] i was knocked out for a week! i couldnt remeber anything when i woke up")
  1655.             os.sleep(4)
  1656.             print("[Chuck] im still woking on remebering the-")
  1657.             os.sleep(3)
  1658.             os.execute("cls")
  1659.             gpu.setBackground(0x7F1EDB)
  1660.             os.execute("cls")
  1661.             os.sleep(4)
  1662.             gpu.setBackground(0x005050)
  1663.             os.execute("cls")
  1664.             print("Chuck is taken back, he has an exsaperated look on him")
  1665.             os.sleep(3)
  1666.             print("[Chuck] wha-what? its never done that before.")
  1667.             os.sleep(3)
  1668.             print("[Chuck] you must be very special")
  1669.             os.sleep(3)
  1670.             print("[Chuck] take this, i dont know why. i just feel like i should give it to you")
  1671.             os.sleep(5)
  1672.             print("[you] o-ok, thank you?")
  1673.             os.sleep(3)
  1674.             print("you take the glowing rune and put it in your pocket")
  1675.             os.sleep(3)
  1676.             os.execute("cls")
  1677.             print("[Chuck] you should check out the lake... you kinda stink")
  1678.             os.sleep(5)
  1679.         end
  1680.         print("--Obtained Void Rune--")
  1681.         HvoidR = 1
  1682.         os.sleep(3)
  1683.         storyC = 1
  1684.     end
  1685.            
  1686. end
  1687. function storyP2()
  1688.     print("you walk toward the lake")
  1689.     os.sleep(2)
  1690.     print("as you walk toward the lake you see the water ripple")
  1691.     os.sleep(4)
  1692.     print("out from the water comes a Leviathan")
  1693.     os.sleep(3)
  1694.     print("he just stands there.")
  1695.     os.sleep(3)
  1696.     print("what should you do?")
  1697.     os.sleep(1)
  1698.     print("")
  1699.     print("1) introduce yourself")
  1700.     print("2) draw your weapon")
  1701.     option2 = io.read("*l")
  1702.     if option2 == "1" then
  1703.         os.execute("cls")
  1704.         print("[you] e-excuse me uh sir?")
  1705.         os.sleep(3)
  1706.         print("[you] m-my na-name is " .. name)
  1707.         os.sleep(3)
  1708.         print("[you] who ar-are you?")
  1709.         os.sleep(2)
  1710.         print("[Leviathan] HAHAHAHAHAHAHA")
  1711.         os.sleep(2)
  1712.         print("[Leviathan] who would have throught you have the heart of a warrior?")
  1713.         os.sleep(2)
  1714.         print("[Leviathan] I am the water rune gaurdian")
  1715.         os.sleep(3)
  1716.         print("[Leviathan] I was created by the gods to protect this rune")
  1717.         os.sleep(4)
  1718.         print("[Leviathan] that was until i met a true warrior.")
  1719.         os.sleep(3)
  1720.         print("[you] im sorry... what!?")
  1721.         os.sleep(2)
  1722.         print("*Leviathan completely ignores you*")
  1723.         os.sleep(2)
  1724.         print("[Leviathan] I guess i am to give you this.")
  1725.         os.sleep(3)
  1726.         print("a glowing rock floats toward you")
  1727.         os.sleep(2)
  1728.         print("--Obtained Water Rune--")
  1729.         os.sleep(3)
  1730.         HwaterR = 1
  1731.     else
  1732.         os.execute("cls")
  1733.         print("the Leviathan notices your movements and soaks you in water")
  1734.         os.sleep(4)
  1735.         print("[you] e-excuse me uh sir?")
  1736.         os.sleep(3)
  1737.         print("[you] m-my na-name is " .. name)
  1738.         os.sleep(3)
  1739.         print("[you] who ar-are you?")
  1740.         os.sleep(2)
  1741.         print("[Leviathan] HAHAHAHAHAHAHA")
  1742.         os.sleep(2)
  1743.         print("[Leviathan] who would have throught you have the heart of a warrior?")
  1744.         os.sleep(2)
  1745.         print("[Leviathan] I am the water rune gaurdian")
  1746.         os.sleep(3)
  1747.         print("[Leviathan] I was created by the gods to protect this rune")
  1748.         os.sleep(4)
  1749.         print("[Leviathan] that was until i met a true warrior.")
  1750.         os.sleep(3)
  1751.         print("[you] im sorry... what!?")
  1752.         os.sleep(2)
  1753.         print("*Leviathan completely ignores you*")
  1754.         os.sleep(2)
  1755.         print("[Leviathan] I guess i am to give you this.")
  1756.         os.sleep(3)
  1757.         print("a glowing rock floats toward you")
  1758.         os.sleep(2)
  1759.         print("--Obtained Water Rune--")
  1760.         os.sleep(3)
  1761.         HwaterR = 1
  1762.     end
  1763.     storyC = 2
  1764. end
  1765. function unicornC()
  1766.     gpu.setBackground(0x949235)
  1767.     os.execute("cls")
  1768.     os.sleep(2)
  1769.     print("while walking a unicorn appears!")
  1770.     os.sleep(2)
  1771.     print("its surrounded by birds and fauna")
  1772.     os.sleep(2)
  1773.     print("you once heard a rumor.")
  1774.     os.sleep(2)
  1775.     print("ask it anything and your wish will be granted 10 times over")
  1776.     os.sleep(2)
  1777.     print("1) ask for health")
  1778.     print("2) ask to increase damage")
  1779.     print("3) ask to increase magic affinity")
  1780.     print("4) ask to increase mana management")
  1781.     print("5) ask for experience")
  1782.     option = io.read("*l")
  1783.     if option == "1" then
  1784.         os.execute("cls")
  1785.         print("the unicorn grants 180 health!")
  1786.         health = health + 180
  1787.         print("health is now " .. health)
  1788.         os.sleep(2)
  1789.     elseif option == "2" then
  1790.         os.execute("cls")
  1791.         print("the unicorn grants 5 damage!")
  1792.         damage = damage + 5
  1793.         print("damage is now " .. damage)
  1794.         os.sleep(2)
  1795.     elseif option == "3" then
  1796.         os.execute("cls")
  1797.         print("the unicorn grants 8 magic affinity")
  1798.         magicAff = magicAff + 8
  1799.         print("magic affinity is now " .. magicAff)
  1800.         os.sleep(3)
  1801.     elseif option == "4" then
  1802.         os.execute("cls")
  1803.         print("the unicorn increases maximum mana by 5")
  1804.         os.sleep(2)
  1805.         maxmana = maxmana + 5
  1806.         print("maximum mana is now " .. maxmana)
  1807.         os.sleep(2)
  1808.         print("increasing mana generation by 2.5")
  1809.         os.sleep(2)
  1810.         managen = managen + 2.5
  1811.         print("mana generation is now " .. managen)
  1812.         os.sleep(2)
  1813.     elseif option == "5" then
  1814.         os.execute("cls")
  1815.         print("the unicorn grants " .. nedexp * 4 .. " XP!")
  1816.         exp = exp + nedexp * 4
  1817.         os.sleep(3)
  1818.     else
  1819.         print("you leave the unicorn behind")
  1820.     end
  1821. end
  1822. function dragonDF()
  1823.     if math.random(1, 2) == 1 then
  1824.         Cname = "Ice Dragon"
  1825.         Cdamage = 50
  1826.         if health >= 200 then
  1827.             Chealth = health * 2
  1828.         else
  1829.             Chealth = 400
  1830.         end
  1831.     else
  1832.         Cname = "Fire Dragon"
  1833.         Cdamage = 50
  1834.         if health >= 200 then
  1835.             Chealth = health * 2
  1836.         else
  1837.             Chealth = 400
  1838.         end
  1839.     end
  1840.     CThealth = Chealth
  1841.     ::DragonB::
  1842.     prepbattle()
  1843.     os.execute("cls")
  1844.     deadcheck()
  1845.     attackstats()
  1846.     attacks()
  1847.     if amrunning == "true" then
  1848.         print("the monster wont allow it")
  1849.         os.sleep(2)
  1850.     end
  1851.     ::DragonOB::
  1852.     if allowbattle == "false" then
  1853.         goto DragonB
  1854.     end
  1855.     oenemyattack()
  1856.     if Cdead == "true" then
  1857.         goto DragonEbattle
  1858.     end
  1859.     goto DragonB
  1860.     ::DragonEbattle::
  1861.     Cdead = "false"
  1862.     gpu.setBackground(0x949235)
  1863.     os.execute("cls")
  1864.     print("you defeted this " .. Cname)
  1865.     exp = exp + CThealth / 5
  1866.     print("you earned " .. exp .. " xp!")
  1867.     print("XP = " .. exp .. " of " .. nedexp)
  1868.     os.sleep(5)
  1869. end
  1870. ::home::
  1871. beatboss = "false"
  1872. mana = maxmana
  1873. admingohome = "false"
  1874. Cdead = "false"
  1875. burning = 0
  1876. freezeing = 0
  1877. endsceneC = math.random(0, 100)
  1878. runchance = math.random(1, 4)
  1879. Rmob = math.random(0, 200)
  1880. mobspawnC = math.random(0, 150)
  1881. dungenC = math.random(0, 200)
  1882. gpu.setBackground(0x005050)
  1883. if exp >= nedexp then
  1884.   goto lvlup
  1885. end
  1886. os.execute("cls")
  1887. print("Axium V" .. version)
  1888. print("Welcome " .. name .. "!")
  1889. print("Stats:")
  1890. print("coins = " .. coins)
  1891. print("X = " .. CordX .. " Z = " .. CordZ)
  1892. print("Health = " .. health)
  1893. print("Physical Damage = " .. damage)
  1894. print("Magic affinity = " .. magicAff)
  1895. print("Max mana = " .. maxmana)
  1896. print("Mana generation = " .. managen)
  1897. print("resistance = " .. ress)
  1898. print("XP = " .. exp .. " of " .. nedexp)
  1899. print("")
  1900. print("what would you like to do?")
  1901. print("1) move")
  1902. print("2) remeber")
  1903. print("3) inventory")
  1904. print("4) save")
  1905. print("5) update game")
  1906. print("6) quit and save")
  1907. option = io.read("*l")
  1908. if option == "1" then
  1909.     goto move
  1910. elseif option == "2" then
  1911.     goto rememberss
  1912. elseif option == "3" then
  1913.     goto inventory
  1914. elseif option == "4" then
  1915.     os.execute("saveAxium")
  1916.     os.sleep(2)
  1917.     goto home
  1918. elseif option == "5" then
  1919.     goto update
  1920. elseif option == "6" then
  1921.     os.execute("saveAxium")
  1922.     goto theend
  1923. elseif option == "adminOV" then
  1924.     goto adminpanel
  1925. else
  1926.     goto home
  1927. end
  1928. ::inventory::
  1929. os.execute("cls")
  1930. print("you have:")
  1931. if HfireR == 1 then
  1932.     print("Fire Rune")
  1933. end
  1934. if HwaterR == 1 then
  1935.     print("Water Rune")
  1936. end
  1937. if HairR == 1 then
  1938.     print("Air Rune")
  1939. end
  1940. if HearthR == 1 then
  1941.     print("Earth Rune")
  1942. end
  1943. if HvoidR == 1 then
  1944.     print("Void Rune")
  1945. end
  1946. if HarcR == 1 then
  1947.     print("Arc Rune")
  1948. end
  1949. if HcheekR == 1 then
  1950.     print("Cheek Rune")
  1951. end
  1952. if HlightningR == 1 then
  1953.     print("Lightning Rune")
  1954. end
  1955. if HmetalR == 1 then
  1956.     print("Metal Rune")
  1957. end
  1958. if HwoodR == 1 then
  1959.     print("Wood Rune")
  1960. end
  1961. if HaxiumR == 1 then
  1962.     print("Axium Rune")
  1963. end
  1964. print("")
  1965. print("press enter to go back")
  1966. option = io.read("*l")
  1967. goto home
  1968. ::rememberss::
  1969. os.execute("cls")
  1970. print("current story objectives:")
  1971. if storyC == 0 then
  1972.     print("Make your way to the town of Ellik")
  1973. elseif storyC == 1 then
  1974.     print("Make your way to a village pond")
  1975. else
  1976.     print("no current objectives")
  1977. end
  1978. print("")
  1979. print("known towns:")
  1980. print("Cento: X = 100 Z = 100")
  1981. print("ellik: X= -50 Z = -50")
  1982. if BTtown1 == 1 then
  1983.     print("Nevo: X = " .. town1X .. " Z = " .. town1Z)
  1984. end
  1985. if BTtown2 == 1 then
  1986.     print("Zenus: X = " .. town2X .. " Z = " .. town2Z)
  1987. end
  1988. if BTtown3 == 1 then
  1989.     print("Cilum: X = " .. town3X .. " Z = " .. town3Z)
  1990. end
  1991. if BTtown4 == 1 then
  1992.     print("Bugendai: X = " .. town4X .. " Z = " .. town4Z)
  1993. end
  1994. if BTtown5 == 1 then
  1995.     print("Kuruma: X = " .. town5X .. " Z = " .. town5Z)
  1996. end
  1997. if BTtown6 == 1 then
  1998.     print("Tonbo: X = " .. town6X .. " Z = " .. town6Z)
  1999. end
  2000. if BTtown7 == 1 then
  2001.     print("Doragon: X = " .. town7X .. " Z = " .. town7Z)
  2002. end
  2003. if BTtown8 == 1 then
  2004.     print("Toripuru: X = " .. town8X .. " Z = " .. town8Z)
  2005. end
  2006. if BTtown9 == 1 then
  2007.     print("Pagu: X = " .. town9X .. " Z = " .. town9Z)
  2008. end
  2009. if BTtown10 == 1 then
  2010.     print("Topikia: X = " .. town10X .. " Z = " .. town10Z)
  2011. end
  2012. if BTtown11 == 1 then
  2013.     print("Gamen: X = " .. town11X .. " Z = " .. town11Z)
  2014. end
  2015. if BTtown12 == 1 then
  2016.     print("Kamu: X = " .. town12X .. " Z = " .. town12Z)
  2017. end
  2018. if BTtown13 == 1 then
  2019.     print("Kita: X = " .. town13X .. " Z = " .. town13Z)
  2020. end
  2021. if BTtown14 == 1 then
  2022.     print("Sarani: X = " .. town14X .. " Z = " .. town14Z)
  2023. end
  2024. print("")
  2025. print("press any key to go back")
  2026. option2 = io.read("*l")
  2027. goto home
  2028. ::adminpanel::
  2029. adminpanelf()
  2030. if admingohome == "true" then
  2031.     goto home
  2032. else
  2033.     goto adminpanel
  2034. end
  2035. ::move::
  2036. coins = coins + 1
  2037. os.execute("cls")
  2038. print("what direction would you like to go?")
  2039. print("1) north -Z")
  2040. print("2) east +X")
  2041. print("3) south +Z")
  2042. print("4) west -X")
  2043. option = io.read("*l")
  2044. if option == "1" then
  2045.   CordZ = CordZ - 1
  2046.   goto chance
  2047. elseif option == "2" then
  2048.   CordX = CordX + 1
  2049.   goto chance
  2050. elseif option == "3" then
  2051.   CordZ = CordZ + 1
  2052.   goto chance
  2053.   elseif option == "4" then
  2054.   CordX = CordX - 1
  2055. elseif option == "adminOV" then
  2056.   adminmove()
  2057.   goto move
  2058. else
  2059.   goto move
  2060. end
  2061. if math.random(0, 1000) == 500 then
  2062.     unicornC()
  2063. end
  2064. ::chance::
  2065. Tmove = Tmove + 1
  2066. if nedexp >= 9 and dungenC == 1 then
  2067.     goto dungen
  2068. end
  2069. if nedexp >= 9 and dungenC == 2 then
  2070.     ruin()
  2071.     if isdead == "true" then
  2072.         goto theend
  2073.     end
  2074. end
  2075. if CordX == 100 and CordZ == 100 then
  2076.     Ctown = "Cento"
  2077.     townf()
  2078.     BTcento = 1
  2079.     goto home
  2080. elseif CordX == -50 and CordZ == -50 then
  2081.     Ctown = "ellik"
  2082.     storyF()
  2083.     townf()
  2084.     BTellik = 1
  2085.     goto home
  2086. elseif CordX == town1X and CordZ == town1Z then
  2087.     Ctown = "Nevo"
  2088.     townf()
  2089.     BTtown1 = 1
  2090.     goto home
  2091. elseif CordX == town2X and CordZ == town2Z then
  2092.     Ctown = "Zenus"
  2093.     townf()
  2094.     BTtown2 = 1
  2095.     goto home
  2096. elseif CordX == town3X and CordZ == town3Z then
  2097.     Ctown = "Cilum"
  2098.     townf()
  2099.     BTtown3 = 1
  2100.     goto home
  2101. elseif CordX == town4X and CordZ == town4Z then
  2102.     Ctown = "Bugendai"
  2103.     townf()
  2104.     BTtown4 = 1
  2105.     goto home
  2106. elseif CordX == town5X and CordZ == town5Z then
  2107.     Ctown = "Kuruma"
  2108.     townf()
  2109.     BTtown5 = 1
  2110.     goto home
  2111. elseif CordX == town6X and CordZ == town6Z then
  2112.     Ctown = "Tonbo"
  2113.     townf()
  2114.     BTtown6 = 1
  2115.     goto home
  2116. elseif CordX == town7X and CordZ == town7Z then
  2117.     Ctown = "Doragon"
  2118.     townf()
  2119.     BTtown7 = 1
  2120.     goto home
  2121. elseif CordX == town8X and CordZ == town8Z then
  2122.     Ctown = "Toripuru"
  2123.     townf()
  2124.     BTtown8 = 1
  2125.     goto home
  2126. elseif CordX == town9X and CordZ == town9Z then
  2127.     Ctown = "Pagu"
  2128.     townf()
  2129.     BTtown9 = 1
  2130.     goto home
  2131. elseif CordX == town10X and CordZ == town10Z then
  2132.     Ctown = "Topikia"
  2133.     townf()
  2134.     BTtown10 = 1
  2135.     goto home
  2136. elseif CordX == town11X and CordZ == town11Z then
  2137.     Ctown = "Gamen"
  2138.     townf()
  2139.     BTtown11 = 1
  2140.     goto home
  2141. elseif CordX == town12X and CordZ == town12Z then
  2142.     Ctown = "Kamu"
  2143.     townf()
  2144.     BTtown12 = 1
  2145.     goto home
  2146. elseif CordX == town13X and CordZ == town13Z then
  2147.     Ctown = "Kita"
  2148.     townf()
  2149.     BTtown13 = 1
  2150.     goto home
  2151. elseif CordX == town14X and CordZ == town14Z then
  2152.     Ctown = "Sarani"
  2153.     townf()
  2154.     BTtown14 = 1
  2155.     goto home
  2156. end
  2157. --mob appear chance
  2158. if mobspawnC <= 50 then
  2159.   print("50!")
  2160.   randomm()
  2161. else
  2162.   goto home
  2163. end
  2164. ::battle::
  2165. prepbattle()
  2166. os.execute("cls")
  2167. Tdamage = 0
  2168. allowOattack = "true"
  2169. if health <= 0 then
  2170.   gpu.setBackground(0xff0303)
  2171.   os.sleep(0.5)
  2172.   print("you have died!")
  2173.   os.sleep(2)
  2174.   print("thats sad")
  2175.   os.sleep(2)
  2176.   print("final coins = " .. coins)
  2177.   print("press enter to leave")
  2178.   option = io.read("*l")
  2179.   goto compbeg
  2180. end
  2181. attackstats()
  2182. attacks()
  2183. if attackfunctionran == "false" then
  2184.     goto battle
  2185. end
  2186. if amrunning == "true" then
  2187.     goto Attackrun
  2188. end
  2189.  
  2190. ::obattle::
  2191. if allowbattle == "false" then
  2192.     goto battle
  2193. end
  2194. oenemyattack()
  2195. if Cdead == "true" then
  2196.     goto endbattle
  2197. end
  2198. goto battle
  2199. ::Attackrun::
  2200. runaway()
  2201. if canrun == "true" then
  2202.     goto home
  2203. else
  2204.     goto obattle
  2205. end
  2206. ::endbattle::
  2207. gpu.setBackground(0x949235)
  2208. os.execute("cls")
  2209. print("you win!")
  2210. print("you got 10 coins")
  2211. exp = exp + CThealth / 10
  2212. coins = coins + 10
  2213. print("you earned " .. CThealth / 10 .. " xp!")
  2214. print("XP = " .. exp .. " of " .. nedexp)
  2215. os.sleep(2)
  2216. allchecks()
  2217. ::lvlup::
  2218. gpu.setBackground(0x949235)
  2219. os.execute("cls")
  2220. if exp >= nedexp then
  2221.     print("you have leveled up!")
  2222.     print("1) increase health")
  2223.     print("2) increase damage")
  2224.     print("3) increase magic affinity")
  2225.     print("4) increase mana management")
  2226.     option = io.read("*l")
  2227.     if option == "1" then
  2228.         os.execute("cls")
  2229.         print("adding 10 health")
  2230.         health = health + 10
  2231.         print("health is now " .. health)
  2232.         os.sleep(2)
  2233.     elseif option == "2" then
  2234.         os.execute("cls")
  2235.         print("adding 1 damage!")
  2236.         damage = damage + 1
  2237.         print("damage is now " .. damage)
  2238.         os.sleep(2)
  2239.     elseif option == "3" then
  2240.         os.execute("cls")
  2241.         print("increasing magic affinity by 1!")
  2242.         magicAff = magicAff + 1
  2243.         print("magic affinity is now " .. magicAff)
  2244.         os.sleep(3)
  2245.     elseif option == "4" then
  2246.         os.execute("cls")
  2247.         print("increasing maximum mana by 1")
  2248.         os.sleep(2)
  2249.         maxmana = maxmana + 1
  2250.         print("maximum mana is now " .. maxmana)
  2251.         os.sleep(2)
  2252.         print("increasing mana generation by 0.5")
  2253.         os.sleep(2)
  2254.         managen = managen + 0.5
  2255.         print("mana generation is now " .. managen)
  2256.         os.sleep(2)
  2257.     else
  2258.         goto lvlup
  2259.     end
  2260.     exp = exp - nedexp
  2261.     nedexp = nedexp + 1
  2262. end
  2263. goto home
  2264. ::dungen::
  2265. mobN = math.random(1, 10)
  2266. TmobN = mobN
  2267. os.execute("cls")
  2268. print("you stumble across a cave entrance")
  2269. print("you can see movement in the cave")
  2270. print("do you enter?")
  2271. print("Y/n")
  2272. option = io.read("*l")
  2273. if option == "n" then
  2274.     print("you moved on, leaving the cave behind")
  2275.     os.sleep(2)
  2276.     goto home
  2277. end
  2278. ::DCheck::
  2279. if mobN == 0 then
  2280.     dungbossC()
  2281.     Tcoin = TmobN * 20
  2282.     os.execute("cls")
  2283.     print("Congrats!")
  2284.     os.sleep(1)
  2285.     print("you beat the dungen!")
  2286.     os.sleep(1)
  2287.     print("you got " .. Tcoin .. " coins from monsters!")
  2288.     os.sleep(2)
  2289.     if beatboss == "true" then
  2290.         print("you also defeated the dungeon boss!")
  2291.         os.sleep(2)
  2292.         print("+200 coins")
  2293.         Tcoin = Tcoin + 200
  2294.         os.sleep(2)
  2295.     end
  2296.     burning = 0
  2297.     freezeing = 0
  2298.     print("and got an additional 300 coins for defeting the dungen!")
  2299.     os.sleep(2)
  2300.     print("thats " .. Tcoin + 300 .. " coins!")
  2301.     os.sleep(3)
  2302.     coins = coins + Tcoin
  2303.     coins = coins + 300
  2304.     goto home
  2305. end
  2306. randomm()
  2307. print("it looks like there are " .. mobN .. " " .. Cname .. "s")
  2308. os.sleep(2)
  2309. ::Dbattle::
  2310. prepbattle()
  2311. os.execute("cls")
  2312. deadcheck()
  2313. if isdeadd == "true" then goto theend end
  2314. attackstats()
  2315. attacks()
  2316. if isdead == "true" then
  2317.     goto theend
  2318. end
  2319. if attackfunctionran == "false" then
  2320.     goto Dbattle
  2321. end
  2322. if amrunning == "true" then
  2323.     goto DAttackrun
  2324. end
  2325. ::Dobattle::
  2326. if allowbattle == "false" then
  2327.     goto Dbattle
  2328. end
  2329. oenemyattack()
  2330. if Cdead == "true" then
  2331.     goto Dendbattle
  2332. end
  2333. goto Dbattle
  2334. ::DAttackrun::
  2335. runaway()
  2336. if canrun == "true" then
  2337.     goto home
  2338. else
  2339.     goto Dobattle
  2340. end
  2341. ::Dendbattle::
  2342. Cdead = "false"
  2343. mobN = mobN - 1
  2344. gpu.setBackground(0x949235)
  2345. os.execute("cls")
  2346. print("you defeted this " .. Cname)
  2347. exp = exp + CThealth / 10
  2348. print("you earned " .. CThealth / 10 .. " xp!")
  2349. print("XP = " .. exp .. " of " .. nedexp)
  2350. print("you wont level up until you defeat the dungen")
  2351. os.sleep(5)
  2352. allchecks()
  2353. goto DCheck
  2354. ::update::
  2355. os.execute("pastebin get -f MJ3aqGp9 Axium")
  2356. os.execute("pastebin get -f WhpDBZYF saveAxium")
  2357. os.execute("pastebin get -f RCgPgtE4 launchAxium")
  2358. print("type [Axium] to start playing")
  2359. os.execute("saveAxium")
  2360. ::theend::
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement