SCRIPT EVENTS ZUMBIE
VERSAO: 8.60
MAP: BAIAK YUROTS
SCRIPT: ATUALIZADO
Acesso Rapido:
Quer conhecer Outros Conteudos da HARD?
1- Praia? [Tibia] Scripts De Verao No Xtibia - Hard Corporation
Tags: Praia, Deusa do Mar,Pacote Summer, Marinheiro, Montaria Maritima,Bar do Eks, Barril de Rum.
116 visualizações.
2 - [Tibia] Scripts De Natal No Xtibia - Hard Corporation
Tags: Presentes de Natal, Enfeites, Carta, Duende Askasleikir,Montaria Natalina, Tarefas de Natal, Toca Natalina (Gorro), Esquilo da Neve, Fireworksrocket.
446 visualizações.
3 - [Tibia] System Zumbi - Hard Corporation
Tag: Funcionamento 100% | 2405 visualizações.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOPICO VISUALIZADO PELO ADMINISTRADOR DA HARD: Dia 30/01/2012.
LEIA O TOPICO COMPLETO, CASO NAO QUEIRA FECHE O NAVEGADOR E DESISTA, POIS NAO IRA CONSEGUIR.
Algumas informações sobre o Script Abaixo primeiramente,
Quando o evento está começando você terá certos minutos para Entrar no teleport antes que desapareça.
Quando o teleport desaparece, acontece o zombie spawn após 20 segundos.
Os Zombies irão aparecer 1 de cada vez, a cada 20 segundos.
Os players que morrerem no evento, serão teleportados para o templo.
O vencedor do evento, recebe algumas recompensas e um cale-se dourado com seu nome.
Lembrando a area do evento DEVE SER NO-PVP PARA os PLAYERS NAO SE MATAREM.
Usaremos como Referencia as Seguintes TAGS:
Tags Disponiveis:
# Como Colocar o Horario para Iniciar o Evento?
# Configurando o Horario?
# Adicionando corretamente no Arquivo Login?
# Criando o Monster Zombie.
# Download do Mapa?
Como Usar:
Basta COPIAR A TAG Desejada Apertar Crtl+F e Procura-la que encontra-la no Topico.
GLOSARIO:
*Evento = Sera o Nome do Script
*Plataforma = Espaço do Quadrado de Nascimento dos ZOMBIE
# Como Colocar o Horario para Iniciar o Evento?
VERIFIQUE se seu otServer Possui a Maioria dos Scripts contendo esta particula:
[ interval="1635" OU time="16:35" ] Isso Vai Determinar Qual Dos Scripts USAR:
ABRA OTserv\data\globalevents\globalevents.XML Adicione Isto:
Adicione [1] Apenas o Compativel com seu OTSERVER!
<globalevent name="zombieevent" time="15:00" event="script" value="zombie.lua">
<globalevent name="zombieevent" interval="150000" event="script" value="zombie.lua">
Salve e Feche
*Este Vai Ser o HORARIO que o Evento ira se Iniciar Sozinho TODO DIA 15:00 (Voce pode trocar).
# Configurando o Horario?
1000 Segundos = 16 minutos e 39,6 segundos
1 hora = 3600 segundos
Um dia tem 86.400 Segundos, que são equivalentes à 1440 Minutos ou 24 Horas.
Uma semana tem 604.800 segundos, que são equivalentes à 10.080 Minutos ou 168 Horas.
Um Mês tem 2 milhões e 592 mil segundos, que são equivalentes à 43.200 Minutos ou 720 Horas.
Um ano tem 31 Milhões e 536 segundos, que são equivalentes à 525.600 Minutos ou 8.760 Horas.
Fonte: froog.com.br - Tudo sobre o Tempo.
Agora Vamos ao Arquivo:
OTserv\data\Globalevents\scripts\ Crie o Arquivo zombie.lua
Usar para as 2 Formas DE OTSERVER
Usado Linguagem Portuguesa Para LOCAIS Que Queira EDITAR o Valor.
local config = {
playerCount = 2001, -- Global storage for counting the players left/entered in the event
zombieCount = 2002, -- Global storage for counting the zombies in the event
teleportActionId = 2000, -- Action id of the teleport needed for the movement script
teleportPosition = {x = 675, y = 600, z = 7, stackpos = 1}, -- onde o teleporte sera criado templo.
teleportToPosition = {x = 606, y = 687, z = 7}, -- local para onde o player sera levado.
teleportId = 1387, -- Id of the teleport
timeToStartEvent = 5, -- Minutos para o teleporte fechar e o evento iniciar
timeBetweenSpawns = 20, -- Segundos para o spawn de cada zombie
zombieName = "event zombie", -- Nome do Monstro Zombie que sera Sumonado
playersNeededToStartEvent = 5, -- Minimo de Players Para o spawn e o evento comecarem, caso nao atingido o evento eh cancelado.
fromPosition = {x = 601, y = 682, z = 7}, -- top left cornor of the playground
toPosition = {x = 611, y = 692, z = 7}, -- bottom right cornor of the playground
}
function onThink(interval, lastExecution, thinkInterval)
local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition)
doItemSetAttribute(tp, "aid", config.teleportActionId)
doBroadcastMessage("Zombie event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING)
setGlobalStorageValue(config.playerCount, 0)
setGlobalStorageValue(config.zombieCount, 0)
addEvent(startEvent, config.timeToStartEvent * 1000 * 60)
print(getGlobalStorageValue(2001))
return true
end
function startEvent()
local get = getThingfromPos(config.teleportPosition)
if get.itemid == config.teleportId then
doRemoveItem(get.uid, 1)
end
local fromp, top = config.fromPosition, config.toPosition
if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then
addEvent(spawnZombie, config.timeBetweenSpawns * 1000)
doBroadcastMessage("Good luck in the zombie event people! The teleport has closed!", MESSAGE_STATUS_WARNING)
for x = fromp.x, top.x do
for y = fromp.y, top.y do
for z = fromp.z, top.z do
areapos = {x = x, y = y, z = z, stackpos = 253}
getPlayers = getThingfromPos(areapos)
if isPlayer(getPlayers.uid) then
doPlayerSendTextMessage(getPlayers.uid, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. config.timeBetweenSpawns .. " seconds! Good luck!")
end
end
end
end
else
doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. config.playersNeededToStartEvent .. " players is needed!", MESSAGE_STATUS_WARNING)
for x = fromp.x, top.x do
for y = fromp.y, top.y do
for z = fromp.z, top.z do
areapos = {x = x, y = y, z = z, stackpos = 253}
getPlayers = getThingfromPos(areapos)
if isPlayer(getPlayers.uid) then
doTeleportThing(getPlayers.uid, getTownTemplePosition(getPlayerTown(getPlayers.uid)), false)
doSendMagicEffect(getPlayerPosition(getPlayers.uid), CONST_ME_TELEPORT)
end
end
end
end
end
end
function spawnZombie()
if getGlobalStorageValue(config.playerCount) >= 2 then
pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)}
doSummonCreature(config.zombieName, pos)
doSendMagicEffect(pos, CONST_ME_MORTAREA)
setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1)
doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED)
addEvent(spawnZombie, config.timeBetweenSpawns * 1000)
end
return TRUE
end
Salve e Feche
Configurando A Base do Script:
O Arquivo SALVO ACIMA é Necessario para:
1- o Evento Acontecer
2- Os Zumbie Nascerem
3- O Teleporte Ser Aberto e Fechado
4- Contagem de Players.
5- o Nome do Zombie, caso altere. MUDE AQUI TAMBEM
6- QUANTIDADE DE PLAYERS NECESSARIO, Maior que 2.
7- ID Do teleporte, ESPAçO DA PLATAFORMA.
Caso ACONTECA ERROS NESTAS FUNCOES PEçA AJUDA E SAIBA ONDE CORRIGI-LAS.
fromPosition = {x = 1186, y = 1072, z = 7}, -- possicao esquerda onde ira nascer os zumbi
toPosition = {x = 1195, y = 1081, z = 7}, -- posicao direita onde ira nascer os zumbi
O Local onde os Zombie irao Nascer deve Ser na area de Attack, ou seja, Se colocar no mar o Inicio da PLATAFORMA Os Zombie poderam nascer no MAR.
Significa Como Apresentado na Imagem:
VAMOS DIZER UM QUADRADO e os zumbie irao nascer SOMENTE dentro daquele LOCAL.
01:DIREITA - PARTE DE CIMA
02: ESQUERDA - PARTE DE BAIXO
DESCONSIDERAR O TELEPORTE DA IMAGEM NUNCA COLOQUE TELEPORTE POIS IRA BUGAR O SCRIPT, NAO CONTANDO O PLAYER.
A HARD NAO disponibiliza o MAP ou parte Deste conteudo para outro LOCAL. a Copia Parcial é CRIME e sera incarada como tal.
Use o Createscripts para as 2 Formas de OTSERVER
OTserv\data\creaturescripts\Creaturescripts.XML Adicione Isto:
<event type="statschange" name="zombieevent" event="script" value="zombie.lua">
Salve e Feche
Este arquivo ABAIXO é ESSENCIAL PARA O FUNCIONAMENTO DESTE:
OTserv\data\creaturescripts\scripts\ Abra o Arquivo login.lua , Dentro Adicione:
registerCreatureEvent(cid, "zombieevent")
*Lembre-se de Adiciona-lo Na Linha ABAIXO dos outros, Sempre Com Paragrafos novos.
Salve e Feche
# Adicionando corretamente no Arquivo Login?
Sempre por Paragrafos, LEMBRANDO que seu otserver Pode ser Por exemplo por Espaço, assim Tente configura-lo conforme ele se apresenta.
registerCreatureEvent(cid, "XXXX")
registerCreatureEvent(cid, "XXXXX")
registerCreatureEvent(cid, "XXXX")
registerCreatureEvent(cid, "zombieevent")
registerCreatureEvent(cid, "XXXX")
AINDA TAMBEM Alguns OTSERVERS Podem Possuir os Arquivos:
Login.lua
Login1.lua
Login2.lua .....
Saiba onde configurar. CORRETAMENTE.
Vamos Agora Para o Arquivo:
OTserv\data\creaturescripts\scripts\ Crie um Aquivo .LUA Chamado zombie.lua , Dentro Adicione:
local config = {
playerCount = 2001, -- Global storage for counting the players left/entered in the event
goblet = 5805, -- id of the gold goblet you'll get when finishing the event.
rewards = {2195, 2152, 2160}, -- alem da taca de ouro com seu nome estes premios.
-- {moneyId, count, using? 1 for using moneyReward, 0 for not using.}
moneyReward = {2160, 10, 1},
-- Should be same as in the globalevent!
-- The zombies will spawn randomly inside this area
fromPosition = {x = 1186, y = 1072, z = 7}, -- Zona esquerda onde ira nascer os zumbi.
toPosition = {x = 1195, y = 1081, z = 7}, -- Zona direita onde ira nascer os zumbi.
}
function onStatsChange(cid, attacker, type, combat, value)
if isPlayer(cid) and isMonster(attacker) then
if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
if getGlobalStorageValue(config.playerCount) >= 2 then
doBroadcastMessage(getPlayerName(cid) .. " have been eated by Zombies!", MESSAGE_STATUS_CONSOLE_RED)
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)-1)
elseif getGlobalStorageValue(config.playerCount) == 1 then
if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
doBroadcastMessage(getPlayerName(cid) .. " won the Zombie event! Congratulations!", MESSAGE_STATUS_WARNING)
local goblet = doPlayerAddItem(cid, config.goblet, 1)
doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(cid) .. " for winning the Zombie event.")
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
for _,items in ipairs(config.rewards) do
doPlayerAddItem(cid, items, 1)
end
if config.moneyReward[3] == 1 then
doPlayerAddItem(cid, config.moneyReward[1], config.moneyReward[2])
end
end
for x = config.fromPosition.x, config.toPosition.x do
for y = config.fromPosition.y, config.toPosition.y do
for z = config.fromPosition.z, config.toPosition.z do
areapos = {x = x, y = y, z = z, stackpos = 253}
getMonsters = getThingfromPos(areapos)
if isMonster(getMonsters.uid) then
doRemoveCreature(getMonsters.uid)
end
end
end
end
end
return false
end
end
return true
end
Salve e FECHE.
* CONFIGURANDO CREATESCRIPTS:
RECORDANDO:
Caso Aconteca PROBLEMAS ou ERROS Neste Arquivo TEMOS:
1- storage dos Players Registrados
2- PLATAFORMA Do Local dos Zombie Irao Nascer, deve ser Igual ao do GlobalEvents.
3- PREMIOS do Player Vencedor(a).
Vamos Agora Para o Arquivo:
OTserv\data\movements\movements.XML Adicione Isto:
<movevent type="StepIn" actionid="2000" event="script" value="zombie.lua">
Salve e FECHE.
ACTION 2000 Se Refere a Action do TELEPORTE, ou seja AQUELA QUE IRA CONTAR OS PLAYERS.
ABAIXO voce Vai Enterder Um Problema que pode Acontecer com o SCRIPT, dependendo do Seu OTserver.
PRESTE MUITA ATENçAO:
PROCURE NA PASTA OTserv\data\actions\ actions.XML
Tente Localizar algum Arquivo que possua a ACTION 2000 >>>Ctrl+F<<
>>CASO NAO EXISTA PODE CONTINUAR O SCRIPT.. (Pule Esta Parte)
>>CASO EXISTA TERA QUE MODIFICAR 2 COISAS NESTE SCRIPT:
DELETE O ARQUIVO ACTIONS 2000 QUE VOCE ACHOU, na Maioria dos OTSERVER ele se chama Quest.lua ou Quests.lua
Pois Este FARA INTERFERENCIA com o Script DO ZOMBIE.
Quando e Como?
Caso ele Esteja configurado como Disse no action 2000, é o ID de Quests, ou seja, ao passar por cima de um BAU Vai aparecer a MSG que o player entrou no Evento, sem ele Estar COMECANDO OU ACONTECENDO.
ENTAO DELETE, e Adote outro MODELO ou Action para QUESTS.
Salve e FECHE CASO TENHA MUDADO NO ACTIONS.
PULE PARA Cá, CASO NAO EXISTA O PROBLEMA ACIMA.
Vamos Agora Para o Arquivo:
OTserv\data\movements\scripts\ Crie um Aquivo .LUA Chamado zombie.lua , Dentro Adicione:
local config = {
playerCount = 2001, -- Global storage for counting the players in the event
maxPlayers = 25, -- Max players que poderam participar
}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if getGlobalStorageValue(config.playerCount) < config.maxPlayers then
setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)+1)
if getGlobalStorageValue(config.playerCount) == config.maxPlayers then
doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(config.playerCount) .. " players]! The event will soon start.")
else
doBroadcastMessage(getPlayerName(cid) .. " entered the Zombie event! Currently " .. getGlobalStorageValue(config.playerCount) .. " players have joined!", MESSAGE_STATUS_CONSOLE_RED)
end
else
addEvent(tpBack, 1000, cid, fromPosition)
doPlayerSendCancel(cid, "The event is full. There is already " .. config.maxPlayers .. " players participating in the quest.")
return false
end
print(getStorage(config.playerCount) .. " Players in the zombie event.")
return true
end
function tpBack(cid, fromPosition)
doTeleportThing(cid, fromPosition, true)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
end
Salve e FECHE.
CASO ACONTEçA PROBLEMAS OU ERROS, saiba o que este script CONTEM:
1- conta o Numero de Player no evento
2- conta o maximo de Players que poderam entrar no Evento.
# Criando o Monster Zombie.
Lembrando:
Vamos Agora Para os ULTIMOS Arquivos:
OTserv\data\monster\monsters.XML Adicione Isto:
<monster name="event zombie" file="event zombie.xml">
Salve e FECHE.
Vamos Agora Para Arquivo do Monster:
OTserv\data\monster\ Crie um Aquivo .XML Chamado event zombie , Dentro Adicione:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="event zombie" nameDescription="an event zombie" race="undead" experience="280" speed="100" manacost="0">
<health now="500" max="500"/>
<look type="311" corpse="9875"/>
<targetchange interval="5000" chance="50"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="0"/>
<flag attackable="0"/>
<flag hostile="1"/>
<flag illusionable="0"/>
<flag convinceable="0"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag canpushcreatures="1"/>
<flag targetdistance="1"/>
<flag staticattack="90"/>
<flag runonhealth="0"/>
</flags>
<attacks>
<attack name="melee" interval="2000" min="-350" max="-350"/>
</attacks>
<defenses armor="15" defense="10"/>
<immunities>
<immunity paralyze="1"/>
<immunity physical="1"/>
<immunity energy="1"/>
<immunity fire="1"/>
<immunity poison="1"/>
<immunity lifedrain="1"/>
<immunity paralyze="1"/>
<immunity outfit="1"/>
<immunity drunk="0"/>
<immunity invisible="1"/>
</immunities>
<voices interval="5000" chance="10">
<voice sentence="You wont last long!"/>
<voice sentence="Mmmmh.. braains!"/>
</voices>
<loot>
<item id="2148" countmax="1" chance="100000"/><!-- gold coin -->
</loot>
</monster>
Salve e FECHE.
CONFIGURANDO MONSTER ZOMBIE:
NAO MUDE O NOME .
<flag attackable="0"> = NAO PODE ATACAR O MONSTER
<immunity invisible="1"> = IMUNE A INVISIBLE E OUTROS PARA NAO ACONTECER DESVANTAGENS.
# Download do Mapa?
* O Mapa pode ser construido por Cada Usuario, Mas configurando as Plataformas, NAO ADIANTA FAZER O DOWNLOAD DO MAPA Pensando que a Plataforma é igual. NAO! é Necessario MUDA-LA pois OS IDs do chao de seu MAPA pode ser diferente.
o Mapa nao é de Propriedade da Hard e Nao Foi Postado Por Esta para Download, pois Infringe Nossas Leis de Conduta.
*a HARD apenas Disponibiliza o Conteudo para Acrescentar em seu OTserv, Retirar os Creditos do Desenvolvidor deste sera Encarado como Plagio a esta Obra.
ENTENDENDO:
*Esta Imagem Mostra que o Player Entrou Dentro do Evento.
EU como (GOD) entrei 6 Vezes para Mostrar. MAS os Players Irao Entrar 1 VEZ SOMENTE e vai aparecer:
PLAYER Entered the Zombie Event! Currently X Players have Joined!
X: numero de players que estao no Evento
PLAYER: Seu nome
NAO DEIXE PORTAIS PARA VOLTA, POIS se o Player entrar novamente no Portal Sera Registrado como +1 e os Zumbie Irao nascer Para procurar este Player que (Nao existe , pois ele voltou e entrou novamente).
Foi Adicionado ao Monster o Poder de Atacar Players INVISIBLE, Pois quando um Player ficava Invisivel Nao era Atacado.
Este é o Exe do seu Otserver e as Msgs que aparecerao para Todos Players.
EXEMPLO:
* Este foi Retirado do script. DEVE SER ENCARADO COMO UM EXEMPLO APENAS POIS existem 2 maneiras diferentes.
<globalevent name="zombieevent" interval="15000" event="script" value="zombie.lua">
o Erro de Execuçao foi Arrumado.
16:35: o Evento Foi aberto, o teleporte ira sumir em 5 minutos
16:40:Aqui o Teleporte ja Fechou..
16:40:E os Zumbie irao começar a nascer em 20 segundos.
Mostra o Nome do Player que Foi Infectado e Foi para o Templo..
LEMBRANDO O CORPO NAO SIGNIFICA QUE O PLAYER MORREU, POIS O LOCAL é NO-PVP
16:44 Numero de Zumbies SUMONADOS ate o momento..
Muito Obrigado por Adicionar este Evento em Seu OTserv e Torna-lo Famoso.
DUVIDAS, PROBLEMAS, ERROS, ELOGIOS, RECLAMACOES E OUTROS COMENTE! e Obrigado