Spell TFS 1.2 Spell Attack Twice/Double

Discussion in 'GlobalEvents, Spells & CreatureEvents' started by gicu0770, Jul 18, 2017.

  1. gicu0770

    gicu0770 New Member

    Joined:
    Feb 26, 2011
    Messages:
    7
    Likes Received:
    1
    Best Answers:
    0
    Spell attack Twice/Double.

    local time_between_hits = "here change time between spells"


    ---spells/attack/twicespell.lua

    Code (Text):
    1. local combat = Combat()
    2. local time_between_hits = 0.3 --seconds
    3.  
    4. combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
    5. combat:setParameter(COMBAT_PARAM_EFFECT, 66)
    6. combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)
    7. combat:setArea(createCombatArea(AREA_SQUARE1X1))
    8.  
    9. function onGetFormulaValues(player, level, maglevel)
    10.     local min = (level / 5) + (maglevel * 2.5) + 30
    11.     local max = (level / 5) + (maglevel * 2.5) + 30
    12.     return -min, -max
    13. end
    14. combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
    15. function onCastSpell(creature, var)
    16.    combat:execute(creature, var)
    17.   addEvent(function()  combat:execute(creature, var) end, time_between_hits * 1000)
    18.   return true
    19. end
    --- spells.xml

    <
    Code (Text):
    1.     <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">
    2.         <vocation name="Sorcerer" />
    3.     </instant>
    4.  
     
  2. devzan14

    devzan14 Member

    Joined:
    Feb 3, 2015
    Messages:
    34
    Likes Received:
    3
    Best Answers:
    0
    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:
    is equal to 0.
    Tested on 350 lvl with 110 maglvl.
     
  3. gicu0770

    gicu0770 New Member

    Joined:
    Feb 26, 2011
    Messages:
    7
    Likes Received:
    1
    Best Answers:
    0
    This is standard formula for all spells. I use TFS 1.2 for 10.98 version.
     

Share This Page

Loading...