Ir para conteúdo
  • Cadastre-se

(Resolvido){Resolvido} [Action] Monstro que desaparece se nao for morto em "X" minutos.


Ir para solução Resolvido por Dwarfer,

Posts Recomendados

Eu criei 4 monstros novos pra evento e queria que eles desaparecessem em 7 minutos se não fossem mortos. 

Editado por dimmebag (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
7 horas atrás, dimmebag disse:

Eu criei 4 monstros novos pra evento e queria que eles desaparecessem em 7 minutos se não fossem mortos. 

 

O forum tem uma caixa de pesquisa, veja se isso vai sanar suas dúvidas.

 

 

Link para o post
Compartilhar em outros sites
3 horas atrás, JcA disse:

 

O forum tem uma caixa de pesquisa, veja se isso vai sanar suas dúvidas.

 

 


Não é isso. Eu só quero adicionar um evento ou ação (não sei) no monstro pra que se ele não for morto dentro de 7min ele desapareça. Algo parecido com as criaturas da arena ou os summon do Azerus que desaparece depois de algum tempo...

Link para o post
Compartilhar em outros sites
5 horas atrás, Dwarfer disse:

Como você tá criando o monstro? Posta aqui o script que faz você sumoná-lo. 

 


@Dwarfer Assim, são criaturas normais, elas aparecem por um action de alavanca.

 

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Demon" nameDescription="a demon" race="fire" experience="1" speed="280" manacost="0">
    <health now="8200" max="8200"/>
    <look type="35" corpse="5995"/>
    <targetchange interval="5000" chance="10"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="0"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="90"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" skill="80" attack="100"/>
        <attack name="manadrain" interval="2000" chance="15" range="7" min="-0" max="-120"/>
        <attack name="fire" interval="2000" chance="15" range="7" radius="7" target="1" min="-150" max="-250">
            <attribute key="shootEffect" value="fire"/>
            <attribute key="areaEffect" value="firearea"/>
        </attack>
        <attack name="energy" interval="2000" chance="15" length="8" spread="0" min="-300" max="-460">
            <attribute key="areaEffect" value="purpleenergy"/>
        </attack>
        <attack name="energy" interval="2000" chance="20" range="3" radius="1" target="1" min="-210" max="-300">
            <attribute key="shootEffect" value="energy"/>
            <attribute key="areaEffect" value="energy"/>
        </attack>        
        <attack name="firefield" interval="2000" chance="10" range="7" radius="1" target="1">
            <attribute key="shootEffect" value="fire"/>
        </attack>
        <attack name="speed" interval="2000" chance="10" range="7" speedchange="-220" duration="5000">
        <attribute key="areaEffect" value="redshimmer"/>
        </attack>
    </attacks>
    <defenses armor="30" defense="30">
        <defense name="healing" interval="2000" chance="10" min="120" max="280">
            <attribute key="areaEffect" value="blueshimmer"/>
        </defense>
        <defense name="speed" interval="2000" chance="5" speedchange="360" duration="20000">
            <attribute key="areaEffect" value="redshimmer"/>
        </defense>
    </defenses>
    <elements>
        <element physicalPercent="25"/>
        <element earthpercent="40"/>
        <element energyPercent="50"/>
        <element deathPercent="20"/>
        <element icePercent="-12"/>
        <element holyPercent="-12"/>
    </elements>
    <immunities>
        <immunity lifedrain="1"/>
        <immunity paralyze="1"/>
        <immunity invisible="1"/>
        <immunity fire="1"/>
    </immunities>
    <summons maxSummons="1">
        <summon name="fire elemental" interval="2000" chance="10" max="1"/>
    </summons>
    <voices interval="5000" chance="10">
        <voice sentence="MUHAHAHAHA!" yell="1"/>
        <voice sentence="I SMELL FEEEEEAAAR!" yell="1"/>
        <voice sentence="CHAMEK ATH UTHUL ARAK!" yell="1"/>
        <voice sentence="Your resistance is futile!"/>
        <voice sentence="Your soul will be mine!" yell="0"/>
    </voices>
</monster>

 

 

 

 

 

 

 

 

 

 

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Hellfire Fighter" nameDescription="a hellfire fighter" race="fire" experience="1" speed="260" manacost="0">
    <health now="3800" max="3800"/>
    <look type="243" corpse="6324"/>
    <targetchange interval="5000" chance="8"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="1"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="90"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" skill="120" attack="80"/>
        <attack name="firefield" interval="2000" chance="20" target="0" radius="3"/>
        <attack name="fire" interval="2000" chance="25" length="8" spread="3" min="-390" max="-1500"/>
        <attack name="fire" interval="2000" chance="30" radius="3" target="0" min="-60" max="-330">
        <attribute key="areaEffect" value="firearea"/>
        </attack>
    </attacks>
    <defenses armor="25" defense="25"/>
    <elements>
        <element firePercent="100"/>
        <element energyPercent="40"/>
        <element physicalPercent="24"/>
        <element deathPercent="22"/>
        <element icePercent="-20"/>
    </elements>
    <immunities>
        <immunity paralyze="1"/>
        <immunity invisible="1"/>
    </immunities>
</monster>
 
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Fury" nameDescription="a fury" race="blood" experience="1" speed="460" manacost="0">
    <health now="4100" max="4100"/>
    <look type="149" head="94" body="77" legs="96" feet="0" addons="3" corpse="6081"/>
    <targetchange interval="5000" chance="25"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="1"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="95"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" skill="80" attack="113"/>
        <attack name="death" interval="2000" chance="9" range="7" target="1" min="-0" max="-250">
            <attribute key="shootEffect" value="death"/>
            <attribute key="areaEffect" value="mortarea"/>
        </attack>
        <attack name="speed" interval="2000" chance="5" range="7" speedchange="-440" duration="5000">
            <attribute key="shootEffect" value="death"/>
            <attribute key="areaEffect" value="mortarea"/>
        </attack>    
        <attack name="lifedrain" interval="2000" chance="8" target="0" radius="3" min="-0" max="-300">
            <attribute key="areaEffect" value="blackspark"/>
        </attack>        
        <attack name="fire" interval="2000" chance="7" length="5" spread="3" min="-200" max="-300">
            <attribute key="areaEffect" value="explosionarea"/>
        </attack>    
        <attack name="death" interval="2000" chance="6" length="8" spread="0" min="-0" max="-700">
            <attribute key="areaEffect" value="redspark"/>
        </attack>            
        <attack name="death" interval="2000" chance="10" range="7" radius="4" target="0" min="-0" max="-300">
            <attribute key="areaEffect" value="redspark"/>
        </attack>
        <attack name="skills" interval="2000" chance="12" target="0" radius="4" shielding="-1">
            <attribute key="areaEffect" value="yellownote"/>
        </attack>
    </attacks>
    <defenses armor="20" defense="20">
        <defense name="speed" interval="2000" chance="20" speedchange="360" duration="2000">
            <attribute key="areaEffect" value="redshimmer"/>
        </defense>
    </defenses>
    <elements>
        <element firePercent="100"/>
        <element icePercent="30"/>
        <element holyPercent="30"/>
        <element deathPercent="-10"/>
        <element energyPercent="-10"/>
        <element earthPercent="-10"/>
        <element physicalPercent="-10"/>
    </elements>
    <immunities>
        <immunity paralyze="1"/>
        <immunity invisible="1"/>
    </immunities>
    <voices interval="3000" chance="30">
        <voice sentence="Ahhhhrrrr!"/>
        <voice sentence="Waaaaah!"/>
        <voice sentence="Carnage!"/>
    </voices>
</monster>
 
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Juggernaut" nameDescription="a juggernaut" race="blood" experience="1" speed="500" manacost="0">
    <health now="20000" max="20000"/>
    <look type="244" corpse="6336"/>
    <targetchange interval="5000" chance="8"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="1"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="95"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" skill="120" attack="160"/>
        <attack name="physical" interval="2000" chance="20" range="7" min="-0" max="-780">
        <attribute key="shootEffect" value="largerock"/>
        </attack>
    </attacks>
    <defenses armor="15" defense="15">
        <defense name="speed" interval="2000" chance="15" speedchange="850" duration="5000">
        <attribute key="areaEffect" value="redshimmer"/>
        </defense>
        <defense name="healing" interval="2000" chance="10" min="350" max="550">
            <attribute key="areaEffect" value="blueshimmer"/>
        </defense>
    </defenses>
    <elements>
        <element physicalPercent="20"/>
        <element firePercent="30"/>
        <element icePercent="10"/>
        <element earthPercent="20"/>
        <element energyPercent="-10"/>
        <element holyPercent="-5"/>
    </elements>
    <immunities>
        <immunity paralyze="1"/>
        <immunity invisible="1"/>
    </immunities>
    <voices interval="5000" chance="30">
        <voice sentence="WAHHHH!" yell="1"/>
        <voice sentence="RAAARRR!" yell="1"/>
        <voice sentence="GRRRRRR!" yell="1"/>
    </voices>
</monster>
 
Editado por dimmebag (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

@Dwarfer 

function onUse(cid, item, fromPosition, toPosition)
    if (getPlayerStorageValue(cid, 11548) >= os.time()) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Você poderá usar novamente em " .. (getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
        return true
    end

    if item.itemid == 1945 then
        doCreateMonster('Demon Arena', {x=32182,y=32236,z=7})
        doCreateMonster('Demon Arena', {x=32171,y=32240,z=7})
        doCreateMonster('Demon Arena', {x=32181,y=32240,z=7})
        doCreateMonster('Demon Arena', {x=32175,y=32242,z=7})
                doCreateMonster('Demon Arena', {x=32168,y=32246,z=7})
                doCreateMonster('Demon Arena', {x=32175,y=32237,z=7})
        doTransformItem(item.uid, 1946)
        setPlayerStorageValue(cid,11548,os.time()+180)
    elseif item.itemid == 1946 then
        doTransformItem(item.uid, 1945)
    end
    return true
end

Link para o post
Compartilhar em outros sites
  • Solução
Spoiler

local monsters = {
{monster = "Demon", pos = {x=32182,y=32236,z=7}}, 
{monster = "Demon", pos = {x=32171,y=32240,z=7}}, 
{monster = "Demon", pos = {x=32181,y=32240,z=7}}, 
{monster = "Demon", pos = {x=32175,y=32242,z=7}}, 
{monster = "Demon", pos = {x=32168,y=32246,z=7}}, 
{monster = "Demon", pos = {x=32175,y=32237,z=7}} 
}

local timetoremove = {2, "min"}

function onUse(cid, item, fromPosition, toPosition)
    if (getPlayerStorageValue(cid, 11548) >= os.time()) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Você poderá usar novamente em " .. (getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
        return true
    end
    local m = {}
    if item.itemid == 1945 then
        for _, p in pairs(monsters) do
            m[#m+1] = doCreateMonster(p.monster, p.pos)
        end
        addEvent(removeMonsters, mathtime(timetoremove) * 1000, m)
        doTransformItem(item.uid, 1946)
        setPlayerStorageValue(cid,11548,os.time()+180)
    elseif item.itemid == 1946 then
        doTransformItem(item.uid, 1945)
    end
    return true
end

function removeMonsters(m)
    for i = 1, #m do
        if isMonster(m[i]) then
            doRemoveCreature(m[i])
        end
    end
end

function mathtime(table) -- by dwarfer
local unit = {"sec", "min", "hour", "day"}
for i, v in pairs(unit) do
if v == table[2] then
return table[1]*(60^(v == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1)
end
end
return error("Bad declaration in mathtime function.")
end

 

 

Contato:

 

Link para o post
Compartilhar em outros sites
21 minutos atrás, Dwarfer disse:
  Mostrar conteúdo oculto


local monsters = {
{monster = "Demon", pos = {x=32182,y=32236,z=7}}, 
{monster = "Demon", pos = {x=32171,y=32240,z=7}}, 
{monster = "Demon", pos = {x=32181,y=32240,z=7}}, 
{monster = "Demon", pos = {x=32175,y=32242,z=7}}, 
{monster = "Demon", pos = {x=32168,y=32246,z=7}}, 
{monster = "Demon", pos = {x=32175,y=32237,z=7}} 
}

local timetoremove = {2, "min"}

function onUse(cid, item, fromPosition, toPosition)
    if (getPlayerStorageValue(cid, 11548) >= os.time()) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Você poderá usar novamente em " .. (getPlayerStorageValue(cid, 11548)-os.time()+(0)) .. " segundos.")
        return true
    end
    local m = {}
    if item.itemid == 1945 then
        for _, p in pairs(monsters) do
            m[#m+1] = doCreateMonster(p.monster, p.pos)
        end
        addEvent(removeMonsters, mathtime(timetoremove) * 1000, m)
        doTransformItem(item.uid, 1946)
        setPlayerStorageValue(cid,11548,os.time()+180)
    elseif item.itemid == 1946 then
        doTransformItem(item.uid, 1945)
    end
    return true
end

function removeMonsters(m)
    for i = 1, #m do
        if isMonster(m[i]) then
            doRemoveCreature(m[i])
        end
    end
end

function mathtime(table) -- by dwarfer
local unit = {"sec", "min", "hour", "day"}
for i, v in pairs(unit) do
if v == table[2] then
return table[1]*(60^(v == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1)
end
end
return error("Bad declaration in mathtime function.")
end

 

 


Vlw @Dwarfer, funcionou perfeitamente =D

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