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

Weapon casting exori

Morenao

New Member
Joined
Jun 11, 2020
Messages
6
Reaction score
2
I want to make a sword that has the chance that, instead of making the normal attack, make an area attack, like an "exori".
So I made the script, and put as area, the same as the spell (AREA_SQUARE1X1), but it gives an error (LuaScriptInterface :: luaCombatSetArea (). Area not found), so I tried to do it using the Burst Arrow scripts as a base, but, when it attacks, the "exori" area is centered on the target, and not the attacker.. Can someone help me? I'll put the script I made below
Sorry for my English, this was translated by google.

Lua:
local combat = createCombatObject()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)


local combat2 = createCombatObject()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat2:setParameter(COMBAT_PARAM_BLOCKARMOR, true)

local area = createCombatArea(AREA_SQUARE1X1)
combat2:setArea(area)
 
 
    function onGetFormulaValues(player, skill, attack, factor)
    local skillTotal = skill * attack
    local levelTotal = player:getLevel() / 5
    return -(((skillTotal * 0.07) + 7) + (levelTotal)), -(((skillTotal * 0.09) + 11) + (levelTotal))
    end
 
    setCombatCallback(combat2, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
 
 
 
function onUseWeapon(cid, var, player, creature)
local target = getCreatureTarget(cid)

    local chance = math.random(2)
        if chance <= 2 then
            doCombat(cid, combat2, var)
        else
            doCombat(cid, combat, var)
    end
    return true
end
 
I want to make a sword that has the chance that, instead of making the normal attack, make an area attack, like an "exori".
So I made the script, and put as area, the same as the spell (AREA_SQUARE1X1), but it gives an error (LuaScriptInterface :: luaCombatSetArea (). Area not found), so I tried to do it using the Burst Arrow scripts as a base, but, when it attacks, the "exori" area is centered on the target, and not the attacker.. Can someone help me? I'll put the script I made below
Sorry for my English, this was translated by google.

Lua:
local combat = createCombatObject()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)


local combat2 = createCombatObject()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat2:setParameter(COMBAT_PARAM_BLOCKARMOR, true)

local area = createCombatArea(AREA_SQUARE1X1)
combat2:setArea(area)


    function onGetFormulaValues(player, skill, attack, factor)
    local skillTotal = skill * attack
    local levelTotal = player:getLevel() / 5
    return -(((skillTotal * 0.07) + 7) + (levelTotal)), -(((skillTotal * 0.09) + 11) + (levelTotal))
    end

    setCombatCallback(combat2, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")



function onUseWeapon(cid, var, player, creature)
local target = getCreatureTarget(cid)

    local chance = math.random(2)
        if chance <= 2 then
            doCombat(cid, combat2, var)
        else
            doCombat(cid, combat, var)
    end
    return true
end

Hey, I would advise using correct indentation (line 16 to 20), and sticking to one way of calling your methods, you are mismatching 0.X semi-outdated functions
doCombat(cid, combat, var)
with 1.X ones,
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true).

It is not clear and really offputting. Consider refactoring your code and then we might be able to help.
 
Back
Top