Ir para conteúdo
  • Cadastre-se

Posts Recomendados

zombieevent.png

Então o evento tá funcionando perfeitamente mais fica dando isso na distro ae como arumo ? :x

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

          Procuro Equipe para projeto sério com remuneração, maior necessidade Programador em C\C++.

Link para o post
Compartilhar em outros sites
  • 2 weeks later...

@Up

          Procuro Equipe para projeto sério com remuneração, maior necessidade Programador em C\C++.

Link para o post
Compartilhar em outros sites
  • 2 weeks later...

@Up² ngm vai mim ajudar ? \: Scripters Plx :C

          Procuro Equipe para projeto sério com remuneração, maior necessidade Programador em C\C++.

Link para o post
Compartilhar em outros sites

Link do tópico que você pegou o evento?

Mals a demora pra responder :z sem net mais enfim eu não peguei daqui não peguei de outro server pqê os daqui não abrem tp e sim removem itens q bloqueiam o tp q tem q ficar aberto o tempo todo e o de lá ñ :) vô passar ele todo aqui ..

data\creaturescripts\scripts\Zombie

Onnatack.lua

function loseOnZombieArena(cid)

kickPlayerFromZombiesArea(cid)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.")

local players = getZombiesEventPlayers()

if(#players <= 1) then

local winner = players[1]

if(winner) then

doPlayerAddItem(winner, 6571, 1, true)

doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.")

doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!")

kickPlayerFromZombiesArea(winner)

else

doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!")

end

doSetStorage(ZE_STATUS, 0)

doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)

doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)

doSetStorage(ZE_ZOMBIES_SPAWNED, 0)

local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1

local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1

local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}

for _, mon in pairs(getGlobalStorageTable(201201062001)) do

if isCreature(mon) then

doRemoveCreature(mon)

end

end

end

end

function onStatsChange(target, cid, changetype, combat, value)

if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then

doCreatureAddHealth(target, getCreatureMaxHealth(target))

loseOnZombieArena(target)

return false

end

return true

end

Ondeath.lua

function onDeath(cid)

setZombiesToSpawnCount(getZombiesToSpawnCount() + 2)

doCreatureSay(cid, "I'll be back!", 19)

return true

end

Onthink.lua

function onThink(cid)

local target = getCreatureTarget(cid)

if(target ~= 0 and not isPlayer(target)) then

doRemoveCreature(target)

end

return true

end

data\globalevents\scripts\zombie

onstartup.lua

function onstartup()

db.executeQuery("UPDATE `player_storage` SET `value` = 0 WHERE `key` = " .. ZE_isOnZombieArea .. ";")

doSetStorage(ZE_STATUS, 0)

doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)

doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)

doSetStorage(ZE_ZOMBIES_SPAWNED, 0)

addZombiesEventBlockEnterPosition()

return true

end

Onthink.lua

function onThink(interval, lastExecution, thinkInterval)

if(getStorage(ZE_STATUS) == 2) then

setZombiesToSpawnCount(getZombiesToSpawnCount()+1)

local players = getZombiesEventPlayers()

for i=1, getZombiesToSpawnCount() * 2 do

if(getZombiesToSpawnCount() > 0 and spawnNewZombie()) then

setZombiesToSpawnCount(getZombiesToSpawnCount()-1)

end

end

end

return true

end

globalevent.xml

<!-- Zombie Event -->

<globalevent name="ZombieGlobalThink" interval="5000" event="script" value="zombie/onthink.lua"/>

<globalevent name="ZombieGlobalStartup" type="start" event="script" value="zombie/onstartup.lua"/>

data/lib

zombie_event.lua

-- CONFIG

ZE_DEFAULT_NUMBER_OF_PLAYERS = 20

ZE_ACCESS_TO_IGNORE_ARENA = 4

-- POSITIONS

ZE_blockEnterItemPosition = {x=32341, y=32213, z=7} -- onde nasce o teleport?

ZE_enterPosition = {x=32154, y=32578, z=7} -- onde os players nascem dentro da arena zombie?

ZE_kickPosition = {x=32368, y=32241, z=7} -- quando morre vai para onde?

ZE_spawnFromPosition = {x=32140,y=32566,z=7} -- para sumonar zombie (de)

ZE_spawnToPosition = {x=32168,y=32590,z=7} -- para sumonar zombie (ate)

-- ITEM IDS

--ZE_blockEnterItemID = 2700

ZE_blockEnterItemID = 1387

-- STORAGES

-- - player

ZE_isOnZombieArea = 34370

-- - global

ZE_STATUS = 34370 -- =< 0 - off, 1 - waiting for players, 2 - is running

ZE_PLAYERS_NUMBER = 34371

ZE_ZOMBIES_TO_SPAWN = 34372

ZE_ZOMBIES_SPAWNED = 34373

-- FUNCTION

function setZombiesEventPlayersLimit(value)

doSetStorage(ZE_PLAYERS_NUMBER, value)

end

function getZombiesEventPlayersLimit()

return getStorage(ZE_PLAYERS_NUMBER)

end

function addPlayerToZombiesArea(cid)

doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)

doTeleportThing(cid, ZE_enterPosition, true)

doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)

if(getPlayerAccess(cid) < ZE_ACCESS_TO_IGNORE_ARENA) then

setPlayerZombiesEventStatus(cid, os.time())

end

end

function kickPlayerFromZombiesArea(cid)

doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)

doTeleportThing(cid, ZE_kickPosition, true)

doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)

setPlayerZombiesEventStatus(cid, 0)

end

function getPlayerZombiesEventStatus(cid)

return getCreatureStorage(cid, ZE_isOnZombieArea)

end

