Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Boa noite rapaziada, tenho os dois scripts, extraídos de locais diferentes e como está meio que um inibe o outro.

 

Seguinte, coloquei o mod changemap, perfeito, ok. Adicionei o script de team x team, e no script ele já dá o town_id de cada team, aí basicamente ocorre o seguinte: Team1 nasce em dp_thais e Team2 nasce no templo_thais, aí após 20 minutos, o changemap entra em ação e leva os players para a próx city (p.ex=Carlin), caso os players morram, eles voltam para suas origens (templo_thais ou dp_thais), vou mostrar parte dos dois scripts. Cada city tem duas towns, gostaria que o script de team levasse os players para suas respectivas towns conforme a city atual do changemap.

 

Team script

 

local config = {

    storageTeamOne = 68473,
    storageTeamTwo = 68474,
    teamOne = { outfitMale =  {lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}, -- 94 representa a cor vermelha.
                outfitFemale =  {lookType = 136, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94},
                templeId = 3
              },
    teamTwo = { outfitMale =  {lookType = 128, lookHead = 82, lookBody = 82, lookLegs = 82, lookFeet = 82}, -- 82 representa a cor verde.
                outfitFemale =  {lookType = 136, lookHead = 82, lookBody = 82, lookLegs = 82, lookFeet = 82},
                templeId = 4
              }
}
 
function onLogin(cid)
local vermelho = getGlobalStorageValue(config.teamOne)
local verde = getGlobalStorageValue(config.storageTeamTwo)
if vermelho > verde then
    if getPlayerSex(cid) == 0 then
        doCreatureChangeOutfit(cid, config.teamTwo.outfitFemale)
    else
        doCreatureChangeOutfit(cid, config.teamTwo.outfitMale)
    end  
    doTeleportThing(cid, getTownTemplePosition(config.teamTwo.templeId))
    setGlobalStorageValue(config.storageTeamTwo, verde+1)
    setPlayerStorageValue(cid, config.storageTeamTwo, 1)
else
    if getPlayerSex(cid) == 0 then
        doCreatureChangeOutfit(cid, config.teamOne.outfitFemale)
    else
        doCreatureChangeOutfit(cid, config.teamOne.outfitMale)
    end  
    doTeleportThing(cid, getTownTemplePosition(config.teamOne.templeId))
    setGlobalStorageValue(config.teamOne, vermelho+1)
    setPlayerStorageValue(cid, config.teamOne, 1)
end
registerCreatureEvent(cid, "LogoutTeam")
registerCreatureEvent(cid, "DeathTeam")
return true
end
 
function onDeath(cid, corpse, deathList)
if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then
    setPlayerStorageValue(cid, config.storageTeamTwo, 0)
    setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)
else
    setPlayerStorageValue(cid, config.teamOne, 0)
    setGlobalStorageValue(config.teamOne, getGlobalStorageValue(config.teamOne)-1)
end
return true
end
 
function onLogout(cid)
if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then
    setPlayerStorageValue(cid, config.storageTeamTwo, 0)
    setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)
else
    setPlayerStorageValue(cid, config.teamOne, 0)
    setGlobalStorageValue(config.teamOne, getGlobalStorageValue(config.teamOne)-1)
end
return true
end

 

Changemap mod

 

<?xml version="1.0" encoding="UTF-8"?>  

<mod name="ChangeMap" version="1.0" author="Vodkart" contact="tibiaking.com" enabled="yes">  
<config name="map_func"><![CDATA[  
 
                      info = {  
                      [0] = {x=654,y=847,z=7},
                      [1] = {x=517,y=602,z=7},
                      [2] = {x=552,y=226,z=7},
                      [3] = {x=789,y=308,z=7},
                      [4] = {x=250,y=180,z=7},
                      [5] = {x=413,y=804,z=7}
                        }
 
                        storage = 50555  
 
]]></config> 
<event type="login" name="Check Map" event="script"><![CDATA[  
domodlib('map_func')  
        function onLogin(cid) 
        if getGlobalStorageValue(storage) == -1 then 
        setGlobalStorageValue(storage,getGlobalStorageValue(storage)+1)  
        end 
        doTeleportThing(cid,info[getGlobalStorageValue(storage)])   
        return true  
end  
]]></event> 
        <globalevent name="ChangeMap" interval="10" event="script"><![CDATA[  
        domodlib('map_func')  
        function onThink(interval, lastExecution)  
                doBroadcastMessage('O mapa sera mudado novamente em 20 minutos.')
                if getGlobalStorageValue(storage) < 5 then  
                setGlobalStorageValue(storage,getGlobalStorageValue(storage)+1)   
                else  
                setGlobalStorageValue(storage,getGlobalStorageValue(storage)-5)
                end  
                for _, pid in ipairs(getPlayersOnline()) do
                doRemoveConditions(pid, true)   
                doTeleportThing(pid,info[getGlobalStorageValue(storage)])    
                end   
         return TRUE  
end]]></globalevent> 
</mod>

 

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