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

Spell TFS 1.2 Spell Attack Twice/Double

Gicu

Well-Known Member
Joined
Feb 26, 2011
Messages
187
Reaction score
52
Spell attack Twice/Double.

local time_between_hits = "here change time between spells"


---spells/attack/twicespell.lua

Code:
local combat = Combat()
local time_between_hits = 0.3 --seconds

combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 66)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 2.5) + 30
    local max = (level / 5) + (maglevel * 2.5) + 30
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, var)
   combat:execute(creature, var)
  addEvent(function()  combat:execute(creature, var) end, time_between_hits * 1000)
  return true
end

--- spells.xml

<
Code:
    <instant group="attack" spellid="107" name="Twice" words="twice" lvl="1" mana="20" prem="0" range="6" needtarget="1" blockwalls="1" cooldown="1000" groupcooldown="500" needlearn="0" script="attack/twice.lua">
        <vocation name="Sorcerer" />
    </instant>
 
How formula works?

I was trying this as high level spell, but when i changed a maglevel multiplier (from 2.5 to 5.5 for e.g.) I noticed damage is reduced to last part (+ 30), what means that part:
(level / 5) + (maglevel * 2.5)
is equal to 0.
Tested on 350 lvl with 110 maglvl.
 
This is standard formula for all spells. I use TFS 1.2 for 10.98 version.
 
I have a question though, what to change if I want the double spells to use different combat areas instead of 1
 
addEvent(function() combat:execute(creature, var) end, 300)
addEvent(function() combat:execute(creature, var) end,600)
addEvent(function() combat:execute(creature, var) end, 900)
addEvent(function() combat:execute(creature, var) end, 1200)

Add many you want. 300,600 is MS.
 
Back
Top