HolywoodJack

TankFire 1.22

Nov 8th, 2016
141
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {$CLEO}
  2. 0000: TF_1_21
  3.  
  4. // Open this text with the Sanny Builder, make your own changes bellow then press the F6 button.
  5. // DO NOT TOUCH "ped" or "veh" constants!!!
  6.  
  7. REPEAT
  8. wait 250
  9. UNTIL 0256: player $PLAYER_CHAR defined
  10.  
  11. CONST
  12. ped = 25@
  13. veh = 31@
  14.  
  15. // ------> changes go here:
  16. PLAYER_TANK_FIRE_RATE = 1000 // integer 1000 = 1 second
  17. NPC_TANK_FIRE_RATE = 0 // integer 1000 = 1 second
  18.  
  19. CANNONBALL_SPEED = 120.0 // float (decimal)
  20. CANNONBALL_SMOKE_R = 1.0 // float (decimal)
  21. CANNONBALL_SMOKE_G = 0.0 // float (decimal)
  22. CANNONBALL_SMOKE_B = 0.0 // float (decimal)
  23. END
  24.  
  25. VAR
  26. ped: int
  27. veh: int
  28. PLAYER_TANK_FIRE_RATE: int
  29. NPC_TANK_FIRE_RATE: int
  30. CANNONBALL_SPEED: float
  31. CANNONBALL_SMOKE_R: float
  32. CANNONBALL_SMOKE_G: float
  33. CANNONBALL_SMOKE_B: float
  34. END
  35.  
  36. IF 0AA9: game_version_original
  37. THEN
  38. 27@ = 0x6AECE9 // NOP 6 ---> constFire
  39. 0A8C: write_memory 0x6AED10 size 2 value PLAYER_TANK_FIRE_RATE virtual_protect 1 // the interval between shots 800 ms
  40. 0A8C: write_memory 0x6AF0AC size 1 value 2 virtual_protect 1 // explo ID
  41. 0A8C: write_memory 0x871080 size 4 value 0.0 virtual_protect 1 // g_fTankPushingPower dd -0.1
  42. // distanceShot-------------------------------------------------------> // def flt_858B34 60.0f [XYZ]
  43. 0A8C: write_memory 0x6AEF42 size 4 value 0x858A48 virtual_protect 1 // *X flt_858A48 200.0
  44. 0A8C: write_memory 0x6AEF56 size 4 value 0x858A48 virtual_protect 1 // *Y flt_858A48 200.0
  45. 0A8C: write_memory 0x6AEF65 size 4 value 0x858A48 virtual_protect 1 // *Z flt_858A48 200.0
  46. ELSE
  47. 27@ = 0x6AF509 // NOP 6 ---> constFire
  48. 0A8C: write_memory 0x6AF530 size 2 value 150 virtual_protect 1 // the interval between shots 800 ms
  49. 0A8C: write_memory 0x6AF8CC size 1 value 2 virtual_protect 1 // explo ID
  50. 0A8C: write_memory 0x8720B8 size 4 value 0.0 virtual_protect 1 // g_fTankPushingPower dd -0.1
  51. // distanceShot-------------------------------------------------------> // def flt_859B34 60.0f [XYZ]
  52. 0A8C: write_memory 0x6AF762 size 4 value 0x859A48 virtual_protect 1 // *X flt_859A48 200.0
  53. 0A8C: write_memory 0x6AF776 size 4 value 0x859A48 virtual_protect 1 // *Y flt_859A48 200.0
  54. 0A8C: write_memory 0x6AF785 size 4 value 0x859A48 virtual_protect 1 // *Z flt_859A48 200.0
  55. END
  56.  
  57. REPEAT
  58. wait 0
  59. IF 00DD: actor $PLAYER_ACTOR driving_car_with_model #RHINO
  60. THEN
  61. gosub @setupPlayerTank
  62. END
  63. UNTIL 010F: player $PLAYER_CHAR wanted_level > 5
  64.  
  65. 0247: request_model 1582
  66. 038B: load_requested_models
  67. 32@ = 0
  68.  
  69. REPEAT
  70. wait 0
  71. IF 00DD: actor $PLAYER_ACTOR driving_car_with_model #RHINO
  72. THEN
  73. gosub @setupPlayerTank
  74. END
  75. UNTIL 32@ >= 2500
  76.  
  77. WHILE TRUE
  78. wait 0
  79. IF 0AA9: game_version_original
  80. THEN
  81. 23@ = 0xB74490
  82. 29@ = 0xB74494
  83. ELSE
  84. 23@ = 0xB76B10
  85. 29@ = 0xB76B14
  86. END
  87.  
  88. 0A8D: 23@ = read_memory 23@ size 4 virtual_protect 0
  89. 23@ += 0x4
  90. 0A8D: 23@ = read_memory 23@ size 4 virtual_protect 0
  91. FOR 24@ = 0 to 35584 step 0x100 // 8B00
  92. 0A8D: ped = read_memory 23@ size 1 virtual_protect 0
  93. 000A: 23@ += 0x1
  94. IF AND
  95. 0029: ped >= 0x00
  96. 001B: 0x80 > ped
  97. THEN
  98. 005A: ped += 24@
  99. IF AND
  100. 010F: player $PLAYER_CHAR wanted_level > 5
  101. 056D: actor ped defined
  102. THEN
  103. IF 8449: NOT actor ped in_a_car
  104. THEN
  105. 089F: get_actor ped pedtype_to 28@
  106. 0A96: 5@ = actor ped struct
  107. 000A: 5@ += 0x484
  108. 0006: 26@ = 0
  109. 0A8D: 26@ = read_memory 5@ size 1 virtual_protect 1
  110. IF AND
  111. 0184: actor ped health >= 97
  112. 8A32: NOT actor ped on_turret_of_car
  113. 8039: NOT 28@ == 0
  114. 8039: NOT 28@ == 6
  115. 0039: 26@ == 1
  116. THEN
  117. 00A0: store_actor $PLAYER_ACTOR position_to 8@ 9@ 10@
  118. 05DA: AS_actor ped run_away_in_panic_from 8@ 9@ 10@ away_radius 1000.0 timelimit -1
  119. 0223: set_actor ped health_to 95
  120. END
  121. ELSE
  122. 03C0: 18@ = actor ped car
  123. 089F: get_actor ped pedtype_to 28@
  124. 0A96: 5@ = actor ped struct
  125. 000A: 5@ += 0x484
  126. 0006: 26@ = 0
  127. 0A8D: 26@ = read_memory 5@ size 1 virtual_protect 1
  128. IF AND
  129. 8975: NOT car 18@ emergency_vehicle
  130. 0184: actor ped health >= 97
  131. 8A32: NOT actor ped on_turret_of_car
  132. 8039: NOT 28@ == 0
  133. 8039: NOT 28@ == 6
  134. 0039: 26@ == 1
  135. 0104: actor ped near_actor $PLAYER_ACTOR radius 40.0 40.0 40.0 sphere 0
  136. 02CA: car 18@ bounding_sphere_visible
  137. THEN
  138. 0633: AS_actor ped exit_car
  139. END
  140. END
  141.  
  142. IF AND
  143. 82F2: NOT actor ped model == #LAPD1
  144. 82F2: NOT actor ped model == #SFPD1
  145. 82F2: NOT actor ped model == #LVPD1
  146. 82F2: NOT actor ped model == #CSHER
  147. 82F2: NOT actor ped model == #DSHER
  148. 82F2: NOT actor ped model == #SWAT
  149. 82F2: NOT actor ped model == #FBI
  150. 82F2: NOT actor ped model == #ARMY
  151. THEN
  152. 03C0: 18@ = actor ped car
  153. 089F: get_actor ped pedtype_to 28@
  154. 0A96: 5@ = actor ped struct
  155. 000A: 5@ += 0x484
  156. 0006: 26@ = 0
  157. 0A8D: 26@ = read_memory 5@ size 1 virtual_protect 1
  158. IF AND
  159. 8A32: NOT actor ped on_turret_of_car
  160. 8039: NOT 28@ == 0
  161. 0039: 28@ == 6
  162. 8449: NOT actor ped in_a_car
  163. 0184: actor ped health >= 97
  164. THEN
  165. 060B: set_actor ped decision_maker_to 1
  166. 0223: set_actor ped health_to 95
  167. END
  168. END
  169. END
  170. END
  171. END
  172.  
  173. 0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
  174.  
  175. 29@ += 0x4
  176. 0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
  177. FOR 30@ = 0 to 27904 step 0x100
  178. 0A8D: veh = read_memory 29@ size 1 virtual_protect 0
  179.  
  180. 000A: 29@ += 0x1
  181. IF AND
  182. 0029: veh >= 0x00
  183. 001B: 0x80 > veh
  184. THEN
  185. 005A: veh += 30@
  186. IF 00DD: actor $PLAYER_ACTOR driving_car_with_model #RHINO
  187. THEN
  188. gosub @setupPlayerTank
  189. gosub @ExplosionEvant
  190. END
  191.  
  192. IF 010F: player $PLAYER_CHAR wanted_level > 5
  193. THEN
  194. IF AND
  195. 8449: NOT actor $PLAYER_ACTOR in_a_car
  196. 84AD: NOT actor $PLAYER_ACTOR in_water
  197. 0AB0: key_pressed 0x11
  198. 0AB0: key_pressed 0x53
  199. THEN
  200. 04D7: set_actor $PLAYER_ACTOR locked 1
  201. 05C4: AS_actor $PLAYER_ACTOR hands_up -1 ms
  202. 0A96: 5@ = actor $PLAYER_ACTOR struct
  203. 000A: 5@ += 0x530
  204. 0A8C: write_memory 5@ size 1 value 63 virtual_protect 1
  205. 0006: 32@ = 0
  206. REPEAT
  207. wait 0
  208. UNTIL 0029: 32@ >= 4500
  209. 04D7: set_actor $PLAYER_ACTOR locked 0
  210. 0687: clear_actor $PLAYER_ACTOR task
  211. END
  212.  
  213. IF 056E: car veh defined
  214. THEN
  215. IF 0137: car veh model == #RHINO
  216. THEN
  217.  
  218. 00AA: store_car veh position_to 8@ 9@ 10@
  219. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  220. 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 5@ 6@ and_XY 8@ 9@ store_to 6@
  221. 0174: 7@ = car veh Z_angle
  222. 0063: 6@ -= 7@
  223. 0017: 6@ /= 57.295779513082320876798154814105 // rad
  224. 0A97: 5@ = car veh struct
  225. 000A: 5@ += 0x94C // HA
  226. 0A8C: write_memory 5@ size 4 value 6@ virtual_protect 1
  227.  
  228. IF OR
  229. 031E: car veh hit_by_weapon 16
  230. 031E: car veh hit_by_weapon 19
  231. 031E: car veh hit_by_weapon 35
  232. 031E: car veh hit_by_weapon 36
  233. 031E: car veh hit_by_weapon 40
  234. THEN
  235. 046C: 4@ = car veh driver
  236. IF 056D: actor 4@ defined
  237. THEN
  238. 009B: destroy_actor 4@
  239. 020B: explode_car veh
  240. ELSE
  241. 020B: explode_car veh
  242. END
  243. END
  244.  
  245. 046C: 4@ = car veh driver
  246. IF AND
  247. 8119: NOT car veh wrecked
  248. 80DB: NOT actor $PLAYER_ACTOR in_car veh
  249. 81F3: NOT car veh in_air
  250. 056D: actor 4@ defined
  251. 010F: player $PLAYER_CHAR wanted_level > 5
  252. 0256: player $PLAYER_CHAR defined
  253. THEN
  254.  
  255. IF 04AD: actor 4@ in_water
  256. THEN
  257. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  258. 07E1: AS_actor 4@ swim_to 5@ 6@ 7@
  259. END
  260.  
  261. IF AND
  262. 02F2: actor 4@ model == #ARMY
  263. 00DF: actor 4@ driving
  264. 010F: player $PLAYER_CHAR wanted_level > 5
  265. THEN
  266.  
  267. IF 8491: NOT actor 4@ has_weapon 16
  268. THEN
  269. 054A: set_actor 4@ can_be_shot_in_a_car 1
  270. 04D8: set_actor 4@ drowns_in_water 0
  271. 048F: actor 4@ remove_weapons
  272. 01B2: give_actor 4@ weapon 45 ammo 9999
  273. 01B2: give_actor 4@ weapon 16 ammo 9999
  274. 01B2: give_actor 4@ weapon 31 ammo 9999
  275. END
  276.  
  277. IF 03CA: object 13@ exists
  278. THEN
  279. IF AND
  280. 0137: car veh model == #RHINO
  281. 8119: NOT car veh wrecked
  282. THEN
  283. IF AND
  284. 010F: player $PLAYER_CHAR wanted_level > 6
  285. 0897: car veh collided_with_object 13@
  286. THEN
  287. IF 056D: actor 4@ defined
  288. THEN
  289. 009B: destroy_actor 4@
  290. 020B: explode_car veh
  291. ELSE
  292. 020B: explode_car veh
  293. END
  294. END
  295. END
  296. END
  297.  
  298. 03C0: 18@ = actor $PLAYER_ACTOR car
  299. IF AND
  300. 056E: car 18@ defined
  301. 03CA: object 13@ exists
  302. THEN
  303. IF 0449: actor $PLAYER_ACTOR in_a_car
  304. THEN
  305. IF AND
  306. 010F: player $PLAYER_CHAR wanted_level > 6
  307. 00DD: actor $PLAYER_ACTOR driving_car_with_model #RHINO
  308. 0897: car 18@ collided_with_object 13@
  309. THEN
  310. 000A: 19@ += 1
  311. IF 0029: 19@ >= 50
  312. THEN
  313. 0224: set_car 18@ health_to 100
  314. 0006: 19@ = 0
  315. END
  316. END
  317. END
  318. END
  319.  
  320. 02AA: set_car veh immune_to_nonplayer 1
  321. 00AA: store_car veh position_to 8@ 9@ 10@
  322. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  323. 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 5@ 6@ and_XY 8@ 9@ store_to 6@
  324. 0174: 7@ = car veh Z_angle
  325. 0063: 6@ -= 7@
  326. 0017: 6@ /= 57.295779513082320876798154814105 // rad
  327. 0A97: 5@ = car veh struct
  328. 000A: 5@ += 0x94C // HA
  329. 0A8C: write_memory 5@ size 4 value 6@ virtual_protect 1
  330.  
  331. 00AA: store_car veh position_to 8@ 9@ 10@
  332. 00A0: store_actor $PLAYER_ACTOR position_to 6@ 7@ 12@
  333. 0509: 11@ = distance_between_XY 6@ 7@ and_XY 8@ 9@
  334. IF AND
  335. 0031: 11@ >= 10.0
  336. 0025: 12@ > 10@
  337. THEN
  338. 0A97: 5@ = car veh struct
  339. 000A: 5@ += 0x950 // VA
  340. 0006: 26@ = 0
  341. 0A8D: 26@ = read_memory 5@ size 4 virtual_protect 1
  342. IF 0021: 26@ > 1.221730476396031
  343. THEN
  344. gosub @getVerticalAngle
  345. 0A97: 5@ = car veh struct
  346. 000A: 5@ += 0x950 // VA
  347. 0A8C: write_memory 5@ size 4 value 1.221730476396031 virtual_protect 1
  348. ELSE
  349. gosub @getVerticalAngle
  350. 0A97: 5@ = car veh struct
  351. 000A: 5@ += 0x950 // VA
  352. 0A8C: write_memory 5@ size 4 value 8@ virtual_protect 1
  353. END
  354. END
  355.  
  356. 00AA: store_car veh position_to 8@ 9@ 10@
  357. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  358. IF 06BD: no_obstacles_between 5@ 6@ 7@ and 8@ 9@ 10@ solid 1 car 0 actor 0 object 0 particle 0
  359. THEN
  360. IF OR
  361. 02CA: car veh bounding_sphere_visible
  362. 0205: actor $PLAYER_ACTOR near_car veh radius 500.0 500.0 500.0 flag 0
  363. THEN
  364. 00AA: store_car veh position_to 8@ 9@ 10@
  365. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  366. 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 5@ 6@ and_XY 8@ 9@ store_to 6@
  367.  
  368. 02F6: 15@ = cos 6@
  369. 02F7: 16@ = sin 6@
  370. 0013: 15@ *= CANNONBALL_SPEED
  371. 0013: 16@ *= CANNONBALL_SPEED
  372. 0013: 15@ *= -1.0
  373.  
  374. gosub @getVerticalAngle
  375. 00AA: store_car veh position_to 9@ 9@ 10@
  376. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  377. IF 0025: 7@ > 10@
  378. THEN
  379. 0013: 8@ *= CANNONBALL_SPEED
  380. 0087: 17@ = 8@
  381. ELSE
  382. 0013: 8@ *= CANNONBALL_SPEED
  383. 8@ *= -1.0
  384. 0087: 17@ = 8@
  385. END
  386. END
  387.  
  388. IF 03CA: object 13@ exists
  389. THEN
  390. 05C0: AS_actor $PLAYER_ACTOR look_at_car veh 1000 ms
  391.  
  392. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  393. IF AND
  394. 04E6: object 13@ near_point 5@ 6@ 7@ radius 1.0 1.0 1.0 flag 0
  395. 8449: NOT actor $PLAYER_ACTOR in_a_car
  396. THEN
  397. ////////////////////////////////////////
  398. END
  399.  
  400. IF AND
  401. 0205: actor $PLAYER_ACTOR near_car veh radius 500.0 500.0 500.0 flag 0
  402. 32@ >= NPC_TANK_FIRE_RATE
  403. THEN
  404. 0392: make_object 13@ moveable 1
  405. 0381: throw_object 13@ velocity_in_direction 15@ 16@ 17@
  406.  
  407. 00AA: store_car veh position_to 8@ 9@ 10@
  408. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  409. 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 5@ 6@ and_XY 8@ 9@ store_to 6@
  410. // 0453: set_object 13@ XY_rotation 0.0 0.0 angle 6@
  411. 0174: 7@ = car veh Z_angle
  412. 0063: 6@ -= 7@
  413. 02F6: 15@ = sine 6@
  414. 02F7: 16@ = cosine 6@
  415. 0013: 15@ *= 7.0
  416. 0013: 16@ *= 7.0
  417. 0013: 15@ *= -1.0
  418.  
  419. 00AA: store_car veh position_to 8@ 9@ 10@
  420. IF 84E5: NOT object 13@ near_point 8@ 9@ radius 10.0 10.0 sphere 0
  421. THEN
  422. 01BB: store_object 13@ position_to 5@ 6@ 7@
  423. 095C: create_smoke_at 5@ 6@ 7@ velocity 0.0 0.0 0.0 RGBA CANNONBALL_SMOKE_R CANNONBALL_SMOKE_G CANNONBALL_SMOKE_B 1.0 size 0.5 last_factor 0.075
  424. END
  425.  
  426. IF OR
  427. 0019: 32@ > 2000
  428. 04DA: object 13@ collided
  429. THEN
  430. 00AA: store_car veh position_to 8@ 9@ 10@
  431. IF 04E6: object 13@ near_point 8@ 9@ 10@ radius 20.0 20.0 20.0 flag 0
  432. THEN
  433. 0108: destroy_object 13@
  434. 32@ = 0
  435. ELSE
  436. IF 0205: actor $PLAYER_ACTOR near_car veh radius 10.0 10.0 10.0 flag 0
  437. THEN
  438. IF 0019: 33@ > 0
  439. THEN
  440. 01BB: store_object 13@ position_to 5@ 6@ 7@
  441. 0948: create_explosion_at 5@ 6@ 7@ type 3 camera_shake 0.5
  442. 08EB: create_sparks_at 5@ 6@ 7@ velocity_direction 10.0 10.0 10.0 density 60
  443. 0108: destroy_object 13@
  444. 32@ = 0
  445. 33@ = 0
  446. END
  447. ELSE
  448. 01BB: store_object 13@ position_to 5@ 6@ 7@
  449. 0948: create_explosion_at 5@ 6@ 7@ type 3 camera_shake 0.5
  450. 08EB: create_sparks_at 5@ 6@ 7@ velocity_direction 10.0 10.0 10.0 density 60
  451. 0108: destroy_object 13@
  452. 32@ = 0
  453. 33@ = 0
  454. END
  455. END
  456. END
  457. END
  458. ELSE
  459.  
  460. 00AA: store_car veh position_to 8@ 9@ 10@
  461. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  462. 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 5@ 6@ and_XY 8@ 9@ store_to 6@
  463. 0174: 7@ = car veh Z_angle
  464. 0063: 6@ -= 7@
  465. 02F6: 15@ = sine 6@
  466. 02F7: 16@ = cosine 6@
  467. 0013: 15@ *= 7.0
  468. 0013: 16@ *= 7.0
  469. 0013: 15@ *= -1.0
  470.  
  471. 0407: store_coords_to 8@ 9@ 10@ from_car veh with_offset 15@ 16@ 1.2
  472. 0107: 13@ = create_object 1582 at 8@ 9@ 10@
  473. 050E: set_object 13@ no_collision_with_car veh
  474. 0177: set_object 13@ Z_angle_to 6@
  475.  
  476. 0750: set_object 13@ visibility 0
  477. 04D9: object 13@ set_scripted_collision_check 1
  478. 0382: set_object 13@ collision_detection 0
  479. 0723: break_object 13@ intensity 0
  480.  
  481. 01BB: store_object 13@ position_to 8@ 9@ 10@
  482. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  483. 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 5@ 6@ and_XY 8@ 9@ store_to 11@
  484. 02F6: 20@ = cos 11@ // (float)
  485. 02F7: 21@ = sin 11@ // (float)
  486. 0013: 20@ *= 27.0
  487. 0013: 21@ *= 27.0
  488. 0013: 20@ *= -1.0
  489. gosub @getVerticalAngle
  490. 0087: 22@ = 8@
  491. 00AA: store_car veh position_to 8@ 9@ 10@
  492. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  493. IF 0025: 10@ > 7@
  494. THEN
  495. 0013: 22@ *= CANNONBALL_SPEED
  496. 22@ *= 1.0
  497. ELSE
  498. 0013: 22@ *= CANNONBALL_SPEED
  499. END
  500.  
  501. 0400: store_coords_to 5@ 6@ 7@ from_object 13@ with_offset 20@ 21@ 22@
  502. 01BB: store_object 13@ position_to 8@ 9@ 10@
  503. IF 8202: NOT actor $PLAYER_ACTOR near_car veh radius 9.0 9.0 sphere 0
  504. THEN
  505. IF 0AA9: game_version_original
  506. THEN
  507. 0AA5: call 0x4A0FA0 num_params 2 pop 0 20@v 8@v // TriggerTankFire
  508. ELSE
  509. 0AA5: call 0x4A1020 num_params 2 pop 0 20@v 8@v // TriggerTankFire
  510. END
  511. END
  512. 0108: destroy_object 13@
  513. 32@ = 0
  514.  
  515. 00AA: store_car veh position_to 8@ 9@ 10@
  516. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  517. 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 5@ 6@ and_XY 8@ 9@ store_to 6@
  518. 0174: 7@ = car veh Z_angle
  519. 0063: 6@ -= 7@
  520. 02F6: 15@ = sine 6@
  521. 02F7: 16@ = cosine 6@
  522. 0013: 15@ *= 7.0
  523. 0013: 16@ *= 7.0
  524. 0013: 15@ *= -1.0
  525.  
  526. gosub @getVerticalAngle
  527. 00AA: store_car veh position_to 9@ 9@ 10@
  528. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  529. IF 0025: 7@ > 10@
  530. THEN
  531. 0013: 8@ *= 1.0
  532. 0087: 17@ = 8@
  533. ELSE
  534. 0013: 8@ *= 1.0
  535. 0087: 17@ = 8@
  536. END
  537. 0407: store_coords_to 8@ 9@ 10@ from_car veh with_offset 15@ 16@ 1.5
  538. 0107: 13@ = create_object 1582 at 8@ 9@ 10@
  539. 050E: set_object 13@ no_collision_with_car veh
  540. 0177: set_object 13@ Z_angle_to 6@
  541.  
  542. 0750: set_object 13@ visibility 0
  543. 04D9: object 13@ set_scripted_collision_check 1
  544. 0382: set_object 13@ collision_detection 1
  545. 0906: set_object 13@ mass_to 200.0
  546. 0908: set_object 13@ turn_mass_to 200.0
  547. 0006: 32@ = 0
  548. END
  549. END
  550. END
  551. END
  552. END
  553. END
  554. END
  555. END
  556. END
  557. END
  558.  
  559. :getAngleBetweenPoints
  560. 0063: 0@ -= 2@
  561. 0063: 1@ -= 3@
  562. 0604: get_Z_angle_for_point 0@ 1@ store_to 6@
  563. 0AB2: ret 1 6@
  564.  
  565. :getVerticalAngle
  566. 0407: store_coords_to 8@ 9@ 10@ from_car veh with_offset 0.0 0.0 0.0
  567. 00A0: store_actor $PLAYER_ACTOR position_to 5@ 6@ 7@
  568. 0063: 7@ -= 10@
  569. 0097: make 7@ absolute_float // a
  570. 050A: 11@ = distance_between_XYZ 8@ 9@ 10@ and_XYZ 5@ 6@ 7@ // c
  571. 0073: 7@ /= 11@ // SIN_VA
  572.  
  573. 0087: 8@ = 7@ // X
  574. 0087: 9@ = 7@ // X
  575. 0087: 5@ = 7@ // X
  576. 0087: 6@ = 7@ // X
  577. 0087: 7@ = 7@ // X
  578.  
  579. 006B: 9@ *= 7@ // X^2
  580. 006B: 9@ *= 7@ // X^3
  581. 006B: 5@ *= 7@ // X^4
  582. 006B: 5@ *= 7@ // X^5
  583. 006B: 6@ *= 7@ // X^6
  584. 006B: 6@ *= 7@ // X^7
  585. 006B: 7@ *= 7@ // X^8
  586. 006B: 7@ *= 7@ // X^9
  587.  
  588. 0017: 9@ /= 6.0 // X^3/6
  589.  
  590. 0013: 5@ *= 3.0
  591. 0017: 5@ /= 40.0 // 3X^5/40
  592.  
  593. 0013: 6@ *= 5.0
  594. 0017: 6@ /= 112.0 // 5X^7/112
  595.  
  596. 0013: 7@ *= 35.0
  597. 0017: 7@ /= 1152.0 // 35X^9/1152
  598.  
  599. 005B: 8@ += 9@
  600. 0087: 12@ = 8@
  601. 005B: 8@ += 5@
  602.  
  603. 005B: 8@ += 12@
  604. 0017: 8@ /= 2.0 // ARC SIN(SIN_VA)= VA
  605. return
  606.  
  607. :setupPlayerTank
  608. 26@ = 0
  609. IF 0AA9: game_version_original
  610. THEN
  611. 0A8D: 26@ = read_memory 0xB73405 size 1 virtual_protect 1 // RMB
  612. ELSE
  613. 0A8D: 26@ = read_memory 0xB75A85 size 1 virtual_protect 1 // RMB
  614. END
  615.  
  616. IF 26@ <> 0
  617. THEN
  618. 26@ = 0
  619. 0A8D: 26@ = read_memory 27@ size 4 virtual_protect 1 // RMB
  620. IF 26@ <> 0x90909090
  621. THEN
  622. 0A8C: write_memory 27@ size 4 value 0x90909090 virtual_protect 1
  623. 27@ += 4
  624. 0A8C: write_memory 27@ size 2 value 0x9090 virtual_protect 1
  625. 27@ += -4
  626. END
  627. ELSE
  628. 26@ = 0
  629. 0A8D: 26@ = read_memory 27@ size 4 virtual_protect 1 // RMB
  630. IF 26@ == 0x90909090
  631. THEN
  632. 0A8C: write_memory 27@ size 4 value 0x040B840F virtual_protect 1
  633. 27@ += 4
  634. 0A8C: write_memory 27@ size 2 value 0x0000 virtual_protect 1
  635. 27@ += -4
  636. END
  637. END
  638.  
  639. 03C0: 18@ = actor $PLAYER_ACTOR car
  640. 00AA: store_car 18@ position_to 5@ 6@ 7@
  641. 068E: get_camera_target_point_to 8@ 9@ 10@
  642. 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 5@ 6@ and_XY 8@ 9@ store_to 6@
  643. 0174: 7@ = car 18@ Z_angle
  644. 0063: 6@ -= 7@
  645. 0017: 6@ /= 57.295779513082320876798154814105 // rad
  646. 0A97: 5@ = car 18@ struct
  647. 000A: 5@ += 0x94C // HA
  648. 0A8C: write_memory 5@ size 4 value 6@ virtual_protect 1
  649. return
  650.  
  651. :ExplosionEvant
  652. 00AA: store_car veh position_to 8@ 9@ 10@
  653. 000F: 8@ -= 7.0
  654. 000F: 9@ -= 7.0
  655. 000F: 10@ -= 7.0
  656. 00AA: store_car veh position_to 5@ 6@ 7@
  657. 000F: 5@ -= -7.0
  658. 000F: 6@ -= -7.0
  659. 000F: 7@ -= -7.0
  660. IF 8119: NOT car veh wrecked
  661. THEN
  662. IF AND
  663. 8356: NOT explosion_type 3 in_cube_cornerA 8@ 9@ 10@ cornerB 5@ 6@ 7@
  664. 0356: explosion_type -1 in_cube_cornerA 8@ 9@ 10@ cornerB 5@ 6@ 7@
  665. 80DB: NOT actor $PLAYER_ACTOR in_car veh
  666. THEN
  667. 020B: explode_car veh
  668. END
  669. END
  670. return
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×