Ir para conteúdo
  • 0

[Sistema] Battlefield Event


Kimbly

Pergunta

Bem gostaria que alguém muda-se o script do Vodkart (http://www.xtibia.co...ent/page__st__0) uma pequena mudança acho que não dará muito trabalho vou logo ao principal:

 

 

_Lib_Battle_Info = {

Reward = {2160,10},

TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=613,y=802,z=7}},

TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=631,y=801,z=7}},

storage_count = 180400,

tpPos = {x=158, y=57, z=7},

limit_Time = 10 -- em minutos

}

function resetBattle()

return setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0) and setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)

end

function OpenWallBattle()

local B = {

{1543,{x=622, y=803, z=7, stackpos = 1}},

{1543,{x=622, y=804, z=7, stackpos = 1}},

{1543,{x=622, y=805, z=7, stackpos = 1}},

{1543,{x=622, y=806, z=7, stackpos = 1}}

}

for i = 1, #B do

if getTileItemById(B[2], B[1]).uid == 0 then

doCreateItem(B[1], 1, B[2])

else

doRemoveItem(getThingfromPos(B[2]).uid,1)

end

end

end

function doBroadCastBattle(type,msg)

local players = {}

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

table.insert(players, cid)

end

end

for i = 1, #players do

doPlayerSendTextMessage(players,type,msg)

end

end

function 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)

end

function getWinnersBattle(storage)

local players,str = {},""

for _, cid in pairs(getPlayersOnline()) do

if getPlayerStorageValue(cid, storage) == 1 then

table.insert(players, cid)

end

end

str = str .. ""..#players.." Player"..(#players > 1 and "s" or "").." from team "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." won the event battlefield, they received a ".._Lib_Battle_Info.Reward[2].." "..getItemNameById(_Lib_Battle_Info.Reward[1]).."!"

for i = 1, #players do

doPlayerAddItem(players, _Lib_Battle_Info.Reward[1], _Lib_Battle_Info.Reward[2])

doRemoveCondition(players, CONDITION_OUTFIT)

doTeleportThing(players, getTownTemplePosition(getPlayerTown(players)))

setPlayerStorageValue(players, storage, -1)

end

resetBattle()

OpenWallBattle()

return doBroadcastMessage(str)

end

function CheckEvent(delay)

if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then

doBroadcastMessage("[battleField Event] We are waiting "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." players to Battlefield starts")

elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then

local players = {}

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

table.insert(players, cid)

end

end

for i = 1, #players do

doRemoveCondition(players, CONDITION_OUTFIT)

doTeleportThing(players, getTownTemplePosition(getPlayerTown(players)))

setPlayerStorageValue(players, getPlayerStorageValue(players, _Lib_Battle_Info.TeamOne.storage) == 1 and _Lib_Battle_Info.TeamOne.storage or _Lib_Battle_Info.TeamTwo.storage, -1)

end

doBroadcastMessage("The event cannot be started because not had enough players.")

setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)

resetBattle()

removeBattleTp()

end

addEvent(CheckEvent, 60000, delay-1)

end

 

 

 

 

Bem eu gostaria que muda-se aqui olha:

_Lib_Battle_Info = {
Reward = {2160,10},
TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=613,y=802,z=7}},
TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=631,y=801,z=7}},
storage_count = 180400,
tpPos = {x=158, y=57, z=7},
limit_Time = 10 -- em minutos
}

 

Nessa parte os jogadores ganhadores do evento ganharam 100k

Reward = {2160,10}

 

Eu simplesmente gostaria que ao invés de receber 100k teleporte-se os jogadores ganhadores para um local

{ x = xxxx, y = xxxx, z = xxxx }

 

Eu tenho mais ou menos uma noção de como seria, bem acho que seria mais ou menos isso:

local config = {
area1 = {x=0000,y=0000,z=0000},
}
oTeleportThing(cid, config.area1)

 

Porém não sei como acrescentar sem danificar o script...

Quem conseguir +Rep é garantido

smile_positivo.gif

Link para o comentário
https://xtibia.com/forum/topic/214535-sistema-battlefield-event/
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

_Lib_Battle_Info = {
RewardPos = {x = x, y = y, z = z},
TeamOne = {name = "Black Assassins", storage = 140120, pos = {x=613,y=802,z=7}},
TeamTwo = {name = "Red Barbarians",storage = 140121,pos = {x=631,y=801,z=7}},
storage_count = 180400,
tpPos = {x=158, y=57, z=7},
limit_Time = 10 -- em minutos
}
function resetBattle()
return setGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage, 0) and setGlobalStorageValue(_Lib_Battle_Info.TeamTwo.storage, 0)
end
function OpenWallBattle()
local B = {
{1543,{x=622, y=803, z=7, stackpos = 1}},
{1543,{x=622, y=804, z=7, stackpos = 1}},
{1543,{x=622, y=805, z=7, stackpos = 1}},
{1543,{x=622, y=806, z=7, 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
end
end
function doBroadCastBattle(type,msg)
local players = {}
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
table.insert(players, cid)
end
end
for i = 1, #players do
doPlayerSendTextMessage(players[i],type,msg)
end
end
function 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)
end
function getWinnersBattle(storage)
local players,str = {},""
for _, cid in pairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, storage) == 1 then
table.insert(players, cid)
end
end
str = str .. ""..#players.." Player"..(#players > 1 and "s" or "").." from team "..(getGlobalStorageValue(_Lib_Battle_Info.TeamOne.storage) == 0 and _Lib_Battle_Info.TeamTwo.name or _Lib_Battle_Info.TeamOne.name).." won the event battlefield, they received a ".._Lib_Battle_Info.Reward[2].." "..getItemNameById(_Lib_Battle_Info.Reward[1]).."!"
for i = 1, #players do
doTeleportThing(players[i], _Lib_Battle_Info.RewardPos)
doRemoveCondition(players[i], CONDITION_OUTFIT)
doTeleportThing(players[i], getTownTemplePosition(getPlayerTown(players[i])))
setPlayerStorageValue(players[i], storage, -1)
end
resetBattle()
OpenWallBattle()
return doBroadcastMessage(str)
end
function CheckEvent(delay)
if delay > 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
doBroadcastMessage("[battleField Event] We are waiting "..getGlobalStorageValue(_Lib_Battle_Info.storage_count).." players to Battlefield starts")
elseif delay == 0 and getGlobalStorageValue(_Lib_Battle_Info.storage_count) > 0 then
local players = {}
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
table.insert(players, cid)
end
end
for i = 1, #players do
doRemoveCondition(players[i], CONDITION_OUTFIT)
doTeleportThing(players[i], getTownTemplePosition(getPlayerTown(players[i])))
setPlayerStorageValue(players[i], getPlayerStorageValue(players[i], _Lib_Battle_Info.TeamOne.storage) == 1 and _Lib_Battle_Info.TeamOne.storage or _Lib_Battle_Info.TeamTwo.storage, -1)
end
doBroadcastMessage("The event cannot be started because not had enough players.")
setGlobalStorageValue(_Lib_Battle_Info.storage_count, 0)
resetBattle()
removeBattleTp()
end
addEvent(CheckEvent, 60000, delay-1)
end

Link para o comentário
https://xtibia.com/forum/topic/214535-sistema-battlefield-event/#findComment-1521743
Compartilhar em outros sites

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

×
×
  • Criar Novo...