function setPlayerZombiesEventStatus(cid, value)

doCreatureSetStorage(cid, ZE_isOnZombieArea, value)

end

function getZombiesEventPlayers()

local players = {}

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

if(getPlayerZombiesEventStatus(cid) > 0) then

table.insert(players, cid)

end

end

return players

end

function getZombiesCount()

return getStorage(ZE_ZOMBIES_SPAWNED)

end

function addZombiesCount()

doSetStorage(ZE_ZOMBIES_SPAWNED, getStorage(ZE_ZOMBIES_SPAWNED)+1)

end

function resetZombiesCount()

doSetStorage(ZE_ZOMBIES_SPAWNED, 0)

end

function getZombiesToSpawnCount()

return getStorage(ZE_ZOMBIES_TO_SPAWN)

end

function setZombiesToSpawnCount(count)

doSetStorage(ZE_ZOMBIES_TO_SPAWN, count)

end

function addZombiesEventBlockEnterPosition() -- remove tp

-- remove o TP

local item = getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID)

if(item.uid ~= 0) then

doRemoveItem(item.uid)

end

--doRemoveItem(getThingFromPos(Castle.desde).uid)

--[[

if(getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID).uid == 0) then

doCreateItem(ZE_blockEnterItemID, 1, ZE_blockEnterItemPosition)

end

]]--

end

function removeZombiesEventBlockEnterPosition() -- add tp

if(getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID).uid == 0) then

--doCreateItem(ZE_blockEnterItemID, 1, ZE_blockEnterItemPosition)

local tp = doCreateTeleport(ZE_blockEnterItemID, ZE_enterPosition, ZE_blockEnterItemPosition)

doItemSetAttribute(tp, "aid", "5555")

end

--[[

local item = getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID)

if(item.uid ~= 0) then

doRemoveItem(item.uid)

end

]]--

end

function spawnNewZombie()

local posx = {}

local posy = {}

local posz = {}

local pir = {}

for i=1, 5 do

local posx_tmp = math.random(ZE_spawnFromPosition.x ,ZE_spawnToPosition.x)

local posy_tmp = math.random(ZE_spawnFromPosition.y ,ZE_spawnToPosition.y)

local posz_tmp = math.random(ZE_spawnFromPosition.z ,ZE_spawnToPosition.z)

local pir_tmp = 0

local spec = getSpectators({x=posx_tmp, y=posy_tmp, z=posz_tmp}, 3, 3, false)

if(spec and #spec > 0) then

for z, pid in pairs(spec) do

if(isPlayer(pid)) then

pir_tmp = pir_tmp + 1

end

end

end

posx = posx_tmp

posy = posy_tmp

posz = posz_tmp

pir = pir_tmp

end

local lowest_i = 1

for i=2, 5 do

if(pir < pir[lowest_i]) then

lowest_i = i

end

end

local ret = doCreateMonster("Zombie Event", {x=posx[lowest_i], y=posy[lowest_i], z=posz[lowest_i]}, false)

if type(ret) == "number" then

addZombiesCount()

doAddGlobalStorageValue(201201051801, ret)

end

return type(ret) == "number"

end

data/movements/scripts/zombie

onenter.lua

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

if(not isPlayer(cid)) then

return true

end

if(getPlayerAccess(cid) >= ZE_ACCESS_TO_IGNORE_ARENA) then

addPlayerToZombiesArea(cid)

elseif(#getZombiesEventPlayers() < getZombiesEventPlayersLimit() and getStorage(ZE_STATUS) == 1) then

addPlayerToZombiesArea(cid)

local players_on_arena_count = #getZombiesEventPlayers()

if(players_on_arena_count == getZombiesEventPlayersLimit()) then

addZombiesEventBlockEnterPosition() -- removeTP

doSetStorage(ZE_STATUS, 2)

doBroadcastMessage("Zombie Arena Event started.")

else

doBroadcastMessage(getCreatureName(cid) .. " has entered a Zombie Arena. We still need " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " players.")

end

else

doTeleportThing(cid, fromPosition, true)

addZombiesEventBlockEnterPosition()

end

return true

end

movements.xml

<movevent type="StepIn" actionid="5555" event="script" value="zombie/onenter.lua"/>

Tá ai :) C faltou algo só falar q posto k

          Procuro Equipe para projeto sério com remuneração, maior necessidade Programador em C\C++.

Link para o post
Compartilhar em outros sites

Troque todos doAddGlobalStorageValue por setGlobalStorageValue.

Mano ta quase lá :) Só tem isso aqui agora .

semas.png

Dá Fim? :D

          Procuro Equipe para projeto sério com remuneração, maior necessidade Programador em C\C++.

Link para o post
Compartilhar em outros sites

Cara, eu acho que é melhor você já instalar algum aqui do TibiaKing.

http://tibiaking.com...bie-event-area/

http://tibiaking.com...60/#entry124578

Tão tá vlw ae por tentar ajudar reputado por isso pena q ñ terminou mais ta susegado vô dar um geito aqui :) esses ai o link 1 do sociopata num abre portal ñ o portal tem q ficar aberto pelo q entendi e com alguma coisa bloqueando ele dai quando inicia o bloqueio só e removido mais num e legal deixar isso na frente do dp néh? :z e o ultimo e bem antigo :s nem por talkaction ainda rs Vlw ae ^^ i move o topico ainda não . /ou pode mover c acha mais adequado eu abrir outro só pra terminar isso mais acho q eh melhor terminar aqui logo :x

@Edit Topico já pode ser movido .

era só trocar o onnatack

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

          Procuro Equipe para projeto sério com remuneração, maior necessidade Programador em C\C++.

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo