Advertisement
Guest User

No Dart Spaghetti

a guest
Feb 24th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.91 KB | None | 0 0
  1. ==============================Variables==============================
  2.  
  3. Private noDartMode As Boolean = False
  4. Private noDartChangeDart As Boolean = False
  5. Private noDartDragoonMode As Byte = 0
  6. Private noDartLV As Short = 0
  7. Private noDartHP As Short = 0
  8. Private noDartAT As Short = 0
  9. Private noDartMAT As Short = 0
  10. Private noDartDF As Short = 0
  11. Private noDartMDF As Short = 0
  12. Private noDartSPD As Short = 0
  13. Private noDartDLV As Byte = 0
  14. Private noDartDAT As Short = 0
  15. Private noDartDMAT As Short = 0
  16. Private noDartDDF As Short = 0
  17. Private noDartDMDF As Short = 0
  18. Private noDartSaveAHIT As Short = 0
  19. Private noDartSaveMHIT As Short = 0
  20. Private noDartSaveAAV As Short = 0
  21. Private noDartSaveMAV As Short = 0
  22. Private noDartSaveHP As Short = 0
  23. Private noDartSaveMP As Short = 0
  24. Private noDartSaveSP As Short = 0
  25. Private noDartSaveAddSP As Short = 0
  26. Private noDartSaveAddDMG As Short = 0
  27. Private dartReplaceMode As Byte = 0
  28. Private switchToCharacter As Byte = 0
  29. Private waitForSpecial As Short = -1
  30.  
  31. ==============================Game Loop (Runs always)==============================
  32.  
  33. If (encounterValue = 0) Then
  34. ...
  35. Else
  36. If ((encounterValue >= 2500 And encounterValue <= 5130) And noDartMode = True And noDartChangeDart = False) Then
  37. writeByte(&HB125F0, 0)
  38. noDartChangeDart = True
  39. End If
  40. End If
  41.  
  42. ...
  43.  
  44.  
  45. If (encounterValue = 0) Then
  46. writeShort(&HB1E488, 1)
  47. ItemChanges()
  48.  
  49. If (noDartMode) Then
  50. If (switchToCharacter = 1) Then
  51. noDartSaveHP = readShort(&HB128C8)
  52. noDartSaveMP = readShort(&HB128CA)
  53. noDartSaveSP = readShort(&HB128CC)
  54. ElseIf (switchToCharacter = 2) Then
  55. noDartSaveHP = readShort(&HB128F4)
  56. noDartSaveMP = readShort(&HB128F6)
  57. noDartSaveSP = readShort(&HB128F8)
  58. ElseIf (switchToCharacter = 3) Then
  59. noDartSaveHP = readShort(&HB12920)
  60. noDartSaveMP = readShort(&HB12922)
  61. noDartSaveSP = readShort(&HB12924)
  62. ElseIf (switchToCharacter = 4) Then
  63. noDartSaveHP = readShort(&HB1294C)
  64. noDartSaveMP = readShort(&HB1294E)
  65. noDartSaveSP = readShort(&HB12950)
  66. ElseIf (switchToCharacter = 5) Then
  67. noDartSaveHP = readShort(&HB12978)
  68. noDartSaveMP = readShort(&HB1297A)
  69. noDartSaveSP = readShort(&HB1297C)
  70. ElseIf (switchToCharacter = 6) Then
  71. noDartSaveHP = readShort(&HB129A4)
  72. noDartSaveMP = readShort(&HB129A6)
  73. noDartSaveSP = readShort(&HB129A8)
  74. ElseIf (switchToCharacter = 7) Then
  75. noDartSaveHP = readShort(&HB129D0)
  76. noDartSaveMP = readShort(&HB129D2)
  77. noDartSaveSP = readShort(&HB129D4)
  78. End If
  79. End If
  80. End If
  81.  
  82. If (noDartMode And encounterValue <= 5130) Then
  83. If (readByte(&HB155D0) = 12 Or readByte(&HB155D0) = 23 Or readByte(&HB155D0) = 8) Then
  84. writeByte(&HB155D0, 2)
  85. End If
  86. End If
  87.  
  88. ==============================Battle End (One time on battle complete)==============================
  89. noDartChangeDart = False
  90. noDartDragoonMode = 0
  91. waitForSpecial = -1
  92.  
  93. If (encounterValue = 9999) Then
  94. stsProgram.Text = "Unknown enemy data."
  95. Else
  96. If (noDartMode) Then
  97. writeByte(&HB125F0, switchToCharacter)
  98. End If
  99. End If
  100.  
  101.  
  102.  
  103. ==============================Battle Loop (Loops every X00MS during battle)==============================
  104. If (noDartMode = True And dartReplaced = False) Then
  105. If (dartReplaceMode = 0) Then
  106. If (readByte(characterAddresses(0) - &HA4) >= 15 And readByte(characterAddresses(0) - &HA8) = 8) Then
  107. System.Threading.Thread.Sleep(1500)
  108. writeByte(characterAddresses(0) - &HA4, 16)
  109.  
  110. If (readByte(characterAddresses(0) + &H7) = 0) Then
  111. writeByte(characterAddresses(0) + &H7, 32)
  112. End If
  113.  
  114. writeByte(characterAddresses(0) - &H2, 1)
  115. writeShort(characterAddresses(0) + &H2, 100)
  116.  
  117. dartReplaceMode = 1
  118. End If
  119. ElseIf (dartReplaceMode = 1) Then
  120. If (readByte(characterAddresses(0) - &HA4) = 96) Then
  121. writeByte(characterAddresses(0) - &HA4, 32)
  122. writeByte(&HAC5FCC, 1)
  123. dartReplaceMode = 2
  124. End If
  125. ElseIf (dartReplaceMode = 2) Then
  126. Dim characterAction As Byte = readByte(characterAddresses(0) - &HA8)
  127. If (characterAction = 24 Or characterAction = 26 Or characterAction = 136 Or characterAction = 138) Then
  128. writeShort(characterAddresses(0) + &H44, readShort(characterAddresses(0) + &H44) + 255)
  129.  
  130. writeByte(&HB125F0, switchToCharacter)
  131. dartReplaceMode = 3
  132. End If
  133. ElseIf (dartReplaceMode = 3) Then
  134. Dim characterAction As Byte = readByte(characterAddresses(0) - &HA8)
  135. If (characterAction = 8) Then
  136. writeByte(characterAddresses(0) - &H2, noDartDLV)
  137. writeShort(characterAddresses(0) + &H34, noDartSaveAHIT)
  138. writeShort(characterAddresses(0) + &H36, noDartSaveMHIT)
  139. writeShort(characterAddresses(0) + &H38, noDartSaveAAV)
  140. writeShort(characterAddresses(0) + &H3A, noDartSaveMAV)
  141. partySlots(0) = readByte(&HB125F0)
  142.  
  143. If (noDartDLV = 0) Then
  144. writeByte(characterAddresses(0) + &H6, 0)
  145. writeShort(characterAddresses(0) + &H2, 0)
  146. writeShort(characterAddresses(0) + &H4, 0)
  147. writeShort(characterAddresses(0) + &HA, 0)
  148. End If
  149.  
  150. If (ubZeroSP = False) Then
  151. writeShort(characterAddresses(0) + &H2, noDartSaveSP)
  152. End If
  153.  
  154. writeShort(characterAddresses(0), noDartSaveHP)
  155. writeShort(characterAddresses(0) + &H4, noDartSaveMP)
  156.  
  157. If (readShort(characterAddresses(0)) > readShort(characterAddresses(0) + &H8)) Then
  158. writeShort(characterAddresses(0), readShort(characterAddresses(0) + &H8))
  159. End If
  160.  
  161. If (readShort(characterAddresses(0) + &H4) > readShort(characterAddresses(0) + &HA)) Then
  162. writeShort(characterAddresses(0) + &H4, readShort(characterAddresses(0) + &HA))
  163. End If
  164.  
  165. dartReplaceMode = 4
  166.  
  167. If (additionChanges) Then
  168. If (partySlots(0) = 1) Then
  169. If (readByte(&HB128D9) = 12) Then
  170. writeByte(characterAddresses(0) + &H114, CByte(Math.Ceiling(readByte(characterAddresses(0) + &H114) * 2.285)))
  171. End If
  172. End If
  173. If (partySlots(0) = 3) Then
  174. If (readByte(&HB12931) = 15) Then
  175. writeByte(characterAddresses(0) + &H114, CByte(Math.Ceiling(readByte(characterAddresses(0) + &H114) + 60)))
  176. ElseIf (readByte(&HB12931) = 16) Then
  177. writeShort(characterAddresses(0) + &H114, CShort(Math.Ceiling(readByte(characterAddresses(0) + &H114) * 1.4)))
  178. ElseIf (readByte(&HB12931) = 17) Then
  179. writeByte(characterAddresses(0) + &H114, CByte(Math.Ceiling(readByte(characterAddresses(0) + &H114) * 1.1666)))
  180. End If
  181. End If
  182. If (partySlots(0) = 5) Then
  183. If (readByte(&HB12989) = 12) Then
  184. writeByte(characterAddresses(0) + &H114, CByte(Math.Ceiling(readByte(characterAddresses(0) + &H114) * 2.285)))
  185. End If
  186. End If
  187. If (partySlots(0) = 6) Then
  188. If (readByte(&HB129B5) = 27) Then
  189. writeByte(characterAddresses(0) + &H114, CByte(Math.Ceiling(readByte(characterAddresses(0) + &H114) * 0.75)))
  190. End If
  191. End If
  192. If (partySlots(0) = 7) Then
  193. If (readByte(&HB129E1) = 19) Then
  194. writeByte(characterAddresses(0) + &H114, CByte(Math.Ceiling(readByte(characterAddresses(0) + &H114) * 2)))
  195. ElseIf (readByte(&HB129E1) = 20) Then
  196. writeShort(characterAddresses(0) + &H112, 80)
  197. writeByte(characterAddresses(0) + &H114, CByte(Math.Ceiling(readByte(characterAddresses(0) + &H114) * 2)))
  198. ElseIf (readByte(&HB129E1) = 21) Then
  199. writeShort(characterAddresses(0) + &H112, 50)
  200. writeShort(characterAddresses(0) + &H114, CUShort(Math.Ceiling(readByte(characterAddresses(0) + &H114) * 4)))
  201. End If
  202. End If
  203. End If
  204.  
  205. If (halfSP) Then
  206. Dim equippedAddition = readByte(&HB128AD + (&H2C * partySlots(0)))
  207. Dim levelOffset = 0
  208. If (partySlots(0) = 0) Then
  209. levelOffset = equippedAddition
  210. ElseIf (partySlots(0) = 1 Or partySlots(0) = 5) Then
  211. levelOffset = equippedAddition - 8
  212. ElseIf (partySlots(0) = 3) Then
  213. levelOffset = equippedAddition - 14
  214. ElseIf (partySlots(0) = 4) Then
  215. levelOffset = equippedAddition - 29
  216. ElseIf (partySlots(0) = 6) Then
  217. levelOffset = equippedAddition - 23
  218. ElseIf (partySlots(0) = 7) Then
  219. levelOffset = equippedAddition - 19
  220. End If
  221. Dim additionLevel = readByte(&HB128AE + (&H2C * (partySlots(0)) + levelOffset))
  222. Dim totalSP = readShort(&HB128A2 + (&H2C * partySlots(0)))
  223. Dim spMulti As UShort = 65535
  224. If (partySlots(0) < 9) Then
  225. If (partySlots(0) = 0) Then
  226. If (additionLevel = 5) Then
  227. If (equippedAddition = 0) Then
  228. spMulti = 65535 - 50 + 1
  229. ElseIf (equippedAddition = 1) Then
  230. spMulti = 0
  231. ElseIf (equippedAddition = 2) Then
  232. spMulti = 75
  233. ElseIf (equippedAddition = 3) Then
  234. spMulti = 0
  235. ElseIf (equippedAddition = 4) Then
  236. spMulti = 75
  237. ElseIf (equippedAddition = 5) Then
  238. spMulti = 65535 - 50 + 1
  239. ElseIf (equippedAddition = 6) Then
  240. spMulti = 65535 - 20 + 1
  241. End If
  242. Else
  243. spMulti = 65535 - 50 + 1
  244. End If
  245. ElseIf (partySlots(0) = 1 Or partySlots(0) = 5) Then
  246. If (additionLevel = 5) Then
  247. If (equippedAddition = 8) Then
  248. spMulti = 65535 - 25 + 1
  249. ElseIf (equippedAddition = 9) Then
  250. spMulti = 65535 - 50 + 1
  251. ElseIf (equippedAddition = 10) Then
  252. spMulti = 75
  253. ElseIf (equippedAddition = 11) Then
  254. spMulti = 65535 - 40 + 1
  255. ElseIf (equippedAddition = 12) Then
  256. spMulti = 75
  257. End If
  258. Else
  259. spMulti = 65535 - 50 + 1
  260. If (equippedAddition = 11) Then
  261. spMulti = 65535 - 40 + 1
  262. End If
  263. End If
  264. ElseIf (partySlots(0) = 2 Or partySlots(0) = 8) Then
  265. Dim shanaSP As Long = shanaSPScan()
  266. writeByteU(shanaSP, 17)
  267. writeByteU(shanaSP + &H4, 25)
  268. writeByteU(shanaSP + &H8, 35)
  269. writeByteU(shanaSP + &HC, 50)
  270. writeByteU(shanaSP + &H10, 75)
  271. ElseIf (partySlots(0) = 3) Then
  272. If (additionLevel = 5) Then
  273. If (equippedAddition = 15) Then
  274. spMulti = 75
  275. Else
  276. spMulti = 65535 - 50 + 1
  277. End If
  278. Else
  279. spMulti = 65535 - 50 + 1
  280. End If
  281. ElseIf (partySlots(0) = 4) Then
  282. If (additionLevel = 5) Then
  283. If (equippedAddition = 29) Then
  284. spMulti = 65535 - 25 + 1
  285. ElseIf (equippedAddition = 30) Then
  286. spMulti = 65535 - 40 + 1
  287. ElseIf (equippedAddition = 31) Then
  288. spMulti = 0
  289. ElseIf (equippedAddition = 32) Then
  290. spMulti = 65535 - 20 + 1
  291. ElseIf (equippedAddition = 33) Then
  292. spMulti = 65535 - 30 + 1
  293. ElseIf (equippedAddition = 34) Then
  294. spMulti = 50
  295. End If
  296. Else
  297. spMulti = 65535 - 50 + 1
  298. If (equippedAddition = 30) Then
  299. spMulti = 65535 - 40 + 1
  300. ElseIf (equippedAddition = 32) Then
  301. spMulti = 65535 - 40 + 1
  302. ElseIf (equippedAddition = 33) Then
  303. spMulti = 65535 - 30 + 1
  304. End If
  305. End If
  306. ElseIf (partySlots(0) = 6) Then
  307. If (additionLevel = 5) Then
  308. If (equippedAddition = 23) Then
  309. spMulti = 65535 - 10 + 1
  310. ElseIf (equippedAddition = 24) Then
  311. spMulti = 0
  312. ElseIf (equippedAddition = 25) Then
  313. spMulti = 70
  314. ElseIf (equippedAddition = 26) Then
  315. spMulti = 65535 - 10 + 1
  316. ElseIf (equippedAddition = 27) Then
  317. spMulti = 65535 - 50 + 1
  318. End If
  319. Else
  320. spMulti = 65535 - 50 + 1
  321. If (equippedAddition = 24) Then
  322. spMulti = 65535 - 45 + 1
  323. ElseIf (equippedAddition = 25) Then
  324. spMulti = 65535 - 20 + 1
  325. ElseIf (equippedAddition = 26) Then
  326. spMulti = 65535 - 10 + 1
  327. End If
  328. 'stsGame.Text = "" & (characterAddresses(i) + &H112) & "/" & equippedAddition & "/" & additionLevel & "/" & spMulti
  329. End If
  330. ElseIf (partySlots(0) = 7) Then
  331. If (additionLevel = 5) Then
  332. If (equippedAddition = 19) Then
  333. spMulti = 65535 - 25 + 1
  334. ElseIf (equippedAddition = 20) Then
  335. If (additionChanges) Then
  336. spMulti = 0
  337. Else
  338. spMulti = 65535 - 40 + 1
  339. End If
  340. ElseIf (equippedAddition = 21) Then
  341. If (additionChanges) Then
  342. spMulti = 65535 - 25 + 1
  343. Else
  344. spMulti = 65535 - 50 + 1
  345. End If
  346. End If
  347. Else
  348. If (equippedAddition = 19) Then
  349. spMulti = 65535 - 50 + 1
  350. ElseIf (equippedAddition = 20) Then
  351. spMulti = 65535 - 40 + 1
  352. ElseIf (equippedAddition = 21) Then
  353. If (additionChanges) Then
  354. spMulti = 65535 - 20 + 1
  355. Else
  356. spMulti = 65535 - 50 + 1
  357. End If
  358. End If
  359. End If
  360. End If
  361. If (spMulti <> 65535) Then
  362. writeShort(characterAddresses(0) + &H112, spMulti)
  363. End If
  364. End If
  365. End If
  366.  
  367. dartReplaced = True
  368. End If
  369. End If
  370. End If
  371.  
  372.  
  373. For i As Integer = 0 To 2
  374. If (partySlots(0) < 9) Then
  375. If (i = 0 And dartReplaced) Then
  376. If (waitForSpecial = -1) Then
  377. For x As Integer = 0 To 2
  378. If ((readByte(characterAddresses(x) - &HA8) = 24 Or readByte(characterAddresses(x) - &HA8) = 11) And partySlots(x) < 9) Then
  379. waitForSpecial = x
  380. End If
  381. Next
  382. End If
  383.  
  384. If (waitForSpecial = -1) Then
  385. If ((readByte(characterAddresses(0) - &HA8) >= 8 And readByte(characterAddresses(0) - &HA8) <= 18) And readByte(characterAddresses(0) - &HA4) <= 15 And readByte(characterAddresses(0) - &H54) <> 6) Then
  386. If (readByte(characterAddresses(0) - &HA8) = 10 And readByte(characterAddresses(0) - &HA4) = 96) Then
  387. Else
  388. If (readByte(characterAddresses(0) - &HA4) = switchToCharacter) Then
  389. writeByte(characterAddresses(0) + &H26A, switchToCharacter)
  390. Else
  391. If (readByte(characterAddresses(0) - &HA4) >= 15) Then
  392. writeByte(characterAddresses(0) + &H26A, switchToCharacter)
  393. Else
  394. If (readByte(characterAddresses(0) - &HA8) = 2) Then
  395. writeByte(characterAddresses(0) + &H26A, switchToCharacter)
  396. Else
  397. If (readByte(&HAC5FCC) >= 1) Then
  398. If (noDartDragoonMode = 0) Then
  399. writeByte(characterAddresses(0) + &H26A, switchToCharacter)
  400. ElseIf (noDartDragoonMode = 1) Then
  401. writeByte(characterAddresses(0) + &H26A, switchToCharacter)
  402. ElseIf (noDartDragoonMode = 2) Then
  403. writeByte(characterAddresses(0) + &H26A, 0)
  404. End If
  405. Else
  406. writeByte(characterAddresses(0) + &H26A, 0)
  407. End If
  408. End If
  409. End If
  410. End If
  411. End If
  412. Else
  413. If (readByte(characterAddresses(0) - &HA8) = 2) Then
  414. writeByte(characterAddresses(0) + &H26A, switchToCharacter)
  415. Else
  416. If (readByte(&HAC5FCC) >= 1) Then
  417. If (noDartDragoonMode = 0) Then
  418. writeByte(characterAddresses(0) + &H26A, switchToCharacter)
  419. ElseIf (noDartDragoonMode = 1) Then
  420. writeByte(characterAddresses(0) + &H26A, switchToCharacter)
  421. ElseIf (noDartDragoonMode = 2) Then
  422. writeByte(characterAddresses(0) + &H26A, 0)
  423. End If
  424. Else
  425. writeByte(characterAddresses(0) + &H26A, switchToCharacter)
  426. End If
  427. End If
  428. End If
  429. Else
  430. writeByte(characterAddresses(0) + &H26A, 0)
  431.  
  432. If (readByte(characterAddresses(waitForSpecial) - &HA4) >= 96) Then
  433. If (readByte(&HAC5FE9) = 255) Then
  434. writeByte(&HAC5FE8, partySlots(waitForSpecial))
  435. writeByte(&HB1E504, partySlots(waitForSpecial))
  436. End If
  437. waitForSpecial = -1
  438. End If
  439. End If
  440. End If
  441.  
  442. ...
  443. End If
  444. Next
  445.  
  446. ==============================Battle Load (One time on battle entry)==============================
  447. If (enemyAddresses(0) > 0) Then
  448. stsProgram.Text = "Stats changed. Reading values..."
  449.  
  450. If (noDartMode) Then
  451. System.Threading.Thread.Sleep(2000)
  452. writeShort(characterAddresses(0) - &H2, noDartLV)
  453. writeShort(characterAddresses(0) + &H8, noDartHP)
  454. writeShort(characterAddresses(0) + &H2C, readShort(characterAddresses(0) + &H2C) + noDartAT)
  455. writeShort(characterAddresses(0) + &H2E, readShort(characterAddresses(0) + &H2E) + noDartMAT)
  456. writeShort(characterAddresses(0) + &H30, readShort(characterAddresses(0) + &H30) + noDartDF)
  457. writeShort(characterAddresses(0) + &H32, readShort(characterAddresses(0) + &H32) + noDartMDF)
  458. writeShort(characterAddresses(0) + &H2A, readShort(characterAddresses(0) + &H2A) + noDartSPD)
  459. writeShort(characterAddresses(0) + &HA4, noDartDAT)
  460. writeShort(characterAddresses(0) + &HA6, noDartDMAT)
  461. writeShort(characterAddresses(0) + &HA8, noDartDDF)
  462. writeShort(characterAddresses(0) + &HAA, noDartDMDF)
  463. writeShort(characterAddresses(0) + &H112, noDartSaveAddSP)
  464. writeShort(characterAddresses(0) + &H114, noDartSaveAddDMG)
  465.  
  466. noDartSaveAHIT = readByte(characterAddresses(0) + &H34)
  467. noDartSaveMHIT = readByte(characterAddresses(0) + &H36)
  468. noDartSaveAAV = readByte(characterAddresses(0) + &H38)
  469. noDartSaveMAV = readByte(characterAddresses(0) + &H3A)
  470.  
  471. writeShort(characterAddresses(0) + &H34, 0)
  472. writeShort(characterAddresses(0) + &H36, 0)
  473. writeShort(characterAddresses(0) + &H38, 100)
  474. writeShort(characterAddresses(0) + &H3A, 100)
  475.  
  476. Dim levelStart As Integer = &HB128A6 '2C
  477. Dim helmetStart As Integer = &HB128A9 '2C
  478. Dim accStart As Integer = &HB128AC '2C
  479. Dim dragon As Byte = &H5A
  480. Dim ring As Byte = &H79
  481. Dim healthRing As Byte = &HB2
  482.  
  483. Dim swapHPChangeCheck = 0.0
  484. If (readShort(characterAddresses(0) + &H118) = dragon) Then
  485. swapHPChangeCheck += 0.5
  486. End If
  487. If (readShort(characterAddresses(0) + &H11E) = ring) Then
  488. swapHPChangeCheck += 0.5
  489. End If
  490. If (readShort(characterAddresses(0) + &H11E) = healthRing) Then
  491. swapHPChangeCheck += 1
  492. End If
  493.  
  494. If (swapHPChangeCheck >= 0.5) Then
  495. hpChangeCheck(0) = Math.Round(noDartHP * (swapHPChangeCheck + 1))
  496. End If
  497.  
  498. If (swapHPChangeCheck >= 0.5 And breakHp = False) Then
  499. If (hpChangeCheck(0) > 9999) Then
  500. hpChangeCheck(0) = 9999
  501. End If
  502. End If
  503.  
  504. If (noDartDLV > 0) Then
  505. Dim maxMP = 0
  506. Dim totalMP = 0
  507.  
  508. If (noDartDLV = 1) Then
  509. maxMP = 20
  510. ElseIf (noDartDLV = 2) Then
  511. maxMP = 40
  512. ElseIf (noDartDLV = 3) Then
  513. maxMP = 60
  514. ElseIf (noDartDLV = 4) Then
  515. maxMP = 80
  516. ElseIf (noDartDLV = 5) Then
  517. maxMP = 100
  518. End If
  519.  
  520. If (readShort(characterAddresses(0) + &H118) = &H5B) Then
  521. totalMP = 0.5
  522. End If
  523.  
  524. If (readShort(characterAddresses(0) + &H11E) = &H7A) Then
  525. totalMP = 1
  526. End If
  527.  
  528. writeShort(characterAddresses(0) + &HA, Math.Round(maxMP * (totalMP + 1)))
  529. End If
  530. End If
  531.  
  532. For i As Integer = 0 To 2
  533. originalCharacterStats(i, 0) = readShort(characterAddresses(i) + &H8)
  534. originalCharacterStats(i, 1) = readShort(characterAddresses(i) + &H2C)
  535. originalCharacterStats(i, 2) = readShort(characterAddresses(i) + &H2E)
  536. originalCharacterStats(i, 3) = readShort(characterAddresses(i) + &H30)
  537. originalCharacterStats(i, 4) = readShort(characterAddresses(i) + &H32)
  538. originalCharacterStats(i, 5) = readShort(characterAddresses(i) + &H2A)
  539.  
  540. If (hpChangeCheck(i) > 1) Then
  541. writeShort(characterAddresses(i) + &H8, CUShort(hpChangeCheck(i)))
  542. originalCharacterStats(i, 0) = readShort(characterAddresses(i) + &H8)
  543. End If
  544. Next
  545. Else
  546. ...
  547. End If
  548.  
  549. If (noDartMode = True And cboAddition.SelectedIndex = 0) Then
  550. btnUnequipDart_Click()
  551. End If
  552.  
  553. ...
  554.  
  555.  
  556. ==============================Setup (Pre battle)==============================
  557. Private Sub btnUnequipDart_Click() Handles btnUnequipDart.Click
  558. If (noDartMode) Then
  559. btnUnequipDart.Background = New SolidColorBrush(Color.FromArgb(255, 255, 168, 168))
  560. noDartMode = False
  561. writeByte(&HB128A8, 255)
  562. writeByte(&HB128A9, 255)
  563. writeByte(&HB128AA, 255)
  564. writeByte(&HB128AB, 255)
  565. writeByte(&HB128AC, 255)
  566. writeByte(&HB12898, 3)
  567. Else
  568. If (readByte(&HB12898) = 0) Then
  569. stsProgram.Text = "Please click on Check Dart first"
  570. Exit Sub
  571. End If
  572.  
  573. Dim address As Integer = &HB12750
  574. Dim firstFreeSlot = -1
  575. Dim freeSlots = 0
  576.  
  577. For i As Integer = 0 To 254
  578. If (readByte(address) = 255) Then
  579. If (firstFreeSlot < 0) Then
  580. firstFreeSlot = address
  581. End If
  582. freeSlots += 1
  583. End If
  584. address += 1
  585. Next
  586.  
  587. If (freeSlots >= 5 Or (readByte(&HB128A8) = 255 And readByte(&HB128A9) = 255 And readByte(&HB128AA) = 255 And readByte(&HB128AB) = 255 And readByte(&HB128AC) = 255)) Then
  588. writeByte(firstFreeSlot, readByte(&HB128A8))
  589. writeByte(firstFreeSlot + 1, readByte(&HB128A9))
  590. writeByte(firstFreeSlot + 2, readByte(&HB128AA))
  591. writeByte(firstFreeSlot + 3, readByte(&HB128AB))
  592. writeByte(firstFreeSlot + 4, readByte(&HB128AC))
  593. writeByte(&HB128A8, 255)
  594. writeByte(&HB128A9, 255)
  595. writeByte(&HB128AA, 255)
  596. writeByte(&HB128AB, 255)
  597. writeByte(&HB128AC, 255)
  598. writeByte(&HB12898, 0)
  599. noDartMode = True
  600. btnUnequipDart.Background = New SolidColorBrush(Color.FromArgb(255, 168, 211, 255))
  601. battleTimer.Interval = TimeSpan.FromMilliseconds(400)
  602. stsProgram.Text = "No Dart activated, please select an addition."
  603. Else
  604. stsProgram.Text = "You do not have enough free slots."
  605. End If
  606. End If
  607. End Sub
  608.  
  609. Private Sub cboAddition_Click() Handles cboAddition.SelectionChanged
  610. If (noDartMode = False) Then
  611. stsProgram.Text = "Switched back to Dart."
  612. writeByte(&HB128AD, 0)
  613. switchToCharacter = 0
  614. cboAddition.SelectedIndex = 0
  615. Exit Sub
  616. End If
  617.  
  618. If (cboAddition.SelectedIndex = 0) Then
  619. stsProgram.Text = "Switched back to Dart."
  620. writeByte(&HB128AD, 0)
  621. switchToCharacter = 0
  622.  
  623. If (noDartMode) Then
  624. btnUnequipDart_Click()
  625. End If
  626. ElseIf (cboAddition.SelectedIndex = 1) Then
  627. switchToCharacter = 2
  628.  
  629. If (readByte(&HB125F4) = switchToCharacter) Then
  630. cboAddition.SelectedIndex = 0
  631. Exit Sub
  632. End If
  633.  
  634. stsProgram.Text = "You will switch to Shana in battle."
  635. writeByte(&HB128AD, 255)
  636. writeByte(&HB128A8, readByte(&HB12900))
  637. writeByte(&HB128A9, readByte(&HB12901))
  638. writeByte(&HB128AA, readByte(&HB12902))
  639. writeByte(&HB128AB, readByte(&HB12903))
  640. writeByte(&HB128AC, readByte(&HB12904))
  641. noDartSaveAddSP = 0
  642. noDartSaveAddDMG = 0
  643. CalculateSwitchToStats(readByte(&HB128A6), readByte(&HB128FE), &HB6930C, &HB69678, readByte(&HB128FF))
  644. ElseIf (cboAddition.SelectedIndex >= 2 And cboAddition.SelectedIndex <= 6) Then
  645. switchToCharacter = 1
  646.  
  647. If (readByte(&HB125F4) = switchToCharacter) Then
  648. cboAddition.SelectedIndex = 0
  649. Exit Sub
  650. End If
  651.  
  652. Dim selectedAddition = cboAddition.SelectedIndex - 2
  653.  
  654. If (readByte(&HB128DA + selectedAddition) < 5) Then
  655. stsProgram.Text = "This addition is not maxed. "
  656. Exit Sub
  657. End If
  658.  
  659. If (selectedAddition = 0) Then
  660. noDartSaveAddSP = 45
  661. noDartSaveAddDMG = 50
  662. ElseIf (selectedAddition = 1) Then
  663. noDartSaveAddSP = 0
  664. noDartSaveAddDMG = 100
  665. ElseIf (selectedAddition = 2) Then
  666. noDartSaveAddSP = 240
  667. noDartSaveAddDMG = 35
  668. ElseIf (selectedAddition = 3) Then
  669. noDartSaveAddSP = 0
  670. noDartSaveAddDMG = 75
  671. ElseIf (selectedAddition = 4) Then
  672. noDartSaveAddSP = 240
  673. noDartSaveAddDMG = 35
  674. End If
  675.  
  676. writeByte(&HB128D9, selectedAddition + 8)
  677.  
  678. stsProgram.Text = "You will switch to Lavitz in battle."
  679. writeByte(&HB128AD, cboAddition.SelectedIndex + 6)
  680. writeByte(&HB128A8, readByte(&HB128D4))
  681. writeByte(&HB128A9, readByte(&HB128D5))
  682. writeByte(&HB128AA, readByte(&HB128D6))
  683. writeByte(&HB128AB, readByte(&HB128D7))
  684. writeByte(&HB128AC, readByte(&HB128D8))
  685. CalculateSwitchToStats(readByte(&HB128A6), readByte(&HB128D2), &HB68F3C, &HB69618, readByte(&HB128D3))
  686. ElseIf (cboAddition.SelectedIndex >= 7 And cboAddition.SelectedIndex <= 10) Then
  687. switchToCharacter = 3
  688.  
  689. If (readByte(&HB125F4) = switchToCharacter) Then
  690. cboAddition.SelectedIndex = 0
  691. Exit Sub
  692. End If
  693.  
  694. Dim selectedAddition = cboAddition.SelectedIndex - 7
  695.  
  696. If (readByte(&HB12932 + selectedAddition) < 5) Then
  697. stsProgram.Text = "This addition is not maxed. "
  698. Exit Sub
  699. End If
  700.  
  701. If (selectedAddition = 0) Then
  702. noDartSaveAddSP = 0
  703. noDartSaveAddDMG = 100
  704. ElseIf (selectedAddition = 1) Then
  705. noDartSaveAddSP = 240
  706. noDartSaveAddDMG = 0
  707. ElseIf (selectedAddition = 2) Then
  708. noDartSaveAddSP = 0
  709. noDartSaveAddDMG = 200
  710. ElseIf (selectedAddition = 3) Then
  711. noDartSaveAddSP = 0
  712. noDartSaveAddDMG = 150
  713. End If
  714.  
  715. writeByte(&HB12931, selectedAddition + 14)
  716.  
  717. stsProgram.Text = "You will switch to Rose in battle."
  718. writeByte(&HB128AD, cboAddition.SelectedIndex + 7)
  719. writeByte(&HB128A8, readByte(&HB1292C))
  720. writeByte(&HB128A9, readByte(&HB1292D))
  721. writeByte(&HB128AA, readByte(&HB1292E))
  722. writeByte(&HB128AB, readByte(&HB1292F))
  723. writeByte(&HB128AC, readByte(&HB12930))
  724. CalculateSwitchToStats(readByte(&HB128A6), readByte(&HB1292A), &HB69124, &HB69648, readByte(&HB1292B))
  725. ElseIf (cboAddition.SelectedIndex >= 11 And cboAddition.SelectedIndex <= 13) Then
  726. switchToCharacter = 7
  727.  
  728. If (readByte(&HB125F4) = switchToCharacter) Then
  729. cboAddition.SelectedIndex = 0
  730. Exit Sub
  731. End If
  732.  
  733. Dim selectedAddition = cboAddition.SelectedIndex - 11
  734.  
  735. If (readByte(&HB129E2 + selectedAddition) < 5) Then
  736. stsProgram.Text = "This addition is not maxed. "
  737. Exit Sub
  738. End If
  739.  
  740. If (selectedAddition = 0) Then
  741. noDartSaveAddSP = 45
  742. noDartSaveAddDMG = 50
  743. ElseIf (selectedAddition = 1) Then
  744. noDartSaveAddSP = 0
  745. noDartSaveAddDMG = 100
  746. ElseIf (selectedAddition = 2) Then
  747. noDartSaveAddSP = 45
  748. noDartSaveAddDMG = 50
  749. End If
  750.  
  751. writeByte(&HB129E1, selectedAddition + 19)
  752.  
  753. stsProgram.Text = "You will switch to Kongol in battle."
  754. writeByte(&HB128AD, cboAddition.SelectedIndex + 8)
  755. writeByte(&HB128A8, readByte(&HB129DC))
  756. writeByte(&HB128A9, readByte(&HB129DD))
  757. writeByte(&HB128AA, readByte(&HB129DE))
  758. writeByte(&HB128AB, readByte(&HB129DF))
  759. writeByte(&HB128AC, readByte(&HB129E0))
  760. CalculateSwitchToStats(readByte(&HB128A6), readByte(&HB129DA), &HB6879C, &HB69528, readByte(&HB1292B))
  761. ElseIf (cboAddition.SelectedIndex >= 14 And cboAddition.SelectedIndex <= 18) Then
  762. switchToCharacter = 6
  763.  
  764. If (readByte(&HB125F4) = switchToCharacter) Then
  765. cboAddition.SelectedIndex = 0
  766. Exit Sub
  767. End If
  768.  
  769. Dim selectedAddition = cboAddition.SelectedIndex - 14
  770.  
  771. If (readByte(&HB129B6 + selectedAddition) < 5) Then
  772. stsProgram.Text = "This addition is not maxed. "
  773. Exit Sub
  774. End If
  775.  
  776. If (selectedAddition = 0) Then
  777. noDartSaveAddSP = 75
  778. noDartSaveAddDMG = 50
  779. ElseIf (selectedAddition = 1) Then
  780. noDartSaveAddSP = 100
  781. noDartSaveAddDMG = 35
  782. ElseIf (selectedAddition = 2) Then
  783. noDartSaveAddSP = 240
  784. noDartSaveAddDMG = 0
  785. ElseIf (selectedAddition = 3) Then
  786. noDartSaveAddSP = 0
  787. noDartSaveAddDMG = 134
  788. ElseIf (selectedAddition = 4) Then
  789. noDartSaveAddSP = 0
  790. noDartSaveAddDMG = 200
  791. End If
  792.  
  793. writeByte(&HB129B5, selectedAddition + 23)
  794.  
  795. stsProgram.Text = "You will switch to Meru in battle."
  796. writeByte(&HB128AD, cboAddition.SelectedIndex + 9)
  797. writeByte(&HB128A8, readByte(&HB129B0))
  798. writeByte(&HB128A9, readByte(&HB129B1))
  799. writeByte(&HB128AA, readByte(&HB129B2))
  800. writeByte(&HB128AB, readByte(&HB129B3))
  801. writeByte(&HB128AC, readByte(&HB129B4))
  802. CalculateSwitchToStats(readByte(&HB128A6), readByte(&HB129AE), &HB68D54, &HB695B8, readByte(&HB129AF))
  803. ElseIf (cboAddition.SelectedIndex >= 19 And cboAddition.SelectedIndex <= 24) Then
  804. switchToCharacter = 4
  805.  
  806. If (readByte(&HB125F4) = switchToCharacter) Then
  807. cboAddition.SelectedIndex = 0
  808. Exit Sub
  809. End If
  810.  
  811. Dim selectedAddition = cboAddition.SelectedIndex - 19
  812.  
  813. If (readByte(&HB1295E + selectedAddition) < 5) Then
  814. stsProgram.Text = "This addition is not maxed. "
  815. Exit Sub
  816. End If
  817.  
  818. If (selectedAddition = 0) Then
  819. noDartSaveAddSP = 45
  820. noDartSaveAddDMG = 50
  821. ElseIf (selectedAddition = 1) Then
  822. noDartSaveAddSP = 0
  823. noDartSaveAddDMG = 35
  824. ElseIf (selectedAddition = 2) Then
  825. noDartSaveAddSP = 102
  826. noDartSaveAddDMG = 0
  827. ElseIf (selectedAddition = 3) Then
  828. noDartSaveAddSP = 45
  829. noDartSaveAddDMG = 100
  830. ElseIf (selectedAddition = 4) Then
  831. noDartSaveAddSP = 0
  832. noDartSaveAddDMG = 100
  833. ElseIf (selectedAddition = 5) Then
  834. noDartSaveAddSP = 200
  835. noDartSaveAddDMG = 67
  836. End If
  837.  
  838. writeByte(&HB1295D, selectedAddition + 29)
  839.  
  840. stsProgram.Text = "You will switch to Haschel in battle."
  841. writeByte(&HB128AD, cboAddition.SelectedIndex + 10)
  842. writeByte(&HB128A8, readByte(&HB12958))
  843. writeByte(&HB128A9, readByte(&HB12959))
  844. writeByte(&HB128AA, readByte(&HB1295A))
  845. writeByte(&HB128AB, readByte(&HB1295B))
  846. writeByte(&HB128AC, readByte(&HB1295C))
  847. CalculateSwitchToStats(readByte(&HB128A6), readByte(&HB1292A), &HB68B6C, &HB69588, readByte(&HB1292B))
  848. ElseIf (cboAddition.SelectedIndex >= 25 And cboAddition.SelectedIndex <= 29) Then
  849. switchToCharacter = 5
  850.  
  851. If (readByte(&HB125F4) = switchToCharacter) Then
  852. cboAddition.SelectedIndex = 0
  853. Exit Sub
  854. End If
  855.  
  856. Dim selectedAddition = cboAddition.SelectedIndex - 25
  857.  
  858. If (readByte(&HB1298A + selectedAddition) < 5) Then
  859. stsProgram.Text = "This addition is not maxed. "
  860. Exit Sub
  861. End If
  862.  
  863. If (selectedAddition = 0) Then
  864. noDartSaveAddSP = 45
  865. noDartSaveAddDMG = 50
  866. ElseIf (selectedAddition = 1) Then
  867. noDartSaveAddSP = 0
  868. noDartSaveAddDMG = 100
  869. ElseIf (selectedAddition = 2) Then
  870. noDartSaveAddSP = 240
  871. noDartSaveAddDMG = 35
  872. ElseIf (selectedAddition = 3) Then
  873. noDartSaveAddSP = 0
  874. noDartSaveAddDMG = 75
  875. ElseIf (selectedAddition = 4) Then
  876. noDartSaveAddSP = 240
  877. noDartSaveAddDMG = 35
  878. End If
  879.  
  880. writeByte(&HB12989, selectedAddition + 8)
  881.  
  882.  
  883. stsProgram.Text = "You will switch to Albert in battle."
  884. writeByte(&HB128AD, cboAddition.SelectedIndex + 11)
  885. writeByte(&HB128A8, readByte(&HB12984))
  886. writeByte(&HB128A9, readByte(&HB12985))
  887. writeByte(&HB128AA, readByte(&HB12986))
  888. writeByte(&HB128AB, readByte(&HB12987))
  889. writeByte(&HB128AC, readByte(&HB12988))
  890. CalculateSwitchToStats(readByte(&HB128A6), readByte(&HB12982), &HB68F3C, &HB69618, readByte(&HB12983))
  891. End If
  892. End Sub
  893.  
  894. Private Sub CalculateSwitchToStats(level As Byte, sLevel As Byte, address As Integer, dAddress As Integer, dLevel As Byte)
  895. noDartLV = sLevel
  896. noDartDLV = dLevel
  897. level = level - 1
  898. sLevel = sLevel - 1
  899. dLevel = dLevel - 1
  900.  
  901. noDartHP = readShort(address + (sLevel * 8))
  902.  
  903. noDartSPD = CShort(readByte(&HB68987 + (level * 8))) - CShort(readByte((address + 3) + (sLevel * 8)))
  904. noDartSPD = noDartSPD * -1
  905.  
  906. noDartAT = CShort(readByte(&HB68988 + (level * 8))) - CShort(readByte((address + 4) + (sLevel * 8)))
  907. noDartAT = noDartAT * -1
  908.  
  909. noDartMAT = CShort(readByte(&HB68989 + (level * 8))) - CShort(readByte((address + 5) + (sLevel * 8)))
  910. noDartMAT = noDartMAT * -1
  911.  
  912. noDartDF = CShort(readByte(&HB6898A + (level * 8))) - CShort(readByte((address + 6) + (sLevel * 8)))
  913. noDartDF = noDartDF * -1
  914.  
  915. noDartMDF = CShort(readByte(&HB6898B + (level * 8))) - CShort(readByte((address + 7) + (sLevel * 8)))
  916. noDartMDF = noDartMDF * -1
  917.  
  918. If (dLevel = -1) Then
  919. noDartDAT = 0
  920. noDartDMAT = 0
  921. noDartDDF = 0
  922. noDartDMDF = 0
  923. Else
  924. noDartDAT = readByte((dAddress) + (dLevel * 8))
  925. noDartDMAT = readByte((dAddress + 1) + (dLevel * 8))
  926. noDartDDF = readByte((dAddress + 2) + (dLevel * 8))
  927. noDartDMDF = readByte((dAddress + 3) + (dLevel * 8))
  928. End If
  929. End Sub
  930.  
  931. ==============================In Battle Hotkey==============================
  932. If (command = (KEY_L1 + KEY_L2)) Then
  933. If (noDartMode) Then
  934. If (noDartDragoonMode = 0 Or noDartDragoonMode = 1) Then
  935. noDartDragoonMode = 2
  936. stsGame.Text = "No Dart Dragoon Mode changed to Magic."
  937. Else
  938. noDartDragoonMode = 1
  939. stsGame.Text = "No Dart Dragoon Mode changed to Addition."
  940. End If
  941. If (noDartDragoonMode = 2) Then
  942. writeAOB(&HB1E31C, "FF FF FF FF FF FF FF FF")
  943. writeAOB(&HB1E301, "FF FF FF FF FF FF FF FF")
  944. If (switchToCharacter = 1) Then
  945. If (noDartDLV >= 1) Then
  946. writeAOB(&HB1E31C, "05")
  947. writeAOB(&HB1E301, "05")
  948. End If
  949. If (noDartDLV >= 2) Then
  950. writeAOB(&HB1E31D, "07")
  951. writeAOB(&HB1E302, "07")
  952. End If
  953. If (noDartDLV >= 3) Then
  954. writeAOB(&HB1E31E, "06")
  955. writeAOB(&HB1E303, "06")
  956. End If
  957. If (noDartDLV >= 5) Then
  958. writeAOB(&HB1E31F, "08")
  959. writeAOB(&HB1E304, "08")
  960. End If
  961. ElseIf (switchToCharacter = 2) Then
  962. If (noDartDLV >= 1) Then
  963. writeAOB(&HB1E31C, "0B")
  964. writeAOB(&HB1E301, "0B")
  965. End If
  966. If (noDartDLV >= 2) Then
  967. writeAOB(&HB1E31D, "0A")
  968. writeAOB(&HB1E302, "0A")
  969. End If
  970. If (noDartDLV >= 3) Then
  971. writeAOB(&HB1E31E, "0C")
  972. writeAOB(&HB1E303, "0C")
  973. End If
  974. If (noDartDLV >= 5) Then
  975. writeAOB(&HB1E31F, "0D")
  976. writeAOB(&HB1E304, "0D")
  977. End If
  978. ElseIf (switchToCharacter = 3) Then
  979. If (noDartDLV >= 1) Then
  980. writeAOB(&HB1E31C, "0F")
  981. writeAOB(&HB1E301, "0F")
  982. End If
  983. If (noDartDLV >= 2) Then
  984. writeAOB(&HB1E31D, "10")
  985. writeAOB(&HB1E302, "10")
  986. End If
  987. If (noDartDLV >= 3) Then
  988. writeAOB(&HB1E31E, "12")
  989. writeAOB(&HB1E303, "12")
  990. End If
  991. If (noDartDLV >= 5) Then
  992. writeAOB(&HB1E31F, "13")
  993. writeAOB(&HB1E304, "13")
  994. End If
  995. ElseIf (switchToCharacter = 4) Then
  996. If (noDartDLV >= 1) Then
  997. writeAOB(&HB1E31C, "14")
  998. writeAOB(&HB1E301, "14")
  999. End If
  1000. If (noDartDLV >= 2) Then
  1001. writeAOB(&HB1E31D, "15")
  1002. writeAOB(&HB1E302, "15")
  1003. End If
  1004. If (noDartDLV >= 3) Then
  1005. writeAOB(&HB1E31E, "16")
  1006. writeAOB(&HB1E303, "16")
  1007. End If
  1008. If (noDartDLV >= 5) Then
  1009. writeAOB(&HB1E31F, "17")
  1010. writeAOB(&HB1E304, "17")
  1011. End If
  1012. ElseIf (switchToCharacter = 5) Then
  1013. If (noDartDLV >= 1) Then
  1014. writeAOB(&HB1E31C, "0E")
  1015. writeAOB(&HB1E301, "0E")
  1016. End If
  1017. If (noDartDLV >= 2) Then
  1018. writeAOB(&HB1E31D, "1A")
  1019. writeAOB(&HB1E302, "1A")
  1020. End If
  1021. If (noDartDLV >= 3) Then
  1022. writeAOB(&HB1E31E, "11")
  1023. writeAOB(&HB1E303, "11")
  1024. End If
  1025. If (noDartDLV >= 5) Then
  1026. writeAOB(&HB1E31F, "08")
  1027. writeAOB(&HB1E304, "08")
  1028. End If
  1029. ElseIf (switchToCharacter = 6) Then
  1030. If (noDartDLV >= 1) Then
  1031. writeAOB(&HB1E31C, "18")
  1032. writeAOB(&HB1E301, "18")
  1033. End If
  1034. If (noDartDLV >= 2) Then
  1035. writeAOB(&HB1E31D, "19")
  1036. writeAOB(&HB1E302, "19")
  1037. End If
  1038. If (noDartDLV >= 3) Then
  1039. writeAOB(&HB1E31E, "1B")
  1040. writeAOB(&HB1E303, "1B")
  1041. End If
  1042. If (noDartDLV >= 5) Then
  1043. writeAOB(&HB1E31F, "1C")
  1044. writeAOB(&HB1E304, "1C")
  1045. End If
  1046. ElseIf (switchToCharacter = 7) Then
  1047. If (noDartDLV >= 1) Then
  1048. writeAOB(&HB1E31C, "1D")
  1049. writeAOB(&HB1E301, "1D")
  1050. End If
  1051. If (noDartDLV >= 2) Then
  1052. writeAOB(&HB1E31D, "1E")
  1053. writeAOB(&HB1E302, "1E")
  1054. End If
  1055. If (noDartDLV >= 5) Then
  1056. writeAOB(&HB1E31D, "1E")
  1057. writeAOB(&HB1E303, "1E")
  1058. End If
  1059. End If
  1060. End If
  1061. SuccessfulHotkey()
  1062. End If
  1063. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement