Ir para conteúdo

Featured Replies

Postado

1° RESOLVIDO...

 

2° RESOLVIDO...

 

3° RESOLVIDO...

 

4° O script que o Victor4312 me passou esta dando erro no actions.xml

Script Que Esta Dando Erro

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)

if not isCreature(itemEx.uid) then

local Obj = Refine:load(itemEx)

if Obj ~= false then

local oldLevel = Obj:getLevel()

Obj:upgrade(cid, item)

if Obj:getLevel() > oldLevel then

doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)

else

doSendMagicEffect(toPosition, CONST_ME_POFF)

end

else

doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)

end

else

doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)

end

return true

end

 

Erro Que Esta Dando Na Distro

Spoiler

[10/7/2018 19:46:29] [Error - Action Interface] 
[10/7/2018 19:46:29] data/actions/scripts/refine.lua:onUse
[10/7/2018 19:46:29] Description: 
[10/7/2018 19:46:29] data/actions/scripts/refine.lua:5: attempt to index global 'Refine' (a nil value)
[10/7/2018 19:46:29] stack traceback:
[10/7/2018 19:46:29]     data/actions/scripts/refine.lua:5: in function <data/actions/scripts/refine.lua:1>

 

5° Eu queria que modificasse esse script de survival para que, quem só possa puxar a alavanca é o primeiro da fila o que fica de frente para a alavanca, e quando alguém entrasse na sala do survival o piso verde com id 9565 ficasse vermelho com id 9562, e que cada wave tivesse 10 minutos para matar todos os bichos da arena, caso não tenha matado todos você era teleportado para o templo e receber a recompensa por ter chegado na quela wave e 5 minutos antes aparecer uma mensagem que em 5 minutos se ele não matasse os bichos rápido ele iria sair do survival...

Script Do Survival

Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<!--
                ULTIMATE SURVIVAL - Código feito por Omega / Pedido por vinnevinne
                    
                      Informações: http://www.xtibia.com/forum/topic/221415-ultimate-survival/
-->
 
