Ir para conteúdo

Featured Replies

Postado

Boa noite galera, adaptei um script que eu tinha de rust remover, para usar em ice cubes e marble rocks, funcionou perfeitamente, porém eu não estou conseguindo juntar ele ao meu script da obsidian knife para ficar com todas as funçoes dos 2 scripts funcionando em 1 só. Por favor me ajudem, deve ser simples pra quem manja. =)

 

obsidian knife script:

local config = {
    level = 2
}

local SKINS = {
    -- Minotaurs
    [2830] = {25000, 5878},
    [2871] = {25000, 5878},
    [2866] = {25000, 5878},
    [2876] = {25000, 5878},
    [3090] = {25000, 5878},

    [11133] = {25000, 11130},

    -- Lizards
    [4259] = {25000, 5876},
    [4262] = {25000, 5876},
    [4256] = {25000, 5876},

    [11271] = {25000, 5876},
    [11275] = {25000, 5876},
    [11267] = {25000, 5876},
    [11279] = {25000, 5876},
    [11263] = {25000, 5876},

    -- Dragons
    [3104] = {25000, 5877},
    [2844] = {25000, 5877},

    -- Dragon Lords
    [2881] = {25000, 5948},

    -- Behemoths
    [2931] = {25000, 5893},

    -- Bone Beasts
    [3031] = {25000, 5925},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getPlayerLevel(cid) < config.level) then
        doPlayerSendCancel(cid, "You have to be at least Level " .. config.level .. " to use this tool.")
        return true
    end
    if itemEx.itemid == 9010 then
        if getPlayerStorageValue(cid, 65049) <= 0 then
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
            doPlayerAddItem(cid, 8310, 1)
            setPlayerStorageValue(cid, 65049, 1)
        else
            doCreatureSayWithRadius(cid, "You already used your knife on the corpse.", TALKTYPE_ORANGE_1, 1, 1)
        end
        return TRUE
    end
    if itemEx.uid == 1705 then
        if (getPlayerStorageValue(cid, 300017) <= 0) and (getPlayerItemCount(cid, 12616) >= 1) then
            doSendMagicEffect(toPosition, CONST_ME_HITBYPOISON)
                        doCreatureSay(cid, "The plant feels cold but dry and very soft. You streak the plant gently with your knife and put a fragment in the almanach.", TALKTYPE_ORANGE_1)
                        doPlayerSendTextMessage(cid,24,"The plant feels cold but dry and very soft. You streak the plant gently with your knife and put a fragment in the almanach.")
            setPlayerStorageValue(cid, 300017, 1)
        else
            doCreatureSayWithRadius(cid, "You cannot collect your plant sample.", TALKTYPE_ORANGE_1, 1, 1)
        end
        return TRUE
    end
    if itemEx.uid == 1706 then
        if (getPlayerStorageValue(cid, 300018) <= 0) and (getPlayerItemCount(cid, 12616) >= 1) then
            doSendMagicEffect(toPosition, CONST_ME_HITBYPOISON)
                        doCreatureSay(cid, "You cut a leaf from a branch and put it in the almanach. It smells strangely sweet and awfully bitter at the same time.", TALKTYPE_ORANGE_1)
                        doPlayerSendTextMessage(cid,24,"You cut a leaf from a branch and put it in the almanach. It smells strangely sweet and awfully bitter at the same time.")
            setPlayerStorageValue(cid, 300018, 1)
        else
            doCreatureSayWithRadius(cid, "You cannot collect your plant sample.", TALKTYPE_ORANGE_1, 1, 1)
        end
        return TRUE
    end
    if(itemEx.itemid == 12256 and getPlayerStorageValue(cid,42828) < 0) then
        doPlayerAddItem(cid,12263,1)
        doPlayerRemoveItem(cid, 12256,1)
        setPlayerStorageValue(cid, 42828, 1)        
        doCreatureSay(cid, 'You carve a solid bowl out of the chunk of wood.', TALKTYPE_ORANGE_1)
    end
    local skin = SKINS[itemEx.itemid]
    if(not skin) then
        if (itemEx.itemid == 9009) then
            if (getPlayerStorageValue(cid, 27005) == EMPTY_STORAGE) then
                doPlayerAddItem(cid, 8310, 1)
                doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
                setPlayerStorageValue(cid, 27005, 1)
            else
                doCreatureSay(cid, "You cannot skin the corpse more than once.", TALKTYPE_MONSTER_YELL)
            end
            return true
        else
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            return true
        end
    end

    local random, effect = math.random(1, 100000), CONST_ME_DRAWBLOOD
    if(random <= skin[1]) then
        doPlayerAddItem(cid, skin[2], 1)
    elseif(skin[3] and random >= skin[3]) then
        doPlayerAddItem(cid, skin[4], 1)
    else
        effect = CONST_ME_POFF
    end

    doSendMagicEffect(toPosition, effect)
    doTransformItem(itemEx.uid, itemEx.itemid + 1)
    return true
