Advertisement
SpinFire

Inventory Reference

Feb 8th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 49.18 KB | None | 0 0
  1. -- LUA Script - precede every function and global member with lowercase name of script + '_main'
  2.  
  3. -- Moshroom's RPG Menu Script version 1.1
  4.  
  5. -- How to edit item/equipment/state tables:
  6. --
  7. -- 1) Create dat file to Game Guru\Files\RPG folder to override a default data set (eg. Game Guru\Files\RPG\item_name.dat)
  8. -- 2) Assign new value for the items. Each row represents one record in the table (eg. row 1 = Healing Potion, row 2 = High Potion, etc.)
  9. --
  10. -- Data types:
  11. --
  12. -- String (item_name.dat, item_description.dat, weapon_name.dat, armor_name.dat, accessory_name.dat, accessory_description.dat, rpg_state.dat)
  13. -- Numeric (item_initial.dat, item_target.dat, item_effect.dat, item_price.dat, weapon_initial.dat, weapon_price.dat, armor_initial.dat, armor_price.dat, accessory_target.dat, accessory_effect.dat, accessory_price.dat)
  14. --
  15. -- Item Targets: (item_target.dat)
  16. --
  17. -- 10 = Add HP
  18. -- 11 = Cure
  19. -- 12 = Full Cure
  20. -- 20 = Add Power
  21. -- 30 = Add Vitality
  22. -- 40 = Add Agility
  23. -- 50 = Add Sight
  24. -- 80 = Remove all negative status changes
  25. -- 84 = Remove Feeble
  26. -- 85 = Remove Weak
  27. -- 86 = Remove Slow
  28. -- 87 = Remove Blind
  29. -- 88 = Remove Venom
  30. -- 99 = No effect
  31. --
  32. -- Equipment Targets: (accessory_target.dat)
  33. --
  34. -- Accessory
  35. -- 20 = Add Power in level up
  36. -- 30 = Add Vitality in level up
  37. -- 40 = Add Agility in level up
  38. -- 41 = Temporarily add Agility
  39. -- 50 = Add Sight in level up
  40. -- 51 = Temporarily add Sight
  41. -- 80 = Prevent all negative status changes
  42. -- 84 = Prevent Feeble
  43. -- 85 = Prevent Weak
  44. -- 86 = Prevent Slow
  45. -- 87 = Prevent Blind
  46. -- 88 = Prevent Venom
  47. -- 99 = No effect
  48. --
  49. -- Weapon = Temporarily add Power (Weapon class only)
  50. -- Armor = Temporarily add Vitality (Armor class only)
  51. --
  52. -- States: (rpg_state.dat)
  53. -- 1 = Normal - no effect
  54. -- 2 = Critical - no effect
  55. -- 3 = Overdrive - no effect
  56. -- 4 = Feeble - reduce Power to 1
  57. -- 5 = Weak - reduce Vitality to 1
  58. -- 6 = Slow - reduce Agility to 1
  59. -- 7 = Blind - reduce Sight to 1
  60. -- 8 = Venom - gradually reduce HP until 1
  61.  
  62. -- Define flags to communicate with other RPG scripts
  63. FLAG_MENU = 1
  64.  
  65. -- Define the constants
  66. SAVE_DISTANCE = 100
  67.  
  68. TIME_W = 145
  69. TIME_B = 200
  70.  
  71. DIV_PARAM = 25
  72. EQ_PARAM = 2
  73.  
  74. LEVEL_PARAM_A = 105
  75. LEVEL_PARAM_B = 75
  76. LEVEL_PARAM_C = 5
  77.  
  78. NUM_DATASETS = 18
  79. NUM_INV = 14
  80. NUM_STATES = 8
  81.  
  82. NUM_SLOTS = 7
  83. NUM_COUNTERS = 9999
  84.  
  85. -- Define table for ActiveMenu
  86. ActiveMenu = {}
  87.  
  88. -- Define tables for inventory
  89. InvItem = {}
  90. InvWeapon = {}
  91. InvArmor = {}
  92. InvAccessory = {}
  93.  
  94. Item_Slot = {}
  95. Weapon_Slot = {}
  96. Armor_Slot = {}
  97. Accessory_Slot = {}
  98.  
  99. -- Define tables for usable items
  100. Item = {"Healing Potion", "High Potion", "Boost Potion", "Elixir", "Antidote", "Stimulant", "Tonic", "Hourglass", "Eye drops", "Panacea", "Power Source", "Vitality Source", "Agility Source", "Sight Source"}
  101. Item_Target = {11, 11, 10, 12, 88, 84, 85, 86, 87, 80, 20, 30, 40, 50}
  102. Item_Effect = {25, 50, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
  103. Item_Description = {"Restores 25 HP.", "Restores 50 HP.", "Adds 10 HP. May inflict overdrive.", "Fully restores HP.", "Cures Venom.", "Cures Feeble.", "Cures Weak.", "Cures Slow.", "Cures Blind.", "Cures all status ailments.", "Raises Power by 1.", "Raises Vitality by 1.", "Raises Agility by 1.", "Raises Sight by 1."}
  104. Item_Price = {100, 200, 500, 1000, 300, 290, 280, 240, 230, 900, 5000, 5000, 5000, 5000}
  105.  
  106. -- Define tables for equipment
  107. Weapon = {"Wooden Rod", "Bronze Rod", "Iron Staff", "Steel Staff", "Crozier", "Holy Sceptre"}
  108. Weapon_Price = {300, 1000, 2100, 4000, 5500, 8000}
  109.  
  110. Armor = {"Burlap", "Tunic", "Vagrant Robe", "Leather Robe", "Magic Cape", "Saint Cape"}
  111. Armor_Price = {400, 900, 2200, 4200, 5900, 7700}
  112.  
  113. Accessory = {"Hermes Shoes", "Spyglass", "Beaked Mask", "Gauntlet", "Cuirass", "Pendulum", "Spectacles", "Holy Pendant", "Sorcerer's Ring", "Warrior's Ring", "Thief's Ring", "Archer's Ring"}
  114. Accessory_Target = {41, 51, 88, 84, 85, 86, 87, 80, 20, 30, 40, 50}
  115. Accessory_Effect = {10, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
  116. Accessory_Description = {"Improves Agility.", "Improves Sight.", "Prevents Venom.", "Prevents Feeble.", "Prevents Weak.", "Prevents Slow.", "Prevents Blind.", "Prevents all status ailments.", "Raises probability of Power growth in level up.", "Raises probability of Vitality growth in level up.", "Raises probability of Agility growth in level up.", "Raises probability of Sight growth in level up."}
  117. Accessory_Price = {2000, 2000, 2200, 2500, 2500, 1900, 1800, 9000, 1000, 1000, 1000, 1000}
  118.  
  119. -- Define table for status changes
  120. State = {}
  121.  
  122. -- Define tables to read RPG data
  123. Data_File = {"RPG\\item_name.dat","RPG\\item_target.dat","RPG\\item_effect.dat","RPG\\item_description.dat","RPG\\item_price.dat","RPG\\weapon_name.dat","RPG\\weapon_price.dat","RPG\\armor_name.dat","RPG\\armor_price.dat","RPG\\accessory_name.dat","RPG\\accessory_target.dat","RPG\\accessory_effect.dat","RPG\\accessory_description.dat","RPG\\accessory_price.dat","RPG\\item_initial.dat","RPG\\weapon_initial.dat","RPG\\armor_initial.dat","RPG\\accessory_initial.dat","RPG\\rpg_state.dat"}
  124.  
  125. -- Define table for save/load system
  126. Counter = {}
  127. DCounter = {}
  128. QCounter = {}
  129. HP = {}
  130. EntityX = {}
  131. EntityY = {}
  132. EntityZ = {}
  133. EntityName = {}
  134.  
  135. -- Define table for menu commands
  136. ActiveCommand = {}
  137. NumCommands = {}
  138.  
  139. function moshroom_rpg_menu_init_name(e, name)
  140. ActiveMenu[e] = 0
  141. ActiveSlot = 0
  142. BtnTime = 0
  143.  
  144. ShopActive = 0
  145. MenuActive = 0
  146. -- Init the clock
  147. TimeCounter = 0
  148. TimeSecond = 0
  149. TimeMinute = 0
  150. TimeHour = 0
  151. TimeInit = 0
  152. UGTimer = 0
  153. -- Init the options
  154. CursorPosition = 1
  155. TextSize = 1
  156. FrontPageText = 1
  157. MessageWindow = 1
  158. BMessageWindow = 1
  159. -- Init the battle message
  160. BTimed = 0
  161. BMsgTime = 0
  162. BCountTime = 0
  163. BMessageString = 0
  164. BMessageTime = 0
  165. -- Init the RPG stats
  166. g_RPG_Level = 1
  167. g_RPG_EXP = 0
  168. g_RPG_Threshold = 0
  169. g_RPG_ToNextLevel = 0
  170. g_RPG_SpellPower = 100
  171. g_RPG_Vitality = 100
  172. g_RPG_Agility = 100
  173. g_RPG_Sight = 100
  174. g_RPG_State = 1
  175. g_RPG_Gold = 0
  176. -- Init the equipment
  177. g_Eq_Weapon = 0
  178. g_Eq_Armor = 0
  179. g_Eq_Accessory = 0
  180. g_Eq_Accessory_Target = 0
  181. g_Eq_Accessory_Effect = 0
  182. -- Init the abnormal states
  183. g_RPG_FeeblePenalty = 0
  184. g_RPG_WeakPenalty = 0
  185. g_RPG_SlowPenalty = 0
  186. g_RPG_BlindPenalty = 0
  187. -- Init the save/load system
  188. SavePoint = 0
  189. ActiveSlot = 0
  190. SavePhase = 0
  191. LoadPhase = 0
  192. end
  193.  
  194. -- Control menu section with 1 column
  195. function Command_One(e)
  196. -- Initiate the command
  197. if ActiveCommand[ActiveMenu[e]] == nil then
  198. ActiveCommand[ActiveMenu[e]] = 1
  199. end
  200. -- Update menu when player presses up/down
  201. if g_KeyPressW == 1 and g_Time > BtnTime then
  202. PlayNon3DSound(e,1)
  203. BtnTime = g_Time + TIME_W
  204. ActiveCommand[ActiveMenu[e]] = ActiveCommand[ActiveMenu[e]] - 1
  205. end
  206. if g_KeyPressS == 1 and g_Time > BtnTime then
  207. PlayNon3DSound(e,1)
  208. BtnTime = g_Time + TIME_W
  209. ActiveCommand[ActiveMenu[e]] = ActiveCommand[ActiveMenu[e]] + 1
  210. end
  211. if g_MouseWheel > 0 and g_Time > BtnTime then
  212. PlayNon3DSound(e,1)
  213. BtnTime = g_Time + TIME_W
  214. ActiveCommand[ActiveMenu[e]] = ActiveCommand[ActiveMenu[e]] - 1
  215. end
  216. if g_MouseWheel < 0 and g_Time > BtnTime then
  217. PlayNon3DSound(e,1)
  218. BtnTime = g_Time + TIME_W
  219. ActiveCommand[ActiveMenu[e]] = ActiveCommand[ActiveMenu[e]] + 1
  220. end
  221. -- Set limits for the command - Wrap
  222. if ActiveCommand[ActiveMenu[e]] > NumCommands[ActiveMenu[e]] then
  223. ActiveCommand[ActiveMenu[e]] = 1
  224. end
  225. if ActiveCommand[ActiveMenu[e]] < 1 then
  226. ActiveCommand[ActiveMenu[e]] = NumCommands[ActiveMenu[e]]
  227. end
  228. end
  229.  
  230. -- Control menu section with 2 columns
  231. function Command_Two(e)
  232. -- Initiate the command
  233. if ActiveCommand[ActiveMenu[e]] == nil then
  234. ActiveCommand[ActiveMenu[e]] = 1
  235. end
  236. -- Update menu when player presses up/down/left/right
  237. if g_KeyPressA == 1 and g_Time > BtnTime then
  238. PlayNon3DSound(e,1)
  239. BtnTime = g_Time + TIME_W
  240. ActiveCommand[ActiveMenu[e]] = ActiveCommand[ActiveMenu[e]] - 1
  241. end
  242. if g_KeyPressW == 1 and g_Time > BtnTime then
  243. PlayNon3DSound(e,1)
  244. BtnTime = g_Time + TIME_W
  245. ActiveCommand[ActiveMenu[e]] = ActiveCommand[ActiveMenu[e]] - 2
  246. end
  247. if g_KeyPressD == 1 and g_Time > BtnTime then
  248. PlayNon3DSound(e,1)
  249. BtnTime = g_Time + TIME_W
  250. ActiveCommand[ActiveMenu[e]] = ActiveCommand[ActiveMenu[e]] + 1
  251. end
  252. if g_KeyPressS == 1 and g_Time > BtnTime then
  253. PlayNon3DSound(e,1)
  254. BtnTime = g_Time + TIME_W
  255. ActiveCommand[ActiveMenu[e]] = ActiveCommand[ActiveMenu[e]] + 2
  256. end
  257. if g_MouseWheel > 0 and g_Time > BtnTime then
  258. PlayNon3DSound(e,1)
  259. BtnTime = g_Time + TIME_W
  260. ActiveCommand[ActiveMenu[e]] = ActiveCommand[ActiveMenu[e]] - 1
  261. end
  262. if g_MouseWheel < 0 and g_Time > BtnTime then
  263. PlayNon3DSound(e,1)
  264. BtnTime = g_Time + TIME_W
  265. ActiveCommand[ActiveMenu[e]] = ActiveCommand[ActiveMenu[e]] + 1
  266. end
  267. -- Set limits for the command - No wrap
  268. if ActiveCommand[ActiveMenu[e]] > NumCommands[ActiveMenu[e]] then
  269. ActiveCommand[ActiveMenu[e]] = NumCommands[ActiveMenu[e]]
  270. end
  271. if ActiveCommand[ActiveMenu[e]] < 1 then
  272. ActiveCommand[ActiveMenu[e]] = 1
  273. end
  274. end
  275.  
  276. function FieldMessage(e, WindowHeight, MessageString1, MessageString2, MessageType)
  277. if MenuActive == 0 and ShopActive == 0 then
  278. -- If MessageWindow is set on, show it
  279. if MessageWindow == 1 then
  280. Panel(20,90 - 5 * WindowHeight,80,95)
  281. -- Show who's speaking
  282. Text(22,90 - 5 * (WindowHeight - 1),TextSize,"<" .. EntityName[e] .. ">")
  283.  
  284. -- Show the message
  285. if MessageType == 0 then
  286. Text(22,90 - 5 * (WindowHeight - 2),TextSize,MessageString1)
  287. Text(22,90 - 5 * (WindowHeight - 3),TextSize,MessageString2)
  288. end
  289. if MessageType == 1 then
  290. Text(22,90 - 5 * (WindowHeight - 2),TextSize,MessageString1)
  291. TextCenterOnX(50,90 - 5 * (WindowHeight - 3),TextSize,"-- " .. MessageString2 .. " --")
  292. end
  293. else
  294. Prompt(MessageString1 .. " " .. MessageString2 .. ".")
  295. end
  296. end
  297. end
  298.  
  299. function BMWindow()
  300. if BTimed == 1 then
  301. if BCountTime == 0 then
  302. BCountTime = g_Time
  303. BMsgTime = g_Time + BMessageTime
  304. end
  305. -- If the timer is running, use it
  306. if BCountTime ~= 0 then
  307. BCountTime = g_Time
  308. Panel(20,85,80,95)
  309. TextCenterOnX(50,90,TextSize,BMessageString)
  310. end
  311. -- If the the timer reaches goal, reset it and deactivate prompt
  312. if BCountTime > BMsgTime then
  313. BTimed = 0
  314. BMsgTime = 0
  315. BCountTime = 0
  316. end
  317. end
  318. end
  319.  
  320. function Load_RPG_Data()
  321. -- Read data from the dataset defined earlier
  322. for DataRead = 1,NUM_DATASETS do
  323. local File = io.open(Data_File[DataRead], "r")
  324. if File ~= nil then
  325. for Line = 1,NUM_INV do
  326. -- 1 = Item Name
  327. if DataRead == 1 then
  328. Item[Line] = File:read("*l")
  329. if Item[Line] == nil then
  330. Item[Line] = "Package"
  331. end
  332. end
  333. -- 2 = Item Target
  334. if DataRead == 2 then
  335. Item_Target[Line] = tonumber(File:read("*l"))
  336. if Item_Target[Line] == nil then
  337. Item_Target[Line] = 99
  338. end
  339. end
  340. -- 3 = Item Effect
  341. if DataRead == 3 then
  342. Item_Effect[Line] = tonumber(File:read("*l"))
  343. if Item_Effect[Line] == nil then
  344. Item_Effect[Line] = 1
  345. end
  346. end
  347. -- 4 = Item Description
  348. if DataRead == 4 then
  349. Item_Description[Line] = File:read("*l")
  350. if Item_Description[Line] == nil then
  351. Item_Description[Line] = "Quest item."
  352. end
  353. end
  354. -- 5 = Item Price
  355. if DataRead == 5 then
  356. Item_Price[Line] = tonumber(File:read("*l"))
  357. if Item_Price[Line] == nil then
  358. Item_Price[Line] = 10
  359. end
  360. end
  361. -- 6 = Weapon Name
  362. if DataRead == 6 then
  363. Weapon[Line] = File:read("*l")
  364. if Weapon[Line] == nil then
  365. Weapon[Line] = "Staff"
  366. end
  367. end
  368. -- 7 = Weapon Price
  369. if DataRead == 7 then
  370. Weapon_Price[Line] = tonumber(File:read("*l"))
  371. if Weapon_Price[Line] == nil then
  372. Weapon_Price[Line] = 10
  373. end
  374. end
  375. -- 8 = Armor Name
  376. if DataRead == 8 then
  377. Armor[Line] = File:read("*l")
  378. if Armor[Line] == nil then
  379. Armor[Line] = "Armor"
  380. end
  381. end
  382. -- 9 = Weapon Price
  383. if DataRead == 9 then
  384. Armor_Price[Line] = tonumber(File:read("*l"))
  385. if Armor_Price[Line] == nil then
  386. Armor_Price[Line] = 10
  387. end
  388. end
  389. -- 10 = Accessory Name
  390. if DataRead == 10 then
  391. Accessory[Line] = File:read("*l")
  392. if Accessory[Line] == nil then
  393. Accessory[Line] = "Ornament"
  394. end
  395. end
  396. -- 11 = Accessory Target
  397. if DataRead == 11 then
  398. Accessory_Target[Line] = tonumber(File:read("*l"))
  399. if Accessory_Target[Line] == nil then
  400. Accessory_Target[Line] = 99
  401. end
  402. end
  403. -- 12 = Accessory Effect
  404. if DataRead == 12 then
  405. Accessory_Effect[Line] = tonumber(File:read("*l"))
  406. if Accessory_Effect[Line] == nil then
  407. Accessory_Effect[Line] = 1
  408. end
  409. end
  410. -- 13 = Accessory Description
  411. if DataRead == 13 then
  412. Accessory_Description[Line] = File:read("*l")
  413. if Accessory_Description[Line] == nil then
  414. Accessory_Description[Line] = "Ordinary accessory."
  415. end
  416. end
  417. -- 14 = Accessory Price
  418. if DataRead == 14 then
  419. Accessory_Price[Line] = tonumber(File:read("*l"))
  420. if Accessory_Price[Line] == nil then
  421. Accessory_Price[Line] = 10
  422. end
  423. end
  424. -- 15 = Initial Item
  425. if DataRead == 15 then
  426. InvItem[Line] = tonumber(File:read("*l"))
  427. if InvItem[Line] == nil or InvItem[Line] == 0 then
  428. InvItem[Line] = nil
  429. end
  430. end
  431. -- 16 = Initial Weapon
  432. if DataRead == 16 then
  433. InvWeapon[Line] = tonumber(File:read("*l"))
  434. if InvWeapon[Line] == nil or InvWeapon[Line] == 0 then
  435. InvWeapon[Line] = nil
  436. end
  437. end
  438. -- 17 = Initial Armor
  439. if DataRead == 17 then
  440. InvArmor[Line] = tonumber(File:read("*l"))
  441. if InvArmor[Line] == nil or InvArmor[Line] == 0 then
  442. InvArmor[Line] = nil
  443. end
  444. end
  445. -- 18 = Initial Accessory
  446. if DataRead == 18 then
  447. InvAccessory[Line] = tonumber(File:read("*l"))
  448. if InvAccessory[Line] == nil or InvAccessory[Line] == 0 then
  449. InvAccessory[Line] = nil
  450. end
  451. end
  452. end
  453. File:close()
  454. else
  455. -- 15 - Default initial item list depends on other RPG scripts in use
  456. if DataRead == 15 then
  457. if FLAG_SHOP == nil and FLAG_CHEST == nil and FLAG_AI == nil then
  458. InvItem = {5, 2, 1, 1}
  459. elseif FLAG_SHOP == nil and FLAG_CHEST == nil and FLAG_AI == 1 then
  460. InvItem = {5, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
  461. end
  462. end
  463. -- 16 - Default initial weapon list depends on other RPG scripts in use
  464. if DataRead == 16 then
  465. if FLAG_SHOP == nil and FLAG_CHEST == nil then
  466. InvWeapon = {1, 1}
  467. end
  468. end
  469. -- 17 - Default initial armor list depends on other RPG scripts in use
  470. if DataRead == 17 then
  471. if FLAG_SHOP == nil and FLAG_CHEST == nil then
  472. InvArmor = {1, 1}
  473. end
  474. end
  475. -- 18 - Default initial accessory list depends on other RPG scripts in use
  476. if DataRead == 18 then
  477. if FLAG_SHOP == nil and FLAG_CHEST == nil then
  478. InvAccessory = {0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1}
  479. end
  480. end
  481. end
  482. end
  483.  
  484. -- If there is state dat, read it
  485. local SFile = io.open(Data_File[19], "r")
  486. if SFile == nil then
  487. -- If there is no file, use the default values
  488. State = {"Normal", "Critical", "Overdrive", "Feeble", "Weak", "Slow", "Blind", "Venom"}
  489. else
  490. -- If there is a File, read it and store it to State table
  491. local SLine = 1
  492. -- Store as many states as there are in the file
  493. while true do
  494. State[SLine] = SFile:read("*l")
  495. if State[SLine] == nil then break end
  496. SLine = SLine + 1
  497. end
  498. SFile:close()
  499. end
  500. end
  501.  
  502. function RPG_State()
  503. if g_RPG_State < 4 then
  504. -- If player is not on abnormal status, show status depending on HP
  505. if g_PlayerHealth <= g_RPG_MAXHP and g_PlayerHealth >= g_RPG_MAXHP / 4 then
  506. g_RPG_State = 1 -- Normal
  507. end
  508. if g_PlayerHealth < g_RPG_MAXHP / 4 then
  509. g_RPG_State = 2 -- Critical
  510. end
  511. if g_PlayerHealth > g_RPG_MAXHP then
  512. g_RPG_State = 3 -- Overdrive
  513. end
  514. -- Set penalties as 0
  515. g_RPG_FeeblePenalty = 0
  516. g_RPG_WeakPenalty = 0
  517. g_RPG_SlowPenalty = 0
  518. g_RPG_BlindPenalty = 0
  519. else
  520. if g_RPG_State == 4 then -- Feeble
  521. g_RPG_FeeblePenalty = g_RPG_SpellPower - DIV_PARAM
  522. g_RPG_WeakPenalty = 0
  523. g_RPG_SlowPenalty = 0
  524. g_RPG_BlindPenalty = 0
  525. end
  526. if g_RPG_State == 5 then -- Weak
  527. g_RPG_WeakPenalty = tonumber(g_RPG_Vitality - DIV_PARAM)
  528. g_RPG_FeeblePenalty = 0
  529. g_RPG_SlowPenalty = 0
  530. g_RPG_BlindPenalty = 0
  531. end
  532. if g_RPG_State == 6 then -- Slow
  533. g_RPG_SlowPenalty = g_RPG_Agility - DIV_PARAM
  534. g_RPG_FeeblePenalty = 0
  535. g_RPG_WeakPenalty = 0
  536. g_RPG_BlindPenalty = 0
  537. end
  538. if g_RPG_State == 7 then -- Blind
  539. g_RPG_BlindPenalty = g_RPG_Sight - DIV_PARAM
  540. g_RPG_FeeblePenalty = 0
  541. g_RPG_WeakPenalty = 0
  542. g_RPG_SlowPenalty = 0
  543. end
  544. if g_RPG_State == 8 then -- Venom
  545. g_RPG_FeeblePenalty = 0
  546. g_RPG_WeakPenalty = 0
  547. g_RPG_SlowPenalty = 0
  548. g_RPG_BlindPenalty = 0
  549. Venom()
  550. end
  551. end
  552. end
  553.  
  554. function Venom()
  555. if VTimed == nil or VTimed == 1 then
  556. -- Reset the clock
  557. HurtTime = g_Time + 2500
  558. VTimed = 2
  559. end
  560. if VTimed == 2 then
  561. -- Run the clock
  562. VCountTime = g_Time
  563. if VCountTime > HurtTime and g_PlayerHealth > 1 then
  564. SetPlayerHealth(g_PlayerHealth - 1)
  565. VTimed = 1
  566. end
  567. end
  568. -- If Player gets killed, remove Venom
  569. if g_PlayerHealth == 0 then
  570. g_RPG_State = 1
  571. end
  572. end
  573.  
  574. function RPG_Timer()
  575. -- Run the timer
  576. if TimeCounter < g_Time then
  577. TimeSecond = TimeSecond + 1
  578. TimeCounter = g_Time + 1000
  579. end
  580. if TimeSecond >= 60 then
  581. TimeMinute = TimeMinute + 1
  582. TimeSecond = 0
  583. end
  584. if TimeMinute >= 60 then
  585. TimeHour = TimeHour + 1
  586. TimeMinute = 0
  587. end
  588. end
  589.  
  590. function moshroom_rpg_menu_main(e)
  591. -- INITIATION --
  592.  
  593. -- Initiate RPG Module parts that can't be initiated in the init() function
  594. if g_RPG_MAXHP == nil then
  595. g_RPG_MAXHP = g_PlayerHealth
  596. end
  597.  
  598. if TimeInit == 0 then
  599. Load_RPG_Data()
  600. TimeInit = 1
  601. end
  602.  
  603. -- BACKGROUND PROCESS --
  604.  
  605. -- Process player state and timer
  606. RPG_State()
  607. RPG_Timer()
  608.  
  609. -- Count leveling variables
  610. g_RPG_Threshold = g_RPG_Level * LEVEL_PARAM_A + (g_RPG_Level - 1) * LEVEL_PARAM_B + (g_RPG_Level - 2) * LEVEL_PARAM_C
  611. g_RPG_ToNextLevel = g_RPG_Threshold - g_RPG_EXP
  612.  
  613. -- Set accessory target and effect
  614. g_Eq_Accessory_Target = Accessory_Target[g_Eq_Accessory]
  615. g_Eq_Accessory_Effect = Accessory_Effect[g_Eq_Accessory]
  616.  
  617. -- Process Battle Message Window
  618. if BMessageWindow == 1 then
  619. BMWindow()
  620. end
  621.  
  622. -- Test the distance to the Save point
  623. PlayerDist = GetPlayerDistance(e)
  624.  
  625. -- MENU ACCESS --
  626.  
  627. if ActiveMenu[e] == 0 then
  628.  
  629. -- Access menu by pressing Q button
  630. if g_InKey == "q" and g_Time > BtnTime and ShopActive == 0 or g_InKey == "Q" and g_Time > BtnTime and ShopActive == 0 or g_MouseClick == 4 and g_Time > BtnTime and ShopActive == 0 then
  631. BtnTime = g_Time + TIME_B
  632. OX = g_PlayerPosX
  633. OY = g_PlayerPosY
  634. OZ = g_PlayerPosZ
  635. UGTimer = g_Time + 10
  636. MenuActive = 1
  637. end
  638. if MenuActive == 1 and UGTimer < g_Time then
  639. if OX == g_PlayerPosX and OY == g_PlayerPosY and OZ == g_PlayerPosZ then
  640. PlayNon3DSound(e,1)
  641. FreezePlayer()
  642. FreezeAI()
  643. HideHuds()
  644. ActivateMouse()
  645. ActiveMenu[e] = 1
  646. else
  647. PromptDuration("To access RPG menu, stop and press Q or middle mouse button.",500)
  648. MenuActive = 0
  649. end
  650. end
  651. else
  652. -- Draw the menu base: Global panels
  653. -- Draw top panel
  654. Panel(0,0,100,10)
  655.  
  656. -- Draw the left panel
  657. TextCenterOnX(12.5,20,TextSize,"Inventory")
  658. TextCenterOnX(12.5,30,TextSize,"Equipment")
  659. TextCenterOnX(12.5,40,TextSize,"Status")
  660. TextCenterOnX(12.5,50,TextSize,"Options")
  661. Panel(0,10,25,80)
  662.  
  663. -- Draw time panel
  664. Panel(0,80,25,90)
  665. TextCenterOnX(12.5,85,TextSize,"Play Time: " .. TimeHour .. ":" .. TimeMinute .. ":" .. TimeSecond)
  666.  
  667. -- Draw the main panel
  668. Panel(25,10,100,90)
  669.  
  670. -- Draw bottom panel
  671. Panel(0,90,100,100)
  672. end
  673.  
  674. -- MENUS --
  675.  
  676. -- 1: Main menu
  677. if ActiveMenu[e] == 1 then
  678. -- Initiate the active command
  679. NumCommands[ActiveMenu[e]] = 4
  680. Command_One(e)
  681.  
  682. -- Top panel text
  683. TextCenterOnX(50,5,TextSize,"Main menu")
  684.  
  685. -- Draw main panel content
  686. if FrontPageText == 1 then
  687. Text(30,20,TextSize,"Navigate in the RPG menu by using A, S, W and D keys or mouse wheel.")
  688. Text(30,25,TextSize,"Press E or left mouse button to select, press Q or right mouse button to exit.")
  689. end
  690.  
  691. Panel(0,10,25,80)
  692.  
  693. -- Draw cursor
  694. Panel(1,15 + 10 * (ActiveCommand[ActiveMenu[e]] - 1),24,25 + 10 * (ActiveCommand[ActiveMenu[e]] - 1))
  695.  
  696. TextCenterOnX(12.5,20,TextSize,"Inventory")
  697. TextCenterOnX(12.5,30,TextSize,"Equipment")
  698. TextCenterOnX(12.5,40,TextSize,"Status")
  699. TextCenterOnX(12.5,50,TextSize,"Options")
  700.  
  701. -- Show text on the bottom panel
  702. if ActiveCommand[ActiveMenu[e]] == 1 then
  703. TextCenterOnX(50,95,TextSize,"Press E to access inventory.")
  704. end
  705. if ActiveCommand[ActiveMenu[e]] == 2 then
  706. TextCenterOnX(50,95,TextSize,"Press E to access equipment.")
  707. end
  708. if ActiveCommand[ActiveMenu[e]] == 3 then
  709. TextCenterOnX(50,95,TextSize,"Press E to access status.")
  710. end
  711. if ActiveCommand[ActiveMenu[e]] == 4 then
  712. TextCenterOnX(50,95,TextSize,"Press E to configure your settings.")
  713. end
  714. if ActiveCommand[ActiveMenu[e]] == 5 then
  715. TextCenterOnX(50,95,TextSize,"Press E to save your process.")
  716. end
  717. if ActiveCommand[ActiveMenu[e]] == 6 then
  718. TextCenterOnX(50,95,TextSize,"Press E to load a saved game.")
  719. end
  720.  
  721. -- Move to the next menu by pressing E button
  722. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  723. PlayNon3DSound(e,1)
  724. BtnTime = g_Time + TIME_B
  725. ActiveMenu[e] = ActiveCommand[ActiveMenu[e]] + 1
  726. end
  727.  
  728. -- Exit menu by pressing Q button
  729. if g_InKey == "q" and g_Time > BtnTime or g_InKey == "Q" and g_Time > BtnTime or g_MouseClick == 2 and g_Time > BtnTime then
  730. PlayNon3DSound(e,1)
  731. BtnTime = g_Time + TIME_B
  732. UnFreezePlayer()
  733. UnFreezeAI()
  734. ShowHuds()
  735. DeactivateMouse()
  736. if CursorPosition == 1 then
  737. ActiveCommand[ActiveMenu[e]] = 1
  738. end
  739. ActiveMenu[e] = 0
  740. MenuActive = 0
  741. end
  742. end
  743.  
  744. -- 2: Item menu
  745. if ActiveMenu[e] == 2 then
  746. -- Initiate the active command
  747. NumCommands[ActiveMenu[e]] = NUM_INV
  748. Command_Two(e)
  749.  
  750. -- Top panel text
  751. TextCenterOnX(50,5,TextSize,"Inventory")
  752.  
  753. -- Draw the main panel
  754. Panel(25,10,100,90)
  755.  
  756. -- Draw cursor
  757. if (ActiveCommand[ActiveMenu[e]] % 2 == 0) then
  758. cx = 67.5
  759. cy = 5 + 10 * (ActiveCommand[ActiveMenu[e]] / 2)
  760. else
  761. cx = 28
  762. cy = 5 + 10 * ((ActiveCommand[ActiveMenu[e]] + 1) / 2)
  763. end
  764. Panel(cx,cy,cx + 29.75,cy + 10)
  765.  
  766. -- Draw the item list
  767. InvRead = 0
  768. ItemSlot = 0
  769.  
  770. while InvRead < NUM_INV do
  771. InvRead = InvRead + 1
  772. if InvItem[InvRead] == nil then
  773. -- Dispose next item slot (to prevent bug that duplicates last item slot of the inventory if all of an item from a middle slot is used)
  774. Item_Slot[ItemSlot + 1] = nil
  775. else
  776. -- If item count equals number, activate item slot
  777. ItemSlot = ItemSlot + 1
  778. -- Draw text
  779. if ItemSlot % 2 == 0 then
  780. tx = 69.5
  781. ty = 10 + 10 * (ItemSlot / 2)
  782. else
  783. tx = 30
  784. ty = 10 + 10 * ((ItemSlot + 1) / 2)
  785. end
  786. Text(tx,ty,TextSize,Item[InvRead])
  787. Text(tx + 23,ty,TextSize,InvItem[InvRead])
  788. -- Save the item id to table Item_Slot
  789. Item_Slot[ItemSlot] = InvRead
  790. end
  791. end
  792.  
  793. -- Draw the bottom panel text
  794. if InvItem[Item_Slot[ActiveCommand[ActiveMenu[e]]]] ~= nil then
  795. if Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] < 20 then
  796. TextCenterOnX(50,95,TextSize,Item_Description[Item_Slot[ActiveCommand[ActiveMenu[e]]]] .. " (Current HP: " .. g_PlayerHealth .. " / " .. g_RPG_MAXHP .. ")")
  797. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 20 then
  798. TextCenterOnX(50,95,TextSize,Item_Description[Item_Slot[ActiveCommand[ActiveMenu[e]]]] .. " (Current Power: " .. g_RPG_SpellPower / DIV_PARAM .. ")")
  799. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 30 then
  800. TextCenterOnX(50,95,TextSize,Item_Description[Item_Slot[ActiveCommand[ActiveMenu[e]]]] .. " (Current Vitality: " .. g_RPG_Vitality / DIV_PARAM .. ")")
  801. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 40 then
  802. TextCenterOnX(50,95,TextSize,Item_Description[Item_Slot[ActiveCommand[ActiveMenu[e]]]] .. " (Current Agility: " .. g_RPG_Agility / DIV_PARAM .. ")")
  803. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 50 then
  804. TextCenterOnX(50,95,TextSize,Item_Description[Item_Slot[ActiveCommand[ActiveMenu[e]]]] .. " (Current Sight: " .. g_RPG_Sight / DIV_PARAM .. ")")
  805. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] >= 80 and Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] < 90 then
  806. TextCenterOnX(50,95,TextSize,Item_Description[Item_Slot[ActiveCommand[ActiveMenu[e]]]] .. " (Current State: " .. State[g_RPG_State] .. ")")
  807. else
  808. TextCenterOnX(50,95,TextSize,Item_Description[Item_Slot[ActiveCommand[ActiveMenu[e]]]])
  809. end
  810.  
  811. -- Use an item by pressing E
  812. if g_KeyPressE == 1 and g_Time > BtnTime and InvItem[Item_Slot[ActiveCommand[ActiveMenu[e]]]] > 0 or g_MouseClick == 1 and g_Time > BtnTime and InvItem[Item_Slot[ActiveCommand[ActiveMenu[e]]]] > 0 then
  813. PlayNon3DSound(e,1)
  814. -- Test whether item is usable
  815. if Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] ~= 99 then
  816. -- Remove the item from the inventory
  817. InvItem[Item_Slot[ActiveCommand[ActiveMenu[e]]]] = InvItem[Item_Slot[ActiveCommand[ActiveMenu[e]]]] - 1
  818. end
  819. -- The effect depends on Item_Target
  820. if Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 10 then
  821. -- Add HP
  822. SetPlayerHealth(g_PlayerHealth + Item_Effect[Item_Slot[ActiveCommand[ActiveMenu[e]]]])
  823. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 11 then
  824. -- Only restore HP up to MAXHP
  825. if g_PlayerHealth + Item_Effect[Item_Slot[ActiveCommand[ActiveMenu[e]]]] <= g_RPG_MAXHP then
  826. SetPlayerHealth(g_PlayerHealth + Item_Effect[Item_Slot[ActiveCommand[ActiveMenu[e]]]])
  827. else
  828. if g_PlayerHealth < g_RPG_MAXHP then
  829. SetPlayerHealth(g_RPG_MAXHP)
  830. end
  831. end
  832. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 12 then
  833. -- Set HP as MAXHP
  834. if g_PlayerHealth < g_RPG_MAXHP then
  835. SetPlayerHealth(g_RPG_MAXHP)
  836. end
  837. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 20 then
  838. -- Add SpellPower and SetPlayerPower to increase fireball size
  839. g_RPG_SpellPower = g_RPG_SpellPower + Item_Effect[Item_Slot[ActiveCommand[ActiveMenu[e]]]] * DIV_PARAM
  840. SetPlayerPower(e, g_RPG_SpellPower)
  841. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 30 then
  842. -- Add Vitality
  843. g_RPG_Vitality = g_RPG_Vitality + Item_Effect[Item_Slot[ActiveCommand[ActiveMenu[e]]]] * DIV_PARAM
  844. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 40 then
  845. -- Add Agility
  846. g_RPG_Agility = g_RPG_Agility + Item_Effect[Item_Slot[ActiveCommand[ActiveMenu[e]]]] * DIV_PARAM
  847. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 50 then
  848. -- Add Sight
  849. g_RPG_Sight = g_RPG_Sight + Item_Effect[Item_Slot[ActiveCommand[ActiveMenu[e]]]] * DIV_PARAM
  850. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 80 then
  851. -- Remove abnormal status
  852. g_RPG_State = 1
  853. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 84 then
  854. -- Remove Feeble
  855. if g_RPG_State == 4 then
  856. g_RPG_State = 1
  857. end
  858. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 85 then
  859. -- Remove Weak
  860. if g_RPG_State == 5 then
  861. g_RPG_State = 1
  862. end
  863. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 86 then
  864. -- Remove Slow
  865. if g_RPG_State == 6 then
  866. g_RPG_State = 1
  867. end
  868. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 87 then
  869. -- Remove Blind
  870. if g_RPG_State == 7 then
  871. g_RPG_State = 1
  872. end
  873. elseif Item_Target[Item_Slot[ActiveCommand[ActiveMenu[e]]]] == 88 then
  874. -- Remove Venom
  875. if g_RPG_State == 8 then
  876. g_RPG_State = 1
  877. end
  878. end
  879. -- Reset the clock
  880. BtnTime = g_Time + TIME_B
  881. end
  882. end
  883.  
  884. -- Exit menu by pressing Q button
  885. if g_InKey == "q" and g_Time > BtnTime or g_InKey == "Q" and g_Time > BtnTime or g_MouseClick == 2 and g_Time > BtnTime then
  886. PlayNon3DSound(e,1)
  887. BtnTime = g_Time + TIME_B
  888. -- Dispose the Item_Slot table
  889. for Disposer = 1,NUM_INV do
  890. Item_Slot[Disposer] = nil
  891. end
  892. for Disposer = 1,NUM_INV do
  893. if InvItem[Disposer] == 0 then
  894. InvItem[Disposer] = nil
  895. end
  896. end
  897. if CursorPosition == 1 then
  898. ActiveCommand[ActiveMenu[e]] = 1
  899. end
  900. ActiveMenu[e] = 1
  901. end
  902. end
  903.  
  904. -- 3: Equip menu
  905. if ActiveMenu[e] == 3 then
  906. -- Only show Equip menu in 3rd person view and if there is at least one RPG compatible AI on the map
  907. if FLAG_AI == 1 and g_PlayerThirdPerson == 1 then
  908. -- Initiate the active command
  909. NumCommands[ActiveMenu[e]] = 3
  910. Command_One(e)
  911.  
  912. -- Top panel text
  913. TextCenterOnX(50,5,TextSize,"Equipment")
  914.  
  915. -- Draw the main panel
  916. Panel(25,10,100,90)
  917.  
  918. -- Draw the cursor
  919. Panel(28,15 + 10 * (ActiveCommand[ActiveMenu[e]] - 1),59.75,25 + 10 * (ActiveCommand[ActiveMenu[e]] - 1))
  920.  
  921. -- Draw the base statistics
  922. Text(67.5,20,TextSize,"HP:")
  923. Text(67.5,25,TextSize,"Power:")
  924. Text(67.5,30,TextSize,"Vitality:")
  925. Text(67.5,35,TextSize,"Agility:")
  926. Text(67.5,40,TextSize,"Sight:")
  927.  
  928. Text(30,20,TextSize,"Weapon:")
  929. Text(30,30,TextSize,"Armor:")
  930. Text(30,40,TextSize,"Accessory:")
  931.  
  932. Text(82.5,20,TextSize,g_PlayerHealth .. " / " .. g_RPG_MAXHP)
  933. -- Count player statistics by level and equipment
  934. Text(82.5,25,TextSize,g_RPG_SpellPower / DIV_PARAM + g_Eq_Weapon * EQ_PARAM)
  935. Text(82.5,30,TextSize,g_RPG_Vitality / DIV_PARAM + g_Eq_Armor * EQ_PARAM)
  936. if g_Eq_Accessory_Target == 41 then
  937. -- Special case: Hermes shoes
  938. Text(82.5,35,TextSize,g_RPG_Agility / DIV_PARAM + g_Eq_Accessory_Effect)
  939. else
  940. Text(82.5,35,TextSize,g_RPG_Agility / DIV_PARAM)
  941. end
  942. if g_Eq_Accessory_Target == 51 then
  943. -- Special case: Spyglass
  944. Text(82.5,40,TextSize,g_RPG_Sight / DIV_PARAM + g_Eq_Accessory_Effect)
  945. else
  946. Text(82.5,40,TextSize,g_RPG_Sight / DIV_PARAM)
  947. end
  948.  
  949. -- Show player equipment
  950. if g_Eq_Weapon == 0 then
  951. Text(45,20,TextSize,"None")
  952. else
  953. Text(45,20,TextSize,Weapon[g_Eq_Weapon])
  954. end
  955. if g_Eq_Armor == 0 then
  956. Text(45,30,TextSize,"None")
  957. else
  958. Text(45,30,TextSize,Armor[g_Eq_Armor])
  959. end
  960. if g_Eq_Accessory == 0 then
  961. Text(45,40,TextSize,"None")
  962. else
  963. Text(45,40,TextSize,Accessory[g_Eq_Accessory])
  964. end
  965.  
  966. -- Move to the next menu by pressing E button
  967. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  968. PlayNon3DSound(e,1)
  969. BtnTime = g_Time + TIME_B
  970. ActiveMenu[e] = 30 + ActiveCommand[ActiveMenu[e]]
  971. end
  972. end
  973.  
  974. -- If there are no RPG compatible AI in the map, changing euipment is pointless
  975. if FLAG_AI == nil and g_PlayerThirdPerson == 1 then
  976. -- Top panel text
  977. TextCenterOnX(50,5,TextSize,"Equipment")
  978.  
  979. -- Draw the main panel
  980. Panel(25,10,100,90)
  981.  
  982. -- Draw
  983. Text(30,20,TextSize,"You don't have any equipment.")
  984. end
  985.  
  986. -- In 1st player mode, equipment is changed outside RPG menu and equipment submenu only shows the amount of weapons
  987. if g_PlayerThirdPerson == 0 then
  988. -- Top panel text
  989. TextCenterOnX(50,5,TextSize,"Equipment")
  990.  
  991. -- Draw the main panel
  992. Panel(25,10,100,90)
  993.  
  994. if g_PlayerGunCount == 0 then
  995. Text(30,20,TextSize,"You don't have any equipment.")
  996. end
  997. if g_PlayerGunCount == 1 then
  998. Text(30,20,TextSize,"You are holding ".. g_PlayerGunCount .. " weapon.")
  999. end
  1000. if g_PlayerGunCount > 1 then
  1001. Text(30,20,TextSize,"You are holding ".. g_PlayerGunCount .. " weapons.")
  1002. Text(30,25,TextSize,"Use 0-9 keys to change equipped weapon in the field.")
  1003. end
  1004. end
  1005.  
  1006. -- Exit menu by pressing Q button
  1007. if g_InKey == "q" and g_Time > BtnTime or g_InKey == "Q" and g_Time > BtnTime or g_MouseClick == 2 and g_Time > BtnTime then
  1008. PlayNon3DSound(e,1)
  1009. BtnTime = g_Time + TIME_B
  1010. if CursorPosition == 1 then
  1011. ActiveCommand[ActiveMenu[e]] = 1
  1012. end
  1013. ActiveMenu[e] = 1
  1014. end
  1015. end
  1016.  
  1017. -- 31: Weapon submenu
  1018. if ActiveMenu[e] == 31 then
  1019. -- Initiate the active command
  1020. NumCommands[ActiveMenu[e]] = NUM_INV
  1021. Command_Two(e)
  1022.  
  1023. -- Top panel text
  1024. TextCenterOnX(50,5,TextSize,"Choose your weapon")
  1025.  
  1026. -- Draw the main panel
  1027. Panel(25,10,100,90)
  1028.  
  1029. -- Draw cursor
  1030. if (ActiveCommand[ActiveMenu[e]] % 2 == 0) then
  1031. cx = 67.5
  1032. cy = 5 + 10 * (ActiveCommand[ActiveMenu[e]] / 2)
  1033. else
  1034. cx = 28
  1035. cy = 5 + 10 * ((ActiveCommand[ActiveMenu[e]] + 1) / 2)
  1036. end
  1037. Panel(cx,cy,cx + 29.75,cy + 10)
  1038.  
  1039. -- Draw the weapon list
  1040. InvRead = 0
  1041. WeaponSlot = 0
  1042.  
  1043. while InvRead < NUM_INV do
  1044. InvRead = InvRead + 1
  1045. if InvWeapon[InvRead] == nil or InvWeapon[InvRead] < 1 then
  1046. -- Dispose next weapon slot
  1047. Weapon_Slot[WeaponSlot + 1] = nil
  1048. else
  1049. -- If weapon count equals number, activate weapon slot
  1050. WeaponSlot = WeaponSlot + 1
  1051. -- Draw text
  1052. if WeaponSlot % 2 == 0 then
  1053. tx = 69.5
  1054. ty = 10 + 10 * (WeaponSlot / 2)
  1055. else
  1056. tx = 30
  1057. ty = 10 + 10 * ((WeaponSlot + 1) / 2)
  1058. end
  1059. Text(tx,ty,TextSize,Weapon[InvRead])
  1060. Text(tx + 23,ty,TextSize,InvWeapon[InvRead])
  1061. -- Save the item id to table Item_Slot
  1062. Weapon_Slot[WeaponSlot] = InvRead
  1063. end
  1064. end
  1065.  
  1066. if InvWeapon[Weapon_Slot[ActiveCommand[ActiveMenu[e]]]] ~= nil then
  1067. -- Draw the bottom panel text
  1068. TextCenterOnX(50,95,TextSize,"Raises Power by " .. Weapon_Slot[ActiveCommand[ActiveMenu[e]]] * EQ_PARAM .. ".")
  1069. -- Equip by pressing E
  1070. if g_KeyPressE == 1 and g_Time > BtnTime then
  1071. PlayNon3DSound(e,1)
  1072. BtnTime = g_Time + TIME_B
  1073. -- Equip
  1074. g_Eq_Weapon = Weapon_Slot[ActiveCommand[ActiveMenu[e]]]
  1075. -- Dispose the Weapon_Slot table
  1076. for Disposer = 1,NUM_INV do
  1077. Weapon_Slot[Disposer] = nil
  1078. end
  1079. if CursorPosition == 1 then
  1080. ActiveCommand[ActiveMenu[e]] = 1
  1081. end
  1082. ActiveMenu[e] = 3
  1083. end
  1084. else
  1085. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  1086. PlayNon3DSound(e,1)
  1087. BtnTime = g_Time + TIME_B
  1088. -- Remove the equipment by pressing E
  1089. g_Eq_Weapon = 0
  1090. -- Dispose the Weapon_Slot table
  1091. for Disposer = 1,NUM_INV do
  1092. Weapon_Slot[Disposer] = nil
  1093. end
  1094. if CursorPosition == 1 then
  1095. ActiveCommand[ActiveMenu[e]] = 1
  1096. end
  1097. ActiveMenu[e] = 3
  1098. end
  1099. end
  1100.  
  1101. -- Exit menu by pressing Q button
  1102. if g_InKey == "q" and g_Time > BtnTime or g_InKey == "Q" and g_Time > BtnTime or g_MouseClick == 2 and g_Time > BtnTime then
  1103. PlayNon3DSound(e,1)
  1104. BtnTime = g_Time + TIME_B
  1105. -- Dispose the Item_Slot table
  1106. for Disposer = 1,NUM_INV do
  1107. Weapon_Slot[Disposer] = nil
  1108. end
  1109. if CursorPosition == 1 then
  1110. ActiveCommand[ActiveMenu[e]] = 1
  1111. end
  1112. ActiveMenu[e] = 3
  1113. end
  1114. end
  1115.  
  1116. -- 32: Armor submenu
  1117. if ActiveMenu[e] == 32 then
  1118. -- Initiate the active command
  1119. NumCommands[ActiveMenu[e]] = NUM_INV
  1120. Command_Two(e)
  1121.  
  1122. -- Top panel text
  1123. TextCenterOnX(50,5,TextSize,"Choose your armor")
  1124.  
  1125. -- Draw the main panel
  1126. Panel(25,10,100,90)
  1127.  
  1128. -- Draw cursor
  1129. if (ActiveCommand[ActiveMenu[e]] % 2 == 0) then
  1130. cx = 67.5
  1131. cy = 5 + 10 * (ActiveCommand[ActiveMenu[e]] / 2)
  1132. else
  1133. cx = 28
  1134. cy = 5 + 10 * ((ActiveCommand[ActiveMenu[e]] + 1) / 2)
  1135. end
  1136. Panel(cx,cy,cx + 29.75,cy + 10)
  1137.  
  1138. -- Draw the weapon list
  1139. InvRead = 0
  1140. ArmorSlot = 0
  1141.  
  1142. while InvRead < NUM_INV do
  1143. InvRead = InvRead + 1
  1144. if InvArmor[InvRead] == nil or InvArmor[InvRead] < 1 then
  1145. -- Dispose next armor slot
  1146. Armor_Slot[ArmorSlot + 1] = nil
  1147. else
  1148. -- If armor count equals number, activate weapon slot
  1149. ArmorSlot = ArmorSlot + 1
  1150. -- Draw text
  1151. if ArmorSlot % 2 == 0 then
  1152. tx = 69.5
  1153. ty = 10 + 10 * (ArmorSlot / 2)
  1154. else
  1155. tx = 30
  1156. ty = 10 + 10 * ((ArmorSlot + 1) / 2)
  1157. end
  1158. Text(tx,ty,TextSize,Armor[InvRead])
  1159. Text(tx + 23,ty,TextSize,InvArmor[InvRead])
  1160. -- Save the item id to table Item_Slot
  1161. Armor_Slot[ArmorSlot] = InvRead
  1162. end
  1163. end
  1164.  
  1165. if InvArmor[Armor_Slot[ActiveCommand[ActiveMenu[e]]]] ~= nil then
  1166. -- Draw the bottom panel text
  1167. TextCenterOnX(50,95,TextSize,"Raises Vitality by " .. Armor_Slot[ActiveCommand[ActiveMenu[e]]] * EQ_PARAM .. ".")
  1168. -- Equip by pressing E
  1169. if g_KeyPressE == 1 and g_Time > BtnTime then
  1170. PlayNon3DSound(e,1)
  1171. BtnTime = g_Time + TIME_B
  1172. -- Equip
  1173. g_Eq_Armor = Armor_Slot[ActiveCommand[ActiveMenu[e]]]
  1174. -- Dispose the Armor_Slot table
  1175. for Disposer = 1,NUM_INV do
  1176. Armor_Slot[Disposer] = nil
  1177. end
  1178. if CursorPosition == 1 then
  1179. ActiveCommand[ActiveMenu[e]] = 1
  1180. end
  1181. ActiveMenu[e] = 3
  1182. end
  1183. else
  1184. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  1185. PlayNon3DSound(e,1)
  1186. BtnTime = g_Time + TIME_B
  1187. -- Remove the equipment by pressing E
  1188. g_Eq_Armor = 0
  1189. -- Dispose the Armor_Slot table
  1190. for Disposer = 1,NUM_INV do
  1191. Armor_Slot[Disposer] = nil
  1192. end
  1193. if CursorPosition == 1 then
  1194. ActiveCommand[ActiveMenu[e]] = 1
  1195. end
  1196. ActiveMenu[e] = 3
  1197. end
  1198. end
  1199.  
  1200. -- Exit menu by pressing Q button
  1201. if g_InKey == "q" and g_Time > BtnTime or g_InKey == "Q" and g_Time > BtnTime or g_MouseClick == 2 and g_Time > BtnTime then
  1202. PlayNon3DSound(e,1)
  1203. BtnTime = g_Time + TIME_B
  1204. -- Dispose the Item_Slot table
  1205. for Disposer = 1,NUM_INV do
  1206. Armor_Slot[Disposer] = nil
  1207. end
  1208. if CursorPosition == 1 then
  1209. ActiveCommand[ActiveMenu[e]] = 1
  1210. end
  1211. ActiveMenu[e] = 3
  1212. end
  1213. end
  1214.  
  1215. -- 33: Accessory submenu
  1216. if ActiveMenu[e] == 33 then
  1217. -- Initiate the active command
  1218. NumCommands[ActiveMenu[e]] = NUM_INV
  1219. Command_Two(e)
  1220.  
  1221. -- Top panel text
  1222. TextCenterOnX(50,5,TextSize,"Choose your accessory")
  1223.  
  1224. -- Draw the main panel
  1225. Panel(25,10,100,90)
  1226.  
  1227. -- Draw cursor
  1228. if (ActiveCommand[ActiveMenu[e]] % 2 == 0) then
  1229. cx = 67.5
  1230. cy = 5 + 10 * (ActiveCommand[ActiveMenu[e]] / 2)
  1231. else
  1232. cx = 28
  1233. cy = 5 + 10 * ((ActiveCommand[ActiveMenu[e]] + 1) / 2)
  1234. end
  1235. Panel(cx,cy,cx + 29.75,cy + 10)
  1236.  
  1237. -- Draw the Accessory list
  1238. InvRead = 0
  1239. AccessorySlot = 0
  1240.  
  1241. while InvRead < NUM_INV do
  1242. InvRead = InvRead + 1
  1243. if InvAccessory[InvRead] == nil or InvAccessory[InvRead] < 1 then
  1244. -- Dispose next armor slot
  1245. Accessory_Slot[AccessorySlot + 1] = nil
  1246. else
  1247. -- If Accessory count equals number, activate Accessory slot
  1248. AccessorySlot = AccessorySlot + 1
  1249. -- Draw text
  1250. if AccessorySlot % 2 == 0 then
  1251. tx = 69.5
  1252. ty = 10 + 10 * (AccessorySlot / 2)
  1253. else
  1254. tx = 30
  1255. ty = 10 + 10 * ((AccessorySlot + 1) / 2)
  1256. end
  1257. Text(tx,ty,TextSize,Accessory[InvRead])
  1258. Text(tx + 23,ty,TextSize,InvAccessory[InvRead])
  1259. -- Save the item id to table Accessory_Slot
  1260. Accessory_Slot[AccessorySlot] = InvRead
  1261. end
  1262. end
  1263.  
  1264. if InvAccessory[Accessory_Slot[ActiveCommand[ActiveMenu[e]]]] ~= nil then
  1265. -- Draw the bottom panel text
  1266. TextCenterOnX(50,95,TextSize,Accessory_Description[Accessory_Slot[ActiveCommand[ActiveMenu[e]]]])
  1267.  
  1268. -- Equip by pressing E
  1269. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  1270. PlayNon3DSound(e,1)
  1271. BtnTime = g_Time + TIME_B
  1272. -- Equip
  1273. g_Eq_Accessory = Accessory_Slot[ActiveCommand[ActiveMenu[e]]]
  1274. -- Dispose the Accessory_Slot table
  1275. for Disposer = 1,NUM_INV do
  1276. Accessory_Slot[Disposer] = nil
  1277. end
  1278. if CursorPosition == 1 then
  1279. ActiveCommand[ActiveMenu[e]] = 1
  1280. end
  1281. ActiveMenu[e] = 3
  1282. end
  1283. else
  1284. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  1285. PlayNon3DSound(e,1)
  1286. BtnTime = g_Time + TIME_B
  1287. -- Remove the Accessory by pressing E
  1288. g_Eq_Accessory = 0
  1289. -- Dispose the Accessory_Slot table
  1290. for Disposer = 1,NUM_INV do
  1291. Accessory_Slot[Disposer] = nil
  1292. end
  1293. if CursorPosition == 1 then
  1294. ActiveCommand[ActiveMenu[e]] = 1
  1295. end
  1296. ActiveMenu[e] = 3
  1297. end
  1298. end
  1299.  
  1300. -- Exit menu by pressing Q button
  1301. if g_InKey == "q" and g_Time > BtnTime or g_InKey == "Q" and g_Time > BtnTime or g_MouseClick == 2 and g_Time > BtnTime then
  1302. PlayNon3DSound(e,1)
  1303. BtnTime = g_Time + TIME_B
  1304. -- Dispose the Accessory_Slot table
  1305. for Disposer = 1,NUM_INV do
  1306. Accessory_Slot[Disposer] = nil
  1307. end
  1308. if CursorPosition == 1 then
  1309. ActiveCommand[ActiveMenu[e]] = 1
  1310. end
  1311. ActiveMenu[e] = 3
  1312. end
  1313. end
  1314.  
  1315. -- 4: Status menu
  1316. if ActiveMenu[e] == 4 then
  1317. -- Initiate the active command
  1318. NumCommands[ActiveMenu[e]] = 1
  1319. Command_One(e)
  1320.  
  1321. -- Top panel text
  1322. TextCenterOnX(50,5,TextSize,"Status")
  1323.  
  1324. -- Draw the main panel
  1325. Panel(25,10,100,90)
  1326.  
  1327. Text(30,20,TextSize,"HP:")
  1328. Text(67.5,20,TextSize,"State:")
  1329.  
  1330. Text(45,20,TextSize,g_PlayerHealth .. " / " .. g_RPG_MAXHP)
  1331. Text(82.5,20,TextSize,State[g_RPG_State])
  1332.  
  1333. if FLAG_AI == 1 then
  1334. Text(30,30,TextSize,"Gold:")
  1335. Text(30,35,TextSize,"Level:")
  1336.  
  1337. Text(67.5,30,TextSize,"EXP:")
  1338. Text(67.5,35,TextSize,"Next:")
  1339.  
  1340. Text(30,45,TextSize,"Power:")
  1341. Text(30,50,TextSize,"Vitality:")
  1342. Text(30,55,TextSize,"Agility:")
  1343. Text(30,60,TextSize,"Sight:")
  1344.  
  1345. Text(67.5,45,TextSize,"Lives:")
  1346.  
  1347. Text(45,30,TextSize,g_RPG_Gold)
  1348. Text(45,35,TextSize,g_RPG_Level)
  1349.  
  1350. -- Count player statistics by level and equipment
  1351. Text(45,45,TextSize,g_RPG_SpellPower / DIV_PARAM + g_Eq_Weapon * EQ_PARAM)
  1352. Text(45,50,TextSize,g_RPG_Vitality / DIV_PARAM + g_Eq_Armor * EQ_PARAM)
  1353.  
  1354. Text(82.5,30,TextSize,g_RPG_EXP)
  1355. Text(82.5,35,TextSize,g_RPG_ToNextLevel)
  1356. Text(82.5,45,TextSize,g_PlayerLives)
  1357.  
  1358. -- Show RPG equipment if 3rd player mode is active
  1359. if g_PlayerThirdPerson == 1 then
  1360. Text(30,70,TextSize,"Weapon:")
  1361. Text(30,75,TextSize,"Armor:")
  1362. Text(30,80,TextSize,"Accessory:")
  1363.  
  1364. if g_Eq_Accessory_Target == 41 then
  1365. -- Special case: Hermes shoes
  1366. Text(45,55,TextSize,g_RPG_Agility / DIV_PARAM + g_Eq_Accessory_Effect)
  1367. else
  1368. Text(45,55,TextSize,g_RPG_Agility / DIV_PARAM)
  1369. end
  1370.  
  1371. if g_Eq_Accessory_Target == 51 then
  1372. -- Special case: Spyglass
  1373. Text(45,60,TextSize,g_RPG_Sight / DIV_PARAM + g_Eq_Accessory_Effect)
  1374. else
  1375. Text(45,60,TextSize,g_RPG_Sight / DIV_PARAM)
  1376. end
  1377.  
  1378. -- Show player equipment
  1379. if g_Eq_Weapon == 0 then
  1380. Text(45,70,TextSize,"None")
  1381. else
  1382. Text(45,70,TextSize,Weapon[g_Eq_Weapon])
  1383. end
  1384. if g_Eq_Armor == 0 then
  1385. Text(45,75,TextSize,"None")
  1386. else
  1387. Text(45,75,TextSize,Armor[g_Eq_Armor])
  1388. end
  1389. if g_Eq_Accessory == 0 then
  1390. Text(45,80,TextSize,"None")
  1391. else
  1392. Text(45,80,TextSize,Accessory[g_Eq_Accessory])
  1393. end
  1394. else
  1395. -- Show Sight and Agility without accessory bonuses
  1396. Text(45,55,TextSize,g_RPG_Agility / DIV_PARAM)
  1397. Text(45,60,TextSize,g_RPG_Sight / DIV_PARAM)
  1398.  
  1399. -- Show number of collected weapons if 1st person mode is active
  1400. Text(30,70,TextSize,"Weapons:")
  1401. Text(45,70,TextSize,g_PlayerGunCount)
  1402. end
  1403. else
  1404. -- If there are no RPG compatible AI in the map, showing RPG statistics is pointless
  1405. Text(30,30,TextSize,"Lives:")
  1406. Text(45,30,TextSize,g_PlayerLives)
  1407. -- If there is a shop in the map, show gold
  1408. if FLAG_SHOP == 1 then
  1409. Text(67.5,30,TextSize,"Gold:")
  1410. Text(82.5,30,TextSize,g_RPG_Gold)
  1411. end
  1412. if g_PlayerThirdPerson == 1 then
  1413. if FLAG_SHOP == 1 or FLAG_MAGIC == 1 then
  1414. Text(30,40,TextSize,"Power:")
  1415. Text(45,40,TextSize,g_RPG_SpellPower / DIV_PARAM)
  1416. end
  1417. else
  1418. -- Show number of collected weapons if 1st person mode is active
  1419. Text(30,40,TextSize,"Weapons:")
  1420. Text(45,40,TextSize,g_PlayerGunCount)
  1421. end
  1422. end
  1423.  
  1424. -- Exit menu by pressing Q button
  1425. if g_InKey == "q" and g_Time > BtnTime or g_InKey == "Q" and g_Time > BtnTime or g_MouseClick == 2 and g_Time > BtnTime then
  1426. PlayNon3DSound(e,1)
  1427. BtnTime = g_Time + TIME_B
  1428. ActiveMenu[e] = 1
  1429. end
  1430. end
  1431.  
  1432. -- 5: Config menu
  1433. if ActiveMenu[e] == 5 then
  1434. -- Initiate the active command
  1435. if FLAG_DIALOG == 1 and FLAG_AI == 1 then
  1436. NumCommands[ActiveMenu[e]] = 5
  1437. elseif FLAG_DIALOG == 1 or FLAG_AI == 1 then
  1438. NumCommands[ActiveMenu[e]] = 4
  1439. else
  1440. NumCommands[ActiveMenu[e]] = 3
  1441. end
  1442. Command_One(e)
  1443.  
  1444. -- Top panel text
  1445. TextCenterOnX(50,5,TextSize,"Configure")
  1446.  
  1447. -- Draw the main panel
  1448. Panel(25,10,100,90)
  1449.  
  1450. -- Draw cursor
  1451. Panel(28,15 + 10 * (ActiveCommand[ActiveMenu[e]] - 1),97,25 + 10 * (ActiveCommand[ActiveMenu[e]] - 1))
  1452.  
  1453. -- Draw text
  1454. Text(30,20,TextSize,"Text size")
  1455. Text(30,30,TextSize,"Cursor position")
  1456. Text(30,40,TextSize,"Front page content")
  1457.  
  1458. if FLAG_DIALOG == 1 and FLAG_AI == 1 then
  1459. Text(30,50,TextSize,"Field Message")
  1460. if MessageWindow == 1 then
  1461. Text(77.5,50,TextSize,"Windowed")
  1462. end
  1463. if MessageWindow == 0 then
  1464. Text(77.5,50,TextSize,"Prompt")
  1465. end
  1466. Text(30,60,TextSize,"Battle Message")
  1467. if BMessageWindow == 1 then
  1468. Text(77.5,60,TextSize,"Windowed")
  1469. end
  1470. if BMessageWindow == 0 then
  1471. Text(77.5,60,TextSize,"Prompt")
  1472. end
  1473. elseif FLAG_DIALOG == 1 then
  1474. Text(30,50,TextSize,"Dialogue style")
  1475. if MessageWindow == 1 then
  1476. Text(77.5,50,TextSize,"Windowed")
  1477. end
  1478. if MessageWindow == 0 then
  1479. Text(77.5,50,TextSize,"Prompt")
  1480. end
  1481. elseif FLAG_AI == 1 then
  1482. Text(30,50,TextSize,"Battle Message")
  1483. if BMessageWindow == 1 then
  1484. Text(77.5,50,TextSize,"Windowed")
  1485. end
  1486. if BMessageWindow == 0 then
  1487. Text(77.5,50,TextSize,"Prompt")
  1488. end
  1489. end
  1490.  
  1491. if TextSize == 1 then
  1492. Text(77.5,20,TextSize,"Default")
  1493. end
  1494. if TextSize == 2 then
  1495. Text(77.5,20,TextSize,"Small")
  1496. end
  1497. if TextSize == 3 then
  1498. Text(77.5,20,TextSize,"Large")
  1499. end
  1500. if CursorPosition == 1 then
  1501. Text(77.5,30,TextSize,"Default")
  1502. end
  1503. if CursorPosition == 2 then
  1504. Text(77.5,30,TextSize,"Memory")
  1505. end
  1506. if FrontPageText == 1 then
  1507. Text(77.5,40,TextSize,"Default")
  1508. end
  1509. if FrontPageText == 2 then
  1510. Text(77.5,40,TextSize,"Nothing")
  1511. end
  1512.  
  1513. -- Process info text and E key
  1514. if ActiveCommand[ActiveMenu[e]] == 1 then
  1515. TextCenterOnX(50,95,TextSize,"Press E to change the text size.")
  1516. -- Edit options by pressing E button
  1517. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  1518. PlayNon3DSound(e,1)
  1519. BtnTime = g_Time + TIME_B
  1520. if TextSize == 1 then
  1521. TextSize = 3
  1522. else
  1523. TextSize = 1
  1524. end
  1525. end
  1526. end
  1527. if ActiveCommand[ActiveMenu[e]] == 2 then
  1528. TextCenterOnX(50,95,TextSize,"Press E to change the cursor position.")
  1529. -- Edit options by pressing E button
  1530. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  1531. PlayNon3DSound(e,1)
  1532. BtnTime = g_Time + TIME_B
  1533. if CursorPosition == 1 then
  1534. CursorPosition = 2
  1535. else
  1536. CursorPosition = 1
  1537. ActiveCommand[2] = 1
  1538. ActiveCommand[3] = 1
  1539. ActiveCommand[6] = 1
  1540. ActiveCommand[7] = 1
  1541. end
  1542. end
  1543. end
  1544. if ActiveCommand[ActiveMenu[e]] == 3 then
  1545. TextCenterOnX(50,95,TextSize,"Press E to change the front page content.")
  1546. -- Edit options by pressing E button
  1547. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  1548. PlayNon3DSound(e,1)
  1549. BtnTime = g_Time + TIME_B
  1550. if FrontPageText == 1 then
  1551. FrontPageText = 2
  1552. else
  1553. FrontPageText = 1
  1554. end
  1555. end
  1556. end
  1557. if ActiveCommand[ActiveMenu[e]] == 4 then
  1558. if FLAG_DIALOG == nil and FLAG_AI == 1 then
  1559. TextCenterOnX(50,95,TextSize,"Press E to change the battle message style.")
  1560. -- Edit options by pressing E button
  1561. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  1562. PlayNon3DSound(e,1)
  1563. BtnTime = g_Time + TIME_B
  1564. if BMessageWindow == 1 then
  1565. BMessageWindow = 0
  1566. else
  1567. BMessageWindow = 1
  1568. end
  1569. end
  1570. else
  1571. TextCenterOnX(50,95,TextSize,"Press E to change the dialogue style.")
  1572. -- Edit options by pressing E button
  1573. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  1574. PlayNon3DSound(e,1)
  1575. BtnTime = g_Time + TIME_B
  1576. if MessageWindow == 1 then
  1577. MessageWindow = 0
  1578. else
  1579. MessageWindow = 1
  1580. end
  1581. end
  1582. end
  1583. end
  1584. if ActiveCommand[ActiveMenu[e]] == 5 then
  1585. TextCenterOnX(50,95,TextSize,"Press E to change the battle message style.")
  1586. -- Edit options by pressing E button
  1587. if g_KeyPressE == 1 and g_Time > BtnTime or g_MouseClick == 1 and g_Time > BtnTime then
  1588. PlayNon3DSound(e,1)
  1589. BtnTime = g_Time + TIME_B
  1590. if BMessageWindow == 1 then
  1591. BMessageWindow = 0
  1592. else
  1593. BMessageWindow = 1
  1594. end
  1595. end
  1596. end
  1597.  
  1598. -- Exit menu by pressing Q button
  1599. if g_InKey == "q" and g_Time > BtnTime or g_InKey == "Q" and g_Time > BtnTime or g_MouseClick == 2 and g_Time > BtnTime then
  1600. PlayNon3DSound(e,1)
  1601. BtnTime = g_Time + TIME_B
  1602. if CursorPosition == 1 then
  1603. ActiveCommand[ActiveMenu[e]] = 1
  1604. end
  1605. ActiveMenu[e] = 1
  1606. end
  1607. end
  1608. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement