Yea i need some help with this, theres a beginner axe and sword i have on my ot, and every few hits it hits a special attack. For this i will be posting the axe script on here. It hits like exori except it is red, and a word "Desemo" appears out of you. Well when some1 started after they reached lvl 20 something and a certain skill it kept hitting "Desemo" but just the phrase, the the effect didnt appear and the monster didnt take the damage it should have. here is the script:
Please help, because I have better weapons with this same script except higher damage for high lvls, as a donater item, and im worried something might go wrong with them. Thanks in advance
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat1, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 0)
setCombatFormula(combat1, COMBAT_FORMULA_SKILL , 1.9, 0, 1.9, 0)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat2, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat2, COMBAT_FORMULA_SKILL , 0.7, 0, 0.7, 0)
local arr = {
{0, 0, 0, 0, 0, 0, 0, 0, 0,},
{0, 0, 0, 0, 0, 0, 0, 0, 0,},
{0, 0, 0, 0, 0, 0, 0, 0, 0,},
{0, 0, 0, 1, 1, 1, 0, 0, 0,},
{0, 0, 0, 1, 3, 1, 0, 0, 0,},
{0, 0, 0, 1, 1, 1, 0, 0, 0,},
{0, 0, 0, 0, 0, 0, 0, 0, 0,},
{0, 0, 0, 0, 0, 0, 0, 0, 0,},
{0, 0, 0, 0, 0, 0, 0, 0, 0,}
}
local area = createCombatArea(arr)
setCombatArea(combat1, area)
function onUseWeapon(cid, var)
pos = getPlayerPosition(cid)
swordskill = getPlayerSkill(cid,2)
rand = math.random(1,100)
if swordskill < 35 then
if rand >= 55 then
doSendAnimatedText(pos,"BloodHit",math.random(1,255))
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end
elseif swordskill >= 35 and swordskill < 55 then
if rand >= 60 then
doSendAnimatedText(pos,"BloodHit",math.random(1,255))
else
doCombat(cid, combat2, var)
end
elseif swordskill >= 60 and swordskill < 75 then
if rand >= 50 then
doSendAnimatedText(pos,"BloodHit",math.random(1,255))
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end
elseif swordskill >= 70 then
if rand >= 55 then
doSendAnimatedText(pos,"BloodHit",math.random(1,255))
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end
elseif swordskill >= 80 then
if rand >= 52 then
doSendAnimatedText(pos,"BloodHit",math.random(1,255))
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end
end
end
Please help, because I have better weapons with this same script except higher damage for high lvls, as a donater item, and im worried something might go wrong with them. Thanks in advance