Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 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. local groundTile = getThingfromPos(toPosition)
  5. if isInArray(holes, itemEx.itemid) == TRUE then
  6. doTransformItem(itemEx.uid, itemEx.itemid + 1)
  7. doDecayItem(itemEx.uid)
  8. elseif itemEx.itemid == 2739 then
  9. doTransformItem(itemEx.uid, 2737)
  10. doCreateItem(2694, 1, toPosition)
  11. doDecayItem(itemEx.uid)
  12. elseif itemEx.itemid == 2782 then
  13. doTransformItem(itemEx.uid, 2781)
  14. doDecayItem(itemEx.uid)
  15. elseif itemEx.itemid == 1499 then
  16. doRemoveItem(itemEx.uid)
  17. elseif (itemEx.uid <= 65535 or itemEx.actionid > 0) and (itemEx.itemid == 355 or itemEx.itemid == 9025) then
  18. doTransformItem(itemEx.uid, 392)
  19. doDecayItem(itemEx.uid)
  20. elseif itemEx.uid == 60001 then
  21. doTeleportThing(cid, {x=329, y=772, z=10})
  22. doSendMagicEffect({x=329, y=772, z=10},10)
  23. elseif groundTile.itemid == 384 or groundTile.itemid == 418 or groundTile.itemid == 8278 then
  24. doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, FALSE)
  25. elseif isInArray(holeId, itemEx.itemid) == TRUE then
  26. #local hole = getThingfromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
  27. #if hole.itemid > 0 then
  28. # doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, FALSE)
  29. #else
  30. # doPlayerSendCancel(cid, "Sorry, not possible.")
  31. #end
  32. else
  33. return FALSE
  34. end
  35. return TRUE
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement