Advertisement
Guest User

Untitled

a guest
Dec 24th, 2018
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.47 KB | None | 0 0
  1. Main
  2. {
  3. questname "Change Class"
  4. version 1
  5. }
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12. state Begin
  13. {
  14.  
  15. desc "Talk to Wise Man"
  16. action AddNpcChat( 4 , "Hellow stranger" );
  17. action AddNpcText( 4 , "Hellow stranger, what can I do for you?" );
  18. action AddNpcInput( 4 , 1 , "View Classes");
  19. action AddNpcInput( 4 , 2 , "Exit");
  20.  
  21. rule InputNpc( 1 ) goto ClassMenu
  22. rule InputNpc( 2 ) goto QuestReset
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. state ClassMenu
  31. {
  32. desc "Talk to Wise Man"
  33. action ShowHint("Class menu opened");
  34.  
  35. action AddNpcText( 4 , "Would you like to buy a class?" );
  36. action AddNpcInput( 4 , 1 , "Priest Class");
  37. action AddNpcInput( 4 , 2 , "Magician Class");
  38. action AddNpcInput( 4 , 3 , "Rogue Class");
  39. action AddNpcInput( 4 , 4 , "Archer Class");
  40. action AddNpcInput( 4 , 5 , "Warrior Class");
  41.  
  42. rule InputNpc( 1 ) goto PriestSelected
  43. rule InputNpc( 2 ) goto MagicianSelected
  44. rule InputNpc( 3 ) goto RogueSelected
  45. rule InputNpc( 4 ) goto ArcherSelected
  46. rule InputNpc( 5 ) goto WarriorSelected
  47. }
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. state PriestSelected
  55. {
  56. action AddNpcText( 4 , "Priest Cost: 100G");
  57. action AddNpcInput( 4 , 1 , "Buy Priest");
  58. action AddNpcInput( 4 , 2 , "View Classes");
  59. action AddNpcInput( 4 , 3 , "Exit");
  60.  
  61. rule InputNpc( 1 ) goto PriestCheck
  62. rule InputNpc( 2 ) goto ClassMenu
  63. rule InputNpc( 3 ) goto QuestReset
  64. }
  65.  
  66. state MagicianSelected
  67. {
  68. action AddNpcText( 4 , "Magician Cost: 200G");
  69. action AddNpcInput( 4 , 1 , "Buy Magician");
  70. action AddNpcInput( 4 , 2 , "View Classes");
  71. action AddNpcInput( 4 , 3 , "Exit");
  72.  
  73. rule InputNpc( 1 ) goto MagicianCheck
  74. rule InputNpc( 2 ) goto ClassMenu
  75. rule InputNpc( 3 ) goto QuestReset
  76. }
  77.  
  78. state RogueSelected
  79. {
  80. action AddNpcText( 4 , "Rogue Cost: 300G");
  81. action AddNpcInput( 4 , 1 , "Buy Rogue");
  82. action AddNpcInput( 4 , 2 , "View Classes");
  83. action AddNpcInput( 4 , 3 , "Exit");
  84.  
  85. rule InputNpc( 1 ) goto RogueCheck
  86. rule InputNpc( 2 ) goto ClassMenu
  87. rule InputNpc( 3 ) goto QuestReset
  88. }
  89.  
  90. state ArcherSelected
  91. {
  92. action AddNpcText( 4 , "Archer Cost: 400G");
  93. action AddNpcInput( 4 , 1 , "Buy Archer");
  94. action AddNpcInput( 4 , 2 , "View Classes");
  95. action AddNpcInput( 4 , 3 , "Exit");
  96.  
  97. rule InputNpc( 1 ) goto ArcherCheck
  98. rule InputNpc( 2 ) goto ClassMenu
  99. rule InputNpc( 3 ) goto QuestReset
  100. }
  101.  
  102. state WarriorSelected
  103. {
  104. action AddNpcText( 4 , "Warrior Cost: 500G");
  105. action AddNpcInput( 4 , 1 , "Buy Warrior");
  106. action AddNpcInput( 4 , 2 , "View Classes");
  107. action AddNpcInput( 4 , 3 , "Exit");
  108.  
  109. rule InputNpc( 1 ) goto WarriorCheck
  110. rule InputNpc( 2 ) goto ClassMenu
  111. rule InputNpc( 3 ) goto QuestReset
  112. }
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119. state PriestCheck
  120. {
  121. rule GotItems(1,100) goto PriestBought
  122. rule LostItems(1,100) goto PriestNoFunds
  123. }
  124.  
  125. state MagicianCheck
  126. {
  127. rule GotItems(1,200) goto MagicianBought
  128. rule LostItems(1,200) goto MagicianNoFunds
  129. }
  130.  
  131. state RogueCheck
  132. {
  133. rule GotItems(1,300) goto RogueBought
  134. rule LostItems(1,300) goto RogueNoFunds
  135. }
  136.  
  137. state ArcherCheck
  138. {
  139. rule GotItems(1,400) goto ArcherBought
  140. rule LostItems(1,400) goto ArcherNoFunds
  141. }
  142.  
  143. state WarriorCheck
  144. {
  145. rule GotItems(1,500) goto WarriorBought
  146. rule LostItems(1,500) goto WarriorNoFunds
  147. }
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154. state PriestBought
  155. {
  156. action SetClass(2);
  157. action RemoveItem( 1 , 100)
  158. action ShowHint("You bought the Priest Class for: 100 Gold.");
  159. action Reset();
  160. }
  161.  
  162. state MagicianBought
  163. {
  164. action SetClass(3);
  165. action RemoveItem( 1 , 200)
  166. action ShowHint("You bought the Magician Class for: 200 Gold.");
  167. action Reset();
  168. }
  169.  
  170. state RogueBought
  171. {
  172. action SetClass(4);
  173. action RemoveItem( 1 , 300)
  174. action ShowHint("You bought the Rogue Class for: 300 Gold.");
  175. action Reset();
  176. }
  177.  
  178. state ArcherBought
  179. {
  180. action SetClass(5);
  181. action RemoveItem( 1 , 400)
  182. action ShowHint("You bought the Archer Class for: 400 Gold.");
  183. action Reset();
  184. }
  185.  
  186. state WarriorBought
  187. {
  188. action SetClass(6);
  189. action RemoveItem( 1 , 500)
  190. action ShowHint("You bought the Warrior Class for: 500 Gold.");
  191. action Reset();
  192. }
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199. state PriestNoFunds
  200. {
  201. action ShowHint("You don't have sufficient funds to buy the Priest Class!");
  202. action goto Begin
  203. }
  204.  
  205. state MagicianNoFunds
  206. {
  207. action ShowHint("You don't have sufficient funds to buy the Magician Class!");
  208. action goto Begin
  209. }
  210.  
  211. state RogueNoFunds
  212. {
  213. action ShowHint("You don't have sufficient funds to buy the Rogue Class!");
  214. action goto Begin
  215. }
  216.  
  217. state ArcherNoFunds
  218. {
  219. action ShowHint("You don't have sufficient funds to buy the Archer Class!");
  220. action goto Begin
  221. }
  222.  
  223. state WarriorNoFunds
  224. {
  225. action ShowHint("You don't have sufficient funds to buy the Warrior Class!");
  226. action goto Begin
  227. }
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234. state QuestReset
  235. {
  236. action Reset();
  237. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement