• 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!

[Global Events] Easier goGoGo Script!

If you want waste some ram and cpu :p
soul storm (sd animations)
PHP:
local startpos = {x=890,y=1020}
local endpos = {x=950,y=1080}

function soulMove(param)
	local pos = param.pos
	local topos = {x=pos.x+math.random(-15,15),y=pos.y+math.random(-15,15),z=pos.z}
	doSendDistanceShoot(pos, topos, CONST_ANI_DEATH)
	if isPlayer(getTopCreature(topos).uid) == TRUE then
		doAreaCombatHealth(0, COMBAT_DEATHDAMAGE, topos, 0, -1, -5, CONST_ME_MORTAREA)
	end
	return TRUE
end

function onThink(interval, lastExecution)
	if(getWorldTime() < 500 or getWorldTime() > 1350) then
		for i=1, 300 do --number of 'soul' in each second on each floor
			for g=4, 7 do -- from floor 7 to floor 4
				addEvent(soulMove, i*8, {pos={x=math.random(startpos.x,endpos.x), y=math.random(startpos.y,endpos.y), z=g}})
			end
		end
	end
	return TRUE
end
PHP:
<globalevent name="soulstorm" interval="1" script="soulstorm.lua"/>
Show 300 SD animations/second from 'startpos' to 'endpos' on floors 4 - 7 when on server is night.
Movie:
soulstorm.avi
 
If you want waste some ram and cpu :p
soul storm (sd animations)
PHP:
local startpos = {x=890,y=1020}
local endpos = {x=950,y=1080}

function soulMove(param)
	local pos = param.pos
	local topos = {x=pos.x+math.random(-15,15),y=pos.y+math.random(-15,15),z=pos.z}
	doSendDistanceShoot(pos, topos, CONST_ANI_DEATH)
	if isPlayer(getTopCreature(topos).uid) == TRUE then
		doAreaCombatHealth(0, COMBAT_DEATHDAMAGE, topos, 0, -1, -5, CONST_ME_MORTAREA)
	end
	return TRUE
end

function onThink(interval, lastExecution)
	if(getWorldTime() < 500 or getWorldTime() > 1350) then
		for i=1, 300 do --number of 'soul' in each second on each floor
			for g=4, 7 do -- from floor 7 to floor 4
				addEvent(soulMove, i*8, {pos={x=math.random(startpos.x,endpos.x), y=math.random(startpos.y,endpos.y), z=g}})
			end
		end
	end
	return TRUE
end
PHP:
<globalevent name="soulstorm" interval="1" script="soulstorm.lua"/>
Show 300 SD animations/second from 'startpos' to 'endpos' on floors 4 - 7 when on server is night.
Movie:
soulstorm.avi

You are having 1200 running event tickers... It'd be more efficient with a single event and instead of creating the events in a loop, call for another event inside of event function with a counter to make it run 300 times only. That would decrease RAM/CPU usage quite a bit ^.-
 
Back
Top