• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Special weapon attack

Dixter

Amateur Web Developer
Joined
Mar 31, 2009
Messages
660
Reaction score
11
Hi I got a script for a special attack on weapons, it works fine but i still don't know how to make the special attack hit more often, i made faster atk for vocs but i dont want the regular attack to be so fast so i will slow it down, i just want to know how to make this special attack hit more often heres the script:

---------------------------------------------------------------------------------------------------------------------
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, 49)
setCombatFormula(combat1, COMBAT_FORMULA_SKILL , 0, 0, 3.0, 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, 0, 1.1, 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 >= 95 then
doSendAnimatedText(pos,"SuperNova",math.random(1,2 55))
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end
elseif swordskill >= 35 and swordskill < 55 then
if rand >= 53 then
doSendAnimatedText(pos,"SuperNova",math.random(1,2 55))
else
doCombat(cid, combat2, var)
end
elseif swordskill >= 55 and swordskill < 75 then
if rand >= 50 then
doSendAnimatedText(pos,"SuperNova",math.random(1,2 55))
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end
elseif swordskill >= 15 then
if rand >= 85 then
doSendAnimatedText(pos,"SuperNova",math.random(1,2 55))
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end
elseif swordskill >= 85 then
if rand >= 100 then
doSendAnimatedText(pos,"SuperNova",math.random(1,2 55))
return doCombat(cid, combat1, var)
else
doCombat(cid, combat2, var)
end 
end
end


---------------------------------------------------------------------------------------------------------------------

Thanks in advance

EDIT: I also want the weapon to have the attack that i set in items.xml, cuz when i make the attack in this script higher the REGULAR melee hits higher. I only want the special attack to hit a little higher and more often, but i dont want the regular melee to hit higher.
 
Last edited:
It seens you are using a random from 1 to 100 interval and you only make the damage when the value is higher than 95. So there is a 5% to hit a special attack. To hit more often change 95 to 50 for example, so there will be 50% change of making a special attack.

I think you got it.
 
Anyone, please help me, in almost new on this ot serv, i cant found any map for 8.54, and i need, to attack faster on all vocs, but i dont know how i fix it, and very i gonna put the script. and i want make a manarune, please anyone? =)

Thanks.:thumbup:
 
Anyone, please help me, in almost new on this ot serv, i cant found any map for 8.54, and i need, to attack faster on all vocs, but i dont know how i fix it, and very i gonna put the script. and i want make a manarune, please anyone? =)

Thanks.:thumbup:

Wrong place to post, go make a new thread =)
 
Back
Top