<mod name="Ultimate Survival" version="1.0" author="Omega" enabled="yes">
<config name="ultimatelib"><![CDATA[
USurvival = {
    posi = {x=579, y=337, z=14},
    posf = {x=609, y=353, z=14},
    posc = {x=594, y=345, z=14},
    
    waves = {
    [1] = {monsters = {'dragon', 'dragon lord'}, count = 30, reward = {exp = 0, item = 2148, amount = 1, money = 100}},
    [2] = {monsters = {'dragon lord', 'frost dragon'}, count = 6, reward = {exp = 0, item = 2152, amount = 1, money = 1000}},
    [3] = {monsters = {'hydra', 'serpent spawn'}, count = 10, reward = {exp = 0, item = 2160, amount = 1, money = 10000}},
    },
    exhaust = 1 * 24 * 60 * 60, -- Tempo em segundos até poder entrar novamente na arena (1 * 24 * 60 * 60 = 1 dia)
    
    final_reward = {item = 2160, amount = 100, exp = 10000, money = 100000},
    
    storage_ex = 607069,
    storage_wave = 607089,
}

function isWalkable(pos)-- by Nord / editado por Omega
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then
        return false
    elseif isCreature(getTopCreature(pos).uid) then
        return false
    elseif getTileInfo(pos).protection then
        return false
    elseif hasProperty(getThingFromPos(pos).uid, 3) or hasProperty(getThingFromPos(pos).uid, 7) then
        return false
    end
return true
end

function doSpawnMonsters(monsters, pos, radius, limit)
    if not pos.x or not pos.y or not pos.z or not type(monsters) == 'table' then
        return false
    end
        local radius = tonumber(radius)
    if radius > 5 then
        radius = 5
    elseif radius < 2 then
        radius = 2
    end
    if not limit or limit < 1 then
        limit = 1
    elseif limit > radius ^ 2 then
        limit = math.floor((radius*1.5) ^ 2)
    end
    
    local k = 0
    local tries = 0
    repeat
        for x = pos.x - radius, pos.x + radius do
            for y = pos.y - radius, pos.y + radius do
                if isWalkable({x=x, y=y, z=pos.z}) then
                    local monster = monsters[math.random(1, #monsters)]
                    local chance = math.random(1, 100)
                    if k == limit then
                        break
                    elseif chance <= 8 and doCreateMonster(monster, {x=x, y=y, z=pos.z}) then
                        k = k + 1
                    end
                end
            end
        end
        tries = tries + 1
    until k >= limit or tries >= 500
    return k >= limit and true or false
end

function getPlayersInArea(pos1,pos2)
    local players = {}
    if pos1.x and pos1.y and pos2.x and pos2.y and pos1.z == pos2.z then
        for a = pos1.x, pos2.x do
            for b = pos1.y,pos2.y do
                local pos = {x=a,y=b,z=pos1.z}
                if isPlayer(getTopCreature(pos).uid) then
                    table.insert(players,getTopCreature(pos).uid)
                end
            end
        end
        return players
    else
        return false
    end
end    

function getMonstersInArea(pos1,pos2)
    local players = {}
    if pos1.x and pos1.y and pos2.x and pos2.y and pos1.z == pos2.z then
        for a = pos1.x, pos2.x do
            for b = pos1.y,pos2.y do
                local pos = {x=a,y=b,z=pos1.z}
                if isMonster(getTopCreature(pos).uid) then
                    table.insert(players,getTopCreature(pos).uid)
                end
            end
        end
        return players
    else
        return false
    end
end

function doCleanArena()
    local monsters = getMonstersInArea(USurvival.posi, USurvival.posf)
    for _, cid in pairs(monsters) do
        doRemoveCreature(cid)
    end
end

function doStartWave(waveID, cid)
    if not isCreature(cid) then return false end
    if USurvival.waves[waveID] then
        wave = USurvival.waves[waveID]
        doSpawnMonsters(wave.monsters, USurvival.posc, 5, wave.count)
        doPlayerSendTextMessage(cid, 21, 'Wave '..waveID..' Comecou! LUTE!')
    end
end
]]></config>

<action actionid="4599" event="script" override="yes"><![CDATA[
domodlib('ultimatelib')
function onUse(cid, item)
    if getPlayerStorageValue(cid, USurvival.storage_ex) <= os.time() then
        if #getPlayersInArea(USurvival.posi, USurvival.posf) == 0 then
            doCleanArena()
            doTeleportThing(cid, USurvival.posc)
            doPlayerSendTextMessage(cid, 21, 'O Ultimate Survival Comecara Em 10 Segundos! Esteja Pronto Para Enfrentar Seu Destino!')
            addEvent(doStartWave, 10000, 1, cid)
            setPlayerStorageValue(cid, USurvival.storage_wave, 1)
            setPlayerStorageValue(cid, USurvival.storage_ex, os.time() + USurvival.exhaust)
            if item.itemid % 2 == 1 then
                doTransformItem(item.uid, item.itemid+1)
            else
                doTransformItem(item.uid, item.itemid-1)
            end
        else
            doPlayerSendCancel(cid, 'Alguem Ja Esta Na Arena.')
            doSendMagicEffect(getThingPos(cid), 2)
        end
    else
        local left = getPlayerStorageValue(cid, USurvival.storage_ex) - os.time()
        left = {hour = math.floor(left/3600), minutes = math.ceil((left % 3600)/60)}
        doPlayerSendCancel(cid, 'Voce Tem Que Esperar '.. left.hour ..'H E '..left.minutes..'Minutos.')
        doSendMagicEffect(getThingPos(cid), 2)
    end
    return true
end
]]></action>

<event type="login" name="US Login" event="script"><![CDATA[
domodlib('ultimatelib')
function onLogin(cid)
    registerCreatureEvent(cid,'UltimateSurvival1')
    registerCreatureEvent(cid,'UltimateSurvival2')
    if isInArea(getThingPos(cid), USurvival.posi, USurvival.posf) then
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
        doSendMagicEffect(getThingPos(cid), 10)
    end
    return true
end
]]></event>

<event type="kill" name="UltimateSurvival1" event="script"><![CDATA[
domodlib('ultimatelib')
function onKill(cid, target)
    if isInArea(getThingPos(cid), USurvival.posi, USurvival.posf) then
        if #getMonstersInArea(USurvival.posi, USurvival.posf) == 1 then
            local wave = getPlayerStorageValue(cid, USurvival.storage_wave)
            if USurvival.waves[wave+1] then
                setPlayerStorageValue(cid, USurvival.storage_wave, wave + 1)
                addEvent(doStartWave, 5000, wave + 1, cid)
                doPlayerSendTextMessage(cid, 22, 'Parabens! A Proxima Wave Comecara Em 5 Segundos!')
            else
                doPlayerSendTextMessage(cid, 22, 'PARABENS! VOCE FOI BATIDO A SOBREVIVENCIA FINAL!')
                local reward = USurvival.final_reward
                if reward.item then
                    doPlayerAddItem(cid, reward.item, (reward.amount or 1), false)
                end
                if reward.exp then
                    doPlayerAddExp(cid, reward.exp)
                end
                if reward.money then
                    doPlayerAddMoney(cid, reward.money)
                end
                local medal = doPlayerAddItem(cid, 5785, 1, false)
                if medal then
                    doItemSetAttribute(medal, 'description', 'Esta Medalha Foi Ganha Pelo Jogador '..getCreatureName(cid)..' Por Completar O Ultimate Survival.')
                    doItemSetAttribute(medal,'name', 'Ultimate Survival Medal')
                end
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
            end
        end
    end
    return true
end

]]></event>

<event type="preparedeath" name="UltimateSurvival2" event="script"><![CDATA[
domodlib('ultimatelib')
function onPrepareDeath(cid, killers)
    if isInArea(getThingPos(cid), USurvival.posi, USurvival.posf) then
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
        doRemoveConditions(cid, false)
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
        doPlayerSendTextMessage(cid, 21, 'Que Pena, Voce Nao Podia\'t Derrotar O Ultimate Survival... Melhor sorte da próxima vez.')
        local reward = USurvival.waves[getPlayerStorageValue(cid, USurvival.storage_wave)].reward
        if reward.item then
            doPlayerAddItem(cid, reward.item, reward.amount or 1)
        end
        if reward.exp then
            doPlayerAddExp(cid, reward.exp)
        end
        if reward.money then
            doPlayerAddMoney(cid, reward.money)
        end
        return false
    end
    return true
end
]]></event>

</mod>

 

6° Como que eu faço para que os GM e os SGM fosse igual a todos os player pudesse atacar, jogar alguma coisa no chão. pegar alguma coisa do chão. porque no meu ot ele não faz nada disso, ele apenas anda e executa comandos....

Groups.xml

Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<groups>
<group id="1" name="Player" customFlags="67108864"/>
<group id="2" name="Tutor" flags="68736352256" customFlags="8914950" access="2" violationReasons="0" nameViolationFlags="0"/>
<group id="3" name="Senior Tutor" flags="68736352256" customFlags="14" access="3" violationReasons="10" nameViolationFlags="2" statementViolationFlags="63" maxVips="200"/>    
<group id="4" name="Gamemaster" flags="25562570661675" customFlags="34161091964175" access="4" violationReasons="20" nameViolationFlags="426" statementViolationFlags="469" depotLimit="1000" maxVips="300" outfit="75"/>
<group id="5" name="Senior Gamemaster" flags="23605136184319" customFlags="96467231" access="5" violationReasons="23" nameViolationFlags="170" statementViolationFlags="213" depotLimit="4000" maxVips="400" outfit="266"/>
<group id="6" name="Administrador" flags="39579197349882" customFlags="67108863" access="6" violationReasons="23" nameViolationFlags="170" statementViolationFlags="213" depotLimit="5000" maxVips="500" outfit="302"/>
</groups>

 

7° Eu tentei adicionar um sistema que coloca no piso, que apenas player com x level poderia passar por aquele sqm, mais não esta funcionando no meu ot, eu uso OTX Server versão (2.90 - 4539) Compilied with Microsoft Visual C++ version 11.0 for arch 64 Bits at Jan 16 2014 19:57:21...

Script Do Level No Piso

Spoiler

function onStepIn(cid, item, position, fromPosition)

level = 400

if getPlayerLevel(cid) < level then
doTeleportThing(cid, fromPosition, true)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
doPlayerSendCancel(cid,"Somente Level " .. level .. " Ou Mais Podem Passar Aqui.")
end
return TRUE
end

 

8° Eu queria que meu castelo só abrisse dia de sábado as 18:00 e terminasse as 19:30...

 

9° RESOLVIDO...

 

10° Os field do meu servidor demoram muito para sair, ele só somem seu alguém usar o destroyer field nele ou se eu reiniciar o servidor, seja os field soltado por player ou os dos bichos, eles são infinitos praticamente, eu tava com um bug na mw que não podia jogar ela em cima dos field então eu pesquisei como arrumar isso, e me disseram para mudar o <attribute key="replaceable" value="0" />

para o <attribute key="replaceable" value="1" /> e com isso o bug da mw foi resolvido e eu acho que isso foi a causa dos field ficarem infinitos no chão...

 

11° Quando um player coloca o personagem dele para dormir na cama da house o servidor trava...

 

REP+ PRA QUEM ME AJUDAR

OBRIGADO A TODOS

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

Postado
Em 05/07/2018 em 20:28, Emanueldk disse:

2° Como que um bicho ainda pode atacar um player sendo que eu coloquei protection zone no piso que o bicho esta...

O target do monstro que não pode está m pz, caso o target esteja ele não ataca. (posso está errado, teste essa teoria!)

 

Em 05/07/2018 em 20:28, Emanueldk disse:

3° Como que eu faço para que quando eu der um comando, mudar alguma coisa no meu site ele mudar na hora? tipo, eu adicionei uns items donate no shop mais eles ficaram sem imagens e alguns ficaram com uma imagem de outro item, então eu adicionei as fotos na pasta e ainda não mudou a foto dos itens no site...

Link Do Site Que Estou Usando

Ctrl+F5

 

Em 05/07/2018 em 20:28, Emanueldk disse:

9° Como que eu arrumo esse piso que não pode passar por cima dele, ele tem id 3154 se chama Stone Floor, ele simplesmente não deixa ninguém passar por cima e se alguma coisa tivesse no sqm em que esse piso tá, o item que tava la some e o piso fica...

ItemEditor e dat, desmarca a opção que impede de passar por cima e habilite a type do item para ground(caso já tenha ignore)!

 

 

 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo