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

directional spell custom big sprite tfs 1.3

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
921
Location
Chile
Hello guys, i find myself needing a spell and can't pay my programmer right now, so im asking the community for help with this, is very important to me

i need a TFS 1.3 spell that shoots a sprite like kamehameha wave, but using a custom kamehameha wave, lets say a sprite of 96 width and 64 height to the sides and 96 height and 64 width to the top and bottom...

i would need this spell to be easy configurable so i can edit it and change the damage areas, damage type and magic effect used

that's it my request, thanks!!

c2e005e23299f352485e2f92c0dbc6b3.png
 
Last edited:
Solution
There is so many ways to achive the way you want. But you have to adjust it for your own server:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_NONE)
combat:setFormula(COMBAT_FORMULA_DAMAGE, 0, -100, 0, -200)
combat:setArea(createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5))

local effect = {
    [DIRECTION_NORTH] = CONST_ME_FIREAREA,
    [DIRECTION_EAST] = CONST_ME_ENERGYHIT,
    [DIRECTION_SOUTH] = CONST_ME_MORTAREA,
    [DIRECTION_WEST] = CONST_ME_POISONAREA
}

function onCastSpell(creature, variant)
    creature:getPosition():sendMagicEffect(effect[creature:getDirection()])
    return combat:execute(creature, variant)
end
It's still normal wave, I'll just explain it for you.

Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) -- damage type
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) -- effect ID/name
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) -- distance effect ID/name 
combat:setArea(createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5)) -- area

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 3) * 1.2 -- minimal damage formula
    local max = (level / 5) + (maglevel * 3) * 2.0 -- maximum damage formula
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, var)
    return combat:execute(creature, var)
end
 
You should check creature (caster) direction and define each effect to direction where's the creature is looking.
 
It's still normal wave, I'll just explain it for you.

Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) -- damage type
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) -- effect ID/name
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) -- distance effect ID/name
combat:setArea(createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5)) -- area

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 3) * 1.2 -- minimal damage formula
    local max = (level / 5) + (maglevel * 3) * 2.0 -- maximum damage formula
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, var)
    return combat:execute(creature, var)
end

oh but how does this spell know the other magic effects? the one looking north, south, etc
 
There is so many ways to achive the way you want. But you have to adjust it for your own server:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_NONE)
combat:setFormula(COMBAT_FORMULA_DAMAGE, 0, -100, 0, -200)
combat:setArea(createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5))

local effect = {
    [DIRECTION_NORTH] = CONST_ME_FIREAREA,
    [DIRECTION_EAST] = CONST_ME_ENERGYHIT,
    [DIRECTION_SOUTH] = CONST_ME_MORTAREA,
    [DIRECTION_WEST] = CONST_ME_POISONAREA
}

function onCastSpell(creature, variant)
    creature:getPosition():sendMagicEffect(effect[creature:getDirection()])
    return combat:execute(creature, variant)
end
 
Last edited:
Solution
Back
Top