Guest User

[GLOBALEVENT] Custom Weather

a guest
Sep 14th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | None | 0 0
  1. local config =
  2.     {
  3.         areas =
  4.             {
  5.                 [1] =
  6.                     {
  7.                         shootType = CONST_ANI_FIRE,         -- shoot effect
  8.                         areaType = CONST_ME_FIREAREA,       -- area effect
  9.                         qty = 3,                            -- how many per interval
  10.                         from = {x=1048, y=1000, z=7},       -- top left area
  11.                         to = {x=1062, y=1010, z=7},         -- bot right area
  12.                         combat = "fire"                     -- fire, water, stone, poison
  13.                     }
  14.                 --[[[2] =
  15.                     {
  16.                         shootType = CONST_ANI_LARGEROCK,
  17.                         areaType = CONST_ME_BLOCKHIT,
  18.                         qty = 3,
  19.                         from = {x=1048, y=1000, z=7},
  20.                         to = {x=1062, y=1010, z=7},
  21.                         combat = "stone"
  22.                     }]]--
  23.             }
  24.     }
  25.  
  26. function onThink(interval)
  27.     for i = 1, #config.areas do
  28.         for t = 1, config.areas[i].qty do
  29.             local xX, yY, zZ = math.random(config.areas[i].from.x, config.areas[i].to.x), math.random(config.areas[i].from.y, config.areas[i].to.y), math.random(config.areas[i].from.z, config.areas[i].to.z)
  30.             local delay = math.random(600)
  31.             addEvent(doSendDistanceShoot, delay, {x=xX-7, y=yY-5, z=zZ}, {x=xX, y=yY, z=zZ}, config.areas[i].shootType)
  32.             addEvent(doSendMagicEffect, delay+250, {x=xX, y=yY, z=zZ}, config.areas[i].areaType)
  33.             -- hacer condición dependiendo del efecto
  34.         end
  35.     end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment