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

Solved explosion rune custom adding skill not working tfs 1.3

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
922
Location
Chile
Hello guys, im trying to add skill in the formula of a custom explosion rune, but i cant get it working D: can anybody help me plz?? tfs 1.3

LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 381)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EXPLOSION)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setArea(createCombatArea(AREA_CROSS1X1))

function onGetFormulaValues(player, level, magicLevel, skill)
    local min = (level / 2) + (magicLevel * 40.3) + skill*4
    local max = (level / 2) + (magicLevel * 44.4) + skill*5
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end
 
Solution
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 381)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EXPLOSION)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setArea(createCombatArea(AREA_CROSS1X1))

function onGetFormulaValues(player, skill, attack, factor)
    local magicLevel, level = player:getMagicLevel(), player:getLevel()
    local min = (level / 2) + (magicLevel * 40.3) + skill*4
    local max = (level / 2) + (magicLevel * 44.4) + skill*5
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)...
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 381)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EXPLOSION)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setArea(createCombatArea(AREA_CROSS1X1))

function onGetFormulaValues(player, skill, attack, factor)
    local magicLevel, level = player:getMagicLevel(), player:getLevel()
    local min = (level / 2) + (magicLevel * 40.3) + skill*4
    local max = (level / 2) + (magicLevel * 44.4) + skill*5
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end
 
Solution
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 381)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EXPLOSION)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setArea(createCombatArea(AREA_CROSS1X1))

function onGetFormulaValues(player, skill, attack, factor)
    local magicLevel, level = player:getMagicLevel(), player:getLevel()
    local min = (level / 2) + (magicLevel * 40.3) + skill*4
    local max = (level / 2) + (magicLevel * 44.4) + skill*5
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end
worked perfectly thank you!!!!!!!
altho, is any chance this can be done so the attack of the player's sword or weapons doesn't count?
 
Last edited:
worked perfectly thank you!!!!!!!
altho, is any chance this can be done so the attack of the player's sword or weapons doesn't count?

Far as I can see Weapon ATK is not a factor in that formula, try to use a 999 Weapon ATK to confirm.
 
Far as I can see Weapon ATK is not a factor in that formula, try to use a 999 Weapon ATK to confirm.
actually we already tested and a player with a high damage sword attacks way more than when he uses a low attack sword :S
 
Then you must be using another CreatureScript since I just tested it and is working as intended:

Weapon attack 1:
23:42 A pharaoh loses 340 hitpoints due to your attack.

Weapon attack 99999:
23:42 A pharaoh loses 344 hitpoints due to your attack.
23:42 A pharaoh loses 352 hitpoints due to your attack.
23:42 A pharaoh loses 320 hitpoints due to your attack.
 
Then you must be using another CreatureScript since I just tested it and is working as intended:

Weapon attack 1:
23:42 A pharaoh loses 340 hitpoints due to your attack.

Weapon attack 99999:
23:42 A pharaoh loses 344 hitpoints due to your attack.
23:42 A pharaoh loses 352 hitpoints due to your attack.
23:42 A pharaoh loses 320 hitpoints due to your attack.
what creaturescript? i dont understand, this is spell
 
I mentioned CreatureScript since that's the most logical place with an onHealthChange, that or you are using a Stat system or something that is affecting the output of the spell, I'm afraid I can't help you further since the formula it is working as intended in a normal TFS 1.3 installation.
 
Back
Top