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

How to achieve dmg around traget

Stanos

Veteran OT User
Joined
Jun 12, 2018
Messages
584
Solutions
4
Reaction score
314
Location
Europe
TFS 1.2
Hello,
so i have this spell which is target spell and i have no clue how to achieve think like this. Lets say you cast this spell to target, and everyone around him get dmg to,
1, 1, 1
1, 2, 1
1, 1, 1
so its square shape so number 2 (target) get dmg, number ones get dmg to
i dont even know if its possible

Spell im trying to edit \/
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENCHANTEDSPEAR)
combat:setFormula(COMBAT_FORMULA_LEVELMAGIC, -6.0, 0, -6.1, 0)

function onCastSpell(creature, variant)
    local player = Player(creature)
    if not player then
        return false
    end
    local target = player:getTarget()
    if not target then
        return false
    end
    local position = target:getPosition() + Position(2, 0, 0)
    position:sendMagicEffect(131)
    return combat:execute(creature, variant)
end

target* lul.
 
Last edited by a moderator:
Solution
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENCHANTEDSPEAR)
combat:setFormula(COMBAT_FORMULA_LEVELMAGIC, -6.0, 0, -6.1, 0)
combat:setArea(createCombatArea(AREA_SQUARE1X1))
function onCastSpell(creature, variant)
    local player = Player(creature)
    if not player then
        return false
    end
    local target = player:getTarget()
    if not target then
        return false
    end
    local position = target:getPosition() + Position(2, 0, 0)
    position:sendMagicEffect(131)
    return combat:execute(creature, variant)
end
what about that
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENCHANTEDSPEAR)
combat:setFormula(COMBAT_FORMULA_LEVELMAGIC, -6.0, 0, -6.1, 0)
combat:setArea(createCombatArea(AREA_SQUARE1X1))
function onCastSpell(creature, variant)
    local player = Player(creature)
    if not player then
        return false
    end
    local target = player:getTarget()
    if not target then
        return false
    end
    local position = target:getPosition() + Position(2, 0, 0)
    position:sendMagicEffect(131)
    return combat:execute(creature, variant)
end
what about that
 
Solution
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENCHANTEDSPEAR)
combat:setFormula(COMBAT_FORMULA_LEVELMAGIC, -6.0, 0, -6.1, 0)
combat:setArea(createCombatArea(AREA_SQUARE1X1))
function onCastSpell(creature, variant)
    local player = Player(creature)
    if not player then
        return false
    end
    local target = player:getTarget()
    if not target then
        return false
    end
    local position = target:getPosition() + Position(2, 0, 0)
    position:sendMagicEffect(131)
    return combat:execute(creature, variant)
end
what about that
1 sec let me try.
 
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENCHANTEDSPEAR)
combat:setFormula(COMBAT_FORMULA_LEVELMAGIC, -6.0, 0, -6.1, 0)
combat:setArea(createCombatArea(AREA_SQUARE1X1))
function onCastSpell(creature, variant)
    local player = Player(creature)
    if not player then
        return false
    end
    local target = player:getTarget()
    if not target then
        return false
    end
    local position = target:getPosition() + Position(2, 0, 0)
    position:sendMagicEffect(131)
    return combat:execute(creature, variant)
end
what about that
Just like i though it gonna be nonsense :D it creates createCombatArea to caster not a target. This
1, 1, 1
1, 2, 1
1, 1, 1
should be applied to target not a caster
 
maybe you missing something in parameters? take a look at burst arrow script, isnt like the same?
Burst arrow is a weapon script i believe.

Just like i though it gonna be nonsense :D it creates createCombatArea to caster not a target. This
1, 1, 1
1, 2, 1
1, 1, 1
should be applied to target not a caster
Go to your spells.xml and delete selftarget parameter, then add needtarget="1". (or however that parameter was called)
 
Back
Top