Ir para conteúdo

Zombie Evento (MOD) Duvida


markim1986

Posts Recomendados

PEssoal meu Zombie Evento está dando esse erro:

 

[29/04/2014 21:55:00] [Error - GlobalEvent Interface]
[29/04/2014 21:55:00] In a timer event called from:
[29/04/2014 21:55:00] buffer:onTimer
[29/04/2014 21:55:00] Description:
[29/04/2014 21:55:00] (luaGetThingPosition) Thing not found

[29/04/2014 21:55:00] [Error - GlobalEvent Interface]
[29/04/2014 21:55:00] In a timer event called from:
[29/04/2014 21:55:00] buffer:onTimer
[29/04/2014 21:55:00] Description:
[29/04/2014 21:55:00] (luaGetThingPosition) Thing not found

 

 

O Script (MOD) é esse:

 

 



zombieRewards = {
random = false, --czy ma losowac nagrode
rew = {2160,5} --nagrody, wypelniamy w ten sposob {itemId1, count1, itemId2, count2 ...}
}

zombieMaxPlayers = 10 --ilosc graczy wymaganych do rozpoczecia eventu
zombieMinPlayers = 2 --minimalna ilosc graczy
zombieAccesToIgnore = 5 --acces ktory nie jest liczony jako osoba uczestniczaca w evencie
timeOnJoinToEvent = 1 --ilosc minut ktora czeka skrypt na wymagana ilosc graczy

zombieJoinType = 'booth' --movement, talkaction lub oba, sposob dolaczania sie do eventu

-- POSITIONS
zombieKickPosition = {x=1588,y=1026,z=7} --gdzie wyrzuca graczy po wyrzuceniu z eventu (przegranej)
zombieEnterPosition = {x=1593,y=1315,z=7} --pozycja gdzie teleportuje graczy po rozpoczeciu eventu

zombieCenterRoomPosition = {x=1593,y=1320,z=7} --idealny srodek pomieszczenia
zombieRangeX_RangeY = {15,15} --szerokosc oraz wysokosc pomieszczenia dzielona przez dwa (liczone w najszerszych miejscach)

zombieStorageStatus = 13300 --storage uzywane do eventu

ZOMBIE = {
--UWAGA! NAZWY POTWORÓW KONIECZNIE PISANE Z MALYCH LITER!
--['nazwa potwora'] = {szansa na stworzenie, szansa na zainfekowanie}
['horned mutant'] = {10,1},
['vile centurion'] = {10,2},
['daidalost'] = {10,4},
['mongrel man'] = {10,8},
['propell zombie'] = {5,16},
['scrathclaw'] = {3,32}
}

function chooseZombieMonster()
local monster = false
for k, v in pairs(ZOMBIE) do
monster = monster or (math.random(100) <= v[1] and k or false)
end
return monster or chooseZombieMonster()
end

function isWalkable(pos, creature, proj, pz)
if getTileThingByPos({x=pos.x,y=pos.y,z=pos.z,stackpos=0}).itemid == 0 then return false end
if getTopCreature(pos).uid > 0 and creature then return false end
if getTileInfo(pos).protection and pz then return false, true end
local n = not proj and 3 or 2
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return false
end
end
end
return true
end

local _f = doTeleportThing
function doTeleportThing(cid, newpos, ignoreBlocking)
return (ignoreBlocking or isWalkable(newpos, true, true, false) or false) and _f(cid, newpos, true)
end

function getZombiesEventPlayers()
local players = {}
for _, cid in pairs(getPlayersOnline()) do
if getCreatureStorage(cid, zombieStorageStatus) == 1 and getPlayerAccess(cid) < zombieAccesToIgnore then
table.insert(players, cid)
end
end
return players
end

function kickPlayerFromZombiesArea(cid)
doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)
doTeleportThing(cid, zombieKickPosition, true)
doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)
return doCreatureSetStorage(cid, zombieStorageStatus, 0) and doCreatureSetNoMove(cid, false)
end

function loseOnZombieArena(cid)
local players, msg = getZombiesEventPlayers(), ''
doCreatureSetStorage(cid, zombieStorageStatus+1, 0)
kickPlayerFromZombiesArea(cid)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are dead.')
if(#getZombiesEventPlayers() <= 1) then
local winner = getZombiesEventPlayers()[1] or players[1]
if winner then
if zombieRewards.random then
local i = math.random(#zombieRewards.rew/2)
local rewardItem = doPlayerAddItem(winner, zombieRewards.rew[i*2-1], zombieRewards.rew[i*2], true)
else
for i = 1, #zombieRewards.rew/2 do
doPlayerAddItem(winner, zombieRewards.rew[i*2-1], zombieRewards.rew[i*2], true)
end
end
doPlayerSendTextMessage(winner, MESSAGE_INFO_DESCR, 'You won Zombie Event.')
msg = getCreatureName(winner) .. ' Venceu o Zombie Event.'
kickPlayerFromZombiesArea(winner)
else
msg = 'Zombie Event finished! No one win!'
end
if getSpectators(zombieCenterRoomPosition, zombieRangeX_RangeY[1], zombieRangeX_RangeY[2]) then
for _, v in ipairs(getSpectators(zombieCenterRoomPosition, zombieRangeX_RangeY[1], zombieRangeX_RangeY[2])) do
if isMonster(v) then
doRemoveThing(v)
elseif isPlayer(v) then
kickPlayerFromZombiesArea(v)
end
end
end
doSetStorage(zombieStorageStatus, 0)
end
return (msg ~= '' and doBroadcastMessage(msg) or true)
end

function addPlayerToZombiesArea(cid, block)
doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)
doTeleportThing(cid, zombieEnterPosition, true)
doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)
return doCreatureSetStorage(cid, zombieStorageStatus, 1) and doCreatureSetNoMove(cid, block)
end

function spawnNewZombie(fromPosition, n)
local n, pos = n or 0, {x = zombieCenterRoomPosition.x + math.random(-zombieRangeX_RangeY[1],zombieRangeX_RangeY[1]), y = zombieCenterRoomPosition.y + math.random(-zombieRangeX_RangeY[2],zombieRangeX_RangeY[2]), z = zombieCenterRoomPosition.z}
if isWalkable(pos, true, true, true) then
local monster = chooseZombieMonster()
local cid = doCreateMonster((monster == '' and 'horned mutant' or monster), pos, false)
doSendMagicEffect(pos, CONST_ME_MORTAREA)
return (isMonster(cid) and registerCreatureEvent(cid, 'zombieEventDeath') and registerCreatureEvent(cid, 'zombieEventThink')) and (fromPosition and doSendDistanceShoot(fromPosition, pos, CONST_ANI_SUDDENDEATH) or true)
end
return (n < 200 and spawnNewZombie(fromPosition, n+1) or true)
end

function setZombieEventStart()
if getStorage(zombieStorageStatus) < 1 then
doSetStorage(zombieStorageStatus, 1)
doBroadcastMessage('Zombie Arena Event está aberto fale !zombie join ou entre no portal que abriu na cadeira de eventos. Esperando... '..zombieMaxPlayers..' players.')
if getSpectators(zombieCenterRoomPosition, zombieRangeX_RangeY[1], zombieRangeX_RangeY[2]) then
for _, cid in pairs(getSpectators(zombieCenterRoomPosition, zombieRangeX_RangeY[1], zombieRangeX_RangeY[2])) do
if isMonster(cid) then doRemoveThing(cid) end
end
end
end
return true
end
]]>

domodlib('zombieEvent_conf')
function onDeath(cid)
for i = 1, math.random(2) do
spawnNewZombie(getThingPos(cid))
end
doSendMagicEffect(getThingPos(cid), CONST_ME_MORTAREA)
return doCreatureSay(cid, 'I\'ll be back!', TALKTYPE_ORANGE_1)
end
]]>

domodlib('zombieEvent_conf')
function onThink(cid)
local name, target = getCreatureName(cid):lower(), getCreatureTarget(cid)
if isMonster(cid) and ZOMBIE[name] and target and isPlayer(target) then
if getCreatureStorage(target, zombieStorageStatus+1) < os.time() and getDistanceBetween(getThingPos(target), getThingPos(cid)) <= 1 and math.random(100) <= ZOMBIE[name][2] then
doSendAnimatedText(getThingPos(target), 'INFECTED!', COLOR_LIGHTGREEN)
doCreatureSetStorage(target, zombieStorageStatus+1, os.time() + 3)
doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'VOCE FOI INFECTADO. Para se curar diga "disable infection", voce tem apenas 3 segundos apos a infecção.')
return addEvent(function()
if isPlayer(target) then
if getCreatureStorage(target, zombieStorageStatus+1) ~= os.time() then
return false
end
doCreatureAddHealth(target, getCreatureMaxHealth(target))
return loseOnZombieArena(target)
end return true end,
3000,
target)
end
end
return true
end
]]>

domodlib('zombieEvent_conf')
function onSay(cid, words, param, channel)
if getCreatureStorage(cid, zombieStorageStatus+1) < os.time() or param ~= 'infection' then
return false
end
doSendAnimatedText(getThingPos(cid), 'CURE!', COLOR_LIGHTBLUE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You use an antidote on infection.')
return doCreatureSetStorage(cid, zombieStorageStatus+1, 0)
end
]]>

domodlib('zombieEvent_conf')
function onStatsChange(cid, attacker, type, combat, value)
if isMonster(attacker) and isPlayer(cid) and ZOMBIE[getCreatureName(attacker):lower()] and type == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(cid) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
return loseOnZombieArena(cid) and false
end
return true
end
]]>

domodlib('zombieEvent_conf')
function onStartup()
return doSetStorage(zombieStorageStatus, 0)
end
]]>

