• 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+ [TFS 1.3 - RevScripts] How to Use Spells by Callback Instead setFormula for Summons?

Yan18

Member
Joined
Jun 14, 2014
Messages
104
Solutions
3
Reaction score
17
Hello guys!

I wanna create a spell by RevScripts using combat:setCallback instead combat:setFormula because setFormula is static and I can't get summons from a player.

I tried to create a spell, but have no damage (0 value damage):

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 4)

function onGetFormulaValues(creature, level, magicLevel)
    print(creature:getName())
    local min = summons_attacks[creature:getSummons()[1]:getName()].min_power
    local max = summons_attacks[creature:getSummons()[1]:getName()].max_power
   
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onGetFormulaValues")

local spell = Spell(SPELL_INSTANT)

function spell.onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end

spell:group("attack")
spell:id(2001)
spell:name("Ember")
spell:words("Ember")
spell:level(35)
spell:mana(10)
spell:isPremium(false)
spell:range(8)
spell:needCasterTargetOrDirection(true)
spell:isBlockingWalls(true)
spell:cooldown(8000)
spell:groupCooldown(8000)
spell:needLearn(false)
spell:vocation("sorcerer;true", "druid;true", "master sorcerer", "elder druid")
spell:register()

My spell must be:

  • Target
  • Based only in player level (it isn't based in anyone other skill, only level)
  • Damage depends on summons power in their respective table value

But it seems like the callback never calls the function onGetFormulaValues.
 
Back
Top