local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -200)
setCombatCondition(combat, condition)
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.0, 0)
function onUseWeapon(cid, var)
if getPlayerLevel(cid) >= 20 then
local chance = math.random(1,10)
if chance == 1 then
doCombat(cid, combat, var)
else
doCombat(cid, combat2, var)
end
else
doPlayerSendCancel(cid, 'You must be level 20 or higher to use this weapon.')
end
end
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_REDSPARKS)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 5.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.0, 0)
function onUseWeapon(cid, var)
if getPlayerLevel(cid) >= 20 then
local chance = math.random(1,10)
if chance == 1 then
doCombat(cid, combat, var)
doSendAnimatedText(getPlayerPosition(cid),"Doublehit!", TEXTCOLOR_RED)
else
doCombat(cid, combat2, var)
end
else
doPlayerSendCancel(cid, 'You must be level 20 or higher to use this weapon.')
end
end
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_REDSPARKS)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)
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, CONST_ME_HITAREA)
setCombatFormula(combat1, COMBAT_FORMULA_SKILL, 0, 0, 1.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.0, 0)
local function onUseWeapon1(parameters)
doCombat(parameters.cid, combat, parameters.var)
end
local function onUseWeapon2(parameters)
doCombat(parameters.cid, combat1, parameters.var)
end
local function onUseWeapon3(parameters)
doCombat(parameters.cid, combat2, parameters.var)
end
function onUseWeapon(cid, var)
local parameters = { cid = cid, var = var, combat = combat, combat1 = combat1, combat2 = combat2 }
if getPlayerLevel(cid) >= 20 then
local chance = math.random(1,10)
if chance == 1 then
addEvent(onUseWeapon1, 1, parameters)
addEvent(onUseWeapon2, 425, parameters)
doSendAnimatedText(getPlayerPosition(cid),"Doublehit!", TEXTCOLOR_RED)
else
addEvent(onUseWeapon3, 325, parameters)
end
else
doPlayerSendCancel(cid, 'You need level 20 to use this weapon.')
end
end
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0
local chance = math.random(1,10)
addEvent(onUseWeapon2, 225, parameters)
You can make 1.0 higher. Combat is the first of the double hit and combat1 is the second of the double hit.
LUA:setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0
This means 10% chance, if you want to to happen more often, just make the 10 lower.
LUA:local chance = math.random(1,10)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.5, 0
This is works for Wand Weapon?!
yep 8.10 versionDo you mean a weapon that gives you mana instead that it costs mana? Should this mana be a certain amount or based on lvl or magic level?
mMmm , showme some scripts for other version ? =\Which server version? I don't have testservers with client 8.10, but I assume it's similar to a more known server version with an other client version.