não tem como usar monstro como efeito
Tem Como Usar Um Item Ou Um Monstro Como Efeito ?
Por Diley007, 20 de out. de 2012 em Scripts
info
Grupo: Campones
Registrado: 15/10/12
Posts: 68
Reputação: +8

info
Grupo: Artesão
Registrado: 17/01/12
Posts: 137
Reputação: -1
Char no Tibia: Nao Tenho

não tem como usar monstro como efeito
mais tem como fazer que a sprite do monstro ou do item aparece no local determinado ??
up
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

Só você fazer quem nem a cip fazer um magiceffect com a mesma outfit do monstro.
info
Grupo: Artesão
Registrado: 17/01/12
Posts: 137
Reputação: -1
Char no Tibia: Nao Tenho

Só você fazer quem nem a cip fazer um magiceffect com a mesma outfit do monstro.
n cara ai e q ta, o motivo deu ta pedindo spells com sprite de item ou monstro e porque o limite de effects e 255, eu ja tentei desbloquear esse limite vi uns topicos aqui, mas os cara nao dao uma explicaçao legal e eu n entendi, o unico que deu uma explicaçao + ou - foi o "pedrowarlock", ai tentei mais aqui nao deu certo...
claro que tem como fazer um monstro/item ser utilizado como efeito, diga exatamente o que você quer fazer, se é item ou monstro, pois os 2 são diferentes
info
Grupo: Artesão
Registrado: 17/01/12
Posts: 137
Reputação: -1
Char no Tibia: Nao Tenho

claro que tem como fazer um monstro/item ser utilizado como efeito, diga exatamente o que você quer fazer, se é item ou monstro, pois os 2 são diferentes
faz os dois pra mim, mas tenta deixar +ou - ao exemplo de spell que eu usei la em cima...REP+ 1 semana
lib necessária (você pode adicionar no início do script, ou então criar um outro arquivo .lua com qualquer nome em data/lib e colocar isso dentro):
function newXYvar(x, y, voltas_horarias)
while voltas_horarias > 3 do
voltas_horarias = voltas_horarias - 4
end
if voltas_horarias <= 0 then
return x, y
elseif voltas_horarias == 1 then
return -y, x
elseif voltas_horarias == 2 then
return -x, -y
elseif voltas_horarias == 3 then
return y, -x
end
return 0, 0
end
function arrayToPositions(array, center, n_horario)
if not center or not center.x or not center.y or not center.z then return {} end
local voltas, mp, ret, iIs, x, y = n_horario and math.max(0, n_horario) or 0, {}, {}, {}, 1, 1
if voltas > 0 then
local maxC = 0
for lines = 1, #array do if maxC < #array[lines] then maxC = #array[lines] end end
if maxC < #array then maxC = #array end
for a = 1, maxC do iIs[a] = {} for b = 1, maxC do table.insert(iIs[a], 0) end end
end
while #mp == 0 do
local check = array[y][x]
if check > 1 then
mp = {x, y}
if voltas > 0 then iIs[y][x] = check end
if check == 3 then table.insert(ret, center) end
break
end
x = x + 1
if x > #array[y] then
y, x = y + 1, 1
if y > #array then break end
end
end
for ly, ny in pairs (array) do
for lx, nx in pairs (ny) do
if nx == 1 then
local dx, dy = lx - mp[1], ly - mp[2]
local newX, newY = newXYvar(dx, dy, voltas)
local newPos = {x = center.x + newX, y = center.y + newY, z = center.z}
table.insert(ret, newPos)
end
end
end
return ret
end
magia criano item:
elseif spell == "?" then
local itemId = 1990
local timeToRemove = 2500
local function damage(cid, area)
if not isCreature(cid) then return end
doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), area, -min, -max, 255)
local positions = arrayToPositions(area, getThingPositionWithDebug(cid))
for _, pos in pairs (positions) do
doCreateItem(itemId, 1, pos)
addEvent(function()
local i = getTileItemById(pos, itemId)
if i.uid > 0 then doRemoveItem(i.uid) end
end, timeToRemove)
end
end
local areas = {teste1, teste2, teste3, teste4, teste5}
for _, area in pairs (areas) do
addEvent(damage, 200 * (_ - 1), cid, area)
end
end
magia criando monstro (precisa ter o "backupPos" configurado):
elseif spell == "?" then
local monsterName = "Monster"
local timeToRemove = 2500
local function damage(cid, area)
if not isCreature(cid) then return end
doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), area, -min, -max, 255)
local positions = arrayToPositions(area, getThingPositionWithDebug(cid))
for _, pos in pairs (positions) do
local newMonster = doCreateMonster(monsterName, backupPos, false)
if newMonster > 1 then
doTeleportThing(newMonster, pos, false)
addEvent(function()
if isCreature(newMonster) then doRemoveCreature(newMonster) end
end, timeToRemove)
end
end
end
local areas = {teste1, teste2, teste3, teste4, teste5}
for _, area in pairs (areas) do
addEvent(damage, 200 * (_ - 1), cid, area)
end
end
info
Grupo: Artesão
Registrado: 17/01/12
Posts: 137
Reputação: -1
Char no Tibia: Nao Tenho

lib necessária (você pode adicionar no início do script, ou então criar um outro arquivo .lua com qualquer nome em data/lib e colocar isso dentro):
function newXYvar(x, y, voltas_horarias) while voltas_horarias > 3 do voltas_horarias = voltas_horarias - 4 end if voltas_horarias <= 0 then return x, y elseif voltas_horarias == 1 then return -y, x elseif voltas_horarias == 2 then return -x, -y elseif voltas_horarias == 3 then return y, -x end return 0, 0 end function arrayToPositions(array, center, n_horario) if not center or not center.x or not center.y or not center.z then return {} end local voltas, mp, ret, iIs, x, y = n_horario and math.max(0, n_horario) or 0, {}, {}, {}, 1, 1 if voltas > 0 then local maxC = 0 for lines = 1, #array do if maxC < #array[lines] then maxC = #array[lines] end end if maxC < #array then maxC = #array end for a = 1, maxC do iIs[a] = {} for b = 1, maxC do table.insert(iIs[a], 0) end end end while #mp == 0 do local check = array[y][x] if check > 1 then mp = {x, y} if voltas > 0 then iIs[y][x] = check end if check == 3 then table.insert(ret, center) end break end x = x + 1 if x > #array[y] then y, x = y + 1, 1 if y > #array then break end end end for ly, ny in pairs (array) do for lx, nx in pairs (ny) do if nx == 1 then local dx, dy = lx - mp[1], ly - mp[2] local newX, newY = newXYvar(dx, dy, voltas) local newPos = {x = center.x + newX, y = center.y + newY, z = center.z} table.insert(ret, newPos) end end end return ret end
magia criano item:
elseif spell == "?" then local itemId = 1990 local timeToRemove = 2500 local function damage(cid, area) if not isCreature(cid) then return end doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), area, -min, -max, 255) local positions = arrayToPositions(area, getThingPositionWithDebug(cid)) for _, pos in pairs (positions) do doCreateItem(itemId, 1, pos) addEvent(function() local i = getTileItemById(pos, itemId) if i.uid > 0 then doRemoveItem(i.uid) end end, timeToRemove) end end local areas = {teste1, teste2, teste3, teste4, teste5} for _, area in pairs (areas) do addEvent(damage, 200 * (_ - 1), cid, area) end end
magia criando monstro (precisa ter o "backupPos" configurado):
elseif spell == "?" then local monsterName = "Monster" local timeToRemove = 2500 local function damage(cid, area) if not isCreature(cid) then return end doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), area, -min, -max, 255) local positions = arrayToPositions(area, getThingPositionWithDebug(cid)) for _, pos in pairs (positions) do local newMonster = doCreateMonster(monsterName, backupPos, false) if newMonster > 1 then doTeleportThing(newMonster, pos, false) addEvent(function() if isCreature(newMonster) then doRemoveCreature(newMonster) end end, timeToRemove) end end end local areas = {teste1, teste2, teste3, teste4, teste5} for _, area in pairs (areas) do addEvent(damage, 200 * (_ - 1), cid, area) end end
po vei nenhum dos 2 deu certo, ta dando o seguinte erro na hora de colocar o serv on:
[Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:157: 'end' expected (to close 'function' at line 24) near 'elseif'
[20/10/2012 22:49:59] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

tenta tirar o ultimo 'end' ali.. se n der tenta acresentar +1 'end'...
e brun.. sempre surpreendendo kk queria intender essas coisas de posiçoes ![]()
info
Grupo: Marquês
Registrado: 02/08/12
Posts: 1k
Reputação: +234
Char no Tibia: Maurolkit

Só adicionar mais um end.
info
Grupo: Artesão
Registrado: 17/01/12
Posts: 137
Reputação: -1
Char no Tibia: Nao Tenho

tenta tirar o ultimo 'end' ali.. se n der tenta acresentar +1 'end'...
e brun.. sempre surpreendendo kk queria intender essas coisas de posiçoes
tirei o end e nao deu erro na hora de colocar o serv on, porem na magia nao sai nada, nao aparece o item...
up
é porque você está colocando no meio do script o elseif, e eu fechei esse mesmo elseif, mas no script ainda tem vários outros elseifs (pros outros golpes)
você tem quer ir no final do script, e vai encontrar isso:
end return true end
você tira esse end que está em cima do return true, e cola a sua spell aí, ficando assim:
elseif spell == "?" then
local monsterName = "Monster"
local timeToRemove = 2500
local function damage(cid, area)
if not isCreature(cid) then return end
doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), area, -min, -max, 255)
local positions = arrayToPositions(area, getThingPositionWithDebug(cid))
for _, pos in pairs (positions) do
local newMonster = doCreateMonster(monsterName, backupPos, false)
if newMonster > 1 then
doTeleportThing(newMonster, pos, false)
addEvent(function()
if isCreature(newMonster) then doRemoveCreature(newMonster) end
end, timeToRemove)
end
end
end
local areas = {teste1, teste2, teste3, teste4, teste5}
for _, area in pairs (areas) do
addEvent(damage, 200 * (_ - 1), cid, area)
end
end
return true
end
ou então faz o que o pessoal falou, tira o último end do script da magia e coloca em qualquer lugar, desde que não seja dentro de outra magia
ShotStyle, a primeira script converte um array para uma tabela com posições, é uma função que eu fiz, precisa dela pra fazer itens em área
Diley007, você também tem que colocar o nome da sua spell no script, ali onde está elseif spell == "?" then, você tem que escrever o nome da sua spell, assim por exemplo: elseif spell == "Minha Magia" then
Se você deixar o ?, aquilo só vai ser executado se você usar algum move que tenha o nome de "?"
Editado Outubro 21 por brun123
info
Grupo: Artesão
Registrado: 17/01/12
Posts: 137
Reputação: -1
Char no Tibia: Nao Tenho

