Tibia 8.57
requer muita habilidade
Galera eu fiz um evento de war usando a pasta globalevents(pra fazer o evento automatico), movements(para selecionar o time automaticamente(time red e time blue), e na pasta creaturescripts(pra quando um time morre o resto do otro time for teletransportado para a rewardroom)...nao tem nd de errado na pasta globalevents e nem na de movements. O problema é o seguinte: o script q tem na pasta creaturescripts só funciona quando o time blue mata o time red(ai o time enteiro blue é teletransportado para redwardroom)... quando o time red mata o blue, o time red nao ta teletransportando para a reward room. O script é esse:
local config = {
redTeam = 1,
blueTeam = 2,
gametime = 2000,
redTeamStorage = 2001,
blueTeamStorage = 2002,
outfitRed = {lookType = 130, lookHead = 94, lookAddons = 1, lookLegs = 94, lookBody = 94, lookFeet = 94},
outfitBlue = {lookType = 130, lookHead = 88, lookAddons = 1, lookLegs = 88, lookBody = 88, lookFeet = 88}
}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == TRUE and
getPlayerStorageValue(cid,1001) > 0 then
local War = {
fromPos={x=638, y=711, z=7, stackpos=253},
toPos={x=751, y=780, z=7, stackpos=253},
rewardRoom = {x=636,y=662,z=7,stackpos=1}}
local redStorage = getGlobalStorageValue(2001)
local blueStorage = getGlobalStorageValue(2002)
local outfit = getCreatureOutfit(cid)
local CHANNEL_BLUE, CHANNEL_RED = 12, 11
function TpWinners(cid)
for _, pid in ipairs(getPlayersOnline()) do
if isInArea(getPlayerPosition(pid), War.fromPos, War.toPos) then
doTeleportThing(pid, War.rewardRoom, false)
end
end
end
local function winKillRed(cid)
addEvent(TpWinners,5000,cid)
doBroadcastMessage("Red Team has won the event!")
doPlayerCloseChannel(cid, CHANNEL_RED)
setGlobalStorageValue(config.redTeamStorage, 0)
setGlobalStorageValue(config.blueTeamStorage, 0)
doTeleportThing(cid, {x=518, y=840, z=7, stackpos=253})
end
local function winKillBlue(cid)
addEvent(TpWinners,5000,cid)
doBroadcastMessage("Blue Team has won the event!")
doPlayerCloseChannel(cid, CHANNEL_BLUE)
setGlobalStorageValue(config.redTeamStorage, 0)
setGlobalStorageValue(config.blueTeamStorage, 0)
doTeleportThing(cid, {x=518, y=840, z=7, stackpos=253})
end
local function arenaDeathRed(cid)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
doTeleportThing(cid, {x=518, y=840, z=7, stackpos=253})
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event')
doPlayerCloseChannel(cid, CHANNEL_RED)
setPlayerStorageValue(cid,1001, 0)
setPlayerStorageValue(cid,1002, 1)
doRemoveCondition(cid,CONDITION_INFIGHT)
doRemoveCondition(cid, CONDITION_OUTFIT)
if redStorage == 1 then
winKillBlue(cid)
end
return true
end
local function arenaDeathBlue(cid)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
doTeleportThing(cid, {x=518, y=840, z=7, stackpos=253})
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have died, you are eliminated from the event')
doPlayerCloseChannel(cid, CHANNEL_BLUE)
setPlayerStorageValue(cid,1001, 0)
setPlayerStorageValue(cid,1002, 1)
doRemoveCondition(cid,CONDITION_INFIGHT)
doRemoveCondition(cid, CONDITION_OUTFIT)
if blueStorage == 1 then
winKillRed(cid)
end
return true
end
--Red Team
if getPlayerStorageValue(cid,1001) == config.redTeam then
arenaDeathRed(cid)
--Blue Team
elseif getPlayerStorageValue(cid,1001) == config.blueTeam then
arenaDeathBlue(cid)
end
end
return true
end
Ve se vcs acham oq ta errado pq eu ja tentei milhares de vezes