TFS 1.X+ how to make a spell to make a constant damage

darknelson

Well-Known Member
Joined
Jun 19, 2011
Messages
73
Best answers
0
Reaction score
2
i like my spell hit always min 1000 maxium 3000 static damage, but i cant figure out how to edit to do that

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
combat:setParameter(COMBAT_PARAM_USECHARGES, 1)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

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

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, var)
    return combat:execute(creature, var)
end
 

M0ustafa

Î Àm ŁĕğẹňĎ
Support Team
Joined
Mar 4, 2017
Messages
889
Best answers
94
Reaction score
318
Location
Egypt
-(((skillTotal * 0.07) + 7) + (levelTotal))
(skillTotal is your character's skills * (weapon attack) * 0.07 + 7 ) + your character's level/5 = minimum
-(((skillTotal * 0.09) + 11) + (levelTotal)
(skillTotal is your character's skills * (weapon attack) * 0.09 + 11 ) + your character's level/5 = maximum
You should calculate it depends on your level and skills, We can't do it since we don't know your character's level or your character's skills.
 
Last edited:

Delusion

Divine Intellect
Support Team
Joined
Feb 14, 2015
Messages
4,935
Best answers
451
Reaction score
2,547
return -1000, -3000
 
Top