Evento Battle AJUDA

mateusmoretti
em Resolvidos

mateusmoretti

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/06/08Posts: 45Char no Tibia: enoizes

Fala galera blz.

bom o meu pedido de ajuda, e sobre o evento Battle tradicional como todos conhecem,

Vamos lá!

 

quando entro no evento, Time Vermelho x Time Preto

Vamos supor que ficou  10x10  de cada time, o ultimo player do time vermelho matar o ultimo do time preto, ele da o premio somente para ele não para todos do time!

 

por favor me ajudem, me pedem qual script e pra eu mandar aqui plx!

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Se possível, poste todo o sistema.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

mateusmoretti

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/06/08Posts: 45Char no Tibia: enoizes
1 hora atrás, zipter98 disse:

Se possível, poste todo o sistema.

fala zipter blz!.

Arquivo Lib.

_Lib_Battle_Info = {Reward = {exp = {true, 7300000000}, items = {true, 2157, 100}, premium_days = {true, 2}},TeamOne = {name = "Time Preto", storage = 140120, pos = {x=70,y=691,z=7}},TeamTwo = {name = "Time Vermelho",storage = 140121,pos = {x=26,y=691,z=7}},storage_count = 180400,tpPos = {x=54, y=257, z=7},limit_Time = 10 -- limite de tempo para adentrar o evento}function resetBattle()setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0)setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)endfunction OpenWallBattle()local B = {{3517,{x=42, y=689, z=6, stackpos = 1}},{3517,{x=42, y=690, z=6, stackpos = 1}},{3517,{x=42, y=691, z=6, stackpos = 1}},{3517,{x=53, y=689, z=6, stackpos = 1}},{3517,{x=53, y=690, z=6, stackpos = 1}},{3517,{x=53, y=691, z=6, stackpos = 1}},{3517,{x=49, y=703, z=6, stackpos = 1}},{3517,{x=49, y=704, z=6, stackpos = 1}},{3517,{x=49, y=705, z=6, stackpos = 1}},{3517,{x=49, y=706, z=6, stackpos = 1}}}for i = 1, #B doif getTileItemById(B[i][2], B[i][1]).uid == 0 thendoCreateItem(B[i][1], 1, B[i][2])elsedoRemoveItem(getThingfromPos(B[i][2]).uid,1)endendendfunction doBroadCastBattle(type, msg)for _, cid in pairs(getPlayersOnline()) doif getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 thendoPlayerSendTextMessage(cid,type,msg)endendendfunction removeBattleTp()local t = getTileItemById(_Lib_Battle_Info.tpPos, 1387).uidreturn t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_Battle_Info.tpPos, CONST_ME_POFF)endfunction getWinnersBattle(storage)local str, c = "" , 0for _, cid in pairs(getPlayersOnline()) doif getPlayerStorageValue(cid, storage) == 1 thenif _Lib_Battle_Info.Reward.exp[1] == true then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) endif _Lib_Battle_Info.Reward.items[1] == true then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) endif _Lib_Battle_Info.Reward.premium_days[1] == true then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) enddoRemoveCondition(cid, CONDITION_OUTFIT)doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))setPlayerStorageValue(cid, storage, -1)c = c+1 endendstr = str .. ""..c.." Player"..(c > 1 and "s" or "").." da equipe "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." venceu a batalha evento!"resetBattle()OpenWallBattle()return doBroadcastMessage(str)endfunction CheckEvent(delay)if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 thendoBroadcastMessage("[battleField Event] Nos estamos esperando "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." jogadores para partidas Battlefield.")elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 thenfor _, cid in pairs(getPlayersOnline()) doif getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 thendoRemoveCondition(cid, CONDITION_OUTFIT)doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)endenddoBroadcastMessage("O evento não pode ser iniciado porque não tinha jogadores suficientes.")setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)resetBattle()removeBattleTp()endaddEvent(CheckEvent, 60000, delay-1)end

 

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Há, em data/creaturescripts/scripts.lua, um código relacionado a este sistema. O nome, naturalmente, eu não sei, mas você deve encontrar rápido.

Nele, remova as seguintes linhas:

setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)

Depois, em login.lua, acima do último return true (que fica na penúltima linha do código), coloque:

if getPlayerStorageValue(cid, 4921) > -1 then    if _Lib_Battle_Info.Reward.exp[1] then         doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2])     end    if _Lib_Battle_Info.Reward.items[1] then         doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3])     end    if _Lib_Battle_Info.Reward.premium_days[1] then         doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2])     end        setPlayerStorageValue(cid, 4921, -1)end

