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

C++ Effect on stack

DiegoRulez

Member
Joined
Apr 16, 2012
Messages
93
Reaction score
11
Location
Feira de Santana - Brasil
I want to modify a detail in my source (TFS 1.2).
I want to leave it as it was before: When using a rune (example: SD - Sudden Death Rune) on someone, this rune must hit everyone who is in the same MQ and not just the target.

Does anyone know where and what to change in source to get this effect?
I appreciate who can help.

If it is not in the source but in the script ..
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 4.3) + 32
    local max = (level / 5) + (maglevel * 7.4) + 48
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end

Example script
Do you have this correction? @Peonso
 
Last edited:
Try this:

Lua:
function onCastSpell(creature, variant, isHotkey)
    local pos = variantToPosition(variant)
    local pPos = Position(creature:getPosition())
  
    local dmg_min = (creature:getLevel() / 5) + (creature:getMagicLevel() * 4.3) + 32
    local dmg_max = (creature:getLevel() / 5) + (creature:getMagicLevel() * 7.4) + 48
  
    pPos:sendDistanceEffect(pos, CONST_ANI_SUDDENDEATH)
    return doAreaCombatHealth(creature, COMBAT_DEATHDAMAGE, pos, dmg_min, dmg_max, CONST_ME_MORTAREA)
end
 
Did not work.
Error appearing on console:
Code:
Lua Script Error: [Spell Interface]
data/spells/scripts/attack/sudden death.lua:onCastSpell
luaDoAreaCombatHealth(). Area not found
stack traceback:

 [C]: in function 'doAreaCombatHealth'
  data/spells/scripts/attack/sudden death.lua:9: in function <data/spells/scripts/attack/sudden death.lua:1>
 
If by MQ you means SQM, that never happened, targeted runes like SD never hit all the creatures in the same SQM, as far as I know.
 
Back
Top