• Congratulations to the OTLand January Mapping Competition Winner! The grand prize of Otland Premium goes to Andréew.
  • Sign up for February Mapping Competition! The prize includes Otland Premium time.
  • 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!

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

darknelson

New Member
Joined
Jun 19, 2011
Messages
77
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 ŁĕğẹňĎ
Premium User
Support Team
Joined
Mar 4, 2017
Messages
1,301
Best answers
153
Reaction score
477
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
5,340
Best answers
528
Reaction score
3,083
return -1000, -3000
 
Top