Using tfs 1.4
How would I parse for example the player to my combat?
Example script:
How would I parse for example the player to my combat?
Example script:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, player:getVocation():getId()) <---- This will return that player is nil, how do I parse it?
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(AREA_SQUARE1X1))
function onGetFormulaValues(player, skill, attack, factor)
local min = (player:getLevel() / 5) + (skill * attack * 0.03) + 7
local max = (player:getLevel() / 5) + (skill * attack * 0.05) + 11
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(player, variant)
return combat:execute(player, variant)
end