não intendi uq vc quer
Abraço
não intendi uq vc quer
Abraço
info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78

não intendi uq vc quer
Abraço
seguinte
if isInArray(WATER_TILES, getThingFromPos(tmp).itemid) then
doCreatureAddMana(cid, 1)
else
doCreatureAddMana(cid, -1)
queria q se ele estivese perto dos ids ele ganha 1 de mana
se n ele perde 1 de mana
o problema é q n sei muito bem como fazer isso
e ele só ta perdendo
info
Grupo: Campones
Registrado: 24/07/12
Posts: 69
Reputação: +13
Char no Tibia: ADM Aritgo

cara o seu script estava necessitando de um 'end' simplesmente o adicionei veja se vai funcionar
function onCastSpell(cid, var)
local pos = getPlayerPosition(cid)
doSendMagicEffect({x = pos.x+1, y = pos.y+1, z = pos.z}, 87)
local position, match = getCreaturePosition(cid)
for x = (position.x - 3), (position.x + 3) do
for y = (position.y - 3), (position.y + 3) do
local tmp = {x = x, y = y, z = position.z}
if isInArray(WATER_TILES, getThingFromPos(tmp).itemid) then
doCreatureAddMana(cid, 1)
else
doCreatureAddMana(cid, -1)
return doCombat(cid, combat, var)
end
end
return doCombat(cid, combat, var)
end
end
info
Grupo: Banidos
Registrado: 11/01/13
Posts: 576
Reputação: +109
Char no Tibia: Darashia del Shee

cara o seu script estava necessitando de um 'end' simplesmente o adicionei veja se vai funcionar
function onCastSpell(cid, var) local pos = getPlayerPosition(cid) doSendMagicEffect({x = pos.x+1, y = pos.y+1, z = pos.z}, 87) local position, match = getCreaturePosition(cid) for x = (position.x - 3), (position.x + 3) do for y = (position.y - 3), (position.y + 3) do local tmp = {x = x, y = y, z = position.z} if isInArray(WATER_TILES, getThingFromPos(tmp).itemid) then doCreatureAddMana(cid, 1) else doCreatureAddMana(cid, -1) return doCombat(cid, combat, var) end end return doCombat(cid, combat, var) end end
Sim faltava um end, mas tambem falta a variaval
if isInArray(WATER_TILES, getThingFromPos(tmp).itemid) then
essa parte precisaria de uma variavel que se chame local WATER_TILES.
Nao testei mas testa ai =o
[size=4]local agua = {1111, 2222, 3333}-- configure o id dos tiles de water[/size]
function onCastSpell(cid, var)
local pos = getPlayerPosition(cid)
doSendMagicEffect({x = pos.x+1, y = pos.y+1, z = pos.z}, 87)
local position, match = getCreaturePosition(cid)
for x = (position.x - 3), (position.x + 3) do
for y = (position.y - 3), (position.y + 3) do
local tmp = {x = x, y = y, z = position.z}
if isInArray(agua, getThingFromPos(tmp).itemid) then
doCreatureAddMana(cid, 1)
else
doCreatureAddMana(cid, -1)
return doCombat(cid, combat, var)
end
end
return doCombat(cid, combat, var)
end
end
Editado Janeiro 31 por Gears
info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78

cara o seu script estava necessitando de um 'end' simplesmente o adicionei veja se vai funcionar
function onCastSpell(cid, var) local pos = getPlayerPosition(cid) doSendMagicEffect({x = pos.x+1, y = pos.y+1, z = pos.z}, 87) local position, match = getCreaturePosition(cid) for x = (position.x - 3), (position.x + 3) do for y = (position.y - 3), (position.y + 3) do local tmp = {x = x, y = y, z = position.z} if isInArray(WATER_TILES, getThingFromPos(tmp).itemid) then doCreatureAddMana(cid, 1) else doCreatureAddMana(cid, -1) return doCombat(cid, combat, var) end end return doCombat(cid, combat, var) end end
n é por causa disso
eu ja tinha tentado antes
pera vou postar o script inteiro '-'
edit: ta ai o script da spell inteiro
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -35, 0, -55)
local area = createCombatArea({
{0, 0, 0},
{1, 1, 1},
{1, 2, 1},
{1, 1, 1},
{0, 0, 0}
})
setCombatArea(combat, area)
local WATER_TILES = {1370,1371,1372,1773,9466,1378, 4718, 6628, 6630, 4664, 5739, 4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825}
function onCastSpell(cid, var)
local pos = getPlayerPosition(cid)
doSendMagicEffect({x = pos.x+1, y = pos.y+1, z = pos.z}, 87)
local position, match = getCreaturePosition(cid)
for x = (position.x - 3), (position.x + 3) do
for y = (position.y - 3), (position.y + 3) do
local tmp = {x = x, y = y, z = position.z}
if isInArray(WATER_TILES, getThingFromPos(tmp).itemid) then
doCreatureAddMana(cid, 1)
else
doCreatureAddMana(cid, -1)
return doCombat(cid, combat, var)
end
end
return doCombat(cid, combat, var)
end
end
Editado Janeiro 31 por rohfagundes
info
Grupo: Banidos
Registrado: 11/01/13
Posts: 576
Reputação: +109
Char no Tibia: Darashia del Shee

@Rohfagundes, testa ai ![]()
local WATER_TILES = {1370,1371,1372,1773,9466,1378, 4718, 6628, 6630, 4664, 5739, 4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825}
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -35, 0, -55)
local area = createCombatArea({
{0, 0, 0},
{1, 1, 1},
{1, 2, 1},
{1, 1, 1},
{0, 0, 0}
})
setCombatArea(combat, area)
function onCastSpell(cid, var)
local pos = getPlayerPosition(cid)
doSendMagicEffect({x = pos.x+1, y = pos.y+1, z = pos.z}, 87)
local position, match = getCreaturePosition(cid)
for x = (position.x - 3), (position.x + 3) do
for y = (position.y - 3), (position.y + 3) do
local tmp = {x = x, y = y, z = position.z}
if isInArray(WATER_TILES, getThingFromPos(tmp).itemid) then
doCreatureAddMana(cid, 1)
else
doCreatureAddMana(cid, -1)
return doCombat(cid, combat, var)
end
end
return doCombat(cid, combat, var)
end
end
info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78

@Rohfagundes, testa ai
local WATER_TILES = {1370,1371,1372,1773,9466,1378, 4718, 6628, 6630, 4664, 5739, 4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -35, 0, -55) local area = createCombatArea({ {0, 0, 0}, {1, 1, 1}, {1, 2, 1}, {1, 1, 1}, {0, 0, 0} }) setCombatArea(combat, area) function onCastSpell(cid, var) local pos = getPlayerPosition(cid) doSendMagicEffect({x = pos.x+1, y = pos.y+1, z = pos.z}, 87) local position, match = getCreaturePosition(cid) for x = (position.x - 3), (position.x + 3) do for y = (position.y - 3), (position.y + 3) do local tmp = {x = x, y = y, z = position.z} if isInArray(WATER_TILES, getThingFromPos(tmp).itemid) then doCreatureAddMana(cid, 1) else doCreatureAddMana(cid, -1) return doCombat(cid, combat, var) end end return doCombat(cid, combat, var) end end
o problema continua
é como se ele ignora-se a posiçao do player em relaçao a agua
ou
o problema ta nessa parte
if isInArray(WATER_TILES, getThingFromPos(tmp).itemid) then
doCreatureAddMana(cid, 1)
else
doCreatureAddMana(cid, -1)
pq sempre tira 1 de mana perto dos ids ou n
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

como q ta a tag da spell heim? ;x
vcs ae emcima colocaram o end no lugar errado ^^
Editado Janeiro 31 por Slicer
info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78

<instant name="Water Circle" words="w-circle" lvl="1" exhaustion="2000" prem="0" range="0" needlearn="0" needtarget="0" blockwalls="1" aggressive="1" event="script" value="water/water circle.lua">
<vocation name="Water"/>
</instant>
info
Grupo: Banidos
Registrado: 11/01/13
Posts: 576
Reputação: +109
Char no Tibia: Darashia del Shee

Pode ser também que a speel esteja errada, peguei 1 spell qualquer aqui testa ai ![]()
Nao entendi mt bem essa spell sua então peguei 1 spell e edita pra que ela só seja usada dentro da agua, o resto vc adapta ![]()
local WATER_TILES = {1370,1371,1372,1773,9466,1378, 4718, 6628, 6630, 4664, 5739, 4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825}
local mana = 1
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_POFF)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 1500, 1500, 1500, 1500)
local arr = {
{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, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 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, 1, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0},
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
if not isInArray(WATER_TILES, getThingfromPos(pos)) then
return doPlayerSendTextMessage(cid, 20, "Vc não pode usar essa magia fora da agua.")
end
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

tenta assim..
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -35, 0, -55)
local area = createCombatArea({
{0, 0, 0},
{1, 1, 1},
{1, 2, 1},
{1, 1, 1},
{0, 0, 0}
})
setCombatArea(combat, area)
local WATER_TILES = {1370,1371,1372,1773,9466,1378, 4718, 6628, 6630, 4664, 5739, 4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825}
function onCastSpell(cid, var)
local pos, found = getPlayerPosition(cid), false
doSendMagicEffect({x = pos.x+1, y = pos.y+1, z = pos.z}, 87)
for x = (pos.x - 3), (pos.x + 3) do
for y = (pos.y - 3), (pos.y + 3) do
local tmp = {x = x, y = y, z = pos.z, stackpos = 0}
if isInArray(WATER_TILES, getTileThingByPos(tmp).itemid) then
found = true
break
end
end
end
if found then
doPlayerAddMana(cid, 1)
else
doPlayerAddMana(cid, -1)
end
return doCombat(cid, combat, var)
end
info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78

aeee vlw =D
funciono
+ rep
pode mover ja =D
mto obg
info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78
eu estou tendo dificuldade em fazer a spell só gastar mana longe dos ids
eu n sei direito como funciona o else
nesse caso só q ele só gasta mana nesse caso \/
acho melhor colocar pra gastar mana por aqui
em vez de gastar pelo xml
Editado Janeiro 31 por rohfagundes