Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.20 KB | None | 0 0
  1. ;set %AtCove #False
  2. ;gosub DetermineVendor
  3. ;halt
  4.  
  5. set %sound C:\Users\Alarms\alarm.mp3
  6. set %PlaySound #False
  7.  
  8. ;************************ ITEM BUY SELECTION MENU **************************
  9. menu Clear
  10. menu Window Size 250 200
  11. menu Show
  12. menu Font Size 12
  13. menu Font Style b
  14. menu Text txtTitle 5 5 Bob Ross' Reagent Buyer
  15. menu Font Size 10
  16. menu Font Style
  17. menu Text txtInstructions 5 30 Select the items you want to buy:
  18. menu Check chkBlackPearl 5 50 100 25 #false Black Pearl
  19. menu Check chkBloodMoss 5 70 100 25 #false Blood Moss
  20. menu Check chkGarlic 5 90 100 25 #false Garlic
  21. menu Check chkGinseng 5 110 100 25 #false Ginseng
  22. menu Check chkMandrakeRoot 5 130 120 25 #false Mandrake Root
  23.  
  24. menu Check chkNightshade 135 50 100 25 #false Nightshade
  25. menu Check chkSpiderSilk 135 70 100 25 #false Spider's Silk
  26. menu Check chkSulphurousAsh 135 90 120 25 #false Sulphurous Ash
  27. menu Font Style i
  28. menu Check chkEmptyBottles 135 110 120 25 #false Empty Bottles
  29. menu Check chkLesserPoisons 135 130 120 25 #false Lesser Poisons
  30.  
  31. menu Font Style
  32. menu Font Size 12
  33. menu Button btnStart 80 160 75 30 Start
  34. set %CompareString
  35.  
  36. MENULOOP:
  37. if #MenuButton <> btnStart
  38. {
  39. wait 5
  40. goto MENULOOP
  41. }
  42. else
  43. {
  44. gosub MenuResults
  45. }
  46. wait 1s
  47.  
  48. ;*************** VARIABLE INITALIZATION ******************
  49. set %counter 0
  50. set %AtCove #false
  51. set %OpenDoor #false
  52. set %SecondMage #false
  53. set %PathFindWait 3
  54.  
  55. set %BuyCount 0
  56. set %PageNumber 1
  57. set %ReagentStorage
  58.  
  59. set %DropOff #false
  60. set %OverWeightDrop #false
  61.  
  62. set %HomeRune
  63. set %RegPouch
  64. set %RuneBook
  65.  
  66. set %NextGump
  67. set %RUNEBOOKGUMP WZQC
  68. set %INITBUYGUMP WZQC
  69. set %BILLGUMP GZE
  70.  
  71. set %GUMPTIMEOUT 5
  72. set %RECALLTIMEOUT 10
  73. ;***********************************************************
  74.  
  75. ;Find our home recall rune, reg pouch and runebook to vendors.
  76. set %temp C_
  77. str Ins %temp #BACKPACKID 3
  78. findItem QWL #strRes
  79. if #FindCnt > 1
  80. {
  81. Event Sysmessage Select Home Rune now!
  82. set #TARGCURS 1
  83. Repeat
  84. Until #TARGCURS = 0
  85. set %HomeRune #lTargetID
  86. }
  87. else
  88. set %HomeRune #findID
  89. findItem CKF #strRes
  90. set %RegPouch #findID
  91.  
  92. ;We must differentiate between the rune book and a spellbook
  93. set %fIndex 1
  94. FINDRUNEBOOKLOOP:
  95. findItem MPF %fIndex #strRes
  96. if #findCnt > 0
  97. {
  98. if #findCol = 542
  99. {
  100. set %RuneBook #findID
  101. }
  102. else
  103. {
  104. if %fIndex <= 2
  105. {
  106. set %fIndex %fIndex + 1
  107. goto FINDRUNEBOOKLOOP
  108. }
  109. else
  110. {
  111. event SysMessage No rune book found! Stopping script!
  112. halt
  113. }
  114. }
  115. }
  116. else
  117. {
  118. event SysMessage No rune book found! Stopping script!
  119. halt
  120. }
  121. event SysMessage Home rune found: %HomeRune
  122. event SysMessage Reg pouch found: %RegPouch
  123. event SysMessage Rune book found: %RuneBook
  124. event SysMessage :
  125. event SysMessage :
  126.  
  127. ;Get the id of the chest where we'll dump reagents.
  128. event SysMessage DOUBLE CLICK on the container for storing reagents. (You should use a metal chest.)
  129. gosub GetChest
  130.  
  131. MAINLOOP:
  132. gosub CheckWeight
  133. if %OverWeightDrop = #false
  134. {
  135. gosub Recall
  136. }
  137. else
  138. {
  139. set %OverWeightDrop #false
  140. }
  141. if %DropOff = #false
  142. {
  143. gosub DetermineVendor
  144. }
  145. else
  146. {
  147. set %DropOff #false
  148. }
  149. goto MAINLOOP
  150.  
  151. ;********************* sub GetChest - This subroutine retrieves and stores the ID for the
  152. ;********************* chest/container used for permanent storage of regs.
  153. sub GetChest
  154. set #LOBJECTID UAZZTDF
  155. set %StoredObjectID #LOBJECTID
  156.  
  157. return
  158.  
  159. ;********************* sub Recall - This subroutine turns to the correct page in the rune book
  160. ;********************* and recalls to that location.
  161. sub Recall
  162. ;If we are finished with a full book, we need to store the reagents.
  163. if %PageNumber = 9 && %BuyCount = 16
  164. {
  165. gosub StoreRegs
  166. set %PageNumber 1
  167. set %BuyCount 0
  168. }
  169. else
  170. {
  171. ;Open the runebook.
  172. set #LOBJECTID %RuneBook
  173. event Macro 17 0
  174. ;wait 4s
  175. set %NextGump %RUNEBOOKGUMP
  176. gosub WaitForGump
  177. ;Turn to the right page.
  178. set %x 0
  179. TURNLOOP:
  180. if %x < %PageNumber
  181. {
  182. click 335 20 ;Turn the page.
  183. wait 5
  184. set %x %x + 1
  185. goto TURNLOOP
  186. }
  187. else ;We are on the correct page.
  188. {
  189. if %BuyCount % 2 = 0
  190. {
  191. click 87 173 ;Left Page
  192. }
  193. else
  194. {
  195. click 253 173 ;Right Page
  196. }
  197. }
  198. }
  199. gosub RecallWait
  200. return
  201.  
  202. ;********************* sub BuyRegs - This subroutine pathfinds to a vendor and buys chosen items.
  203. sub BuyRegs
  204. if #findCnt > 0 && %AtCove = #false
  205. {
  206. If #FindDist > 3 2
  207. set %pathfind #True
  208. event PathFind #findX #findY #findZ
  209. if %OpenDoor = #true ;This only happens at the Occlo mages.
  210. {
  211. set %VendorX #findX
  212. set %VendorY #findY
  213. set %VendorZ #findZ
  214. set %VendorID #findID
  215. findItem QULRJMD G_10
  216. event PathFind #findX #findY #findZ
  217. wait 3s
  218. set #lObjectID #FindID
  219. Event Macro 17
  220. ;click 334 222 d
  221. wait 2s
  222. event PathFind %VendorX %VendorY %VendorZ
  223. wait 3s
  224. set #LOBJECTID %VendorID
  225. }
  226. else ;This is where most vendors are dealt with. The others are exceptional cases.
  227. {
  228. set %PathFindCounter 0
  229. PATHFINDWAITLOOP:
  230. wait 1s
  231. set %PathFindCounter %PathFindCounter + 1
  232. if %PathFindCounter < %PathFindWait && ( #CHARPOSX <> #findX || #CHARPOSY <> #findY ) && %pathfind = #True
  233. {
  234. goto PATHFINDWAITLOOP
  235. }
  236. set #LOBJECTID #findID
  237. set %pathfind #False
  238. }
  239. }
  240. else
  241. {
  242. if %SecondMage = #false
  243. {
  244. set #LOBJECTID #findID
  245. }
  246. else
  247. {
  248. event PathFind #findX #findY #findZ
  249. wait 3s
  250. set %SecondMage #false
  251. }
  252. }
  253. event Macro 17 0
  254. set %NextGump %INITBUYGUMP
  255. gosub WaitForGump
  256. click 75 140
  257. set %NextGump %BILLGUMP
  258. gosub WaitForGump
  259.  
  260. BUYLOOP:
  261. click 200 20
  262. getShopInfo
  263. if #SHOPITEMNAME in %CompareString
  264. {
  265. click 249 87 d
  266. click 249 87 d
  267. set %counter %counter + 1
  268. ;wait 5
  269. setShopItem #SHOPITEMID #SHOPITEMMAX
  270. }
  271. if #SHOPCURPOS = #SHOPCNT || %counter = %_counter
  272. {
  273. click 364 426
  274. set %counter 0
  275. return
  276. }
  277. else
  278. {
  279. click 391 204
  280. ;wait 5
  281. goto BUYLOOP
  282. }
  283. return
  284.  
  285. ;********************* sub CheckWeight - This subroutine monitors weight. If you are overweight,
  286. ;********************* it will go home to unload and continue buying.
  287. sub CheckWeight
  288. if #WEIGHT > 380
  289. {
  290. event SysMessage You are overweight!
  291. gosub StoreRegs
  292. wait 2s
  293. set %OverWeightDrop #true
  294. }
  295. if #GOLD < 30000
  296. {
  297. event SysMessage You are poor as fuck!
  298. gosub StoreRegs
  299. wait 2s
  300. set %OverWeightDrop #true
  301. }
  302. return
  303.  
  304. ;********************* sub WaitForGump - This subroutine pauses execution of the script
  305. ;********************* until a specified gump appears.
  306. sub WaitForGump
  307. set %GumpTimer 0
  308. GUMPWAITLOOP:
  309. if #CONTKIND <> %NextGump && %GumpTimer < %GUMPTIMEOUT
  310. {
  311. set %GumpTimer %GumpTimer + 1
  312. wait 1s
  313. goto GUMPWAITLOOP
  314. }
  315. return
  316.  
  317. ;********************* sub RecallWait - This subroutine pauses execution of the script
  318. ;********************* until a character has recalled to a different location.
  319. sub RecallWait
  320. set %RecallTimer 0
  321. set %PreRecallX #CHARPOSX
  322. set %PreRecallY #CHARPOSY
  323. RECALLWAITLOOP:
  324. if #CHARPOSX = %PreRecallX && #CHARPOSY = %PreRecallY && %RecallTimer < %RECALLTIMEOUT
  325. {
  326. set %RecallTimer %RecallTimer + 1
  327. wait 1s
  328. goto RECALLWAITLOOP
  329. }
  330. return
  331.  
  332. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  333. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  334. ;@@@@@@@@@@@@@@@@@@@@@@@ THESE SUBROUTINES ARE RELATIVELY STATIC @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  335. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  336. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  337.  
  338.  
  339.  
  340. ;******************** sub MenuResults - This subroutine handles the results of the inital menu.
  341. ;******************** It builds a string to compare item names with in the buy
  342. ;******************** menu. It stores this in %CompareString
  343. sub MenuResults
  344. set %_counter 0
  345. menu Get chkBlackPearl
  346. if #menures = #true
  347. {
  348. set %StringAddition black_pearl_
  349. str Len %CompareString
  350. set %strLen #strRes + 1
  351. str Ins %CompareString %StringAddition %strLen
  352. set %CompareString #strRes
  353. set %_counter %_counter + 1
  354. }
  355. menu Get chkBloodMoss
  356. if #menures = #true
  357. {
  358. set %StringAddition blood_moss_
  359. str Len %CompareString
  360. set %strLen #strRes + 1
  361. str Ins %CompareString %StringAddition %strLen
  362. set %CompareString #strRes
  363. set %_counter %_counter + 1
  364. }
  365. menu Get chkGarlic
  366. if #menures = #true
  367. {
  368. set %StringAddition garlic_
  369. str Len %CompareString
  370. set %strLen #strRes + 1
  371. str Ins %CompareString %StringAddition %strLen
  372. set %CompareString #strRes
  373. set %_counter %_counter + 1
  374. }
  375. menu Get chkGinseng
  376. if #menures = #true
  377. {
  378. set %StringAddition ginseng_
  379. str Len %CompareString
  380. set %strLen #strRes + 1
  381. str Ins %CompareString %StringAddition %strLen
  382. set %CompareString #strRes
  383. set %_counter %_counter + 1
  384. }
  385. menu Get chkMandrakeRoot
  386. if #menures = #true
  387. {
  388. set %StringAddition mandrake_root_
  389. str Len %CompareString
  390. set %strLen #strRes + 1
  391. str Ins %CompareString %StringAddition %strLen
  392. set %CompareString #strRes
  393. set %_counter %_counter + 1
  394. }
  395. menu Get chkNightshade
  396. if #menures = #true
  397. {
  398. set %StringAddition nightshade_
  399. str Len %CompareString
  400. set %strLen #strRes + 1
  401. str Ins %CompareString %StringAddition %strLen
  402. set %CompareString #strRes
  403. set %_counter %_counter + 1
  404. }
  405. menu Get chkSpiderSilk
  406. if #menures = #true
  407. {
  408. set %StringAddition spider's_silk_
  409. str Len %CompareString
  410. set %strLen #strRes + 1
  411. str Ins %CompareString %StringAddition %strLen
  412. set %CompareString #strRes
  413. set %_counter %_counter + 1
  414. }
  415. menu Get chkSulphurousAsh
  416. if #menures = #true
  417. {
  418. set %StringAddition sulphurous_ash_
  419. str Len %CompareString
  420. set %strLen #strRes + 1
  421. str Ins %CompareString %StringAddition %strLen
  422. set %CompareString #strRes
  423. set %_counter %_counter + 1
  424. }
  425. menu Get chkEmptyBottles
  426. if #menures = #true
  427. {
  428. set %StringAddition empty_bottle_
  429. str Len %CompareString
  430. set %strLen #strRes + 1
  431. str Ins %CompareString %StringAddition %strLen
  432. set %CompareString #strRes
  433. set %_counter %_counter + 1
  434. }
  435. menu Get chkLesserPoisons
  436. if #menures = #true
  437. {
  438. set %StringAddition lesser_poison_potion_
  439. str Len %CompareString
  440. set %strLen #strRes + 1
  441. str Ins %CompareString %StringAddition %strLen
  442. set %CompareString #strRes
  443. set %_counter %_counter + 1
  444. }
  445. menu Hide
  446. return
  447.  
  448. ;******************** sub StoreRegs - This subroutine recalls home and transfers all regs from
  449. ;******************** your pouch to permanent storage. The id of the permanent
  450. ;******************** storage container is saved in %ReagentStorage
  451. sub StoreRegs
  452. if %PlaySound && %PageNumber = 9 && %BuyCount = 16
  453. execute %sound
  454. event Macro 15 30
  455. target 6s
  456. set #LTARGETID %HomeRune
  457. event Macro 22 0
  458. wait 2s
  459. ;Open our pouch
  460. set #LOBJECTID %RegPouch
  461. event Macro 17 0
  462. wait 2s
  463. contPos 400 400
  464. set %temp C_
  465. str Ins %temp %RegPouch 3
  466. findItem RZF #strRes ;spider's silk
  467. if #findCnt > 0
  468. {
  469. set %StackSize #findStack - 50
  470. exevent Drag #findID %StackSize
  471. exevent Dropc %ReagentStorage
  472. }
  473. findItem KUF #strRes ;black pearl
  474. if #findCnt > 0
  475. {
  476. set %StackSize #findStack - 50
  477. exevent Drag #findID %StackSize
  478. exevent Dropc %ReagentStorage
  479. }
  480. findItem JZF #strRes ;ginseng
  481. if #findCnt > 0
  482. {
  483. set %StackSize #findStack - 50
  484. exevent Drag #findID %StackSize
  485. exevent Dropc %ReagentStorage
  486. }
  487. findItem JUF #strRes ;blood moss
  488. if #findCnt > 0
  489. {
  490. set %StackSize #findStack - 50
  491. exevent Drag #findID %StackSize
  492. exevent Dropc %ReagentStorage
  493. }
  494. findItem SZF #strRes ;sulphurous ash
  495. if #findCnt > 0
  496. {
  497. set %StackSize #findStack - 50
  498. exevent Drag #findID %StackSize
  499. exevent Dropc %ReagentStorage
  500. }
  501. findItem KZF #strRes ;garlic
  502. if #findCnt > 0
  503. {
  504. set %StackSize #findStack - 50
  505. exevent Drag #findID %StackSize
  506. exevent Dropc %ReagentStorage
  507. }
  508.  
  509. findItem MZF #strRes ;mandrake root
  510. if #findCnt > 0
  511. {
  512. set %StackSize #findStack - 50
  513. exevent Drag #findID %StackSize
  514. exevent Dropc %ReagentStorage
  515. }
  516. findItem WZF #strRes ;nightshade
  517. if #findCnt > 0
  518. {
  519. set %StackSize #findStack - 50
  520. exevent Drag #findID %StackSize
  521. exevent Dropc %ReagentStorage
  522. }
  523. ;Last we need to search for bottles or lesser poisons in the main backpack
  524. set %temp C_
  525. str Ins %temp #BACKPACKID 3
  526. findItem WUF #strRes ;empty bottles
  527. if #findCnt > 0
  528. {
  529. exevent Drag #findID #findStack
  530. exevent Dropc %ReagentStorage
  531. }
  532. findItem AVF #strRes ;lesser poisons
  533. if #findCnt > 0
  534. {
  535. exevent Drag #findID #findStack
  536. exevent Dropc %ReagentStorage
  537. }
  538. set %DropOff #true
  539. wait 5
  540. if #GOLD < 60000
  541. {
  542. finditem %ReagentStorage G_2
  543. wait 5
  544. if #findkind <> -1
  545. {
  546. set #lobjectid #findid
  547. event macro 17
  548. wait 15
  549. }
  550. finditem POF C_ , %ReagentStorage
  551. wait 5
  552. Exevent drag #findid 60000
  553. wait 5
  554. Exevent dropc #backpackid
  555. }
  556. return
  557.  
  558. ;******************** sub MoveRegs - This subroutine transfers all regs from your backpack to
  559. ;******************** your pouch after buying from all vendors at a location.
  560. sub MoveRegs
  561. set %temp C_
  562. str Ins %temp #BACKPACKID 3
  563. set %MyBackpack #strRes
  564. findItem RZF %MyBackpack ;spider's silk
  565. if #findCnt > 0
  566. {
  567. exevent Drag #findID #findStack
  568. exevent Dropc %RegPouch
  569. }
  570. findItem KUF %MyBackpack ;black pearl
  571. if #findCnt > 0
  572. {
  573. exevent Drag #findID #findStack
  574. exevent Dropc %RegPouch
  575. }
  576. findItem JZF %MyBackpack ;ginseng
  577. if #findCnt > 0
  578. {
  579. exevent Drag #findID #findStack
  580. exevent Dropc %RegPouch
  581. }
  582. findItem JUF %MyBackpack ;blood moss
  583. if #findCnt > 0
  584. {
  585. exevent Drag #findID #findStack
  586. exevent Dropc %RegPouch
  587. }
  588. findItem SZF %MyBackpack ;sulphurous ash
  589. if #findCnt > 0
  590. {
  591. exevent Drag #findID #findStack
  592. exevent Dropc %RegPouch
  593. }
  594. findItem KZF %MyBackpack ;garlic
  595. if #findCnt > 0
  596. {
  597. exevent Drag #findID #findStack
  598. exevent Dropc %RegPouch
  599. }
  600. findItem MZF %MyBackpack ;mandrake root
  601. if #findCnt > 0
  602. {
  603. exevent Drag #findID #findStack
  604. exevent Dropc %RegPouch
  605. }
  606.  
  607. findItem WZF %MyBackpack ;nightshade
  608. if #findCnt > 0
  609. {
  610. exevent Drag #findID #findStack
  611. exevent Dropc %RegPouch
  612. }
  613. return
  614.  
  615. ;******************** sub Buy_____ - This block contains subroutines for buying regs from vendors
  616. ;******************** at a specific location. Any location specific modifications
  617. ;******************** should be placed here. Any new vendor location must have a
  618. ;******************** correspnding subroutine here.
  619. sub BuyYewRegs
  620. ;Buy from Vendors
  621. set %PathFindWait 4
  622. findItem LED G_20 ;Marcin the mage
  623. if #FindKind <> -1
  624. gosub BuyRegs
  625. findItem MED G_20 ;Kuba the mage
  626. if #FindKind <> -1
  627. gosub BuyRegs
  628. findItem RED G_20 ;Konrad the mage
  629. if #FindKind <> -1
  630. gosub BuyRegs
  631. findItem OED G_20 ;Iria the alchemist
  632. if #FindKind <> -1
  633. gosub BuyRegs
  634. wait 2s
  635. ;Put regs in a pouch
  636. gosub MoveRegs
  637. return
  638.  
  639. sub BuyMerlinRegs
  640. set %PathFindWait 5
  641. ;Buy from vendors.
  642. findItem OXX G_20 ;Adrian, Merlin's Disciple
  643. if #FindKind <> -1
  644. gosub BuyRegs
  645. findItem OXMBB G_20 ;Merlin the High Wizard
  646. if #FindKind <> -1
  647. gosub BuyRegs
  648. set %PathFindWait 10
  649. event pathFind 3760 2105 20
  650. findItem ZZX G_30 ;A Merlin's Disciple
  651. if #FindKind <> -1
  652. gosub BuyRegs
  653. findItem FAY G_30 ;A Merlin's Disciple
  654. if #FindKind <> -1
  655. gosub BuyRegs
  656. wait 2s
  657. gosub MoveRegs
  658. return
  659.  
  660. sub BuyMaginciaWestRegs
  661. set %PathFindWait 4
  662. findItem ROHC G_20 ;Geo the Mage
  663. if #FindKind <> -1
  664. gosub BuyRegs
  665. findItem SOHC G_20 ;Benny the Mage
  666. if #FindKind <> -1
  667. gosub BuyRegs
  668. findItem LIGD G_20 ;Jeanett the Alchemist
  669. if #FindKind <> -1
  670. gosub BuyRegs
  671. wait 2s
  672. gosub MoveRegs
  673. return
  674.  
  675. sub BuyMaginciaEastRegs
  676. set %PathFindWait 5
  677. findItem AQI G_20 ;Raymond the Mage
  678. if #FindKind <> -1
  679. gosub BuyRegs
  680. findItem ZPI G_20 ;Vlad the Mage
  681. if #FindKind <> -1
  682. gosub BuyRegs
  683. findItem CQI G_20 ;Gord the Mage
  684. if #FindKind <> -1
  685. gosub BuyRegs
  686. wait 2s
  687. gosub MoveRegs
  688. return
  689.  
  690. sub BuyBritWestRegs
  691. set %PathFindWait 4
  692. findItem NYC G_20 ;Nicholas the mage
  693. if #FindKind <> -1
  694. gosub BuyRegs
  695. findItem OYC G_20 ;Kent the mage
  696. if #FindKind <> -1
  697. gosub BuyRegs
  698. wait 2s
  699. gosub MoveRegs
  700. return
  701.  
  702. sub BuyBritEastRegs
  703. set %PathFindWait 3
  704. findItem ZEDC ;Lumpour the Alchemist
  705. if #FindKind <> -1
  706. gosub BuyRegs
  707. findItem OEDC ;Lisa the mage
  708. if #FindKind <> -1
  709. gosub BuyRegs
  710. findItem SGPF ;Danica the mage
  711. if #FindKind <> -1
  712. gosub BuyRegs
  713. wait 2s
  714. gosub MoveRegs
  715. return
  716.  
  717. sub BuyBritSouthRegs
  718. set %PathFindWait 3
  719. findItem XXC ; Spock the al
  720. if #FindKind <> -1
  721. gosub BuyRegs
  722. findItem YXC ; Kirk the herbalist
  723. if #FindKind <> -1
  724. gosub BuyRegs
  725. wait 2s
  726. gosub MoveRegs
  727. return
  728.  
  729. sub BuyTrinsicSouthRegs
  730. set %PathFindWait 3
  731. findItem BHD ;Twardy the mage
  732. if #FindKind <> -1
  733. gosub BuyRegs
  734. findItem CHD ;Lizawka the alch
  735. if #FindKind <> -1
  736. gosub BuyRegs
  737. wait 2s
  738. gosub MoveRegs
  739. return
  740.  
  741. sub BuyTrinsicNorthRegs
  742. set %PathFindWait 3
  743. findItem SGD ; Chmielu the mage
  744. if #FindKind <> -1
  745. gosub BuyRegs
  746. findItem RGD ;Marty the mage
  747. if #FindKind <> -1
  748. gosub BuyRegs
  749. findItem QGD ;Blazej the alchemist
  750. if #FindKind <> -1
  751. gosub BuyRegs
  752. findItem PGD ; Dorota the mage
  753. if #FindKind <> -1
  754. gosub BuyRegs
  755. wait 2s
  756. gosub MoveRegs
  757. return
  758.  
  759. sub BuyCoveRegs
  760. set %PathFindWait 4
  761. set %AtCove #true
  762. findItem NDD ;Anne the mage
  763. if #FindKind <> -1
  764. gosub BuyRegs
  765. set %SecondMage #true
  766. findItem ODD ;Ned the herbalist
  767. if #FindKind <> -1
  768. gosub BuyRegs
  769. wait 2s
  770. gosub MoveRegs
  771. set %AtCove #false
  772. set %SecondMage #false
  773. return
  774.  
  775. sub BuyJhelomSouthRegs
  776. set %PathFindWait 3
  777. findItem DBG G_20 ;Damien the Mage
  778. if #FindKind <> -1
  779. gosub BuyRegs
  780. wait 2s
  781. gosub MoveRegs
  782. return
  783.  
  784. sub BuyJhelomNorthRegs
  785. set %PathFindWait 3
  786. findItem YAG G_20 ;Abra the Mage
  787. if #FindKind <> -1
  788. gosub BuyRegs
  789. wait 2s
  790. gosub MoveRegs
  791. return
  792.  
  793. sub BuyJhelomDocksRegs
  794. set %PathFindWait 2
  795. findItem BAYWD G_20 ;Hogwart the Witch
  796. if #FindKind <> -1
  797. gosub BuyRegs
  798. findItem CAYWD G_20 ;Mildred the Witch
  799. if #FindKind <> -1
  800. gosub BuyRegs
  801. findItem WZXWD G_20 ;Drathmore the Mage
  802. if #FindKind <> -1
  803. gosub BuyRegs
  804. wait 2s
  805. gosub MoveRegs
  806. return
  807.  
  808. sub BuySouthJhelomIslandRegs
  809. set %PathFindWait 3
  810. findItem PAG G_20 ;Melissa the Mage
  811. if #FindKind <> -1
  812. gosub BuyRegs
  813. findItem SAG G_20 ;Eli the Mage
  814. if #FindKind <> -1
  815. gosub BuyRegs
  816. wait 2s
  817. gosub MoveRegs
  818. return
  819.  
  820. sub BuyMoonglowNorthRegs
  821. set %PathFindWait 5
  822. findItem PMD ;Claire the mage
  823. if #FindKind <> -1
  824. gosub BuyRegs
  825. findItem SMD ;Chris the mage
  826. if #FindKind <> -1
  827. gosub BuyRegs
  828. findItem RMD ;pencer the mage
  829. if #FindKind <> -1
  830. gosub BuyRegs
  831. wait 2s
  832. gosub MoveRegs
  833. return
  834.  
  835. sub BuyMoonglowSouthRegs
  836. set %PathFindWait 3
  837. findItem NMD ;Zolta the alchemist
  838. if #FindKind <> -1
  839. gosub BuyRegs
  840. wait 2s
  841. gosub MoveRegs
  842. return
  843.  
  844. sub BuyMoonglowSouthAlchemistRegs
  845. set %PathFindWait 3
  846. findItem AXF G_20 ;Todd the Alchemist
  847. if #FindKind <> -1
  848. gosub BuyRegs
  849. wait 2s
  850. gosub MoveRegs
  851. return
  852.  
  853. sub BuyOccloRegs
  854. set %PathFindWait 5
  855. findItem CYF G_20 ;Tommie the Mage
  856. if #FindKind <> -1
  857. gosub BuyRegs
  858. findItem BYF G_20 ;Jeff the Alchemist
  859. if #FindKind <> -1
  860. gosub BuyRegs
  861. findItem ZSFC G_20 ;Frida the Mage
  862. if #FindKind <> -1
  863. set %OpenDoor #true
  864. gosub BuyRegs
  865. wait 2s
  866. gosub MoveRegs
  867. set %OpenDoor #false
  868. return
  869.  
  870. sub BuySkaraBraeRegs
  871. set %PathFindWait 4
  872. findItem OND ;Bob the mage
  873. if #FindKind <> -1
  874. gosub BuyRegs
  875. wait 2s
  876. gosub MoveRegs
  877. return
  878.  
  879. sub BuySkaraBraeNorthRegs
  880. set %PathFindWait 3
  881. findItem GID ;Siwa the alchemist
  882. if #FindKind <> -1
  883. gosub BuyRegs
  884. wait 2s
  885. gosub MoveRegs
  886. return
  887.  
  888. sub BuyVesperSouthRegs
  889. set %PathFindWait 5
  890. findItem KBD ;Amen the mage
  891. if #FindKind <> -1
  892. gosub BuyRegs
  893. findItem JBD ;Lucy the mage
  894. if #FindKind <> -1
  895. gosub BuyRegs
  896. wait 2s
  897. gosub MoveRegs
  898. return
  899.  
  900. sub BuyVesperNorthRegs
  901. set %PathFindWait 4
  902. findItem QBD ;Ben the mage
  903. if #FindKind <> -1
  904. gosub BuyRegs
  905. findItem PBD ;Troy the alchemist
  906. if #FindKind <> -1
  907. gosub BuyRegs
  908. wait 2s
  909. gosub MoveRegs
  910. return
  911.  
  912. sub BuyVesperSoutheastRegs
  913. set %PathFindWait 3
  914. findItem VBD ;Bayu the lachemist
  915. if #FindKind <> -1
  916. gosub BuyRegs
  917. wait 2s
  918. gosub MoveRegs
  919. return
  920.  
  921. sub BuyMinocAlchemistRegs
  922. set %PathFindWait 2
  923. findItem WBJ G_20 ;Sonya the Alchemist
  924. if #FindKind <> -1
  925. gosub BuyRegs
  926. wait 2s
  927. gosub MoveRegs
  928. return
  929.  
  930. sub BuyMinocGypsyMageRegs
  931. set %PathFindWait 3
  932. findItem KYDC ;Battousai the alchemist
  933. if #FindKind <> -1
  934. gosub BuyRegs
  935. findItem JYDC ;Decius the mage
  936. if #FindKind <> -1
  937. gosub BuyRegs
  938. wait 2s
  939. gosub MoveRegs
  940. return
  941.  
  942. sub BuyNuJelmMageRegs
  943. set %PathFindWait 5
  944. findItem ZTG G_20 ;Fredrica the Mage
  945. if #FindKind <> -1
  946. gosub BuyRegs
  947. findItem AUG G_20 ;Otto the Mage
  948. if #FindKind <> -1
  949. gosub BuyRegs
  950. findItem CUG G_20 ;Avian the Mage
  951. if #FindKind <> -1
  952. gosub BuyRegs
  953. wait 2s
  954. gosub MoveRegs
  955. return
  956.  
  957. sub BuyNuJelmAlchemistRegs
  958. set %PathFindWait 5
  959. findItem OUIHB G_20 ;Alchemist 1
  960. if #FindKind <> -1
  961. gosub BuyRegs
  962. findItem IUIHB G_20 ;Alchemist 2
  963. if #FindKind <> -1
  964. gosub BuyRegs
  965. findItem LUIHB G_20 ;Alchemist 3
  966. if #FindKind <> -1
  967. gosub BuyRegs
  968. findItem NUIHB G_20 ;Alchemist 3
  969. if #FindKind <> -1
  970. gosub BuyRegs
  971. wait 2s
  972. gosub MoveRegs
  973. return
  974.  
  975. sub BuyMinocRegs
  976. set %PathFindWait 5
  977. findItem ABD ;Nelson the mage
  978. if #FindKind <> -1
  979. gosub BuyRegs
  980. findItem TAD ;Ophelia the alchemist
  981. if #FindKind <> -1
  982. gosub BuyRegs
  983. findItem ZAD ;Thomas the mage
  984. if #FindKind <> -1
  985. gosub BuyRegs
  986. findItem UAD ;Nancy the herbalist
  987. if #FindKind <> -1
  988. gosub BuyRegs
  989. wait 2s
  990. gosub MoveRegs
  991. return
  992.  
  993. ;******************** sub DetermineVendor - This subroutine uses the #CHARPOSX, #CHARPOSY to determine
  994. ;******************** which vendor location you are at. If any new vendors are
  995. ;******************** are added, their location boundaries must be added here.
  996. sub DetermineVendor
  997. if #CHARPOSX <= 3720 && #CHARPOSX >= 3678 && #CHARPOSY <= 2231 && #CHARPOSY >= 2190
  998. {
  999. event SysMessage You are in Magincia West!
  1000. gosub BuyMaginciaWestRegs
  1001. set %VendorFound #true
  1002. }
  1003. if #CHARPOSX <= 3784 && #CHARPOSX >= 3747 && #CHARPOSY <= 2129 && #CHARPOSY >= 2093
  1004. {
  1005. event SysMessage You are in Merlin's!
  1006. gosub BuyMerlinRegs
  1007. set %VendorFound #true
  1008. }
  1009. if #CHARPOSX <= 630 && #CHARPOSX >= 624 && #CHARPOSY <= 846 && #CHARPOSY >= 832
  1010. {
  1011. event SysMessage You are in Yew!
  1012. gosub BuyYewRegs
  1013. set %VendorFound #true
  1014. }
  1015. if #CHARPOSX <= 3808 && #CHARPOSX >= 3777 && #CHARPOSY <= 2272 && #CHARPOSY >= 2233
  1016. {
  1017. event SysMessage You are in Magincia East!
  1018. gosub BuyMaginciaEastRegs
  1019. set %VendorFound #true
  1020. }
  1021. if #CHARPOSX <= 1498 && #CHARPOSX >= 1484 && #CHARPOSY <= 1558 && #CHARPOSY >= 1544
  1022. {
  1023. event SysMessage You are in Brit West!
  1024. gosub BuyBritWestRegs
  1025. set %VendorFound #true
  1026. }
  1027. if #CHARPOSX <= 1598 && #CHARPOSX >= 1584 && #CHARPOSY <= 1662 && #CHARPOSY >= 1648
  1028. {
  1029. event SysMessage You are in Brit East!
  1030. gosub BuyBritEastRegs
  1031. set %VendorFound #true
  1032. }
  1033. if #CHARPOSX <= 1506 && #CHARPOSX >= 1496 && #CHARPOSY <= 1666 && #CHARPOSY >= 1656
  1034. {
  1035. event SysMessage You are in Brit South!
  1036. gosub BuyBritSouthRegs
  1037. set %VendorFound #true
  1038. }
  1039. if #CHARPOSX <= 1850 && #CHARPOSX >= 1837 && #CHARPOSY <= 2708 && #CHARPOSY >= 2701
  1040. {
  1041. event SysMessage You are in Trinsic South!
  1042. gosub BuyTrinsicSouthRegs
  1043. set %VendorFound #true
  1044. }
  1045. if #CHARPOSX <= 1861 && #CHARPOSX >= 1844 && #CHARPOSY <= 2686 && #CHARPOSY >= 2673
  1046. {
  1047. event SysMessage You are in Trinsic North!
  1048. gosub BuyTrinsicNorthRegs
  1049. set %VendorFound #true
  1050. }
  1051. if #CHARPOSX <= 2286 && #CHARPOSX >= 2280 && #CHARPOSY <= 1230 && #CHARPOSY >= 1224
  1052. {
  1053. event SysMessage You are in Cove!
  1054. gosub BuyCoveRegs
  1055. set %VendorFound #true
  1056. }
  1057. if #CHARPOSX <= 1462 && #CHARPOSX >= 1456 && #CHARPOSY <= 3830 && #CHARPOSY >= 3816
  1058. {
  1059. event SysMessage You are in Jhelom South!
  1060. gosub BuyJhelomSouthRegs
  1061. set %VendorFound #true
  1062. }
  1063. if #CHARPOSX <= 1462 && #CHARPOSX >= 1456 && #CHARPOSY <= 3806 && #CHARPOSY >= 3792
  1064. {
  1065. event SysMessage You are in Jhelom North!
  1066. gosub BuyJhelomNorthRegs
  1067. set %VendorFound #true
  1068. }
  1069. if #CHARPOSX <= 1382 && #CHARPOSX >= 1376 && #CHARPOSY <= 3854 && #CHARPOSY >= 3848
  1070. {
  1071. event SysMessage You are in Jhelom Docks!
  1072. gosub BuyJhelomDocksRegs
  1073. set %VendorFound #true
  1074. }
  1075. if #CHARPOSX <= 1430 && #CHARPOSX >= 1419 && #CHARPOSY <= 3990 && #CHARPOSY >= 3976
  1076. {
  1077. event SysMessage You are in South Jhelom Island!
  1078. gosub BuySouthJhelomIslandRegs
  1079. set %VendorFound #true
  1080. }
  1081. if #CHARPOSX <= 4463 && #CHARPOSX >= 4447 && #CHARPOSY <= 1094 && #CHARPOSY >= 1080
  1082. {
  1083. event SysMessage You are in Moonglow North!
  1084. gosub BuyMoonglowNorthRegs
  1085. set %VendorFound #true
  1086. }
  1087. if #CHARPOSX <= 4422 && #CHARPOSX >= 4408 && #CHARPOSY <= 1115 && #CHARPOSY >= 1108
  1088. {
  1089. event SysMessage You are in Moonglow North Alchemist!
  1090. gosub BuyMoonglowSouthRegs
  1091. set %VendorFound #true
  1092. }
  1093. if #CHARPOSX <= 4422 && #CHARPOSX >= 4408 && #CHARPOSY <= 1142 && #CHARPOSY >= 1129
  1094. {
  1095. event SysMessage You are in Moonglow South Alchemist!
  1096. gosub BuyMoonglowSouthAlchemistRegs
  1097. set %VendorFound #true
  1098. }
  1099. if #CHARPOSX <= 3630 && #CHARPOSX >= 3624 && #CHARPOSY <= 2550 && #CHARPOSY >= 2536
  1100. {
  1101. event SysMessage You are in Occlo!
  1102. gosub BuyOccloRegs
  1103. set %VendorFound #true
  1104. }
  1105. if #CHARPOSX <= 611 && #CHARPOSX >= 600 && #CHARPOSY <= 2182 && #CHARPOSY >= 2176
  1106. {
  1107. event SysMessage You are in Skara Brae South!
  1108. gosub BuySkaraBraeRegs
  1109. set %VendorFound #true
  1110. }
  1111. if #CHARPOSX <= 670 && #CHARPOSX >= 656 && #CHARPOSY <= 2142 && #CHARPOSY >= 2136
  1112. {
  1113. event SysMessage You are in Skara Brae North!
  1114. gosub BuySkaraBraeNorthRegs
  1115. set %VendorFound #true
  1116. }
  1117. if #CHARPOSX <= 2926 && #CHARPOSX >= 2912 && #CHARPOSY <= 678 && #CHARPOSY >= 664
  1118. {
  1119. event SysMessage You are in Vesper South!
  1120. gosub BuyVesperSouthRegs
  1121. set %VendorFound #true
  1122. }
  1123. if #CHARPOSX <= 2892 && #CHARPOSX >= 2883 && #CHARPOSY <= 654 && #CHARPOSY >= 648
  1124. {
  1125. event SysMessage You are in Vesper North!
  1126. gosub BuyVesperNorthRegs
  1127. set %VendorFound #true
  1128. }
  1129. ;if #CHARPOSX <= 2998 && #CHARPOSX >= 2992 && #CHARPOSY <= 846 && #CHARPOSY >= 832
  1130. if #CHARPOSX <= 2910 && #CHARPOSX >= 2904 && #CHARPOSY <= 718 && #CHARPOSY >= 704
  1131. {
  1132. event SysMessage You are in Vesper Southeast!
  1133. gosub BuyVesperSoutheastRegs
  1134. set %VendorFound #true
  1135. }
  1136. if #CHARPOSX <= 2552 && #CHARPOSX >= 2546 && #CHARPOSY <= 659 && #CHARPOSY >= 650
  1137. {
  1138. event SysMessage You are in Minoc Alchemist!
  1139. ;gosub BuyMinocAlchemistRegs
  1140. gosub BuyMinocGypsyMageRegs
  1141. set %VendorFound #true
  1142. }
  1143. if #CHARPOSX <= 2520 && #CHARPOSX >= 2514 && #CHARPOSY <= 659 && #CHARPOSY >= 650
  1144. {
  1145. event SysMessage You are in Minoc Gypsy Mage!
  1146. gosub BuyMinocGypsyMageRegs
  1147. set %VendorFound #true
  1148. }
  1149. if #CHARPOSX <= 3782 && #CHARPOSX >= 3760 && #CHARPOSY <= 1206 && #CHARPOSY >= 1184
  1150. {
  1151. event SysMessage You are in Nu'Jelm Mage!
  1152. gosub BuyNuJelmMageRegs
  1153. set %VendorFound #true
  1154. }
  1155. if #CHARPOSX <= 3702 && #CHARPOSX >= 3688 && #CHARPOSY <= 1271 && #CHARPOSY >= 1256
  1156. {
  1157. event SysMessage You are in Nu'Jelm Alchemist!
  1158. gosub BuyNuJelmAlchemistRegs
  1159. set %VendorFound #true
  1160. }
  1161. if #CHARPOSX <= 2465 && #CHARPOSX >= 2443 && #CHARPOSY <= 497 && #CHARPOSY >= 475
  1162. {
  1163. event SysMessage You are in Minoc!
  1164. gosub BuyMinocRegs
  1165. set %VendorFound #true
  1166. }
  1167. if %VendorFound = #true
  1168. {
  1169. set %BuyCount %BuyCount + 1
  1170. if %BuyCount % 2 = 0
  1171. {
  1172. set %PageNumber %PageNumber + 1
  1173. }
  1174. }
  1175. else
  1176. {
  1177. event SysMessage Unknown vendor! Going to the next vendor!
  1178. set %BuyCount %BuyCount + 1
  1179. if %BuyCount % 2 = 0
  1180. {
  1181. set %PageNumber %PageNumber + 1
  1182. }
  1183. }
  1184. set %VendorFound #false
  1185. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement