• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Rain SyStem

bodycarcoo11

Mapper
Joined
Apr 26, 2011
Messages
213
Reaction score
9
Location
USA
Hello And Welcome I WIll Show You How To Make Rain System First Of All Add This Code Into GlobalEvents.xml
The Path Of IT ../Data/GlobalEvents/Globalevents.xml
XML Code:
Code:
<globalevent name="rain" interval="-1" script="rain.lua"/>
And Now The Lua Script
Path ../data/globalevents/scripts/rain.lua
Code:
local rain = Rain:new()
 
function onThink(interval, lastExecution)
    local minX = 949
    local minY = 965
    local maxX = 1069
    local maxY = 1020
 
    local frompos = {x=math.random(minX, maxX), y=math.random(minY, maxY), z=7}
    local topos = {x=math.random(frompos.x, maxX), y=math.random(frompos.y, maxY), z=7}
 
    local effects = {
        snow = {
            disteffect = CONST_ANI_FIRE,
            effect = CONST_ME_FIREAREA
        },
        rain = {
            disteffect = CONST_ANI_ICE,
            effect = CONST_ME_WATERSPLASH
 
        }
    }
    random = math.random(0, 10)
    if (random == 0) then
        rain.chance = math.random(10,50)
        rain:start({fromPos = frompos, toPos = topos}, effects.snow, 300, math.random(100, 500))
    else
        rain.chance = math.random(40,100)
        rain.createItem = {chance = math.random(0,10), item = {itemid = 2016, type = 1}}
        rain:start({fromPos = frompos, toPos = topos}, effects.rain, math.random(300, 1000), math.random(100, 350))
    end
    return TRUE
end
And Done Now Hard :) Have Fun
 
Im trying to find the snow version of this so I have a question...is
local effects = {
snow = {
disteffect = CONST_ANI_FIRE,
effect = CONST_ME_FIREAREA
},
rain = {
disteffect = CONST_ANI_ICE,
effect = CONST_ME_WATERSPLASH

}
}
the name of different weather types posible?
If so why would snow setting use fire? and where would you change it to make it snow...

1 last question if snow works, can i have rain in 1 area of my map and snow going in another at the same time?
 
How do you change it from rain to snow?

Can I use this sytem to make it snow in 1 place on server and rain in another place or would I need 2 different versions to use both effects same time in different areas?
 
Back
Top