• 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.3] - Need help creating a spell

Nani3601

elhanan
Joined
May 18, 2012
Messages
82
Reaction score
2
Location
israel
123123.png

this is the spell script.

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(AREA_CIRCLE3X3))

function onGetFormulaValues(player, skill, attack, factor)
    local min = (player:getLevel() / 5) + (skill * attack * 0.04) + 10
    local max = (player:getLevel() / 5) + (skill * attack * 0.08) + 18
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local function castSpell(creatureId, variant, amount)
    local creature = Creature(creatureId)
    if creature then
        combat:execute(creature, variant)
        if amount > 1 then
            addEvent(castSpell, 500, creatureId, variant, amount - 1)
        end
    end
end

function onCastSpell(creature, variant)
    local creatureId = creature:getId()
    addEvent(castSpell, 0, creatureId, variant, 3)
    return true
end
 

alkurius

Intermediate OT User
Joined
May 13, 2014
Messages
104
Reaction score
115
Lua:
local combat = COMBAT_FIREDAMAGE
local disteffect = CONST_ANI_FIRE
local effect1 = CONST_ME_HITBYFIRE    --fuerte
local effect2 = CONST_ME_FIREAREA     --medio
local effect3 = CONST_ME_FIREATTACK   --bajo

area1 = createCombatArea({
{0, 1, 0},
{1, 3, 1},
{0, 1, 0}
})

area2 = createCombatArea({
{0, 1, 1, 1, 0},
{1, 1, 0, 1, 1},
{1, 0, 3, 0, 1},
{1, 1, 0, 1, 1},
{0, 1, 1, 1, 0}
})

area3 = createCombatArea({
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 3, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 1, 0},
{0, 0, 1, 1, 1, 0, 0}
})

function onGetFormulaValues1(player, level, magicLevel)
    local min = (4*level / 5) + (magicLevel * 1.2) + 5
    local max = (4*level / 5) + (magicLevel * 2.85) + 16
    return -min, -max
end

function onGetFormulaValues2(player, level, magicLevel)
    local min = (2*level / 5) + (magicLevel * 0.8) + 5
    local max = (2*level / 5) + (magicLevel * 1.2) + 16
    return -min, -max
end

function onGetFormulaValues3(player, level, magicLevel)
    local min = (1*level / 5) + (magicLevel * 0.4) + 5
    local max = (1*level / 5) + (magicLevel * 0.8) + 16
    return -min, -max
end

local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, combat)
combat1:setParameter(COMBAT_PARAM_EFFECT, effect1)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, disteffect)
combat1:setArea(area1)
combat1:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues1")

local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, combat)
combat2:setParameter(COMBAT_PARAM_EFFECT, effect2)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, disteffect)
combat2:setArea(area2)
combat2:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues2")


local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, combat)
combat3:setParameter(COMBAT_PARAM_EFFECT, effect3)
combat3:setParameter(COMBAT_PARAM_DISTANCEEFFECT, disteffect)
combat3:setArea(area3)
combat3:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues3")

local function Meteoro3(creature, variant)   
    combat3:execute(creature, variant)
    return true
end

local function Meteoro2(creature, variant)   
    combat2:execute(creature, variant)
    local player = Player(creature)
    addEvent(Meteoro3, 50, player.uid, variant)   
    return true
end

local function Meteoro1(creature, variant)   
    combat1:execute(creature, variant)
    local player = Player(creature)
    addEvent(Meteoro2, 50, player.uid, variant)   
    return true
end

function onCastSpell(creature, variant, isHotkey)
    Meteoro1(creature.uid, variant)   
    return true
end

1200.gif

like this??
 
Last edited by a moderator:
Top