Advertisement
Guest User

Untitled

a guest
Mar 25th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.99 KB | None | 0 0
  1. ///////////////////////
  2. //Peace/Tame script ///
  3. //Made by Aga ///
  4. //Do not loop ///
  5. ///////////////////////
  6. @clearlist 'nameoftames'
  7. @clearlist 'numberoffollowers'
  8. @clearlist 'peacemakeyesorno'
  9. @clearlist 'pathfinding'
  10. @clearlist 'tameables'
  11. @createlist 'nameoftames'
  12. @createlist 'numberoffollowers'
  13. @createlist 'peacemakeyesorno'
  14. @createlist 'pathfinding'
  15. /////////////////////////
  16. //Setup section ////
  17. /////////////////////////
  18. pushlist 'nameoftames' 'thxaga' //Change thxaga to whatever name you want
  19. pushlist 'numberoffollowers' '1' //Change 1 to however many followers you currently have
  20. pushlist 'peacemakeyesorno' 'yes' //yes or no if you want to peacemake
  21. pushlist 'pathfinding' 'yes' //yes or no if you want to pathfind to tame
  22. /////////////////////////
  23. //End Setup ////
  24. /////////////////////////
  25. @clearjournal
  26. if not timerexists 'skilltimer'
  27. createtimer 'skilltimer'
  28. settimer 'skilltimer' 10000
  29. endif
  30. @createlist 'unstuck'
  31. if list 'unstuck' == 0
  32. pushlist 'unstuck' 'east'
  33. pushlist 'unstuck' 'west'
  34. pushlist 'unstuck' 'south'
  35. pushlist 'unstuck' 'north'
  36. endif
  37. @clearlist 'timestried'
  38. @createlist 'timestried'
  39. @createlist 'tameables'
  40. unsetalias 'currentlytaming'
  41. unsetalias 'found'
  42. pushlist 'tameables' 0xc8 // Horse
  43. pushlist 'tameables' 0xe2 // Horse2
  44. pushlist 'tameables' 0xcc // Horse3
  45. pushlist 'tameables' 0xe4 // Horse4
  46. pushlist 'tameables' 0xa7 // Brown Bear
  47. pushlist 'tameables' 0xd3 // Black Bear
  48. pushlist 'tameables' 0xd5 // polar bear
  49. pushlist 'tameables' 0xed // hind
  50. pushlist 'tameables' 0xe1 // timber wolf
  51. pushlist 'tameables' 0xdc // llama
  52. if skill 'animal taming' > 60
  53. pushlist 'tameables' 0x41 // snow leapord
  54. pushlist 'tameables' 0xdd // walrus
  55. pushlist 'tameables' 0xd4 // grizzly bear
  56. pushlist 'tameables' 0x30 // scorpion
  57. pushlist 'tameables' 0xd6 // cougar
  58. pushlist 'tameables' 0xea // great hart
  59. pushlist 'tameables' 0x19 // grey wolf
  60. pushlist 'tameables' 0x1b // grey wolf
  61. pushlist 'tameables' 0x22 //white wolf
  62. pushlist 'tameables' 0x25 //white wolf
  63. pushlist 'tameables' 0xe8 //bull
  64. endif
  65. if skill 'animal taming' > 75
  66. pushlist 'tameables' 0x17 //Dire Wolf
  67. pushlist 'tameables' 0x62 //Hellhound
  68. pushlist 'tameables' 0xbc //Savage Ridgeback
  69. pushlist 'tameables' 0xbb //Ridgeback
  70. pushlist 'tameables' 0x14 //Frost spider
  71. pushlist 'tameables' 0xc9 //Hellcat (Small)
  72. pushlist 'tameables' 0xda //Frenzied Ostard
  73. pushlist 'tameables' 0x50 //Giant Toad
  74. pushlist 'tameables' 0xe8 //Bull
  75. pushlist 'tameables' 0xe9 //Bull2
  76. endif
  77. if skill 'animal taming' > 81
  78. pushlist 'tameables' 0xce //Lava Lizard
  79. endif
  80. while not dead 'self'
  81. if list 'timestried' > 25
  82. // clearlist 'timestried'
  83. // ignoreobject 'currentlytaming'
  84. // unsetalias 'currentlytaming'
  85. // removetimer 'stucktimer'
  86. // headmsg 'Tried more than 10 times to tame. Ignoring' 5
  87. endif
  88. warmode 'on'
  89. warmode 'off'
  90. if hits 'self' != maxhits 'self'
  91. if @inlist 'peacemakeyesorno' 'Yes' or @inlist 'peacemakeyesorno' 'yes'
  92. getenemy 'red' 'criminal' 'nearest'
  93. while war 'enemy'
  94. if timer 'skilltimer' > 10000
  95. @cleartargetqueue
  96. @canceltarget
  97. while not targetexists 'any'
  98. useskill 'Peacemaking'
  99. endwhile
  100. settimer 'skilltimer' 0
  101. target 'enemy'
  102. if war 'self'
  103. warmode 'off'
  104. endif
  105. endif
  106. endwhile
  107. endif
  108. endif
  109. if diffhits > 15
  110. @cleartargetqueue
  111. @canceltarget
  112. cast 'greater heal' 'self'
  113. endif
  114. if not @inrange 'currentlytaming' 12
  115. @headmsg 'Too far away! Ignoring for now.' 34 'currentlytaming'
  116. @unsetalias 'currentlytaming'
  117. removetimer 'stucktimer'
  118. for 0 to 'tameables'
  119. if @findtype tameables[] 'any' 'ground' 1 8
  120. @setalias 'currentlytaming' 'found'
  121. createtimer 'stucktimer'
  122. settimer 'stucktimer' 0
  123. createtimer 'imstuck'
  124. settimer 'imstuck' 0
  125. if innocent 'currentlytaming'
  126. @headmsg 'This is already tame' 34 'currentlytaming'
  127. // ignoreobject 'currentlytaming'
  128. unsetalias 'currentlytaming'
  129. removetimer 'stucktimer'
  130. removetimer 'imstuck'
  131. endif
  132. endif
  133. endfor
  134. endif
  135. if not @inrange 'currentlytaming' 2
  136. @headmsg 'Not close enough!' 34 'currentlytaming'
  137. endif
  138. if @inlist 'peacemakeyesorno' 'Yes' or @inlist 'peacemakeyesorno' 'yes'
  139. if war 'currentlytaming'
  140. if war 'self'
  141. warmode 'off'
  142. endif
  143. if timer 'skilltimer' > 10000
  144. @cleartargetqueue
  145. @canceltarget
  146. if not targetexists 'any'
  147. useskill 'Peacemaking'
  148. endif
  149. if @injournal 'Whom do you wish to calm?' 'system'
  150. settimer 'skilltimer' 0
  151. clearjournal
  152. endif
  153. target 'currentlytaming'
  154. if war 'self'
  155. warmode 'off'
  156. endif
  157. endif
  158. endif
  159. endif
  160. if @inlist 'peacemakeyesorno' 'No' or @inlist 'peacemakeyesorno' 'no'
  161. if @inrange 'currentlytaming' 2
  162. if war 'self'
  163. warmode 'off'
  164. endif
  165. if timer 'skilltimer' > 10000
  166. @cleartargetqueue
  167. @canceltarget
  168. @clearjournal
  169. if not targetexists 'any'
  170. useskill 'Animal Taming'
  171. endif
  172. pause 500
  173. if @injournal 'Tame which animal?' 'system'
  174. pushlist 'timestried' 1
  175. @settimer 'skilltimer' 0
  176. @clearjournal
  177. endif
  178. target 'currentlytaming'
  179. pause 500
  180. if @injournal 'That is too far away' 'system' or @injournal 'Target cannot be seen' 'system'
  181. settimer 'skilltimer' 10501
  182. ignoreobject 'currentlytaming'
  183. unsetalias 'currentlytaming'
  184. removetimer 'stucktimer'
  185. removetimer 'imstuck'
  186. clearlist 'timestried'
  187. @clearjournal
  188. endif
  189. if @injournal 'You fail to tame the creature' 'system' or @injournal 'You must wait a few moments to use another skill' 'system'
  190. settimer 'skilltimer' 10501
  191. @clearjournal
  192. endif
  193. if @injournal 'You have no chance of taming this creature' 'system' or @injournal 'do not have a clear path to the animal' 'system'
  194. ignoreobject 'currentlytaming'
  195. settimer 'skilltimer' 10501
  196. unsetalias 'currentlytaming'
  197. removetimer 'stucktimer'
  198. removetimer 'imstuck'
  199. clearlist 'timestried'
  200. @clearjournal
  201. endif
  202. if @injournal 'This animal has had too many owners' 'system' or @injournal 'That animal looks tame already' 'system'
  203. settimer 'skilltimer' 10501
  204. ignoreobject 'currentlytaming'
  205. unsetalias 'currentlytaming'
  206. removetimer 'stucktimer'
  207. removetimer 'imstuck'
  208. clearlist 'timestried'
  209. @clearjournal
  210. endif
  211. endif
  212. endif
  213. endif
  214. if @inlist 'peacemakeyesorno' 'Yes' or @inlist 'peacemakeyesorno' 'yes'
  215. if not war 'currentlytaming'
  216. if @inrange 'currentlytaming' 2
  217. if war 'self'
  218. warmode 'off'
  219. endif
  220. if timer 'skilltimer' > 10500
  221. @cleartargetqueue
  222. @canceltarget
  223. @clearjournal
  224. if not targetexists 'any'
  225. useskill 'Animal Taming'
  226. endif
  227. pause 500
  228. if @injournal 'Tame which animal?' 'system'
  229. pushlist 'timestried' 1
  230. @settimer 'skilltimer' 0
  231. @clearjournal
  232. endif
  233. target 'currentlytaming'
  234. pause 500
  235. if @injournal 'That is too far away' 'system' or @injournal 'Target cannot be seen' 'system'
  236. settimer 'skilltimer' 10501
  237. ignoreobject 'currentlytaming'
  238. unsetalias 'currentlytaming'
  239. removetimer 'stucktimer'
  240. removetimer 'imstuck'
  241. clearlist 'timestried'
  242. @clearjournal
  243. endif
  244. if @injournal 'You fail to tame the creature' 'system' or @injournal 'You must wait a few moments to use another skill' 'system'
  245. settimer 'skilltimer' 10501
  246. @clearjournal
  247. endif
  248. if @injournal 'You have no chance of taming this creature' 'system' or @injournal 'do not have a clear path to the animal' 'system'
  249. ignoreobject 'currentlytaming'
  250. settimer 'skilltimer' 10501
  251. unsetalias 'currentlytaming'
  252. removetimer 'stucktimer'
  253. removetimer 'imstuck'
  254. clearlist 'timestried'
  255. @clearjournal
  256. endif
  257. if @injournal 'This animal has had too many owners' 'system' or @injournal 'That animal looks tame already' 'system'
  258. settimer 'skilltimer' 10501
  259. // ignoreobject 'currentlytaming'
  260. unsetalias 'currentlytaming'
  261. removetimer 'stucktimer'
  262. removetimer 'imstuck'
  263. clearlist 'timestried'
  264. @clearjournal
  265. endif
  266. endif
  267. endif
  268. endif
  269. endif
  270. if @inlist 'numberoffollowers' '0'
  271. if followers > 0
  272. pause 500
  273. @rename 'currentlytaming' nameoftames[0]
  274. pause 500
  275. if name 'currentlytaming' == nameoftames[0]
  276. waitforcontext 'currentlytaming' 8 15000
  277. while not @gumpexists 0x909cc741
  278. pause 500
  279. endwhile
  280. pause 500
  281. replygump 0x909cc741 2
  282. clearlist 'timestried'
  283. ignoreobject 'currentlytaming'
  284. unsetalias 'currentlytaming'
  285. removetimer 'stucktimer'
  286. removetimer 'imstuck'
  287. pause 500
  288. endif
  289. endif
  290. endif
  291. if @inlist 'numberoffollowers' '1'
  292. if followers > 1
  293. pause 500
  294. @rename 'currentlytaming' nameoftames[0]
  295. pause 500
  296. if name 'currentlytaming' == nameoftames[0]
  297. waitforcontext 'currentlytaming' 8 15000
  298. while not @gumpexists 0x909cc741
  299. pause 500
  300. endwhile
  301. pause 500
  302. replygump 0x909cc741 2
  303. clearlist 'timestried'
  304. ignoreobject 'currentlytaming'
  305. unsetalias 'currentlytaming'
  306. removetimer 'stucktimer'
  307. removetimer 'imstuck'
  308. pause 500
  309. endif
  310. endif
  311. endif
  312. if @inlist 'numberoffollowers' '2'
  313. if followers > 2
  314. pause 500
  315. @rename 'currentlytaming' nameoftames[0]
  316. pause 500
  317. if name 'currentlytaming' == nameoftames[0]
  318. waitforcontext 'currentlytaming' 8 15000
  319. while not @gumpexists 0x909cc741
  320. pause 500
  321. endwhile
  322. pause 500
  323. replygump 0x909cc741 2
  324. clearlist 'timestried'
  325. ignoreobject 'currentlytaming'
  326. unsetalias 'currentlytaming'
  327. removetimer 'stucktimer'
  328. removetimer 'imstuck'
  329. pause 500
  330. endif
  331. endif
  332. endif
  333. if @inlist 'numberoffollowers' '3'
  334. if followers > 3
  335. pause 500
  336. @rename 'currentlytaming' nameoftames[0]
  337. pause 500
  338. if name 'currentlytaming' == nameoftames[0]
  339. waitforcontext 'currentlytaming' 8 15000
  340. while not @gumpexists 0x909cc741
  341. pause 500
  342. endwhile
  343. pause 500
  344. replygump 0x909cc741 2
  345. clearlist 'timestried'
  346. ignoreobject 'currentlytaming'
  347. unsetalias 'currentlytaming'
  348. removetimer 'stucktimer'
  349. removetimer 'imstuck'
  350. pause 500
  351. endif
  352. endif
  353. endif
  354. if @inlist 'numberoffollowers' '4'
  355. if followers > 4
  356. pause 500
  357. @rename 'currentlytaming' nameoftames[0]
  358. pause 500
  359. if name 'currentlytaming' == nameoftames[0]
  360. waitforcontext 'currentlytaming' 8 15000
  361. while not @gumpexists 0x909cc741
  362. pause 500
  363. endwhile
  364. pause 500
  365. replygump 0x909cc741 2
  366. clearlist 'timestried'
  367. ignoreobject 'currentlytaming'
  368. unsetalias 'currentlytaming'
  369. removetimer 'stucktimer'
  370. removetimer 'imstuck'
  371. pause 500
  372. endif
  373. endif
  374. endif
  375. if @inlist 'pathfinding' 'yes' or @inlist 'pathfinding' 'Yes'
  376. if timerexists 'stucktimer'
  377. if @inrange 'currentlytaming' 1
  378. settimer 'stucktimer' 0
  379. settimer 'imstuck' 0
  380. endif
  381. if not @inrange 'currentlytaming' 1
  382. if timer 'imstuck' >= 20000
  383. headmsg 'Stuck. Ignoring current animal' 5
  384. ignoreobject 'currentlytaming'
  385. unsetalias 'currentlytaming'
  386. removetimer 'stucktimer'
  387. removetimer 'imstuck'
  388. endif
  389. if timer 'stucktimer' >= 5000
  390. if direction == 0
  391. @poplist 'unstuck' 'north'
  392. elseif direction == 2
  393. @poplist 'unstuck' 'east'
  394. elseif direction == 4
  395. @poplist 'unstuck' 'south'
  396. elseif direction == 6
  397. @poplist 'unstuck' 'west'
  398. endif
  399. if list 'unstuck' != 0
  400. headmsg 'Trying to pathfind' 5
  401. for 5
  402. run 'unstuck[0]'
  403. pause 100
  404. endfor
  405. poplist 'unstuck' 'front'
  406. settimer 'stucktimer' 0
  407. endif
  408. endif
  409. if @x 'currentlytaming' > x 'self' and @y 'currentlytaming' > y 'self'
  410. walk 'Southeast'
  411. elseif @x 'currentlytaming' < x 'self' and @y 'currentlytaming' > y 'self'
  412. walk 'Southwest'
  413. elseif @x 'currentlytaming' > x 'self' and @y 'currentlytaming' < y 'self'
  414. walk 'Northeast'
  415. elseif @x 'currentlytaming' < x 'self' and @y 'currentlytaming' < y 'self'
  416. walk 'Northwest'
  417. elseif @x 'currentlytaming' > x 'self' and @y 'currentlytaming' == y 'self'
  418. walk 'East'
  419. elseif @x 'currentlytaming' < x 'self' and @y 'currentlytaming' == y 'self'
  420. walk 'West'
  421. elseif @x 'currentlytaming' == x 'self' and @y 'currentlytaming' > y 'self'
  422. walk 'South'
  423. elseif @x 'currentlytaming' == x 'self' and @y 'currentlytaming' < y 'self'
  424. walk 'North'
  425. endif
  426. endif
  427. endif
  428. endif
  429. endwhile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement