Advertisement
Guest User

script

a guest
Aug 3rd, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.64 KB | None | 0 0
  1. local TYPE_ITEM, TYPE_MONSTER, TYPE_NPC = 0, 2, 3
  2.  
  3. local config = {
  4. [5907] = {
  5. name = 'bear',
  6. id = 3,
  7. type = TYPE_MONSTER,
  8. chance = 20,
  9. fail = {
  10. {run = true, text = 'The bear ran away.'},
  11. {broke = true, text = 'Oh no! The slingshot broke.'},
  12. {sound = 'GRRRRRRRRRRRR', text = 'The bear is trying to hit you with its claws.'}
  13. },
  14. success = {sound = 'Grrrrrrr', text = 'You tamed the wild bear.'}
  15. },
  16. [13247] = {
  17. name = 'boar',
  18. id = 10,
  19. type = TYPE_MONSTER,
  20. chance = 40,
  21. fail = {
  22. {run = true, text = 'The boar ran away'},
  23. {broke = true, text = 'Oh no! The hunting horn broke!'},
  24. {sound = 'Grunt! Grunt!', text = 'The boar is refusing to obey the hunting horn.'}
  25. },
  26. success = {sound = 'Oink', text = 'You tamed the wild boar.'}
  27. },
  28. [13291] = {
  29. name = 'undead cavebear',
  30. id = 12,
  31. type = TYPE_MONSTER,
  32. chance = 40,
  33. fail = {
  34. {run = true, text = 'The undead cavebear ran away.'},
  35. {sound = 'GRRRRRRRRRR', text = 'The undead cavebear is growling at you.'}
  36. },
  37. success = {sound = 'Grrrrrrr', text = 'You tamed the undead cavebear.'}
  38. },
  39. [13292] = {
  40. name = 'inoperative tin lizzard',
  41. mountName = 'tin lizzard',
  42. id = 8,
  43. type = TYPE_ITEM,
  44. chance = 40,
  45. fail = {
  46. {destroyObject = true, sound = 'Krr... kch.', text = 'The tin lizzard broke apart.'}
  47. },
  48. success = {sound = 'Krkrkrkrk', text = 'You wind up the tin lizzard.'}
  49. },
  50. [13293] = {
  51. name = 'midnight panther',
  52. id = 5,
  53. type = TYPE_MONSTER,
  54. chance = 40,
  55. fail = {
  56. {run = true, text = 'The midnight panther ran away.'},
  57. {sound = 'Groarrrrrrrr', text = 'The midnight panther is growling at you.'}
  58. },
  59. success = {sound = 'Purrrrrrr', text = 'You tamed the wild panther.'}
  60. },
  61. [13294] = {
  62. name = 'draptor',
  63. id = 6,
  64. type = TYPE_MONSTER,
  65. chance = 40,
  66. fail = {
  67. {run = true, text = 'The wild draptor ran away.'},
  68. {sound = 'Screeeeeeeeech', text = 'The wild draptor is struggling.'}
  69. },
  70. success = {sound = 'Screeeeeeeeech', text = 'You tamed the wild draptor.'}
  71. },
  72. [13295] = {
  73. name = 'black sheep',
  74. id = 4,
  75. type = TYPE_MONSTER,
  76. chance = 25,
  77. fail = {
  78. {run = true, sound = 'Baaaah', text = 'The black sheep ran away.'},
  79. {broke = true, text = 'Oh no! The reins were torn.'},
  80. {sound = 'Baaaah', text = 'The black sheep is trying to run away.'}
  81. },
  82. success = {sound = 'Baaaaaah', text = 'You tamed the black sheep.'}
  83. },
  84. [13298] = {
  85. name = 'terror bird',
  86. id = 2,
  87. type = TYPE_MONSTER,
  88. chance = 15,
  89. fail = {
  90. {run = true, text = 'The terror bird ran away.'},
  91. {broke = true, text = 'Oh no, the bird ate the carrot.'},
  92. {sound = 'CARRRRAAAH!', text = 'The terror bird is pecking you.'}
  93. },
  94. success = {sound = 'Guruuuuh', text = 'You tamed the bird.'}
  95. },
  96. [13305] = {
  97. name = 'crustacea gigantica',
  98. id = 7,
  99. type = TYPE_MONSTER,
  100. chance = 40,
  101. fail = {
  102. {run = true, text = 'The gigantic creature ran away.'},
  103. {sound = 'CHRRRR', text = 'The gigantic creature is trying to pinch you.'}
  104. },
  105. success = {sound = 'Chrrrrr', text = 'You tamed the gigantic creature.'}
  106. },
  107. [13307] = {
  108. name = 'wailing widow',
  109. id = 1,
  110. type = TYPE_MONSTER,
  111. chance = 40,
  112. fail = {
  113. {run = true, sound = 'SSSSSSSSSSSSS', text = 'The wailing widow ran away.'},
  114. {broke = true, text = 'Oh no! The wailing widow ate the bait.'},
  115. {sound = 'SSSSSSSSSSSSS', text = 'The wailing widow is hissing at you.'}
  116. },
  117. success = {sound = 'Sssssssss', text = 'You tamed the wailing widow.'}
  118. },
  119. [13498] = {
  120. name = 'sandstone scorpion',
  121. id = 21,
  122. type = TYPE_MONSTER,
  123. chance = 40,
  124. fail = {
  125. {run = true, sound = '*rattle-rattle*', text = 'The sandstone scorpion flees.'},
  126. {broke = true, text = 'Using the sceptre on the stone surface of the scorpion, it breaks in two halves.'},
  127. {sound = '*tak tak tak*', text = 'The sandstone scorpion eludes the influence of the scepter.'}
  128. },
  129. success = {sound = '*rattle*', text = 'You tamed the sandstone scorpion'}
  130. },
  131. [13508] = {
  132. name = 'slug',
  133. id = 14,
  134. type = TYPE_MONSTER,
  135. chance = 40,
  136. fail = {
  137. {run = true, sound = 'Slurp!', text = 'The slug flees.'},
  138. {broke = true, text = 'This slug drug didn\'t seem to have any effect.'},
  139. {sound = '*shlorp*', text = 'The slug slips through your grasp.'}
  140. },
  141. success = {sound = 'Sluuuuurp!', text = 'You drugged the slug.'}
  142. },
  143. [13535] = {
  144. name = 'dromedary',
  145. id = 20,
  146. type = TYPE_MONSTER,
  147. chance = 40,
  148. fail = {
  149. {run = true, sound = 'Gruuuuunt!', text = 'The dromedary flees.'},
  150. {sound = 'Grunt!', text = 'The dromedary remains stubborn.'}
  151. },
  152. success = {sound = '*blaaammm*', text = 'You tamed the dromedary.'}
  153. },
  154. [13536] = {
  155. name = 'crystal wolf',
  156. id = 16,
  157. type = TYPE_MONSTER,
  158. chance = 40,
  159. fail = {
  160. {run = true, sound = '*zwiiiish*', text = 'The crystal wolf vanished into thin air.'},
  161. {sound = '*klaaaaaang* Rrrrooooaaaarrrgh!', text = 'The crystal wolf is startled by the wrong sound of the diapason.'}
  162. },
  163. success = {sound = '*kliiiiiiiiiiing* Aooooouuuuu!!', text = 'The smooth sound of the diapason tamed the crystal wolf.'}
  164. },
  165. [13537] = {
  166. mountName = 'donkey',
  167. lookType = 399,
  168. id = 13,
  169. type = TYPE_MONSTER,
  170. chance = 40,
  171. fail = {
  172. {removeTransformation = true, text = 'The donkey transformation suddenly wears off.'},
  173. {broke = true, sound = 'Heeee-haaa-haaa-haaw!', text = 'You did not manage to feed the donkey enough apple slices.'}
  174. },
  175. success = {sound = 'Heeee-haaaaw!', text = 'Munching a large pile of apple slices tamed the donkey.'}
  176. },
  177. [13538] = {
  178. name = 'panda',
  179. id = 19,
  180. type = TYPE_MONSTER,
  181. chance = 40,
  182. fail = {
  183. {run = true, sound = 'Grrrrr!', text = 'The panda flees.'},
  184. {broke = true, text = 'While you were trying to soothe the panda, it ate all the remaining bamboo behind your back.'},
  185. {sound = 'Grrrroaaar!!', text = 'The panda refuses to follow any of your orders.'}
  186. },
  187. success = {sound = 'Rrrrr...', text = 'You tamed the panda.'}
  188. },
  189. [13539] = {
  190. name = 'enraged white deer',
  191. mountName = 'white deer',
  192. id = 18,
  193. type = TYPE_MONSTER,
  194. chance = 40,
  195. fail = {
  196. {run = true, sound = '*sniff*', text = 'The white deer flees.'},
  197. {broke = true, sound = 'ROOOAAARR!!', text = 'Oh no... the enraged deer angrily ripped the fir cone from your hands!'},
  198. {sound = '*wheeze*', text = 'The white deer sniffs and wheezes trying to withstand the taming.'}
  199. },
  200. success = {sound = '*bell*', text = 'You tamed the white deer.'}
  201. },
  202. [13938] = {
  203. name = 'inoperative uniwheel',
  204. mountName = 'uniwheel',
  205. id = 15,
  206. type = TYPE_ITEM,
  207. chance = 40,
  208. fail = {
  209. {broke = true, sound = 'Splosh!', text = 'It looks like most of the special oil this can was holding was spilt without any effect.'}
  210. },
  211. success = {sound = 'Vroooomratatatatatatat.', text = 'The strange wheel seems to vibrate and slowly starts turning continuously.'}
  212. },
  213. [13939] = {
  214. name = 'wild horse',
  215. id = 17,
  216. type = TYPE_MONSTER,
  217. chance = 5,
  218. fail = {
  219. {run = true, text = 'With its last strength the horse the horse runs to safety.'},
  220. {broke = true, sound = 'Weeeheeeehee', text = 'The wild horse happily munches the sugar oat and runs on.'},
  221. {sound = 'Weeheheheehaaa!!', text = 'Weeeheeeehee.'}
  222. },
  223. success = {sound = '*snort*', text = 'The horse eats the sugar oat and accepts you as its new master.'}
  224. },
  225. [15545] = {
  226. name = 'manta ray',
  227. id = 28,
  228. type = TYPE_MONSTER,
  229. chance = 30,
  230. fail = {
  231. {run = true, sound = 'Swooooosh', text = 'The manta ray fled.'},
  232. {sound = 'Shhhhhh', text = 'The manta ray is trying to escape.'}
  233. },
  234. success = {sound = '~~~', text = 'You tamed the manta ray.'}
  235. },
  236. [15546] = {
  237. name = 'ladybug',
  238. id = 27,
  239. type = TYPE_MONSTER,
  240. chance = 30,
  241. fail = {
  242. {run = true, text = 'The bug got scared and ran away.'},
  243. {sound = 'Chrk chrk!', text = 'The ladybug is trying to nibble you.'}
  244. },
  245. success = {sound = 'Chhrk...', text = 'You tamed the lady bug.'}
  246. },
  247. [18447] = {
  248. name = 'ironblight',
  249. id = 29,
  250. type = TYPE_MONSTER,
  251. chance = 30,
  252. fail = {
  253. {run = true, sound = 'Pling', text = 'The ironblight managed to run away.'},
  254. {broke = true, text = 'Oh no! The magnet lost its power!'},
  255. {sound = 'Plinngggg', text = 'The ironblight is fighting against the magnetic force.'}
  256. },
  257. success = {sound = 'Plinnnggggggg', text = 'You tamed the ironblight.'}
  258. },
  259. [18448] = {
  260. name = 'magma crawler',
  261. id = 30,
  262. type = TYPE_MONSTER,
  263. chance = 30,
  264. fail = {
  265. {run = true, sound = 'Charrrrrr', text = 'The magma crawler refused to drink wine and vanishes into thin air.'},
  266. {broke = true, text = 'Argh! The magma crawler pushed you and you spilled the glow wine!'},
  267. {sound = '<sniff> <sniff>', text = 'The magma crawler is smelling the glow wine suspiciously.'}
  268. },
  269. success = {sound = 'ZzzZzzZzzzZz', text = 'The magma crawler will accompany you as a friend from now on.'}
  270. },
  271. [18449] = {
  272. name = 'dragonling',
  273. id = 31,
  274. type = TYPE_MONSTER,
  275. chance = 30,
  276. fail = {
  277. {sound = 'FCHHHHHHHHHHHHHHHH', text = 'The dragonling doesn\'t seem to impressed with your ribbon.'}
  278. },
  279. success = {sound = 'FI?', text = 'The wild dragonling has accepted you as its master.'}
  280. },
  281. [18516] = {
  282. name = 'modified gnarlhound',
  283. id = 32,
  284. type = TYPE_MONSTER,
  285. chance = 100,
  286. success = {sound = 'Gnarl!', text = 'You now own a modified gnarlhound.'}
  287. },
  288. [20138] = {
  289. name = 'water buffalo',
  290. id = 35,
  291. type = TYPE_MONSTER,
  292. chance = 30,
  293. fail = {
  294. {run = true, sound = 'Baaaah', text = 'The water buffalo flees.'},
  295. {broke = true, text = 'The leech slipped through your fingers and is now following the call of nature.'},
  296. {sound = 'Bellow!', text = 'The water buffalo ignores you.'}
  297. },
  298. success = {sound = 'Looooow!', text = 'The leech appeased the water buffalo and your taming was successful.'}
  299. },
  300. [22608] = {
  301. name = 'shock head',
  302. id = 42,
  303. type = TYPE_MONSTER,
  304. chance = 30,
  305. fail = {
  306. {run = true, text = 'The shock head ran away.'},
  307. {sound = 'GRRRRRRRRRRR', text = 'The shock head is growling at you.'}
  308. },
  309. success = {sound = 'Grrrrrrr', text = 'You tamed the shock head.'}
  310. }
  311. }
  312.  
  313. function onUse(player, item, fromPosition, target, toPosition, isHotkey)
  314. local mount = config[item.itemid]
  315. if not mount then
  316. return false
  317. end
  318.  
  319. local targetName = target:getName():lower()
  320. if mount.type ~= target.type
  321. or (mount.lookType and mount.lookType ~= target:getOutfit().lookType)
  322. or (mount.name and mount.name ~= targetName) then
  323. return false
  324. end
  325.  
  326. if player:hasMount(mount.id) then
  327. player:say('You already tamed a ' .. (mount.mountName or targetName) .. '.', TALKTYPE_MONSTER_SAY)
  328. return true
  329. end
  330.  
  331. if target.type == TYPE_MONSTER then
  332. if target:getMaster() then
  333. return false
  334. end
  335. end
  336.  
  337. if math.random(100) > mount.chance then
  338. local action = mount.fail[math.random(#mount.fail)]
  339. if action.run then
  340. target:remove()
  341. elseif action.broke then
  342. item:remove(1)
  343. elseif action.destroyObject then
  344. addEvent(Game.createItem, 60 * 60 * 1000, target.itemid, 1, toPosition)
  345. target:remove()
  346. elseif action.removeTransformation then
  347. target:removeCondition(CONDITION_OUTFIT)
  348. end
  349.  
  350. doCreatureSayWithRadius(player, action.text, TALKTYPE_MONSTER_SAY, 2, 2)
  351. if action.sound then
  352. player:say(action.sound, TALKTYPE_MONSTER_SAY, false, 0, toPosition)
  353. end
  354. return true
  355. end
  356.  
  357. player:addMount(mount.id)
  358. doCreatureSayWithRadius(player, mount.success.text, TALKTYPE_MONSTER_SAY, 2, 2)
  359. player:say(mount.success.sound, TALKTYPE_MONSTER_SAY, false, 0, toPosition)
  360.  
  361. target:remove()
  362. item:remove(1)
  363. return true
  364. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement