Advertisement
Ramaraunt1

Untitled

Mar 17th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.27 KB | None | 0 0
  1. #-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  2. #-#-#-#Hunting Mod begin#-#-#-#
  3. #-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  4.  
  5. (
  6. "deer_hunting",mtf_battle_mode,-1,
  7. "You lead your deers to battle.",
  8. [
  9. (1,mtef_team_0|mtef_leader_only,0,aif_start_alarmed,12,[]),
  10. (4,mtef_visitor_source,0,aif_start_alarmed,0,[]),
  11. ],
  12. [
  13. (ti_tab_pressed, 0, 0, [
  14. (set_trigger_result,1)], []), #leaving area
  15. (0, 0, ti_once, [ #spawing deers
  16. (party_count_members_of_type,":num_deers","$g_encountered_party","trp_deer"),
  17. (val_sub,":num_deers",1),
  18. (ge,":num_deers",0),
  19. (assign,"$num_deers_killed",0),
  20. (get_scene_boundaries, pos10,pos11),
  21. (position_get_x, ":scene_min_x", pos10),
  22. (position_get_x, ":scene_max_x", pos11),
  23. (position_get_y, ":scene_min_y", pos10),
  24. (position_get_y, ":scene_max_y", pos11),
  25. (store_div,":border_x",":scene_max_x",10),
  26. (val_add,":scene_min_x",":border_x"),
  27. (val_sub,":scene_max_x",":border_x"),
  28. (store_div,":border_y",":scene_max_y",10),
  29. (val_add,":scene_min_y",":border_y"),
  30. (val_sub,":scene_max_y",":border_y"),
  31. (store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
  32. (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
  33. (init_position, pos1),
  34. (position_set_x,pos1,":x_pos"),
  35. (position_set_y,pos1,":y_pos"),
  36. (position_set_z,pos1,10000),
  37. (position_set_z_to_ground_level,pos1),
  38. (set_spawn_position, pos1),
  39. (spawn_horse, "itm_deer"),
  40. (assign,"$leading_deer",reg0),
  41. (try_for_range,":unused",0,":num_deers"),
  42. (init_position, pos1),
  43. (store_random_in_range,":x_pos_add",0,1000),
  44. (store_random_in_range,":y_pos_add",0,1000),
  45. (val_add,":x_pos_add",":x_pos"),
  46. (val_add,":y_pos_add",":y_pos"),
  47. (position_set_x,pos1,":x_pos_add"),
  48. (position_set_y,pos1,":y_pos_add"),
  49. (position_set_z,pos1,10000),
  50. (position_set_z_to_ground_level,pos1),
  51. (set_spawn_position, pos1),
  52. (spawn_horse, "itm_deer"),
  53. (try_end),
  54. ], []),
  55. (1,0,0,[], #wounded deers move slower
  56. [(try_for_agents,reg(1)),
  57. (agent_get_item_id,reg(2),reg(1)),
  58. (eq,reg(2),"itm_deer"),
  59. (store_agent_hit_points,reg(2),reg(1)),
  60. (store_mul,reg(3),20,reg(2)),
  61. (val_div,reg(3),40),
  62. (agent_set_speed_limit,reg(1),reg(3)),
  63. (try_end),
  64. ]),
  65. (5,0,0,
  66. [
  67. (neg|agent_is_alive,"$leading_deer"),
  68. ],
  69. [
  70. (try_for_agents,reg(1)),
  71. (agent_get_item_id,reg(2),reg(1)),
  72. (eq,reg(2),"itm_deer"),
  73. (assign,"$leading_deer",reg(1)),
  74. (try_end),
  75. ]),
  76. (1,0,0,[],
  77. [
  78. (assign,":num_kills",0),
  79. (try_for_agents,reg(1)),
  80. (agent_get_item_id,reg(2),reg(1)),
  81. (eq,reg(2),"itm_deer"),
  82. (store_agent_hit_points,reg(2),reg(1)),
  83. (eq,reg(2),0),
  84. (val_add,":num_kills",1),
  85. (try_end),
  86. (gt,":num_kills","$num_deers_killed"),
  87. (get_scene_boundaries, pos10,pos11),
  88. (position_get_x, ":scene_min_x", pos10),
  89. (position_get_x, ":scene_max_x", pos11),
  90. (position_get_y, ":scene_min_y", pos10),
  91. (position_get_y, ":scene_max_y", pos11),
  92. (store_div,":border_x",":scene_max_x",10),
  93. (val_add,":scene_min_x",":border_x"),
  94. (val_sub,":scene_max_x",":border_x"),
  95. (store_div,":border_y",":scene_max_y",10),
  96. (val_add,":scene_min_y",":border_y"),
  97. (val_sub,":scene_max_y",":border_y"),
  98. (store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
  99. (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
  100. (init_position, pos1),
  101. (position_set_x,pos1,":x_pos"),
  102. (position_set_y,pos1,":y_pos"),
  103. (position_set_z,pos1,10000),
  104. (position_set_z_to_ground_level,pos1),
  105. (agent_set_scripted_destination,"$leading_deer",pos1),
  106. (assign,"$num_deers_killed",":num_kills"),
  107. ]),
  108. (5,0,0,[],
  109. [
  110. (agent_get_position,pos1,"$leading_deer"),
  111. (position_get_x,":x_pos",pos1),
  112. (position_get_y,":y_pos",pos1),
  113. (this_or_next|le,":x_pos",5000),
  114. (this_or_next|le,":y_pos",5000),
  115. (this_or_next|ge,":x_pos",38000),
  116. (ge,":y_pos",38000),
  117. (get_scene_boundaries, pos10,pos11),
  118. (position_get_x, ":scene_min_x", pos10),
  119. (position_get_x, ":scene_max_x", pos11),
  120. (position_get_y, ":scene_min_y", pos10),
  121. (position_get_y, ":scene_max_y", pos11),
  122. (store_div,":border_x",":scene_max_x",10),
  123. (val_add,":scene_min_x",":border_x"),
  124. (val_sub,":scene_max_x",":border_x"),
  125. (store_div,":border_y",":scene_max_y",10),
  126. (val_add,":scene_min_y",":border_y"),
  127. (val_sub,":scene_max_y",":border_y"),
  128. (store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
  129. (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
  130. (init_position, pos1),
  131. (position_set_x,pos1,":x_pos"),
  132. (position_set_y,pos1,":y_pos"),
  133. (position_set_z,pos1,10000),
  134. (position_set_z_to_ground_level,pos1),
  135. (agent_set_scripted_destination,"$leading_deer",pos1),
  136. ]),
  137. (1,0,0,[],
  138. [
  139. (try_for_agents,reg(1)),
  140. (agent_get_item_id,reg(2),reg(1)),
  141. (eq,reg(2),"itm_deer"),
  142. (store_agent_hit_points,":health",reg(1)),
  143. (store_sub,":damage",100,":health"),
  144. (agent_get_slot,":prev_damage",reg(1),1),
  145. (neq,":prev_damage",":damage"),
  146. (agent_set_slot,reg(1),1,":damage"),
  147. (agent_get_position,pos1,reg(1)),
  148. (position_get_x,":x_pos",pos1),
  149. (position_get_y,":y_pos",pos1),
  150. (store_random_in_range,":x_pos_add",0,1000),
  151. (store_random_in_range,":y_pos_add",0,1000),
  152. (val_add,":x_pos",":x_pos_add"),
  153. (val_add,":y_pos",":y_pos_add"),
  154. (position_set_x,pos1,":x_pos"),
  155. (position_set_y,pos1,":y_pos"),
  156. (agent_set_scripted_destination,reg(1),pos1),
  157. (try_end),
  158. ]),
  159. (0.5,0,0, #deer travelling
  160. [],
  161. [
  162. (get_player_agent_no,reg(1)),
  163. (agent_get_position,pos1,reg(1)),
  164. (agent_get_position,pos4,"$leading_deer"),
  165. (position_get_x,":x_pos",pos4),
  166. (position_get_y,":y_pos",pos4),
  167. (try_for_agents,reg(1)),
  168. (agent_get_item_id,reg(2),reg(1)),
  169. (eq,reg(2),"itm_deer"),
  170. (agent_get_position,pos2,reg(1)),
  171. (get_distance_between_positions,reg(3),pos1,pos2),
  172. (try_begin),
  173. (position_get_x,":pos_x",pos2),
  174. (position_get_x,":pos_y",pos2),
  175. (position_get_x, ":scene_min_x", pos10),
  176. (position_get_x, ":scene_max_x", pos11),
  177. (position_get_y, ":scene_min_y", pos10),
  178. (position_get_y, ":scene_max_y", pos11),
  179. (store_div,":border_x",":scene_max_x",10),
  180. (val_add,":scene_min_x",":border_x"),
  181. (val_sub,":scene_max_x",":border_x"),
  182. (store_div,":border_y",":scene_max_y",10),
  183. (val_add,":scene_min_y",":border_y"),
  184. (val_sub,":scene_max_y",":border_y"),
  185. (this_or_next|gt,":pos_x",":scene_max_x"),
  186. (this_or_next|lt,":pos_x",":scene_min_x"),
  187. (this_or_next|gt,":pos_y",":scene_max_y"),
  188. (lt,":pos_y",":scene_min_y"),
  189. (store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
  190. (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
  191. (init_position, pos1),
  192. (position_set_x,pos1,":x_pos"),
  193. (position_set_y,pos1,":y_pos"),
  194. (position_set_z,pos1,10000),
  195. (position_set_z_to_ground_level,pos1),
  196. (agent_set_scripted_destination,reg(1),pos1),
  197. (else_try),
  198. (le,reg(3),2500),
  199. (position_get_x,reg(4),pos1),
  200. (position_get_x,reg(5),pos2),
  201. (store_sub,":x_dist",reg(5),reg(4)),
  202. (val_mul,":x_dist",10),
  203. (position_get_y,reg(6),pos1),
  204. (position_get_y,reg(7),pos2),
  205. (store_sub,":y_dist",reg(7),reg(6)),
  206. (val_mul,":y_dist",10),
  207. (init_position,pos3),
  208. (val_add,":x_dist",reg(5)),
  209. (val_add,":y_dist",reg(7)),
  210. (position_set_x,pos3,":x_dist"),
  211. (position_set_y,pos3,":y_dist"),
  212. (position_set_z,pos3,10000),
  213. (position_set_z_to_ground_level,pos3),
  214. (agent_set_scripted_destination,reg(1),pos3),
  215. (else_try),
  216. (get_distance_between_positions,reg(3),pos4,pos2),
  217. (ge,reg(3),2000),
  218. (init_position, pos6),
  219. (store_random_in_range,":x_pos_add",0,1000),
  220. (store_random_in_range,":y_pos_add",0,1000),
  221. (val_add,":x_pos_add",":x_pos"),
  222. (val_add,":y_pos_add",":y_pos"),
  223. (position_set_x,pos6,":x_pos_add"),
  224. (position_set_y,pos6,":y_pos_add"),
  225. (position_set_z,pos6,10000),
  226. (position_set_z_to_ground_level,pos6),
  227. (agent_set_scripted_destination,reg(1),pos6),
  228. (try_end),
  229. (try_end),
  230. ]),
  231. ]),
  232.  
  233.  
  234. (
  235. "boar_hunting",mtf_battle_mode,-1,
  236. "You lead your boars to battle.",
  237. [
  238. (1,mtef_team_0|mtef_leader_only,0,aif_start_alarmed,12,[]),
  239. (4,mtef_visitor_source,0,aif_start_alarmed,0,[]),
  240. ],
  241. [
  242. (ti_tab_pressed, 0, 0, [ (set_trigger_result,1)], []), #leaving area
  243. (0, 0, ti_once, [ #spawing boars
  244. (party_count_members_of_type,":num_boars","$g_encountered_party","trp_boar"),
  245. (val_sub,":num_boars",1),
  246. (ge,":num_boars",0),
  247. (assign,"$num_boars_killed",0),
  248. (get_scene_boundaries, pos10,pos11),
  249. (position_get_x, ":scene_min_x", pos10),
  250. (position_get_x, ":scene_max_x", pos11),
  251. (position_get_y, ":scene_min_y", pos10),
  252. (position_get_y, ":scene_max_y", pos11),
  253. (store_div,":border_x",":scene_max_x",10),
  254. (val_add,":scene_min_x",":border_x"),
  255. (val_sub,":scene_max_x",":border_x"),
  256. (store_div,":border_y",":scene_max_y",10),
  257. (val_add,":scene_min_y",":border_y"),
  258. (val_sub,":scene_max_y",":border_y"),
  259. (store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
  260. (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
  261. (init_position, pos1),
  262. (position_set_x,pos1,":x_pos"),
  263. (position_set_y,pos1,":y_pos"),
  264. (position_set_z,pos1,10000),
  265. (position_set_z_to_ground_level,pos1),
  266. (set_spawn_position, pos1),
  267. (spawn_horse, "itm_boar"),
  268. (assign,"$leading_boar",reg0),
  269. (try_for_range,":unused",0,":num_boars"),
  270. (init_position, pos1),
  271. (store_random_in_range,":x_pos_add",0,1000),
  272. (store_random_in_range,":y_pos_add",0,1000),
  273. (val_add,":x_pos_add",":x_pos"),
  274. (val_add,":y_pos_add",":y_pos"),
  275. (position_set_x,pos1,":x_pos_add"),
  276. (position_set_y,pos1,":y_pos_add"),
  277. (position_set_z,pos1,10000),
  278. (position_set_z_to_ground_level,pos1),
  279. (set_spawn_position, pos1),
  280. (spawn_horse, "itm_boar"),
  281. (try_end),
  282. ], []),
  283. (1,0,0,[], #wounded boars move slower
  284. [(try_for_agents,reg(1)),
  285. (agent_get_item_id,reg(2),reg(1)),
  286. (eq,reg(2),"itm_boar"),
  287. (store_agent_hit_points,reg(2),reg(1)),
  288. (store_mul,reg(3),20,reg(2)),
  289. (val_div,reg(3),100),
  290. (agent_set_speed_limit,reg(1),reg(3)),
  291. (try_end),
  292. ]),
  293. (5,0,0,
  294. [
  295. (neg|agent_is_alive,"$leading_boar"),
  296. ],
  297. [
  298. (try_for_agents,reg(1)),
  299. (agent_get_item_id,reg(2),reg(1)),
  300. (eq,reg(2),"itm_boar"),
  301. (assign,"$leading_boar",reg(1)),
  302. (try_end),
  303. ]),
  304. (1,0,0,[],
  305. [
  306. (assign,":num_kills",0),
  307. (try_for_agents,reg(1)),
  308. (agent_get_item_id,reg(2),reg(1)),
  309. (eq,reg(2),"itm_boar"),
  310. (store_agent_hit_points,reg(2),reg(1)),
  311. (eq,reg(2),0),
  312. (val_add,":num_kills",1),
  313. (try_end),
  314. (gt,":num_kills","$num_boars_killed"),
  315. (get_scene_boundaries, pos10,pos11),
  316. (position_get_x, ":scene_min_x", pos10),
  317. (position_get_x, ":scene_max_x", pos11),
  318. (position_get_y, ":scene_min_y", pos10),
  319. (position_get_y, ":scene_max_y", pos11),
  320. (store_div,":border_x",":scene_max_x",10),
  321. (val_add,":scene_min_x",":border_x"),
  322. (val_sub,":scene_max_x",":border_x"),
  323. (store_div,":border_y",":scene_max_y",10),
  324. (val_add,":scene_min_y",":border_y"),
  325. (val_sub,":scene_max_y",":border_y"),
  326. (store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
  327. (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
  328. (init_position, pos1),
  329. (position_set_x,pos1,":x_pos"),
  330. (position_set_y,pos1,":y_pos"),
  331. (position_set_z,pos1,10000),
  332. (position_set_z_to_ground_level,pos1),
  333. (agent_set_scripted_destination,"$leading_boar",pos1),
  334. (assign,"$num_boars_killed",":num_kills"),
  335. ]),
  336. (5,0,0,[],
  337. [
  338. (agent_get_position,pos1,"$leading_boar"),
  339. (position_get_x,":x_pos",pos1),
  340. (position_get_y,":y_pos",pos1),
  341. (this_or_next|le,":x_pos",5000),
  342. (this_or_next|le,":y_pos",5000),
  343. (this_or_next|ge,":x_pos",38000),
  344. (ge,":y_pos",38000),
  345. (get_scene_boundaries, pos10,pos11),
  346. (position_get_x, ":scene_min_x", pos10),
  347. (position_get_x, ":scene_max_x", pos11),
  348. (position_get_y, ":scene_min_y", pos10),
  349. (position_get_y, ":scene_max_y", pos11),
  350. (store_div,":border_x",":scene_max_x",10),
  351. (val_add,":scene_min_x",":border_x"),
  352. (val_sub,":scene_max_x",":border_x"),
  353. (store_div,":border_y",":scene_max_y",10),
  354. (val_add,":scene_min_y",":border_y"),
  355. (val_sub,":scene_max_y",":border_y"),
  356. (store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
  357. (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
  358. (init_position, pos1),
  359. (position_set_x,pos1,":x_pos"),
  360. (position_set_y,pos1,":y_pos"),
  361. (position_set_z,pos1,10000),
  362. (position_set_z_to_ground_level,pos1),
  363. (agent_set_scripted_destination,"$leading_boar",pos1),
  364. ]),
  365. (1,0,0,[],
  366. [
  367. (try_for_agents,reg(1)),
  368. (agent_get_item_id,reg(2),reg(1)),
  369. (eq,reg(2),"itm_boar"),
  370. (store_agent_hit_points,":health",reg(1)),
  371. (store_sub,":damage",100,":health"),
  372. (agent_get_slot,":prev_damage",reg(1),1),
  373. (neq,":prev_damage",":damage"),
  374. (agent_set_slot,reg(1),1,":damage"),
  375. (agent_get_position,pos1,reg(1)),
  376. (position_get_x,":x_pos",pos1),
  377. (position_get_y,":y_pos",pos1),
  378. (store_random_in_range,":x_pos_add",0,1000),
  379. (store_random_in_range,":y_pos_add",0,1000),
  380. (val_add,":x_pos",":x_pos_add"),
  381. (val_add,":y_pos",":y_pos_add"),
  382. (position_set_x,pos1,":x_pos"),
  383. (position_set_y,pos1,":y_pos"),
  384. (agent_set_scripted_destination,reg(1),pos1),
  385. (try_end),
  386. ]),
  387. (0.5,0,0, #boar travelling
  388. [],
  389. [
  390. (get_player_agent_no,reg(1)),
  391. (agent_get_position,pos1,reg(1)),
  392. (agent_get_position,pos4,"$leading_boar"),
  393. (position_get_x,":x_pos",pos4),
  394. (position_get_y,":y_pos",pos4),
  395. (try_for_agents,reg(1)),
  396. (agent_get_item_id,reg(2),reg(1)),
  397. (eq,reg(2),"itm_boar"),
  398. (agent_get_position,pos2,reg(1)),
  399. (get_distance_between_positions,reg(3),pos1,pos2),
  400. (try_begin),
  401. (position_get_x,":pos_x",pos2),
  402. (position_get_x,":pos_y",pos2),
  403. (position_get_x, ":scene_min_x", pos10),
  404. (position_get_x, ":scene_max_x", pos11),
  405. (position_get_y, ":scene_min_y", pos10),
  406. (position_get_y, ":scene_max_y", pos11),
  407. (store_div,":border_x",":scene_max_x",10),
  408. (val_add,":scene_min_x",":border_x"),
  409. (val_sub,":scene_max_x",":border_x"),
  410. (store_div,":border_y",":scene_max_y",10),
  411. (val_add,":scene_min_y",":border_y"),
  412. (val_sub,":scene_max_y",":border_y"),
  413. (this_or_next|gt,":pos_x",":scene_max_x"),
  414. (this_or_next|lt,":pos_x",":scene_min_x"),
  415. (this_or_next|gt,":pos_y",":scene_max_y"),
  416. (lt,":pos_y",":scene_min_y"),
  417. (store_random_in_range,":x_pos",":scene_min_x",":scene_max_x"),
  418. (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
  419. (init_position, pos1),
  420. (position_set_x,pos1,":x_pos"),
  421. (position_set_y,pos1,":y_pos"),
  422. (position_set_z,pos1,10000),
  423. (position_set_z_to_ground_level,pos1),
  424. (agent_set_scripted_destination,reg(1),pos1),
  425. (else_try),
  426. (le,reg(3),2500),
  427. (position_get_x,reg(4),pos1),
  428. (position_get_x,reg(5),pos2),
  429. (store_sub,":x_dist",reg(5),reg(4)),
  430. (val_mul,":x_dist",10),
  431. (position_get_y,reg(6),pos1),
  432. (position_get_y,reg(7),pos2),
  433. (store_sub,":y_dist",reg(7),reg(6)),
  434. (val_mul,":y_dist",10),
  435. (init_position,pos3),
  436. (val_add,":x_dist",reg(5)),
  437. (val_add,":y_dist",reg(7)),
  438. (position_set_x,pos3,":x_dist"),
  439. (position_set_y,pos3,":y_dist"),
  440. (position_set_z,pos3,10000),
  441. (position_set_z_to_ground_level,pos3),
  442. (agent_set_scripted_destination,reg(1),pos3),
  443. (else_try),
  444. (get_distance_between_positions,reg(3),pos4,pos2),
  445. (ge,reg(3),2000),
  446. (init_position, pos6),
  447. (store_random_in_range,":x_pos_add",0,1000),
  448. (store_random_in_range,":y_pos_add",0,1000),
  449. (val_add,":x_pos_add",":x_pos"),
  450. (val_add,":y_pos_add",":y_pos"),
  451. (position_set_x,pos6,":x_pos_add"),
  452. (position_set_y,pos6,":y_pos_add"),
  453. (position_set_z,pos6,10000),
  454. (position_set_z_to_ground_level,pos6),
  455. (agent_set_scripted_destination,reg(1),pos6),
  456. (try_end),
  457. (try_end),
  458. ]),
  459. ]),
  460. #-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  461. #-#-#-#Hunting Mod end#-#-#-#
  462. #-#-#-#-#-#-#-#-#-#-#-#-#-#-#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement