• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[0.4] Distance Effect does not work

Hashirama479

World of Ninja
Joined
Dec 19, 2016
Messages
536
Solutions
6
Reaction score
74
LUA:
local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 2)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 11)
setCombatParam(combat1, COMBAT_PARAM_CREATEITEM, 1353)

local arr1 = {
{0, 1, 0},
{1, 3, 1},
{0, 1, 0}
}

local area1 = createCombatArea(arr1)
setCombatArea(acombat1, area1)

function onTargetTile(cid, pos)
    doCombat(cid,combat1,positionToVariant(pos))
end

setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

local function onCastSpell1(parameters)
    doCombat(parameters.cid, acombat1, parameters.var)
end
function onCastSpell(cid, var)
local parameters = {cid = cid, var = var}
    addEvent(onCastSpell1, 0, parameters)
    return true
end

( Working now. )
 
Last edited:
I don't see anything wrong with the distance effect line, but line 13 doesnt seem to be doing anything. Maybe the problem with the distance effect is in your spells.xml.
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ANI_EXPLOSION)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1304)
local arr = {
{0, 0, 0},
{1, 3, 1},
{0, 0, 0}
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
local rebirths = getPlayerStorageValue(cid,85987)
function onCastSpell(cid, var)
    if(getTileInfo(getThingPos(cid)).optional == true) then
        doPlayerSendCancel(cid, "You cannot use trap rune in no pvp zone.")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        return true
        end
    return doCombat(cid, combat, var)
end
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ANI_EXPLOSION)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1304)
local arr = {
{0, 0, 0},
{1, 3, 1},
{0, 0, 0}
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
local rebirths = getPlayerStorageValue(cid,85987)
function onCastSpell(cid, var)
    if(getTileInfo(getThingPos(cid)).optional == true) then
        doPlayerSendCancel(cid, "You cannot use trap rune in no pvp zone.")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        return true
        end
    return doCombat(cid, combat, var)
end


Didnt work but I alredy have found a other solution for that spell problem :P so problem is solved ;D
 
Back
Top