Advertisement
Guest User

shooting.lua (movement

a guest
Apr 16th, 2015
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. local function doCreateDummy(cid, position)
  2. local player = Player(cid)
  3. if not player then
  4. return true
  5. end
  6.  
  7. local tile = Tile(position)
  8. if tile then
  9. local thing = tile:getTopVisibleThing()
  10. if thing and isInArray({18226, 18227}, thing.itemid) then
  11. thing:remove()
  12. end
  13. end
  14.  
  15. if player:getStorageValue(Storage.BigfootBurden.Shooting) >= 5 then
  16. player:setStorageValue(Storage.BigfootBurden.QuestLine, 9)
  17. return
  18. end
  19.  
  20. position:sendMagicEffect(CONST_ME_POFF)
  21. Game.createItem(math.random(18226, 18227), 1, position)
  22. addEvent(doCreateDummy, 2 * 1000, cid, position)
  23. end
  24.  
  25. function onStepIn(cid, item, position, fromPosition)
  26. local player = Player(cid)
  27. if not player then
  28. return true
  29. end
  30.  
  31. if player:getStorageValue(Storage.BigfootBurden.QuestLine) ~= 8 then
  32. player:teleportTo(fromPosition)
  33. return true
  34. end
  35.  
  36. local playerPosition = player:getPosition()
  37. player:setStorageValue(Storage.BigfootBurden.Shooting, 0)
  38. position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
  39. doCreateDummy(player.uid, Position(playerPosition.x, playerPosition.y - 5, 10))
  40. return true
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement