Guest User

Untitled

a guest
Apr 10th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. hasWaterCombat = createCombatObject()
  2.  
  3. arrzor = {{1,1,1,1,1,1,1},{1,1,1,1,1,1,1},{1,1,0,0,0,1,1},{1,1,0,2,0,1,1},{1,1,0,0,0,1,1},{1,1,1,1,1,1,1},{1,1,1,1,1,1,1}}
  4.  
  5. setCombatArea(hasWaterCombat, createCombatArea(arrzor))
  6.  
  7. function onTile90(cid, pos)
  8. local needcheck = getPlayerStorageValue(cid, 7177)
  9. if needcheck == 1 then
  10. return 1 end
  11. pos.stackpos = 0
  12. local mitem = getTileThingByPos(pos)
  13. if isPisoAgua(mitem.itemid) == 1 then
  14. setPlayerStorageValue(cid, 7177, 1)
  15. return 1
  16. end
  17. end
  18.  
  19.  
  20. setCombatCallback(hasWaterCombat, CALLBACK_PARAM_TARGETTILE, "onTile90")
  21.  
  22. function hasWater(cid, porcento)
  23. doCombat(cid, hasWaterCombat, positionToVariant(getThingPos(cid)))
  24. local nearwater = getPlayerStorageValue(cid, 7177)
  25. if nearwater == 1 then
  26. setPlayerStorageValue(cid, 7177, 0)
  27. doPlayerSendTextMessage(cid, 25, "Using ambient water.")
  28. return true
  29. end
  30. if porcento > 100 then return false end
  31. local pouch = getPlayerSlotItem(cid, 10)
  32. if pouch.itemid == 4864 and (pouch.actionid == 0 and 100 or pouch.actionid-100) >= porcento then
  33. local newtype = (pouch.actionid == 0 and 200 or pouch.actionid) - porcento
  34. if newtype == 100 then doTransformItem(pouch.uid, 4863) end
  35. doSetItemActionId(pouch.uid, newtype)
  36. doPlayerSendTextMessage(cid, 25, (newtype-100).. "% Rest")
  37. return true
  38. end
  39. doPlayerSendTextMessage(cid, 25, "There is not enough water to perform this bending.")
  40. return false
  41. end
Advertisement
Add Comment
Please, Sign In to add comment