end

 

ice cube script:

local breakChance = 60
local rustyItems = {
    [7441] = {7442}, --head
    [7442] = {7444}, --tusk
    [7444] = {7445}, --mammoth
    [7445] = {7446}, --done
    [11337] = {11338}, -- 1
    [11338] = {11339}, -- 2
    [11339] = {11340}, -- 3
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if rustyItems[itemEx.itemid] ~= nil then
        if math.random(100) <= breakChance then
            doRemoveItem(itemEx.uid)
        doCreatureSay(cid, 'The attempt of sculpting failed miserably.', TALKTYPE_ORANGE_1)
            doSendMagicEffect(toPosition,3)
        else
            local newId = rustyItems[itemEx.itemid][math.random(#rustyItems[itemEx.itemid])]
            doTransformItem(itemEx.uid,newId)
            doSendMagicEffect(toPosition,9)
        end

    end
    return true
end

 

  • Respostas 6
  • Visualizações 523
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Boa noite galera, adaptei um script que eu tinha de rust remover, para usar em ice cubes e marble rocks, funcionou perfeitamente, porém eu não estou conseguindo juntar ele ao meu script da obsidian knife para ficar com todas as funçoes dos 2 scripts funcionando em 1 só. Por favor me ajudem, deve ser simples pra quem manja. =)

 

obsidian knife script:

local config = {

    level = 2

}

local SKINS = {

    -- Minotaurs

    [2830] = {25000, 5878},

    [2871] = {25000, 5878},

    [2866] = {25000, 5878},

    [2876] = {25000, 5878},

    [3090] = {25000, 5878},

    [11133] = {25000, 11130},

    -- Lizards

    [4259] = {25000, 5876},

    [4262] = {25000, 5876},

    [4256] = {25000, 5876},

    [11271] = {25000, 5876},

    [11275] = {25000, 5876},

    [11267] = {25000, 5876},

    [11279] = {25000, 5876},

    [11263] = {25000, 5876},

    -- Dragons

    [3104] = {25000, 5877},

    [2844] = {25000, 5877},

    -- Dragon Lords

    [2881] = {25000, 5948},

    -- Behemoths

    [2931] = {25000, 5893},

    -- Bone Beasts

    [3031] = {25000, 5925},

}

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

    if(getPlayerLevel(cid) < config.level) then

        doPlayerSendCancel(cid, "You have to be at least Level " .. config.level .. " to use this tool.")

        return true

    end

    if itemEx.itemid == 9010 then

        if getPlayerStorageValue(cid, 65049) <= 0 then

            doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)

            doPlayerAddItem(cid, 8310, 1)

            setPlayerStorageValue(cid, 65049, 1)

        else

            doCreatureSayWithRadius(cid, "You already used your knife on the corpse.", TALKTYPE_ORANGE_1, 1, 1)

        end

        return TRUE

    end

    if itemEx.uid == 1705 then

        if (getPlayerStorageValue(cid, 300017) <= 0) and (getPlayerItemCount(cid, 12616) >= 1) then

            doSendMagicEffect(toPosition, CONST_ME_HITBYPOISON)

                        doCreatureSay(cid, "The plant feels cold but dry and very soft. You streak the plant gently with your knife and put a fragment in the almanach.", TALKTYPE_ORANGE_1)

                        doPlayerSendTextMessage(cid,24,"The plant feels cold but dry and very soft. You streak the plant gently with your knife and put a fragment in the almanach.")

            setPlayerStorageValue(cid, 300017, 1)

        else

            doCreatureSayWithRadius(cid, "You cannot collect your plant sample.", TALKTYPE_ORANGE_1, 1, 1)

        end

        return TRUE

    end

    if itemEx.uid == 1706 then

        if (getPlayerStorageValue(cid, 300018) <= 0) and (getPlayerItemCount(cid, 12616) >= 1) then

            doSendMagicEffect(toPosition, CONST_ME_HITBYPOISON)

                        doCreatureSay(cid, "You cut a leaf from a branch and put it in the almanach. It smells strangely sweet and awfully bitter at the same time.", TALKTYPE_ORANGE_1)

                        doPlayerSendTextMessage(cid,24,"You cut a leaf from a branch and put it in the almanach. It smells strangely sweet and awfully bitter at the same time.")

            setPlayerStorageValue(cid, 300018, 1)

        else

            doCreatureSayWithRadius(cid, "You cannot collect your plant sample.", TALKTYPE_ORANGE_1, 1, 1)

        end

        return TRUE

    end

    if(itemEx.itemid == 12256 and getPlayerStorageValue(cid,42828) < 0) then

        doPlayerAddItem(cid,12263,1)

        doPlayerRemoveItem(cid, 12256,1)

        setPlayerStorageValue(cid, 42828, 1)        

        doCreatureSay(cid, 'You carve a solid bowl out of the chunk of wood.', TALKTYPE_ORANGE_1)

    end

    local skin = SKINS[itemEx.itemid]

    if(not skin) then

        if (itemEx.itemid == 9009) then

            if (getPlayerStorageValue(cid, 27005) == EMPTY_STORAGE) then

                doPlayerAddItem(cid, 8310, 1)

                doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)

                setPlayerStorageValue(cid, 27005, 1)

            else

                doCreatureSay(cid, "You cannot skin the corpse more than once.", TALKTYPE_MONSTER_YELL)

            end

            return true

        else

            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)

            return true

        end

    end

    local random, effect = math.random(1, 100000), CONST_ME_DRAWBLOOD

    if(random <= skin[1]) then

        doPlayerAddItem(cid, skin[2], 1)

    elseif(skin[3] and random >= skin[3]) then

        doPlayerAddItem(cid, skin[4], 1)

    else

        effect = CONST_ME_POFF

    end

    doSendMagicEffect(toPosition, effect)

    doTransformItem(itemEx.uid, itemEx.itemid + 1)

    return true

