Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. local ropeSpots = {
  2. 386, 421, 5791
  3. }
  4.  
  5. local holeSpots = {
  6. 293, 294, 369, 370, 385, 394, 411, 412,
  7. 421, 432, 433, 435, 482, 5081, 483, 594,
  8. 595, 607, 609, 610, 615, 1066, 1067, 1080
  9. }
  10.  
  11. function onUse(player, item, fromPosition, target, toPosition)
  12. local tile = Tile(toPosition)
  13. if not tile then
  14. return false
  15. end
  16.  
  17. if not target:isItem() then
  18. return false
  19. end
  20.  
  21. if target:getId() >= 2886 and target:getId() <= 2891 then
  22. target = tile:getGround()
  23. end
  24.  
  25. if table.contains(ropeSpots, target:getId()) then
  26. player:teleportTo(target:getPosition():moveRel(0, 1, -1))
  27. return true
  28. elseif table.contains(holeSpots, target:getId()) or target:getId() == 435 then
  29. local tile = Tile(target:getPosition():moveRel(0, 0, 1))
  30. if not tile then
  31. return false
  32. end
  33.  
  34. local thing = tile:getTopVisibleThing()
  35. if thing:isCreature() then
  36. thing:teleportTo(target:getPosition():moveRel(0, 1, 0), false)
  37. return true
  38. end
  39. if thing:isItem() and thing:getType():isMovable() then
  40. thing:moveTo(target:getPosition():moveRel(0, 1, 0))
  41. return true
  42. end
  43. return true
  44. end
  45. return false
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement