Ir para conteúdo
  • 0

Premio Golden Arena


BrunooMaciell

Pergunta

9 respostass a esta questão

Posts Recomendados

  • 0

Configuration(Golden Arena)

 

------------- Configuraçoes da Golden Arena --------------------------------- --alterado v1.7 \/\/ algumas pos, soh pro novo mapa!
timeToWaves = 30 --time entre waves, em segs... --alterado v1.7 -- obrigatorio pegar pelo menos isso!
---------
GoldenUpper = {x=528, y=676, z=6} --posiçao da ponta superior esquerda da arena!
GoldenLower = {x=556, y=686, z=6} --posiçao da ponta inferior direita da arena!
---------
posGolden = {x=531, y=681, z=6} --pos da golden pra onde os players vao ser teleportados!
posBackGolden = {x=547, y=676, z=7} --pos da golden pra onde os players vao ser teleportados ao morrerem e quando acabar a golden...
---------
horas = {"05:30", "10:30", "15:30", "20:30", "00:00"} --alterar aki os horarios da golden arena!
--deixe sempre na ordem do menor pro maior horario!!!
--------
posisGolden = {
{x=533, y=678, z=6},
{x=533, y=684, z=6},
{x=537, y=684, z=6},
{x=536, y=678, z=6}, --aki vcs colocam todas as posiçoes q os monstros vao nascer dentro da golden arena...
{x=541, y=678, z=6}, --lembrando q o numero de posis q vcs colocarem tem q ser igual ao numero de pokes q vcs vao colocar ali embaixo!
{x=541, y=684, z=6},
{x=545, y=678, z=6},
{x=545, y=684, z=6}, --LEMBRANDO Q AGORA N PRECISA MAIS EDITAR MAIS NENHUM SCRIPT A N SER ESSE!!
{x=552, y=681, z=6}, --E O GLOBALEVENTS/GLOBALEVENTS.XML COM OS HORARIOS!
}
----------
wavesGolden = { --waves q vao ter na golden arena... o numero de pokes tem q ser igual ao numero de posis!!
[1] = {"Raticate", "Pikachu", "", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[2] = {"Raticate", "Pikachu", "", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[3] = {"Raticate", "Pikachu", "", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[4] = {"Raticate", "Ekans", "Arbok", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[5] = {"Raticate", "Ekans", "Arbok", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[6] = {"Raticate", "Ekans", "Arbok", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[7] = {"Raticate", "Ekans", "Arbok", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[8] = {"Raticate", "Ekans", "Arbok", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[9] = {"Raticate", "Ekans", "Arbok", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[10] = {"Raticate", "Ekans", "Arbok", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[11] = {"Raticate", "Ekans", "Arbok", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[12] = {"Raticate", "Ekans", "Arbok", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[13] = {"", "Shiny Blastoise", "", "", "", "", "Shiny Venusaur", "", "Shiny Charizard"},
[14] = {"Raticate", "Ekans", "Arbok", "Koffing", "Ponyta", "Bulbasaur", "Charmander", "Squirtle", "Pidgeotto"},
[15] = {"", "Shiny Gyarados", "", "", "", "", "", "", ""}, --o numero de espaços na tabela tem q ser o ms do numero de posis!!!
}

 

 

Golden Arena(Script)

 

--[[storages
22545 = player q entra na arena (normal)
22546 = monstros na arena (normal)
22547 = waves (global)
22548 = qnts monstros tem na arena (global)
22549 = nome dos players q vao pra arena (global)
22550 = qnts players tem na arena (global)
22551 = waves para cada player (normal)
]]
------------------------------------------------------------------------------------------------------------------
function doWave(start) --alterado v1.8 \/
if getGlobalStorageValue(22550) >= 1 and getGlobalStorageValue(22548) <= 0 then
if start then
doBroadcastMessage("The Golden Arena are started!")
end
local wave = getGlobalStorageValue(22547) <= 0 and 1 or getGlobalStorageValue(22547)
local players = creaturesInGolden(GoldenUpper, GoldenLower, true)
for i = 1, #posisGolden do
if wavesGolden[wave] ~= "" then
local monster = doSummonCreature(wavesGolden[wave], posisGolden)
doSetMonsterPassive(monster)
doWildAttackPlayer(monster, players[math.random(#players)])
doSendMagicEffect(getThingPos(monster), 21)
setPlayerStorageValue(monster, 22546, 1)
local sto = getGlobalStorageValue(22548) <= 0 and 0 or getGlobalStorageValue(22548)
setGlobalStorageValue(22548, sto+1)
end
end
for a = 1, #players do
setPlayerStorageValue(players[a], 22551, wave)
end
setGlobalStorageValue(22547, wave+1)
else
if start then
doBroadcastMessage("Golden Arena will not begin, because no player are registered!")
return true
end
end
end
------------------------------------------------------------------------------------------------------------------
function puxaParticipantes()
local s = ""
if getGlobalStorageValue(22549) ~= -1 then
s = string.explode(getGlobalStorageValue(22549), ",")
end

if type(s) ~= 'table' or s == "" then
return true --alterado v1.8 \/
end

for i = 1, #s do
local sid = getPlayerByName(s)
if isCreature(sid) then
doTeleportThing(sid, getClosestFreeTile(sid, posGolden)) --pos pra onde os players vao ser teleportados quando a golden começar!
doSendMagicEffect(getThingPos(sid), 21)
setPlayerStorageValue(sid, 22545, 1)
setGlobalStorageValue(22550, (getGlobalStorageValue(22550) <= 0 and 0 or getGlobalStorageValue(22550))+1)
end
end
setGlobalStorageValue(22549, -1)
end
------------------------------------------------------------------------------------------------------------------
function endGoldenArena(onStart)
for sto = 22547, 22550 do
setGlobalStorageValue(sto, -1)
end
addEvent(creaturesInGolden, 150, GoldenUpper, GoldenLower, false, true, true)
if not onStart then
doBroadcastMessage("The Golden Arena are finished!")
end
end
------------------------------------------------------------------------------------------------------------------
function creaturesInGolden(upper, lower, player, remove, clean) -- function by Vodkart and edited by Slicer
local players = {}
for x = upper.x - 1, lower.x + 1 do
for y = upper.y - 1, lower.y + 1 do
local pos = {x = x, y = y, z = upper.z}
local m = getTopCreature(pos).uid
if remove ~= false and m ~= 0 and ehMonstro(m) then doRemoveCreature(m) end
if clean ~= false and hasTile(pos) then doCleanTile(pos, false) end --alterado v1.8
if player ~= false and m ~= 0 and isPlayer(m) and getPlayerStorageValue(m, 22545) == 1 then table.insert(players, m) end
end
end
if player ~= false then return players end
end
------------------------------------------------------------------------------------------------------------------
function installRankGolden() --alterado v1.8 \/
if db.getResult("SELECT `Golden` FROM `players`;"):getID() ~= -1 then return true end

if db.executeQuery("ALTER TABLE `players` ADD `Golden` integer not null default 0;") then
if db.executeQuery("UPDATE `players` SET `Golden` = '10000' WHERE `id` = 1;") then
print("Table 'Golden' added with success!")
end
end
return true
end
------------------------------------------------------------------------------------------------------------------
function getPlayerRecordWaves(cid)
if not isCreature(cid) then return 0 end
local pid = getPlayerGUID(cid)
local query = db.getResult("SELECT `Golden` FROM `players` WHERE `id` = "..pid..";")

if query:getID() == -1 then
return 0
end
return query:getDataInt("Golden")
end
------------------------------------------------------------------------------------------------------------------
function setPlayerRecordWaves(cid)
if not isCreature(cid) then return false end
local waves = getPlayerStorageValue(cid, 22551)
local acc = getPlayerGUID(cid)
if waves > getPlayerRecordWaves(cid) then
if db.executeQuery("UPDATE `players` SET `Golden` = '"..waves.."' WHERE `id` = "..acc..";") then
setPlayerStorageValue(cid, 22551, -1)
return true
end
end
return false
end
------------------------------------------------------------------------------------------------------------------
function getRankGolden() --alterado v1.9 \/
local query = db.getResult("SELECT `id`, `Golden` FROM `players` ORDER BY `Golden` DESC;")
local str = {}
table.insert(str, "Rank of the Golden Arena:\n\n")

if query:getID() ~= -1 then
for i = 1, 10 do
if not(query:next()) or query:getDataInt("Golden") == 0 then
table.insert(str, i.."° None - 0 wave.\n")
else
local s = tonumber(query:getDataInt("Golden")) > 1 and "s" or ""
table.insert(str, i.."° "..getPlayerNameByGUID(query:getDataString("id")).." - "..query:getDataInt("Golden").." wave"..s..".\n")
end
end
query:free()
end
return table.concat(str)
end
------------------------------------------------------------------------------------------------------------------

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

nao sei se é ctz mais..

2251 é o id do hd

ou seja, a cada wave ele vai multiplicando o id

entao seria:

wave 1: 2251 = 1 hd

wave2: 2251*2 = 2 hd

creio que funciona assim x

isso...

 

quando fiz o sistema alguem me disse q era assim q funcionava na pxg então..

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...