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

addEvent, delay

kermaxpl

Pora na Nonsens Scripter
Joined
Aug 21, 2012
Messages
121
Reaction score
7
Location
Poland
Hi,
I have problem, i have this script(I know it's terrible, but i'm newbie):
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)

local damage = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(damage, CONDITION_PARAM_SUBID, 1)
setConditionParam(damage, CONDITION_PARAM_TICKS, 10000)
setConditionParam(damage, CONDITION_SKILL_MELEEPERCENT, 199)
setCombatCondition(combat, damage)

local outfit = {
    [0] = {{lookType = 244}, 1000},
    [1] = {{lookType = 245}, 1000},
    [2] = {{lookType = 246}, 1000},
    [3] = {{lookType = 247}, 1000}
	}
function onCastSpell(cid, var)
	local f = getPlayerVocation(cid) == 4
	doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	if f then
		doCreatureAddHealth(cid, -30) 
		for i = 1, 3 do
		addEvent(500*i, doSetCreatureOutfit(cid,  outfit[i]))
		doCombat(cid, combat, var)
		end
	else
		doRemoveCondition(cid, CONDITION_OUTFIT)
	end
	return true
end
and I want to add delay between each stage of outfit change
Can any one help me? If u have any idea how to make this script better u can write too.

With this script i have console error:
Code:
[Error - Spell Interface
data/spells/custom/furia.lua:onCastSpell
Description:
(luaAddEvent) Callback parameter should be a function
Sorry for my English.


Btw. It isn't my script I only stick some parts from other scripts.

PS. Ok, I repaired my script, if someone want to use him, here u are:
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)

local damage = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(damage, CONDITION_PARAM_SUBID, 1)
setConditionParam(damage, CONDITION_PARAM_TICKS, 10000)
setConditionParam(damage, CONDITION_SKILL_MELEEPERCENT, 199)
setCombatCondition(combat, damage)

function onCastSpell(cid, var)
	local f = getPlayerVocation(cid) == 4
	doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	if f then
		doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
		doCreatureAddHealth(cid, -30) 
		addEvent(doSetCreatureOutfit, 100, cid,{lookType = 244}, 1000)
		addEvent(doSetCreatureOutfit, 1100, cid,{lookType = 245}, 1000)
		addEvent(doSetCreatureOutfit, 2100, cid,{lookType = 246}, 1000)
		doCombat(cid, combat, var)
	else
		doRemoveCondition(cid, CONDITION_OUTFIT)
	end
	return true
end
 
Last edited:
Back
Top