Depois, na lib que você postou, troque o código da função getWinnersBattle(storage) por:

function getWinnersBattle(storage)    local str, c, winners_online = "" , 0, {}        for _, cid in pairs(getPlayersOnline()) do        if getPlayerStorageValue(cid, storage) == 1 then            if _Lib_Battle_Info.Reward.exp[1] then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) end            if _Lib_Battle_Info.Reward.items[1] then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end            if _Lib_Battle_Info.Reward.premium_days[1] then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) end            doRemoveCondition(cid, CONDITION_OUTFIT)            doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))            setPlayerStorageValue(cid, storage, -1)            table.insert(winners_online, getPlayerGUID(cid))            c = c + 1         end    end        local query = db.getResult("SELECT player_id FROM player_storage WHERE key = "..storage.." AND value > -1")    if query:getID() ~= -1 then        repeat            local id = query:getDataInt("player_id")                        if not isInArray(winners_online, id) then                c = c + 1                db.executeQuery("UPDATE player_storage SET value = -1 WHERE player_id = "..id.." AND value = "..storage)                db.executeQuery("UPDATE player_storage SET value = 1 WHERE player_id = "..id.." AND value = 4921")            end        until not query:next()        query:free()    end        str = str .. ""..c.." Player"..(c > 1 and "s" or "").." da equipe "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." venceu a batalha evento!"    resetBattle()    OpenWallBattle()    return doBroadcastMessage(str)end

 

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

mateusmoretti

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/06/08Posts: 45Char no Tibia: enoizes
9 minutos atrás, zipter98 disse:

Há, em data/creaturescripts/scripts.lua, um código relacionado a este sistema. O nome, naturalmente, eu não sei, mas você deve encontrar rápido.

Nele, remova as seguintes linhas:

setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)

Depois, em login.lua, acima do último return true (que fica na penúltima linha do código), coloque:

if getPlayerStorageValue(cid, 4921) > -1 then    if _Lib_Battle_Info.Reward.exp[1] then         doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2])     end    if _Lib_Battle_Info.Reward.items[1] then         doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3])     end    if _Lib_Battle_Info.Reward.premium_days[1] then         doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2])     end        setPlayerStorageValue(cid, 4921, -1)end

Depois, na lib que você postou, troque o código da função getWinnersBattle(storage) por:

function getWinnersBattle(storage)    local str, c, winners_online = "" , 0, {}        for _, cid in pairs(getPlayersOnline()) do        if getPlayerStorageValue(cid, storage) == 1 then            if _Lib_Battle_Info.Reward.exp[1] then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) end            if _Lib_Battle_Info.Reward.items[1] then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end            if _Lib_Battle_Info.Reward.premium_days[1] then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) end            doRemoveCondition(cid, CONDITION_OUTFIT)            doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))            setPlayerStorageValue(cid, storage, -1)            table.insert(winners_online, getPlayerGUID(cid))            c = c + 1         end    end        local query = db.getResult("SELECT player_id FROM player_storage WHERE key = "..storage.." AND value > -1")    if query:getID() ~= -1 then        repeat            local id = query:getDataInt("player_id")                        if not isInArray(winners_online, id) then                c = c + 1                db.executeQuery("UPDATE player_storage SET value = -1 WHERE player_id = "..id.." AND value = "..storage)                db.executeQuery("UPDATE player_storage SET value = 1 WHERE player_id = "..id.." AND value = 4921")            end        until not query:next()    end    query:free()        str = str .. ""..c.." Player"..(c > 1 and "s" or "").." da equipe "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." venceu a batalha evento!"    resetBattle()    OpenWallBattle()    return doBroadcastMessage(str)end

 

fiz tudo oque me pediu. e ta dando isso agora!

 

[13/12/2016 0:27:6] [Error - GlobalEvent Interface] [13/12/2016 0:27:6] data/globalevents/scripts/BattleGlobalEvents.lua:onThink[13/12/2016 0:27:6] Description: [13/12/2016 0:27:6] data/globalevents/scripts/BattleGlobalEvents.lua:37: attempt to call global 'CheckEvent' (a nil value)[13/12/2016 0:27:6] stack traceback:[13/12/2016 0:27:6] 	data/globalevents/scripts/BattleGlobalEvents.lua:37: in function <data/globalevents/scripts/BattleGlobalEvents.lua:1>[13/12/2016 0:27:6] [Error - GlobalEvents::think] Couldn't execute event: GlobalBattle

 

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Esse erro diz que a função CheckEvent não existe. Provavelmente, na hora da substituição, você fez algo errado.

