Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. local holes = {468, 481, 483, 7932}
  2. local holeId = {294, 369, 370, 383, 392, 408, 409, 427, 428, 430, 462, 469, 470, 482, 484, 485, 489, 924, 3135, 3136}
  3. function onUse(cid, item, fromPosition, itemEx, toPosition)
  4. if toPosition == nil or toPosition == false or toPosition == '' then
  5. return false
  6. end
  7. local groundTile = getThingfromPos(toPosition)
  8. if isInArray(holes, itemEx.itemid) == TRUE then
  9. doTransformItem(itemEx.uid, itemEx.itemid + 1)
  10. doDecayItem(itemEx.uid)
  11. elseif itemEx.itemid == 2739 then
  12. doTransformItem(itemEx.uid, 2737)
  13. doCreateItem(2694, 1, toPosition)
  14. doDecayItem(itemEx.uid)
  15. elseif itemEx.itemid == 2782 then
  16. doTransformItem(itemEx.uid, 2781)
  17. doDecayItem(itemEx.uid)
  18. elseif itemEx.itemid == 1499 then
  19. doRemoveItem(itemEx.uid)
  20. elseif (itemEx.uid <= 65535 or itemEx.actionid > 0) and (itemEx.itemid == 355 or itemEx.itemid == 9025) then
  21. doTransformItem(itemEx.uid, 392)
  22. doDecayItem(itemEx.uid)
  23. elseif itemEx.uid == 60001 then
  24. doTeleportThing(cid, {x=329, y=772, z=10})
  25. doSendMagicEffect({x=329, y=772, z=10},10)
  26. elseif groundTile.itemid == 384 or groundTile.itemid == 418 or groundTile.itemid == 8278 then
  27. doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, FALSE)
  28. elseif isInArray(holeId, itemEx.itemid) == TRUE then
  29. local hole = getThingfromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
  30. if hole.itemid > 0 then
  31. doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, FALSE)
  32. else
  33. doPlayerSendCancel(cid, "Sorry, not possible.")
  34. end
  35. else
  36. return FALSE
  37. end
  38. return TRUE
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement