Ir para conteúdo

Featured Replies

Postado

Hi

 

Tenho um script aqui que o player mata um boss, toda guild daquele player que matou ganha o granEffect, porem quando outra guild mata o boss, a que tinha antes tem que perder o granEffect na hora que outra guild matasse só que não está perdendo, perde só depois que reloga o character.

 

Script:

local function Teleport(cid)
 
doSendAnimatedText(getPlayerPosition(cid), "Aaaaah...", TEXTCOLOR_BLUE)
 
local templo = {x=442, y=549, z=7}
 
for j = 0, 60 do
starting = {x=839 + j, y=952, z=7, stackpos=253}
 
for i = 0, 60 do
checking={x=starting.x, y=starting.y + i, z=starting.z, stackpos=starting.stackpos}
creature= getThingfromPos(checking)
 
if isPlayer(creature.uid) == TRUE then
doTeleportThing(creature.uid, templo)
end
 
end
 
end
 
for j = 0, 61 do
starting = {x=1128 + j, y=1120, z=6, stackpos=253}
 
for i = 0, 6 do
checking={x=starting.x, y=starting.y + i, z=starting.z, stackpos=starting.stackpos}
creature= getThingfromPos(checking)
 
if isPlayer(creature.uid) == TRUE then
doTeleportThing(creature.uid,templo)
end
 
end
 
end
 
for j = 0, 14 do
starting = {x=1151 + j, y=1115, z=6, stackpos=253}
 
for i = 0, 5 do
checking={x=starting.x, y=starting.y + i, z=starting.z, stackpos=starting.stackpos}
creature= getThingfromPos(checking)
 
if isPlayer(creature.uid) == TRUE then
doTeleportThing(creature.uid,templo)
end
 
end
 
end
 
for j = 0, 14 do
starting = {x=1151 + j, y=1127, z=6, stackpos=253}
 
for i = 0, 5 do
checking={x=starting.x, y=starting.y + i, z=starting.z, stackpos=starting.stackpos}
creature= getThingfromPos(checking)
 
if isPlayer(creature.uid) == TRUE then
doTeleportThing(creature.uid,templo)
end
 
end
 
end
 
for j = 0, 49 do
starting = {x=1134 + j, y=1120, z=5, stackpos=253}
 
for i = 0, 6 do
checking={x=starting.x, y=starting.y + i, z=starting.z, stackpos=starting.stackpos}
creature= getThingfromPos(checking)
 
if isPlayer(creature.uid) == TRUE then
doTeleportThing(creature.uid,templo)
end
 
end
 
end
 
for j = 0, 14 do
starting = {x=1151 + j, y=1115, z=5, stackpos=253}
 
for i = 0, 5 do
checking={x=starting.x, y=starting.y + i, z=starting.z, stackpos=starting.stackpos}
creature= getThingfromPos(checking)
 
if isPlayer(creature.uid) == TRUE then
doTeleportThing(creature.uid,templo)
end
 
end
 
end
 
for j = 0, 14 do
starting = {x=1151 + j, y=1127, z=5, stackpos=253}
 
for i = 0, 5 do
checking={x=starting.x, y=starting.y + i, z=starting.z, stackpos=starting.stackpos}
creature= getThingfromPos(checking)
 
if isPlayer(creature.uid) == TRUE then
doTeleportThing(creature.uid,templo)
end
 
end
 
end
 
return TRUE
end
 
function onKill(cid, target, lastHit)
 
local monstros ={"Gran Tower","gran tower"}
 
if getCreatureTarget(cid) ~= 0 then
if isMonster(target) == TRUE then
for i = 1, 2 do
nome = getCreatureName(getCreatureTarget(cid))
if (nome == monstros[i]) then
if getPlayerStorageValue(cid, 13340) ~= 1 then
setGlobalStorageValue(13340, getPlayerGuildId(cid))
granEffect(cid)
if getPlayerStorageValue(cid, 13340) == 0 then
stopEvent(granEffect[cid])
doSendMagicEffect(getCreaturePosition(cid), 47)
broadcastMessage("O player ".. getPlayerName(cid) .." conquistou o Gran Castle, e todos membros da guild ".. getPlayerGuildName(cid) .." acabam de receber a Gran Aura.")
end
addEvent(Teleport, 1000, cid)
end
end
end
end
end
 
return TRUE
end
 
A parte que eu adicionei foi essa pra parar o granEffect:
if getPlayerStorageValue(cid, 13340) == 0 then
stopEvent(granEffect[cid])
 
Só que mesmo assim continua o efeito nos chares, se alguem pudesse me ajudar pois ja tentei de tudo :x

Editado por Rofl (veja o histórico de edições)

"Derrotar o inimigo em cem batalhas não é a excelência suprema; a excelência suprema consiste em vencer o inimigo sem ser preciso lutar."

 

mcYVuRL.png

 


 

logo_SS.png

  • Respostas 10
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Posta a função granEffect junto com onde é definido uma tabela com nome granEffect também

  • Troca stopEvent(granEffect[cid]) por stopEvent(events[cid])

  • Você mudou algo a mais. Mande o script de como está agora. Ou é possível que tenha dado erro no console. Veja se tem algum erro no console.

Postado
  • Autor

Opa valeu por responder.

 

Então eu alterei como você disse, coloquei:

stopEvent(granEffect(cid))
Continua mesma coisa, peguei um char de outra guild e matei mas a guild que tinha a granEffect ainda continuou.

Editado por Rofl (veja o histórico de edições)

"Derrotar o inimigo em cem batalhas não é a excelência suprema; a excelência suprema consiste em vencer o inimigo sem ser preciso lutar."

 

mcYVuRL.png

 


 

logo_SS.png

Postado
  • Autor

Elwyn

 

Data/lib/granAura.lua:

local events = {}
 
local function getPositions(cid)
local pos = getCreaturePosition(cid)
local ret = {
[1] = {x = pos.x + 1, y = pos.y, z = pos.z},
[2] = {x = pos.x, y = pos.y + 1, z = pos.z},
[3] = {x = pos.x - 1, y = pos.y, z = pos.z},
[4] = {x = pos.x, y = pos.y - 1, z = pos.z},
}
return ret
end
 
function granEffect(cid, last)
 
local sec = 200
if (isPlayer(cid) == FALSE) then
return false
end
 
local positions = getPositions(cid)
local last = last or 1
local last = (positions[last] and last) or 1
local next = (last == #positions) and 1 or last + 1
doSendDistanceShoot(positions[last], positions[next], 18)
local event = addEvent(granEffect, sec, cid, last + 1)
events[cid] = event
return true
end
 
Data/ib/constant.lua:
dofile('data/lib/granAura.lua')
 
Data/lib/function.lua:
dofile('data/lib/granAura.lua')
 
:)

Editado por Rofl (veja o histórico de edições)

"Derrotar o inimigo em cem batalhas não é a excelência suprema; a excelência suprema consiste em vencer o inimigo sem ser preciso lutar."

 

mcYVuRL.png

 


 

logo_SS.png

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo