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.10 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.x == CONTAINER_POSITION) then
  5. doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
  6. return true
  7. end
  8. toPosition.stackpos = STACKPOS_GROUND
  9. local groundTile = getThingfromPos(toPosition)
  10. if isInArray(holes, itemEx.itemid) == TRUE then
  11. doTransformItem(itemEx.uid, itemEx.itemid + 1)
  12. doDecayItem(itemEx.uid)
  13. elseif itemEx.itemid == 2739 then
  14. doTransformItem(itemEx.uid, 2737)
  15. doCreateItem(2694, 1, toPosition)
  16. doDecayItem(itemEx.uid)
  17. elseif itemEx.itemid == 2782 then
  18. doTransformItem(itemEx.uid, 2781)
  19. doDecayItem(itemEx.uid)
  20. elseif itemEx.itemid == 1499 then
  21. doRemoveItem(itemEx.uid)
  22. elseif (itemEx.uid <= 65535 or itemEx.actionid > 0) and (itemEx.itemid == 355 or itemEx.itemid == 9025) then
  23. doTransformItem(itemEx.uid, 392)
  24. doDecayItem(itemEx.uid)
  25. elseif itemEx.uid == 60001 then
  26. doTeleportThing(cid, {x=329, y=772, z=10})
  27. doSendMagicEffect({x=329, y=772, z=10},10)
  28. elseif groundTile.itemid == 384 or groundTile.itemid == 418 or groundTile.itemid == 8278 then
  29. doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, FALSE)
  30. elseif isInArray(holeId, itemEx.itemid) == TRUE then
  31. #local hole = getThingfromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
  32. #if hole.itemid > 0 then
  33. # doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, FALSE)
  34. #else
  35. # doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
  36. #end
  37. else
  38. return FALSE
  39. end
  40. return TRUE
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement