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

attack based on lvl

agomez

Member
Joined
Jan 28, 2009
Messages
211
Reaction score
5
i got this spell, but how can i change it to the condition attack basen on your lvl:

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

local condition = createConditionObject(CONDITION_ENERGY)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 20, 1000, -300)
addDamageCondition(condition, 10, 1000, -300)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
i had this:

local damage = 60

function onCastSpell(cid, var)
local check = math.random(damage,damage+30)
local formula = math.floor((getPlayerLevel(cid)*check)/3)

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

local condition = createConditionObject(CONDITION_ENERGY)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 20, 1000, formula)
setCombatCondition(combat, condition)


return doCombat(cid, combat, var)
end


idk why doesnt work :<
 
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
 
local condition = {}
local damage = 60

for lvl = 1, 400 do -- how many levels to create conditions for
	condition[lvl] = createConditionObject(CONDITION_ENERGY)
	setConditionParam(condition[lvl], CONDITION_PARAM_DELAYED, 1)
	addDamageCondition(condition[lvl], 20, 1000, -math.floor(lvl*damage/3))
end

function onCastSpell(cid, var)
	if doCombat(cid, combat, var) then
		local lvl = getPlayerLevel(cid)
		return doAddCondition(variantToNumber(var), condition[math.random(lvl, math.floor(lvl+(lvl/2)))])
	end
end
 
Back
Top