Aqui está sua lib modificada:

Spoiler
_Lib_Battle_Info = {    Reward = {        exp = {true, 7300000000}, items = {true, 2157, 100}, premium_days = {true, 2}    },    TeamOne = {name = "Time Preto", storage = 140120, pos = {x=70,y=691,z=7}},    TeamTwo = {name = "Time Vermelho",storage = 140121,pos = {x=26,y=691,z=7}},    storage_count = 180400,    tpPos = {x=54, y=257, z=7},    limit_Time = 10 -- limite de tempo para adentrar o evento}function resetBattle()    setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0)    setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)endfunction OpenWallBattle()    local B = {        {3517,{x=42, y=689, z=6, stackpos = 1}},        {3517,{x=42, y=690, z=6, stackpos = 1}},        {3517,{x=42, y=691, z=6, stackpos = 1}},        {3517,{x=53, y=689, z=6, stackpos = 1}},        {3517,{x=53, y=690, z=6, stackpos = 1}},        {3517,{x=53, y=691, z=6, stackpos = 1}},        {3517,{x=49, y=703, z=6, stackpos = 1}},        {3517,{x=49, y=704, z=6, stackpos = 1}},        {3517,{x=49, y=705, z=6, stackpos = 1}},        {3517,{x=49, y=706, z=6, stackpos = 1}}    }    for i = 1, #B do        if getTileItemById(B[i][2], B[i][1]).uid == 0 then            doCreateItem(B[i][1], 1, B[i][2])        else            doRemoveItem(getThingfromPos(B[i][2]).uid,1)        end    endendfunction doBroadCastBattle(type, msg)    for _, cid in pairs(getPlayersOnline()) do        if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then            doPlayerSendTextMessage(cid,type,msg)        end    endendfunction removeBattleTp()    local t = getTileItemById(_Lib_Battle_Info.tpPos, 1387).uid    return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_Battle_Info.tpPos, CONST_ME_POFF)endfunction getWinnersBattle(storage)    local str, c, winners_online = "" , 0, {}        for _, cid in pairs(getPlayersOnline()) do        if getPlayerStorageValue(cid, storage) == 1 then            if _Lib_Battle_Info.Reward.exp[1] then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) end            if _Lib_Battle_Info.Reward.items[1] then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end            if _Lib_Battle_Info.Reward.premium_days[1] then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) end            doRemoveCondition(cid, CONDITION_OUTFIT)            doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))            setPlayerStorageValue(cid, storage, -1)            table.insert(winners_online, getPlayerGUID(cid))            c = c + 1         end    end        local query = db.getResult("SELECT player_id FROM player_storage WHERE key = "..storage.." AND value > -1")    if query:getID() ~= -1 then        repeat            local id = query:getDataInt("player_id")                        if not isInArray(winners_online, id) then                c = c + 1                db.executeQuery("UPDATE player_storage SET value = -1 WHERE player_id = "..id.." AND value = "..storage)                db.executeQuery("UPDATE player_storage SET value = 1 WHERE player_id = "..id.." AND value = 4921")            end        until not query:next()        query:free()    end        str = str .. ""..c.." Player"..(c > 1 and "s" or "").." da equipe "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." venceu a batalha evento!"    resetBattle()    OpenWallBattle()    return doBroadcastMessage(str)endfunction CheckEvent(delay)    if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then        doBroadcastMessage("[battleField Event] Nos estamos esperando "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." jogadores para partidas Battlefield.")    elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then        for _, cid in pairs(getPlayersOnline()) do            if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then                doRemoveCondition(cid, CONDITION_OUTFIT)                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))                setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)                setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)            end        end        doBroadcastMessage("O evento não pode ser iniciado porque não tinha jogadores suficientes.")        setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)        resetBattle()        removeBattleTp()    end    addEvent(CheckEvent, 60000, delay-1)end

 

 

Tome bastante cuidado ao modificar login.lua.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

mateusmoretti

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/06/08Posts: 45Char no Tibia: enoizes
5 minutos atrás, zipter98 disse:

Esse erro diz que a função CheckEvent não existe. Provavelmente, na hora da substituição, você fez algo errado.

Aqui está sua lib modificada:

  Mostrar conteúdo oculto
_Lib_Battle_Info = {    Reward = {        exp = {true, 7300000000}, items = {true, 2157, 100}, premium_days = {true, 2}    },    TeamOne = {name = "Time Preto", storage = 140120, pos = {x=70,y=691,z=7}},    TeamTwo = {name = "Time Vermelho",storage = 140121,pos = {x=26,y=691,z=7}},    storage_count = 180400,    tpPos = {x=54, y=257, z=7},    limit_Time = 10 -- limite de tempo para adentrar o evento}function resetBattle()    setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0)    setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)endfunction OpenWallBattle()    local B = {        {3517,{x=42, y=689, z=6, stackpos = 1}},        {3517,{x=42, y=690, z=6, stackpos = 1}},        {3517,{x=42, y=691, z=6, stackpos = 1}},        {3517,{x=53, y=689, z=6, stackpos = 1}},        {3517,{x=53, y=690, z=6, stackpos = 1}},        {3517,{x=53, y=691, z=6, stackpos = 1}},        {3517,{x=49, y=703, z=6, stackpos = 1}},        {3517,{x=49, y=704, z=6, stackpos = 1}},        {3517,{x=49, y=705, z=6, stackpos = 1}},        {3517,{x=49, y=706, z=6, stackpos = 1}}    }    for i = 1, #B do        if getTileItemById(B[i][2], B[i][1]).uid == 0 then            doCreateItem(B[i][1], 1, B[i][2])        else            doRemoveItem(getThingfromPos(B[i][2]).uid,1)        end    endendfunction doBroadCastBattle(type, msg)    for _, cid in pairs(getPlayersOnline()) do        if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then            doPlayerSendTextMessage(cid,type,msg)        end    endendfunction removeBattleTp()    local t = getTileItemById(_Lib_Battle_Info.tpPos, 1387).uid    return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_Battle_Info.tpPos, CONST_ME_POFF)endfunction getWinnersBattle(storage)    local str, c, winners_online = "" , 0, {}        for _, cid in pairs(getPlayersOnline()) do        if getPlayerStorageValue(cid, storage) == 1 then            if _Lib_Battle_Info.Reward.exp[1] then doPlayerAddExperience(cid, _Lib_Battle_Info.Reward.exp[2]) end            if _Lib_Battle_Info.Reward.items[1] then doPlayerAddItem(cid, _Lib_Battle_Info.Reward.items[2], _Lib_Battle_Info.Reward.items[3]) end            if _Lib_Battle_Info.Reward.premium_days[1] then doPlayerAddPremiumDays(cid, _Lib_Battle_Info.Reward.premium_days[2]) end            doRemoveCondition(cid, CONDITION_OUTFIT)            doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))            setPlayerStorageValue(cid, storage, -1)            table.insert(winners_online, getPlayerGUID(cid))            c = c + 1         end    end        local query = db.getResult("SELECT player_id FROM player_storage WHERE key = "..storage.." AND value > -1")    if query:getID() ~= -1 then        repeat            local id = query:getDataInt("player_id")                        if not isInArray(winners_online, id) then                c = c + 1                db.executeQuery("UPDATE player_storage SET value = -1 WHERE player_id = "..id.." AND value = "..storage)                db.executeQuery("UPDATE player_storage SET value = 1 WHERE player_id = "..id.." AND value = 4921")            end        until not query:next()    end    query:free()        str = str .. ""..c.." Player"..(c > 1 and "s" or "").." da equipe "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." venceu a batalha evento!"    resetBattle()    OpenWallBattle()    return doBroadcastMessage(str)endfunction CheckEvent(delay)    if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then        doBroadcastMessage("[battleField Event] Nos estamos esperando "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." jogadores para partidas Battlefield.")    elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then        for _, cid in pairs(getPlayersOnline()) do            if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 or getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 then                doRemoveCondition(cid, CONDITION_OUTFIT)                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))                setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)                setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)            end        end        doBroadcastMessage("O evento não pode ser iniciado porque não tinha jogadores suficientes.")        setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)        resetBattle()        removeBattleTp()    end    addEvent(CheckEvent, 60000, delay-1)end

 

 

acho que errei mesmo.. o evento funcionou abriu certinho perdiu player!

Porem o ultimo que fico vivou so ganhou a xp. o ultimo que sobreviveu! e nao ganhou nem iten

 

deu erro na distro tambem!

