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

Paralyze Axe

Wifebeater

New Member
Joined
Feb 24, 2011
Messages
60
Reaction score
1
Hello, i have a 8.6 server. And i want to create a paralyze axe.

This is what i wrote in weapons.xml

Code:
<melee id="8924" level="110" unproperly="1" event="script" value="paraaxe.lua"/>

And here's the script

Code:
 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, -150) 
    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) >= 100 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 need level 100 to use this weapon.') 
    end 
end

I want it to paralyze like every 10th hit or something. But it doesnt work. i keep hitting and nothing happends :S Anybody got any idea what i did wrong?
 
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, 20000)
setConditionFormula(condition, -0.9, 0, -0.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, 0, 1.0, 0) 
     
function onUseWeapon(cid, var)
	local ret = doCombat(cid, combat, var)
	if not ret then
		return false
	end

	local target = variantToNumber(var)
	if isCreature(target) then
        local chance = math.random(1,10) 
        if chance == 1 then 
			doAddCondition(target, condition)
		end
	end
	return true
end

Try that, not tested. since you have it registered in your weapons xml for level you dont need the level thing in there
 
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) 
    setConditionFormula(condition, -0.9, 0, -0.9, 0)
    setCombatCondition(combat, condition) 
     
function onUseWeapon(cid, var) 
    if getPlayerLevel(cid) >= 100 then 
        local chance = math.random(1,10) 
        if chance == 1 then 
        doCombat(cid, combat, var) 
        else 
        doCombat(cid, condition, var) 
        end 
    else 
        doPlayerSendCancel(cid, 'You need level 100 to use this weapon.') 
    end 
end


test this
 
Not tested, but should work:

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, 20000)
    setConditionFormula(condition, -0.9, 0, -0.9, 0)
    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 onCastSpell(cid, var)
	if(not doCombat(cid, combat, var)) then
		return false
	end

	doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN)
	return true
end
     
function onUseWeapon(cid, var) 
    if getPlayerLevel(cid) >= 100 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 need level 100 to use this weapon.') 
    end 
end
 
Back
Top