é porque você está colocando no meio do script o elseif, e eu fechei esse mesmo elseif, mas no script ainda tem vários outros elseifs (pros outros golpes)
você tem quer ir no final do script, e vai encontrar isso:
end return true end
você tira esse end que está em cima do return true, e cola a sua spell aí, ficando assim:
elseif spell == "?" then local monsterName = "Monster" local timeToRemove = 2500 local function damage(cid, area) if not isCreature(cid) then return end doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), area, -min, -max, 255) local positions = arrayToPositions(area, getThingPositionWithDebug(cid)) for _, pos in pairs (positions) do local newMonster = doCreateMonster(monsterName, backupPos, false) if newMonster > 1 then doTeleportThing(newMonster, pos, false) addEvent(function() if isCreature(newMonster) then doRemoveCreature(newMonster) end end, timeToRemove) end end end local areas = {teste1, teste2, teste3, teste4, teste5} for _, area in pairs (areas) do addEvent(damage, 200 * (_ - 1), cid, area) end end return true end
ou então faz o que o pessoal falou, tira o último end do script da magia e coloca em qualquer lugar, desde que não seja dentro de outra magia
ShotStyle, a primeira script converte um array para uma tabela com posições, é uma função que eu fiz, precisa dela pra fazer itens em área
Diley007, você também tem que colocar o nome da sua spell no script, ali onde está elseif spell == "?" then, você tem que escrever o nome da sua spell, assim por exemplo: elseif spell == "Minha Magia" then
Se você deixar o ?, aquilo só vai ser executado se você usar algum move que tenha o nome de "?"
voce testou a magia e deu certo ???? por que aqui nao ta indo, nao aparece nada quando o pokemon solta a magia...
Não tinha testado, mas acabei de testar e deu tudo certo...
se você tá usndo a de criar monstro, certifique-se de que a variável "backupPos" foi declarada em configuration.lua
e pelo amor de Deus, não me diga que você deixou a variável monsterName declarada como "Monster"...
local monsterName = "Monster"
você tem que alterar essa parte pro nome do monstro que vai ser criado como efeito





info
Grupo: Artesão
Registrado: 17/01/12
Posts: 137
Reputação: -1
Char no Tibia: Nao Tenho
tipo vou usar uma magia de area, mas queria que fosse um item do dateditor nao um efeito...tem como isso ??? como ficaria ???
elseif spell == "Teste" then
doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), teste1, -min, -max, 236)
local function damage(cid, area)
if not isCreature(cid) then return true end
doAreaCombatHealth(cid, FIREDAMAGE, getThingPositionWithDebug(cid), area, -min, -max, 236)
end
addEvent(damage, 200, cid, teste2)
addEvent(damage, 400, cid, teste3)
addEvent(damage, 600, cid, teste4)
addEvent(damage, 800, cid, teste5)