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

Reverse Distanceeffects

Reyn

On to the next One
Joined
May 15, 2010
Messages
259
Reaction score
1
Location
Germany ;3
Hey guys ;P
i need some help with a spell.
i want to make it if i do a distanceeffect that it comes to you, not that its going away from you.
i hope that's possible and sry for my english ;s
looking forward to answers
regards
 
oh well ;S ty
but if i take for example this spell
Code:
local acombat = createCombatObject()

local combat8 = createCombatObject()
setCombatParam(combat8, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat8, COMBAT_PARAM_HITCOLOR, 180)
setCombatParam(combat8, COMBAT_PARAM_HITEFFECT, 5)
setCombatParam(combat8, COMBAT_PARAM_EFFECT, 84)
setCombatParam(combat8, COMBAT_PARAM_DISTANCEEFFECT, 40)
setCombatFormula(combat8, COMBAT_FORMULA_LEVELMAGIC, -32, -1, -37, -1)

local combat9 = createCombatObject()
setCombatParam(combat9, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat9, COMBAT_PARAM_HITCOLOR, 240)
setCombatParam(combat9, COMBAT_PARAM_HITEFFECT, 20)
setCombatParam(combat9, COMBAT_PARAM_EFFECT, 79)
setCombatFormula(combat9, COMBAT_FORMULA_LEVELMAGIC, -32, -1, -37, -1)

arr8 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}


arr9 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}

local area8 = createCombatArea(arr8)
local area9 = createCombatArea(arr9)
setCombatArea(acombat, area8)
setCombatArea(combat9, area9)

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

setCombatCallback(acombat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

local function onCastSpell8(parameters)
    doCombat(parameters.cid, acombat, parameters.var)
end

local function onCastSpell9(parameters)
    doCombat(parameters.cid, combat9, parameters.var)
end

function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell8, 0, parameters)
addEvent(onCastSpell9, 100, parameters)
return TRUE
end
where do i have to put it?
 
Code:
function onTargetTile2(cid, pos)
	 doSendDistanceShoot(pos, getThingPos(cid),TYPE) 
end

setCombatCallback(WHICH_COMBAT, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")

or add
Code:
doSendDistanceShoot(pos, getThingPos(cid),TYPE)
to the existing targettile function
 
Im not to sure but if you could write this
make it for a healing spell, make it have a pull effect towards the player and add health, whatever effect looks best.

make it like this
030030030
002020200
000111000
0321P1230
000111000
002020200
030030030

P = player and it works from 3 to 1 so it looks like its drawing in health from around them
 
aproveitando a situação
como eu faria com essa script para o combat 2 ser reverso?

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 36)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -0, -0, -0, -0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 36)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -0, -0, -0, -0)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 43)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -2.0, -22, -2.1, -31)







local area1 = {
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 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, createCombatArea(area2))
setCombatArea(combat3, createCombatArea(area3))

function onCastSpell(cid, var)
addEvent(doCombat, 100, cid, combat1, var)
addEvent(doCombat, 400, cid, combat2, var)
addEvent(doCombat, 500, cid, combat3, var)
return TRUE
end
 
err here it is o.o
Code:
local acombat = createCombatObject()

local combat8 = createCombatObject()
setCombatParam(combat8, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat8, COMBAT_PARAM_HITCOLOR, 215)
setCombatParam(combat8, COMBAT_PARAM_HITEFFECT, 2)
setCombatParam(combat8, COMBAT_PARAM_EFFECT, 88)
setCombatParam(combat8, COMBAT_PARAM_DISTANCEEFFECT, 10)
setCombatFormula(combat8, COMBAT_FORMULA_LEVELMAGIC, -32, -1, -37, -1)

local combat9 = createCombatObject()
setCombatParam(combat9, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat9, COMBAT_PARAM_HITCOLOR, 1)
setCombatParam(combat9, COMBAT_PARAM_HITEFFECT, 2)
setCombatParam(combat9, COMBAT_PARAM_EFFECT, 255)
setCombatParam(combat9, COMBAT_PARAM_DISTANCEEFFECT, 255)
setCombatFormula(combat9, COMBAT_FORMULA_LEVELMAGIC, -32, -1, -37, -1)

arr9 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}


arr8 = {
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0},
{0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0},
{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},
{1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 1},
{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},
{0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0},
{0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0}}

local area8 = createCombatArea(arr8)
local area9 = createCombatArea(arr9)
setCombatArea(acombat, area8)
setCombatArea(combat9, area9)

function onTargetTile(cid, pos)
	doCombat(cid,combat8,positionToVariant(pos))
	doSendDistanceShoot(pos, getThingPos(cid),30)
end

setCombatCallback(acombat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

local function onCastSpell8(parameters)
    doCombat(parameters.cid, acombat, parameters.var)
end

local function onCastSpell9(parameters)
    doCombat(parameters.cid, combat9, parameters.var)
end

function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell8, 0, parameters)
addEvent(onCastSpell9, 100, parameters)
return TRUE
end
 
okai sorry for doublepost but i need some more help :S
how do i edit the doSendDistanceShoot(pos,getThingPos(cid),17) or the whole spell idk what to edit so that it goes to the mob/player i attack if i have this line on spells.xml needtarget="1"
 
Back
Top