domodlib('zombieEvent_conf')
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if zombieJoinType == 'talkaction' then
return doTeleportThing(cid, fromPosition, true) end
local msg = ''
if isPlayer(cid) then
if getCreatureCondition(cid, CONDITION_INFIGHT) and getPlayerAccess(cid) < zombieAccesToIgnore then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have a PZ! You have to get rid of it. Somehow.')
end
if getPlayerAccess(cid) >= zombieAccesToIgnore then
setZombieEventStart()
return doTeleportThing(cid, zombieEnterPosition, true)
elseif #getZombiesEventPlayers() < zombieMaxPlayers and getStorage(zombieStorageStatus) == 1 then
addPlayerToZombiesArea(cid, true)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You are player of number '..#getZombiesEventPlayers()..', which join to event.')
if #getZombiesEventPlayers() == zombieMaxPlayers then
doSetStorage(zombieStorageStatus, 2)
for i = 1, math.random(2) do
spawnNewZombie(getThingPos(cid))
end
for _, v in pairs(getZombiesEventPlayers()) do
addPlayerToZombiesArea(v, false)
end
msg = 'Zombie Event is started. We have ' .. zombieMaxPlayers .. ' players, which joined to event. Have fun!'
else
msg = getCreatureName(cid) .. ' has entered a Zombie Arena. We still need ' .. zombieMaxPlayers - #getZombiesEventPlayers() .. ' players.'
end
return (msg ~= '' and doBroadcastMessage(msg) or true)
else
return doTeleportThing(cid, fromPosition, true) and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Arena is full.')
end
end
return true
end
]]>

domodlib('zombieEvent_conf')
function onSay(cid, words, param, channel)
if zombieJoinType == 'movement' then
return false end
local msg = ''
if isInArray({'join','add','go','joined'}, param:lower()) then
if getCreatureCondition(cid, CONDITION_INFIGHT) and getPlayerAccess(cid) <= zombieAccesToIgnore then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você precisa estar em PZ para participar, CORRA!!')
end
if getPlayerAccess(cid) >= zombieAccesToIgnore then
setZombieEventStart()
return doTeleportThing(cid, zombieEnterPosition, true)
elseif #getZombiesEventPlayers() < zombieMaxPlayers and getStorage(zombieStorageStatus) == 1 then
addPlayerToZombiesArea(cid, true)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You are player of number '..#getZombiesEventPlayers()..', which join to event.')
if #getZombiesEventPlayers() == zombieMaxPlayers then
doSetStorage(zombieStorageStatus, 2)
for i = 1, math.random(2) do
spawnNewZombie(getThingPos(cid))
end
for _, v in pairs(getZombiesEventPlayers()) do
addPlayerToZombiesArea(v, false)
end
msg = 'Zombie Event COMEÇOU BOA SORTE ' .. zombieMaxPlayers .. ' !'
else
msg = getCreatureName(cid) .. ' acabou de entrar na Zombie Arena. Ainda é possivel entrar mais ' .. zombieMaxPlayers - #getZombiesEventPlayers() .. ' players.'
end
return (msg ~= '' and doBroadcastMessage(msg) or true)
else
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (getStorage(zombieStorageStatus) == -1 and 'Event is no started.' or 'Arena is full.'))
end
elseif isInArray({'leave','abort','delete'}, param:lower()) then
if getStorage(zombieStorageStatus) < 2 then
doCreatureSetStorage(cid, zombieStorageStatus, 0)
doCreatureSetNoMove(cid, false)
return doTeleportThing(cid, getCreatureLastPosition(cid), true)
end
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You can\'t leave from arena if event is already running.')
end
return true
end
]]>

domodlib("zombieEvent_conf")
function onTimer()
addEvent(function()
if getStorage(zombieStorageStatus) == 2 then return true end
if getStorage(zombieStorageStatus) == 1 and #getZombiesEventPlayers() >= zombieMinPlayers then
doSetStorage(zombieStorageStatus, 2)
for i = 1, math.random(2) do
spawnNewZombie(getThingPos(cid))
end
for _, v in ipairs(getZombiesEventPlayers()) do
addPlayerToZombiesArea(v, false)
end
return doBroadcastMessage('Zombie Event is started. We have '..#getZombiesEventPlayers()..' players on area')
end
for _, v in ipairs(getZombiesEventPlayers()) do
kickPlayerFromZombiesArea(v)
end
return doBroadcastMessage('Zombie Event parou, não foi atingido o numero minimo de players.')
end,
timeOnJoinToEvent * 1000 * 60)

return setZombieEventStart()
end
]]>

function onLogin(cid)
doCreatureSetStorage(cid, zombieStorageStatus, 0)
return registerCreatureEvent(cid, 'zombieEventStatsChange')
end
]]>

 

 

Ele ate roda, mas fica dando esse erro acima direto, alguem sabe o que pode ser?

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...