[13/12/2016 0:41:3] [Error - CreatureScript Interface] [13/12/2016 0:41:3] data/creaturescripts/scripts/BattleCreatureScript.lua:onPrepareDeath[13/12/2016 0:41:3] Description: [13/12/2016 0:41:3] data/lib/004-database.lua:106: [Result:free] Result not set![13/12/2016 0:41:3] stack traceback:[13/12/2016 0:41:3] 	[C]: in function 'error'[13/12/2016 0:41:3] 	data/lib/004-database.lua:106: in function 'free'[13/12/2016 0:41:3] 	data/lib/BattleLib.lua:80: in function 'getWinnersBattle'[13/12/2016 0:41:3] 	...ata/creaturescripts/scripts/BattleCreatureScript.lua:32: in function <...ata/creaturescripts/scripts/BattleCreatureScript.lua:23>

 

mateusmoretti

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/06/08Posts: 45Char no Tibia: enoizes

up

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Ops, coloquei uma coisa no lugar errado. Corrigido.

Se apenas o último estiver ganhando a premiação, poste o creatureevent que mencionei.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

mateusmoretti

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/06/08Posts: 45Char no Tibia: enoizes
Em 13/12/2016 at 19:34, zipter98 disse:

Ops, coloquei uma coisa no lugar errado. Corrigido.

Se apenas o último estiver ganhando a premiação, poste o creatureevent que mencionei.

blzzz 

Creaturescripts

function onLogin(cid)if getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == -1 thensetGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0)setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)endregisterCreatureEvent(cid, "BattleTeam")registerCreatureEvent(cid, "BattleDeath")return trueendfunction onCombat(cid, target)if isPlayer(cid) and isPlayer(target) thenif getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) == 1 and getPlayerStorageValue(target, _Lib_Battle_Info.TeamOne.storage) == 1 thendoPlayerSendCancel(cid, "You may not attack your team mates.") return falseendif getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) == 1 and getPlayerStorageValue(target, _Lib_Battle_Info.TeamTwo.storage) == 1 thendoPlayerSendCancel(cid, "You may not attack your team mates.") return falseendreturn trueendreturn trueendfunction onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller)if getPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage) >= 1 thensetPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage)-1)doRemoveCondition(cid, CONDITION_OUTFIT)doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[battle Field] Voce foi Morto, Que Pena!")if getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 thengetWinnersBattle(_Lib_Battle_Info.TeamTwo.storage)elsedoBroadCastBattle(23,"[battleField Information] ".._Lib_Battle_Info.TeamOne.name.." "..getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage).." VS "..getGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage).." " .._Lib_Battle_Info.TeamTwo.name)endelseif getPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage) >= 1 thensetPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, getGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage)-1)doRemoveCondition(cid, CONDITION_OUTFIT)doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[battle Field] Voce foi Morto, Que Pena!")if getGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage) == 0 thengetWinnersBattle(_Lib_Battle_Info.TeamOne.storage)elsedoBroadCastBattle(23,"[battleField Information] ".._Lib_Battle_Info.TeamOne.name.." "..getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage).." VS "..getGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage).." " .._Lib_Battle_Info.TeamTwo.name)endendreturn trueend

 

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Imagino que você não tenha lido meu primeiro comentário.

Enfim, remova no creatureevent (NÃO na lib) essa linha:

setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)

e essa:

setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)

 

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

mateusmoretti

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/06/08Posts: 45Char no Tibia: enoizes
19 horas atrás, zipter98 disse:

Imagino que você não tenha lido meu primeiro comentário.

Enfim, remova no creatureevent (NÃO na lib) essa linha:

setPlayerStorageValue(cid, _Lib_Battle_Info.TeamOne.storage, -1)

e essa:

setPlayerStorageValue(cid, _Lib_Battle_Info.TeamTwo.storage, -1)

 

EU FIZ ISSO QUE VOCE ME CITOU, POREM EU NAO CONSIGO MATAR MAIS NINGUEM DENTRO DO EVENTO :(. NAO CONSIGO FAZER NADA NO EVENTO :(

 

isso ai que voce mandou eu fazer cabo meu servidor cara, esqueci de salvar ele caso desse bug, agora me fudeu tudo.. afff

deletei tudo que se encontra sobre battefield, porem eu nao consigo atacar nenhum player nao consigo fazer nada vei

estrago tudo meu ot !

agora nao da nem pra saber onde ta erro vei, que merda

mateusmoretti

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/06/08Posts: 45Char no Tibia: enoizes

up