end

 

ice cube script:

local breakChance = 60

local rustyItems = {

    [7441] = {7442}, --head

    [7442] = {7444}, --tusk

    [7444] = {7445}, --mammoth

    [7445] = {7446}, --done

    [11337] = {11338}, -- 1

    [11338] = {11339}, -- 2

    [11339] = {11340}, -- 3

}

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

    if rustyItems[itemEx.itemid] ~= nil then

        if math.random(100) <= breakChance then

            doRemoveItem(itemEx.uid)

        doCreatureSay(cid, 'The attempt of sculpting failed miserably.', TALKTYPE_ORANGE_1)

            doSendMagicEffect(toPosition,3)

        else

            local newId = rustyItems[itemEx.itemid][math.random(#rustyItems[itemEx.itemid])]

            doTransformItem(itemEx.uid,newId)

            doSendMagicEffect(toPosition,9)

        end

    end

    return true

end

 

Eu recomendo não juntar, você tem algum motivo para juntar?

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado
  • Autor

os dois são funçoes da obsidian knife, nao encontrei uma maneira de usar 2 scripts diferentes pra um unico item id

    <action itemid="5908" event="script" value="tools/obsidian_knife.lua"/>

Postado

os dois são funçoes da obsidian knife, nao encontrei uma maneira de usar 2 scripts diferentes pra um unico item id    

 

Não é obsidian knife e outro rusty remover?

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado

Tente assim.. Não tive tempo de testar ;-;

local config = {
    level = 2
}

local SKINS = {
    -- Minotaurs
    [2830] = {25000, 5878},
    [2871] = {25000, 5878},
    [2866] = {25000, 5878},
    [2876] = {25000, 5878},
    [3090] = {25000, 5878},

    [11133] = {25000, 11130},

    -- Lizards
    [4259] = {25000, 5876},
    [4262] = {25000, 5876},
    [4256] = {25000, 5876},

    [11271] = {25000, 5876},
    [11275] = {25000, 5876},
    [11267] = {25000, 5876},
    [11279] = {25000, 5876},
    [11263] = {25000, 5876},

    -- Dragons
    [3104] = {25000, 5877},
    [2844] = {25000, 5877},

    -- Dragon Lords
    [2881] = {25000, 5948},

    -- Behemoths
    [2931] = {25000, 5893},

    -- Bone Beasts
    [3031] = {25000, 5925},
}

local breakChance = 60
local rustyItems = {
    [7441] = {7442}, --head
    [7442] = {7444}, --tusk
    [7444] = {7445}, --mammoth
    [7445] = {7446}, --done
    [11337] = {11338}, -- 1
    [11338] = {11339}, -- 2
    [11339] = {11340}, -- 3
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getPlayerLevel(cid) < config.level) then
        doPlayerSendCancel(cid, "You have to be at least Level " .. config.level .. " to use this tool.")
        return true
    end
    if itemEx.itemid == 9010 then
        if getPlayerStorageValue(cid, 65049) <= 0 then
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
            doPlayerAddItem(cid, 8310, 1)
            setPlayerStorageValue(cid, 65049, 1)
        else
            doCreatureSayWithRadius(cid, "You already used your knife on the corpse.", TALKTYPE_ORANGE_1, 1, 1)
        end
        return TRUE
    end
    if itemEx.uid == 1705 then
        if (getPlayerStorageValue(cid, 300017) <= 0) and (getPlayerItemCount(cid, 12616) >= 1) then
            doSendMagicEffect(toPosition, CONST_ME_HITBYPOISON)
                        doCreatureSay(cid, "The plant feels cold but dry and very soft. You streak the plant gently with your knife and put a fragment in the almanach.", TALKTYPE_ORANGE_1)
                        doPlayerSendTextMessage(cid,24,"The plant feels cold but dry and very soft. You streak the plant gently with your knife and put a fragment in the almanach.")
            setPlayerStorageValue(cid, 300017, 1)
        else
            doCreatureSayWithRadius(cid, "You cannot collect your plant sample.", TALKTYPE_ORANGE_1, 1, 1)
        end
        return TRUE
    end
    if itemEx.uid == 1706 then
        if (getPlayerStorageValue(cid, 300018) <= 0) and (getPlayerItemCount(cid, 12616) >= 1) then
            doSendMagicEffect(toPosition, CONST_ME_HITBYPOISON)
                        doCreatureSay(cid, "You cut a leaf from a branch and put it in the almanach. It smells strangely sweet and awfully bitter at the same time.", TALKTYPE_ORANGE_1)
                        doPlayerSendTextMessage(cid,24,"You cut a leaf from a branch and put it in the almanach. It smells strangely sweet and awfully bitter at the same time.")
            setPlayerStorageValue(cid, 300018, 1)
        else
            doCreatureSayWithRadius(cid, "You cannot collect your plant sample.", TALKTYPE_ORANGE_1, 1, 1)
        end
        return TRUE
    end
    if(itemEx.itemid == 12256 and getPlayerStorageValue(cid,42828) < 0) then
        doPlayerAddItem(cid,12263,1)
        doPlayerRemoveItem(cid, 12256,1)
        setPlayerStorageValue(cid, 42828, 1)        
        doCreatureSay(cid, 'You carve a solid bowl out of the chunk of wood.', TALKTYPE_ORANGE_1)
    end
    local skin = SKINS[itemEx.itemid]
    if(not skin) then
        if (itemEx.itemid == 9009) then
            if (getPlayerStorageValue(cid, 27005) == EMPTY_STORAGE) then
                doPlayerAddItem(cid, 8310, 1)
                doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
                setPlayerStorageValue(cid, 27005, 1)
            else
                doCreatureSay(cid, "You cannot skin the corpse more than once.", TALKTYPE_MONSTER_YELL)
            end
            return true
        else
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            return true
        end
    end
	
	if rustyItems[itemEx.itemid] ~= nil then
        if math.random(100) <= breakChance then
            doRemoveItem(itemEx.uid)
        doCreatureSay(cid, 'The attempt of sculpting failed miserably.', TALKTYPE_ORANGE_1)
            doSendMagicEffect(toPosition,3)
        else
            local newId = rustyItems[itemEx.itemid][math.random(#rustyItems[itemEx.itemid])]
            doTransformItem(itemEx.uid,newId)
            doSendMagicEffect(toPosition,9)
			return true
        end
    end

    local random, effect = math.random(1, 100000), CONST_ME_DRAWBLOOD
    if(random <= skin[1]) then
        doPlayerAddItem(cid, skin[2], 1)
    elseif(skin[3] and random >= skin[3]) then
        doPlayerAddItem(cid, skin[4], 1)
    else
        effect = CONST_ME_POFF
    end

    doSendMagicEffect(toPosition, effect)
    doTransformItem(itemEx.uid, itemEx.itemid + 1)
    return true
end

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo