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

weapons scripts!

Sehoxe

New Member
Joined
Feb 15, 2010
Messages
53
Reaction score
1
Hello can somebody help me with this?

i need weapon scripts, for example a weapon with 10% of double hit chance
a weapon with 10% paralyze chance

anyone? :D
 
Paralyze
LUA:
    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

Double hit
LUA:
    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

Let me know if it worked.
 
Last edited:
it works! but, for example when the sword hits it says "double hit" right? and its just 1 hit like a critical
i wanna know if the sword can show the 2 damages? for example "double hit!"
100
210

instead of double hit! 310

THANKS! :D
 
New double hit script
LUA:
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
 
Last edited:
thank you!!!
i know you already done enough for me, but if you could answer a few last questions would be great! :D
very often the second hit never hit, i mean its the hit and them (spark like a exori but no hit or super weak hit) how can i make the scrip hit harder the second hit? is that possible?
and how can i change the percentage of how often will be a double hit?
thankyou limos!
 
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)

Also if it happens to often that the double hit hits at the same time just make 225 higher.
LUA:
	addEvent(onUseWeapon2, 225, parameters)
 
Last edited:
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)


so that means if i apply the changes this way will hit harder?
LUA:
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.5, 0
 
Thanks Limos you are the best your weapons are amazing!!!!!!!!!!!

- - - Updated - - -

How i can do a paralyze staff use this script??? because script paralyze is on another folder :/ <wand id="2437" level="1" mana="13" min="180" max="370" type="holy" event="function" value="default"> <!-- Drunk Staff -->
 
Do 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?
 
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.
 
Back
Top