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

repeatEffect

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
Please I need one function to repeat effect and magicEffect, ex:
function repeatEffect(cid, effect, time)
---
local spellTime = ??
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_POISON)

function repeatEffect()
repeatEffect(cid, CONST_ME_MAGIC_BLUE, spellTime)
end

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Very useful idea :D

Code:
function repeatEffect(pos, effect, delay, repeatTime)
	if repeatTime > 0 then
		doSendMagicEffect(pos, effect)
		repeatTime = repeatTime - 1
		addEvent(repeatEffect, delay, pos, effect, delay, repeatTime)
	end
end

Usage:
repeatEffect(position, effect, delay, repeatTime)

Example talkaction:
Code:
function onSay(cid, words, param)
	repeatEffect(getCreaturePos(cid), param, 1 * 60 * 1000, 5)
end

Will send 5x magic effect. Delay is 1 min. Effect here is param.
 
Back
Top