Advertisement
Guest User

Untitled

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