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

Spell Exori

Broldosk

New Member
Joined
Aug 23, 2019
Messages
31
Reaction score
1
Hi Comunity, i want change my spell "exori" by knight, without weapon, i already tried several ways and couldn't
this is my original script
not put the modification because it already gave several errors
tfs 0.4




local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

function onGetFormulaValues(cid, level, skill, attack, factor)
local skillTotal, levelTotal = skill, level / 5
return -(skillTotal * 0.5 + levelTotal), -(skillTotal * 1.5 + levelTotal)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Last edited:
Solution
@roriscrave Won't work because he is using TFS 0.4
@Broldosk You can try this one.
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

function onGetFormulaValues(cid, level, skill, attack, factor)
local skillTotal, levelTotal = skill, level / 5
return -(70 + levelTotal), -(150 + levelTotal)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
spells.xml

change this:
Lua:
needweapon="1"

result:
Lua:
<instant group="attack" spellid="80" name="Berserk" words="exori" level="35" mana="115" premium="1" needweapon="0" cooldown="4000" groupcooldown="2000" needlearn="0" script="attack/berserk.lua">
    <vocation name="Knight" />
    <vocation name="Elite Knight" />
</instant>
 
@namco

I want the weapon not to influence exori's damage.
I want the exori to do the same damage with or without a weapon.

data/spells/attack/bersek.lua
change for it

Lua:
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

function onGetFormulaValues(player, attack, factor)
    local min = (player:getLevel() / 5) + (attack * 0.03) + 7
    local max = (player:getLevel() / 5) + (attack * 0.05) + 11
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end
 
@roriscrave Won't work because he is using TFS 0.4
@Broldosk You can try this one.
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

function onGetFormulaValues(cid, level, skill, attack, factor)
local skillTotal, levelTotal = skill, level / 5
return -(70 + levelTotal), -(150 + levelTotal)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Solution
Back
Top