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

Convert this spell to TFS 1.3

maper1

New Member
Joined
Aug 17, 2012
Messages
38
Reaction score
0
i need a spell with two damage for tfs 1.3 please
 
Last edited:
Lua:
   arr1 = {
    {0, 0, 1, 0, 0},
    {0, 1, 1, 1, 0},
    {1, 1, 3, 1, 1},
    {0, 1, 1, 1, 0},
    {0, 0, 1, 0, 0},
}

   arr2 = {
   {1, 0, 0, 0, 1, 0, 0, 0, 1},
{0, 1, 0, 0, 1, 0, 0, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 0, 0},
{1, 1, 1, 1, 3, 1, 1, 1, 1},
{0, 0, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 0, 0, 1, 0, 0, 1, 0},
{1, 0, 0, 0, 1, 0, 0, 0, 1},
}


local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS)
combat1:setParameter(arr, COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat2:setParameter(arr2, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH)

combat1:setArea(createCombatArea(arr1))
combat2:setArea(createCombatArea(arr2))

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 4.5) + 20
    local max = (level / 5) + (maglevel * 7.6) + 48
    return -min, -max
end

combat1:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onGetFormulaValues2(player, level, maglevel)
    local min = (level / 5) + (maglevel * 4.5) + 20
    local max = (level / 5) + (maglevel * 7.6) + 48
    return -min, -max
end

combat2:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues2")

function onCastSpell(creature, var)
    if creature:getStorageValue(warPrivate_UE) > 0 then
          return false
     else
     combat1:execute(creature, var)
     combat2:execute(creature, var)
          return true
     end
end
 
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 16)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))

local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, 22)
combat2:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat2:setParameter(COMBAT_PARAM_USECHARGES, true)
combat2:setArea(createCombatArea(AREA_CIRCLE3X3))

-- callback function for combat
function onGetFormulaValues1(player, level, maglevel)
    local min = (level / 1) + (maglevel * 3) + 32
    local max = (level / 5) + (maglevel * 9) + 40
    return -min, -max
end

-- callback function for combat2
function onGetFormulaValues2(player, level, maglevel)
    local min = (level / 1) + (maglevel * 3) + 32
    local max = (level / 5) + (maglevel * 9) + 40
    return -min, -max
end

-- execute the callback functions after casting the spell for both combat & combat2 respectfully
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues1")
combat2:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues2")

-- 2 second delay
local delay = 1000 * 2

function onCastSpell(creature, var)
    -- if the spell casts successfully then continue
    if combat:execute(creature, var) then
        -- will execute when the delay time is reached
        addEvent(function(cid, v)
            -- check if the creature exists
            local c = Creature(cid)
            if c then
                -- execute if it does
                combat2:execute(c, v)
            end
            -- parameters the delay time, the creature id (cid) and var (v)
        end, delay, creature:getId(), var)
        -- return true (show the words above the player's head emote or regular text)
        return true
    end
    -- if it doesn't cast successfully then return false and don't show any text
    return false
end

Don't know who made this for me long time ago but i think it was @Apollos So all credit to him. " if it was him" xD
 
Back
Top