• 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++ Lua Combat Object Question?

dantexd

Member
Joined
Sep 1, 2010
Messages
97
Reaction score
23
Is there any way to control the position of the effects on this script?
Or implement this into the combat object effect?

local position = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z}

Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 180)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -11.5, 1, -11.2, 1)


local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 64)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -11.6, 1, -10.8, 1)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 72)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -10.9, 1, -11.7, 1)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 197)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -10.6, 1, -10.8, 1)


arr1 = {
    {3}
}

arr2 = {
    {3}
}

arr3 = {
    {3}
}

arr4 = {
    {3}
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
 
local function onCastSpell1(parameters)
    return isPlayer(parameters.cid) and doCombat(parameters.cid, combat1, parameters.var)
end
 
local function onCastSpell2(parameters)
    return isPlayer(parameters.cid) and doCombat(parameters.cid, combat2, parameters.var)
end

local function onCastSpell3(parameters)
    return isPlayer(parameters.cid) and doCombat(parameters.cid, combat3, parameters.var)
end

local function onCastSpell4(parameters)
    return isPlayer(parameters.cid) and doCombat(parameters.cid, combat4, parameters.var)
end
 
function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 10, parameters)
addEvent(onCastSpell2, 10, parameters)
addEvent(onCastSpell3, 1200, parameters)
addEvent(onCastSpell4, 1200, parameters)
return TRUE
end
 
Solution
@dantexd I don't think so. But will return error if the target die before the spells end, cause will don't find a target to send the effect. Need to find a way to avoid it, but I dont know how.
@dantexd
Lua:
local target = getCreatureTarget(cid)
local pos = getCreaturePosition(target)
local monsterpos = {x=pos.x, y=pos.y+1, z=pos.z}
doSendMagicEffect(monsterpos, EFFECT)
 
@dantexd I don't think so. But will return error if the target die before the spells end, cause will don't find a target to send the effect. Need to find a way to avoid it, but I dont know how.
 
Solution
Back
Top