Mateus Robeerto
Excellent OT User
my ot is TFS 1.2 7.92, it's not attacking any, it's giving an error
follow script
see in the error:
[C]: in function 'hasCondition'
data/weapons/scripts/emos/ammo6.lua:64: in function <data/weapons/scripts/emos/ammo6.lua:62>
follow script
LUA:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 42)
function onGetFormulaValues(cid, level, maglevel)
skill = getPlayerSkill(cid,4)
min = -((skill*26)+level+maglevel)
max = -((skill*27)+level+maglevel)
return min, max
end
setCombatCallback(combat1, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 31)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 42)
function onGetFormulaValues(cid, level, maglevel)
skill = getPlayerSkill(cid,4)
min = -((skill*30)+maglevel+level)
max = -((skill*31)+maglevel*3+level*3)
return min, max
end
setCombatCallback(combat2, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 31)
setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 42)
function onGetFormulaValues(cid, level, maglevel)
skill = getPlayerSkill(cid,4)
min = -((skill*29)+maglevel+level)
max = -((skill*30)+maglevel*2+level*3)
return min, max
end
setCombatCallback(combat3, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 31)
setCombatParam(combat4, COMBAT_PARAM_DISTANCEEFFECT, 42)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 1000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -100)
setConditionFormula(condition, -0.1, 0, -0.1, 0)
setCombatCondition(combat2, condition)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 1000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -100)
setConditionFormula(condition, -0.1, 0, -0.1, 0)
setCombatCondition(combat3, condition)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 1000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -100)
setConditionFormula(condition, -0.1, 0, -0.1, 0)
setCombatCondition(combat4, condition)
function onUseWeapon(cid, var)
if cid:hasCondition(CONDITION_INFIGHT) then
doSendAnimatedText(getPlayerPosition(cid),"Critical!",TEXTCOLOR_LIGHTGREY)
doCombat(cid, combat3, var)
return FALSE
end
fala = math.random(1,25)
rand = math.random(1,600)
if rand <= getPlayerSkill(cid,4) then
if fala == 1 then
doPlayerAddHealth(cid,(getPlayerMaxHealth(cid)/10))
doSendAnimatedText(getPlayerPosition(cid), "Critical!", TEXTCOLOR_LIGHTGREY)
doCombat(cid, combat3, var)
else
doPlayerAddHealth(cid,(getPlayerMaxHealth(cid)/6))
doSendAnimatedText(getPlayerPosition(cid),"Critical!",TEXTCOLOR_LIGHTGREY)
doCombat(cid, combat2, var)
end
else
doCombat(cid, combat1, var)
end
end
see in the error:
[C]: in function 'hasCondition'
data/weapons/scripts/emos/ammo6.lua:64: in function <data/weapons/scripts/emos/ammo6.lua:62>
Last edited by a moderator: