Advertisement
dalvorsn

rain.lua

May 14th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. --#config#
  2. local townId        = 1
  3. local timer     = 100 -- 100 ms para cada pingo
  4. local range         = 5 -- raio de variação
  5. local defec         = 0
  6. local mefec         = 2160
  7.  
  8.  
  9. function onThink(interval)
  10.  
  11.     local pos = getTownTemplePosition(townId)
  12.     for i=0, math.floor(interval/timer) do
  13.         rain(pos, range, defec, mefec)
  14.     end
  15.     return true
  16. end
  17.  
  18. function rain(pos, range, defec, mefec)
  19.     addEvent(function()
  20.             local fromPos = {x = pos.x -6, y = pos.y -6, z = pos.z}
  21.             local newPos = {x = pos.x, y = pos.y, z = pos.z}
  22.             newPos.x = newPos.x + math.random(-range, range)
  23.             newPos.y = newPos.y + math.random(-range, range)
  24.             doSendDistanceShoot(fromPos, newPos, defec)
  25.             doSendMagicEffect(newPos, mefec)   
  26.         end, timer)
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement