Ir para conteúdo
  • Cadastre-se

Posts Recomendados

6 horas atrás, priextix disse:

opa!! Boa noite, uso TFS 1.3!!

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    if itemEx.itemid == 8300 then
        local storageValue = player:getStorageValue(50501)
        if storageValue == -1 then
            player:setStorageValue(50501, 1)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "Parabéns! Você aprendeu suas habilidades de cralfing e agora pode ir cralfing.")
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "Você já aprendeu suas habilidades de cralfing.")
        end
    else
        player:sendCancelMessage("Você precisa clicar no item correto para aprender suas habilidades de cralfing.")
    end
    return true
end

Se você não quer aprender para poder fazer craft, eu posso remover e te enviar o script. É apenas CreatureScript mesmo.

Link para o post
Compartilhar em outros sites
52 minutos atrás, GM Vortex disse:


function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    if itemEx.itemid == 8300 then
        local storageValue = player:getStorageValue(50501)
        if storageValue == -1 then
            player:setStorageValue(50501, 1)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "Parabéns! Você aprendeu suas habilidades de cralfing e agora pode ir cralfing.")
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "Você já aprendeu suas habilidades de cralfing.")
        end
    else
        player:sendCancelMessage("Você precisa clicar no item correto para aprender suas habilidades de cralfing.")
    end
    return true
end

Se você não quer aprender para poder fazer craft, eu posso remover e te enviar o script. É apenas CreatureScript mesmo.

não deu aqui! só fica aparecendo a mensagem "Você precisa clicar no item correto para aprender suas habilidades de cralfing".

 

se puder tirar esse bgl de ter de aprender a skill do script e me enviar eu agradeço muito meu amigo!!

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

não deu aqui! só fica aparecendo a mensagem "Você precisa clicar no item correto para aprender suas habilidades de cralfing".

 

se puder tirar esse bgl de ter de aprender a skill do script e me enviar eu agradeço muito meu amigo!!

Estou no trabalho, quando chegar em casa, vou resolver isso e envio aqui, sim.

actions:

craftsys.lua.

function onUse(player, item, fromPosition, itemEx, toPosition)
    function capitalizar(str)
        return (str:gsub("(%l)(%w*)", function(a,b) return string.upper(a)..b end))
    end

    local receitas = craftingProfessionsConfig[item.actionid].skillRecipes
    local modal = ModalWindow(item.actionid, ""..craftingProfessionsConfig[item.actionid].skillName..".", craftingProfessionsConfig[item.actionid].message)

   if item.itemid == 8046 and isInArray({50501, 50502, 50503, 50504, 50505, 50506}, item.actionid) then
        if getCreatureCondition(player, CONDITION_SPELLCOOLDOWN, 160) then
            return player:sendCancelMessage("Você já está fabricando, aguarde!.")
        end

        for i = 1, #receitas do
            modal:addChoice(i, capitalizar(getItemName(receitas[i].item)))
        end

        craftingProfessionsConfig.extraData[player:getId()] = {
            lastPos = Item(item.uid):getPosition()
        }

        if modal:getChoiceCount() ~= 0 then
            modal:addButton(1, "Criar")
            modal:setDefaultEnterButton(1)
            modal:addButton(2, "Cancelar")
            modal:setDefaultEscapeButton(2)
            modal:addButton(3, "Materiais")
            modal:sendToPlayer(player)
        end
    end
    return true
end

creaturescripts.

crafting.lua

function onModalWindow(player, modalWindowId, buttonId, choiceId)
    if not isInArray({50501, 50502, 50503, 50504, 50505, 50506}, modalWindowId) or buttonId == 2 then
        return false
    end

    local count = 0
    local recipes = craftingProfessionsConfig[modalWindowId].skillRecipes

    if buttonId == 3 then
        local str = ""..capAll(getItemName(recipes[choiceId].item)).."\n  Skill Needed: "..recipes[choiceId].skill.." - Point Cost: 1p\n\nMaterials:"

        for i = 1, #recipes[choiceId].mats do
            str = str.."\n- "..capAll(getItemName(recipes[choiceId].mats[i][1])).." ("..player:getItemCount(recipes[choiceId].mats[i][1]).."/"..recipes[choiceId].mats[i][2]..")"
        end

        if str ~= "" then
            player:showTextDialog(recipes[choiceId].item, str)
        end

        return true
    end

    for i = 1, #recipes[choiceId].mats do
        if player:getItemCount(recipes[choiceId].mats[i][1]) >= recipes[choiceId].mats[i][2] then
            count = count + 1
        end
    end

    if count == #recipes[choiceId].mats then
        local craftCD = Condition(CONDITION_SPELLCOOLDOWN)
        craftCD:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
        craftCD:setParameter(CONDITION_PARAM_SUBID, 160)
        craftCD:setParameter(CONDITION_PARAM_TICKS, recipes[choiceId].time * 1000)
        player:addCondition(craftCD)

        player:say("Crafting...", TALKTYPE_MONSTER_SAY)

        local itemPos = craftingProfessionsConfig.extraData[player:getId()].lastPos

        function sendAnimation(times)
            itemPos:sendMagicEffect(CONST_ME_BLOCKHIT)

            if times == 0 then
                return true
            end

            addEvent(sendAnimation, 1000, times - 1)
        end

        sendAnimation(recipes[choiceId].time)

        for i = 1, count do
            player:removeItem(recipes[choiceId].mats[i][1], recipes[choiceId].mats[i][2])
        end

        addEvent(function(id)
            local player = Player(id)

            if player then
                local craftedItem = player:addItem(recipes[choiceId].item, 1)

                if craftedItem then
                    player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "You've successfully crafted "..craftedItem:getArticle().." "..capAll(craftedItem:getName())..".")
                    craftedItem:setAttribute(ITEM_ATTRIBUTE_NAME, "crafted "..craftedItem:getName())
                    player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_RED)

                    if craftedItem:getType():getDescription() ~= "" then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, craftedItem:getType():getDescription().."\nCrafted by "..player:getName()..".")
                    else
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Crafted by "..player:getName()..".")
                    end

                    if craftedItem:getType():getAttack() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.attack ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_ATTACK, craftedItem:getType():getAttack() + recipes[choiceId].attr.attack)
                    end

                    if craftedItem:getType():getDefense() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.defense ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_DEFENSE, craftedItem:getType():getDefense() + recipes[choiceId].attr.defense)
                    end

                    if craftedItem:getType():getExtraDefense() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.extradefense ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_EXTRADEFENSE, craftedItem:getType():getExtraDefense() + recipes[choiceId].attr.extradefense)
                    end

                    if craftedItem:getType():getArmor() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.armor ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_ARMOR, craftedItem:getType():getArmor() + recipes[choiceId].attr.armor)
                    end

                    if craftedItem:getType():getHitChance() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.hitchance ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_HITCHANCE, craftedItem:getType():getHitChance() + recipes[choiceId].attr.hitchance)
                    end

                    if craftedItem:getType():getShootRange() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.shootrange ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_SHOOTRANGE, craftedItem:getType():getShootRange() + recipes[choiceId].attr.shootrange)
                    end
                end
            end
        end, recipes[choiceId].time * 1000, player:getId())
    else
        player:sendCancelMessage("You don't have all the materials to craft this item.")
    end

    return true
end

Pronto, removi a restrição de aprender + customSkills. Agora você pode clicar quando quiser, aproveitar e se divertir com o sistema. Realmente, o sistema está tão fluido.

:)

Link para o post
Compartilhar em outros sites
Em 06/11/2023 em 09:36, GM Vortex disse:

Estou no trabalho, quando chegar em casa, vou resolver isso e envio aqui, sim.

actions:

craftsys.lua.


function onUse(player, item, fromPosition, itemEx, toPosition)
    function capitalizar(str)
        return (str:gsub("(%l)(%w*)", function(a,b) return string.upper(a)..b end))
    end

    local receitas = craftingProfessionsConfig[item.actionid].skillRecipes
    local modal = ModalWindow(item.actionid, ""..craftingProfessionsConfig[item.actionid].skillName..".", craftingProfessionsConfig[item.actionid].message)

   if item.itemid == 8046 and isInArray({50501, 50502, 50503, 50504, 50505, 50506}, item.actionid) then
        if getCreatureCondition(player, CONDITION_SPELLCOOLDOWN, 160) then
            return player:sendCancelMessage("Você já está fabricando, aguarde!.")
        end

        for i = 1, #receitas do
            modal:addChoice(i, capitalizar(getItemName(receitas[i].item)))
        end

        craftingProfessionsConfig.extraData[player:getId()] = {
            lastPos = Item(item.uid):getPosition()
        }

        if modal:getChoiceCount() ~= 0 then
            modal:addButton(1, "Criar")
            modal:setDefaultEnterButton(1)
            modal:addButton(2, "Cancelar")
            modal:setDefaultEscapeButton(2)
            modal:addButton(3, "Materiais")
            modal:sendToPlayer(player)
        end
    end
    return true
end

creaturescripts.

crafting.lua


function onModalWindow(player, modalWindowId, buttonId, choiceId)
    if not isInArray({50501, 50502, 50503, 50504, 50505, 50506}, modalWindowId) or buttonId == 2 then
        return false
    end

    local count = 0
    local recipes = craftingProfessionsConfig[modalWindowId].skillRecipes

    if buttonId == 3 then
        local str = ""..capAll(getItemName(recipes[choiceId].item)).."\n  Skill Needed: "..recipes[choiceId].skill.." - Point Cost: 1p\n\nMaterials:"

        for i = 1, #recipes[choiceId].mats do
            str = str.."\n- "..capAll(getItemName(recipes[choiceId].mats[i][1])).." ("..player:getItemCount(recipes[choiceId].mats[i][1]).."/"..recipes[choiceId].mats[i][2]..")"
        end

        if str ~= "" then
            player:showTextDialog(recipes[choiceId].item, str)
        end

        return true
    end

    for i = 1, #recipes[choiceId].mats do
        if player:getItemCount(recipes[choiceId].mats[i][1]) >= recipes[choiceId].mats[i][2] then
            count = count + 1
        end
    end

    if count == #recipes[choiceId].mats then
        local craftCD = Condition(CONDITION_SPELLCOOLDOWN)
        craftCD:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
        craftCD:setParameter(CONDITION_PARAM_SUBID, 160)
        craftCD:setParameter(CONDITION_PARAM_TICKS, recipes[choiceId].time * 1000)
        player:addCondition(craftCD)

        player:say("Crafting...", TALKTYPE_MONSTER_SAY)

        local itemPos = craftingProfessionsConfig.extraData[player:getId()].lastPos

        function sendAnimation(times)
            itemPos:sendMagicEffect(CONST_ME_BLOCKHIT)

            if times == 0 then
                return true
            end

            addEvent(sendAnimation, 1000, times - 1)
        end

        sendAnimation(recipes[choiceId].time)

        for i = 1, count do
            player:removeItem(recipes[choiceId].mats[i][1], recipes[choiceId].mats[i][2])
        end

        addEvent(function(id)
            local player = Player(id)

            if player then
                local craftedItem = player:addItem(recipes[choiceId].item, 1)

                if craftedItem then
                    player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "You've successfully crafted "..craftedItem:getArticle().." "..capAll(craftedItem:getName())..".")
                    craftedItem:setAttribute(ITEM_ATTRIBUTE_NAME, "crafted "..craftedItem:getName())
                    player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_RED)

                    if craftedItem:getType():getDescription() ~= "" then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, craftedItem:getType():getDescription().."\nCrafted by "..player:getName()..".")
                    else
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Crafted by "..player:getName()..".")
                    end

                    if craftedItem:getType():getAttack() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.attack ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_ATTACK, craftedItem:getType():getAttack() + recipes[choiceId].attr.attack)
                    end

                    if craftedItem:getType():getDefense() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.defense ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_DEFENSE, craftedItem:getType():getDefense() + recipes[choiceId].attr.defense)
                    end

                    if craftedItem:getType():getExtraDefense() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.extradefense ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_EXTRADEFENSE, craftedItem:getType():getExtraDefense() + recipes[choiceId].attr.extradefense)
                    end

                    if craftedItem:getType():getArmor() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.armor ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_ARMOR, craftedItem:getType():getArmor() + recipes[choiceId].attr.armor)
                    end

                    if craftedItem:getType():getHitChance() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.hitchance ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_HITCHANCE, craftedItem:getType():getHitChance() + recipes[choiceId].attr.hitchance)
                    end

                    if craftedItem:getType():getShootRange() > 0 and recipes[choiceId].attr ~= nil and recipes[choiceId].attr.shootrange ~= nil then
                        craftedItem:setAttribute(ITEM_ATTRIBUTE_SHOOTRANGE, craftedItem:getType():getShootRange() + recipes[choiceId].attr.shootrange)
                    end
                end
            end
        end, recipes[choiceId].time * 1000, player:getId())
    else
        player:sendCancelMessage("You don't have all the materials to craft this item.")
    end

    return true
end

Pronto, removi a restrição de aprender + customSkills. Agora você pode clicar quando quiser, aproveitar e se divertir com o sistema. Realmente, o sistema está tão fluido.

:)

opa!! boa noite meu amigo. Funcionou em partes! a restrição de precisar aprender as skills realmente foi removida, mas agora não está funcionando nem o botão de "criar" e nem o de "materiais". Quando clico nesses dois botões nada acontece! nenhum erro ou informação no cliente ou na distro. Simplesmente não ocorre nada! teria como me ajudar nisso?

Link para o post
Compartilhar em outros sites
Em 27/04/2015 em 15:21, Thiago Rulexz disse:

Parte Configurave  :bleh:

@priextix Você já adicionou as actions e creaturescripts que eu passei, certo? Agora você precisa ter adicionado aqui também, junto com global.lua... pronto.

 

É só copiar a pasta do seu servidor (data/) e colar aqui. Depois, você deve adicionar no global.lua.

craftsystem.lua

function Player.isProfession(self, storage)
   if self:getStorageValue(storage) >= 1 then
     return true
   end
end
craftingProfessionsConfig = {
   [50501] = {
     skillName = "Blacksmithing",
     skillRecipes = {
       [1] = {item = 2400, skill = 10, storage = 101, mats = {{2554, 1}, {2120, 1}}, time = 5, difficulty = 20},
       [2] = {item = 2432, skill = 15, storage = 102, mats = {{2148, 10}, {10608, 10}}, time = 5, difficulty = 20},
       [3] = {item = 2178, skill = 20, storage = 103, mats = {{2177, 1}, {1295, 1}, {2146, 3}}, time = 5, difficulty = 40},
       [4] = {item = 5944, skill = 20, storage = 104, mats = {{2177, 1}, {1295, 1}, {2150, 3}}, time = 5, difficulty = 40},
       [5] = {item = 2363, skill = 25, storage = 105, mats = {{2177, 1}, {2177, 1}, {1295, 1}, {2798, 1}, {2788, 1}}, time = 5, difficulty = 50},
       [6] = {item = 10092, skill = 30, storage = 106, mats = {{2677, 3}, {1685, 1}, {2013, 1}, {2015, 1}}, time = 5, difficulty = 60},
       [7] = {item = 4864, skill = 35, storage = 107, mats = {{4850, 1}, {2913, 1}, {2144, 1}}, time = 5, difficulty = 40}
     },
     message = "Crafting allows you to create anything from potions to bombs to weapons of the highest caliber. The materials used in crafting can be obtained through gathering and through drops in dungeons and the open world.\n\n"
   },
   [50502] = {
     skillName = "Alchemy",
     skillRecipes = { --Based on Shinmaru/Soul4Soul Alchemy's System
       [1] = {item = 8474, skill = 10, storage = 201, mats = {{2007, 1}, {2795, 1}, {2760, 1}}, time = 5, difficulty = 20},
       [2] = {item = 2152, skill = 15, storage = 202, mats = {{2148, 10}, {10608, 2}}, time = 5, difficulty = 20},
       [3] = {item = 2178, skill = 20, storage = 203, mats = {{2177, 1}, {1295, 1}, {2146, 3}}, time = 5, difficulty = 40},
       [4] = {item = 5944, skill = 20, storage = 204, mats = {{2177, 1}, {1295, 1}, {2150, 3}}, time = 5, difficulty = 40},
       [5] = {item = 2363, skill = 25, storage = 205, mats = {{2177, 1}, {2177, 1}, {1295, 1}, {2798, 1}, {2788, 1}}, time = 5, difficulty = 50},
       [6] = {item = 10092, skill = 30, storage = 206, mats = {{2677, 3}, {1685, 1}, {2013, 1}, {2015, 1}}, time = 5, difficulty = 60},
       [7] = {item = 4864, skill = 35, storage = 207, mats = {{4850, 1}, {2913, 1}, {2144, 1}}, time = 5, difficulty = 40},
       [8] = {item = 2276, skill = 40, storage = 208, mats = {{10558, 1}, {2260, 1}, {10554, 1}, {2151, 1}, {5951, 1}, {2265, 1}}, time = 5, difficulty = 40},
       [9] = {item = 2160, skill = 45, storage = 209, mats = {{2152, 1}, {2145, 1}, {2146, 1}, {2800, 1}}, time = 5, difficulty = 30},
       [10] = {item = 11201, skill = 45, storage = 210, mats = {{2759, 1}, {10565, 1}, {2803, 1}, {2692, 1}}, time = 5, difficulty = 40},
       [11] = {item = 5892, skill = 5, storage = 211, mats = {{5468, 1}, {2393, 1}}, time = 5, difficulty = 50},
       [12] = {item = 5887, skill = 5, storage = 212, mats = {{5468, 1}, {2487, 1}}, time = 5, difficulty = 50},
       [13] = {item = 5888, skill = 5, storage = 213, mats = {{5468, 1}, {2462, 1}}, time = 5, difficulty = 50},
       [14] = {item = 5889, skill = 5, storage = 214, mats = {{5468, 1}, {2516, 1}}, time = 5, difficulty = 50},
       [15] = {item = 5891, skill = 10, storage = 215, mats = {{2195, 1}, {4265, 1}, {2151, 1}}, time = 5, difficulty = 40},
       [16] = {item = 5884, skill = 10, storage = 216, mats = {{2498, 1}, {2498, 1}, {2913, 1}, {5865, 1}}, time = 5, difficulty = 40},
       [17] = {item = 5885, skill = 10, storage = 217, mats = {{2475, 1}, {2475, 1}, {2475, 1}, {2475, 1}, {2015, 1}, {5865, 1}}, time = 5, difficulty = 40},
       [18] = {item = 7439, skill = 60, storage = 218, mats = {{6558, 1}, {2007, 1}, {4993, 1}, {5480, 1}, {2796, 1}}, time = 5, difficulty = 30},
       [19] = {item = 7440, skill = 60, storage = 219, mats = {{6558, 1}, {2007, 1}, {4992, 1}, {3955, 1}, {7250, 1}}, time = 5, difficulty = 30},
       [20] = {item = 7443, skill = 60, storage = 220, mats = {{6558, 1}, {2007, 1}, {4994, 1}, {2193, 1}, {2031, 1}}, time = 5, difficulty = 30},
       [21] = {item = 7140, skill = 65, storage = 221, mats = {{7141, 1}, {2015, 1}, {5014, 1}, {2235, 1}, {7439, 1}, {7440, 1}, {7443, 1}, {4845, 1}}, time = 5, difficulty = 60},
       [22] = {item = 9971, skill = 70, storage = 222, mats = {{10552, 1}, {2157, 1}, {2159, 1}, {5906, 1}}, time = 5, difficulty = 50},
       [23] = {item = 2284, skill = 75, storage = 223, mats = {{10523, 1}, {2260, 1}, {10554, 1}, {2151, 1}, {2273, 1}}, time = 5, difficulty = 30},
       [24] = {item = 11387, skill = 80, storage = 224, mats = {{2805, 1}, {2798, 1}, {8582, 1}}, time = 5, difficulty = 70},
       [25] = {item = 8980, skill = 90, storage = 225, mats = {{5941, 1}, {10559, 1}, {2194, 1}, {2377, 1}}, time = 5, difficulty = 80},
       [26] = {item = 2184, skill = 90, storage = 226, mats = {{9942, 1}, {9941, 1}, {9980, 1}, {2445, 1}}, time = 5, difficulty = 80},
       [27] = {item = 2352, skill = 90, storage = 227, mats = {{2177, 1}, {2160, 1}, {2544, 1}, {2544, 1}, {2802, 1}}, time = 5, difficulty = 80},
       [28] = {item = 9969, skill = 100, storage = 228, mats = {{5741, 1}, {2229, 1}, {5669, 1}, {5809, 1}, {2143, 1}}, time = 5, difficulty = 90},
       [29] = {item = 9006, skill = 110, storage = 229, mats = {{8859, 1}, {2289, 1}, {2807, 1}, {10556, 1}, {2545, 1}, {5879, 1}}, time = 5, difficulty = 100},
       [30] = {item = 2348, skill = 120, storage = 230, mats = {{2153, 1}, {2154, 1}, {2155, 1}, {2156, 1}, {2158, 1}, {2260, 1}, {2260, 1}, {2600, 1}}, time = 5, difficulty = 100}
     },
     message = "Crafting allows you to create ~"
   },
   [50503] = {
     skillName = "Inscription",
     skillRecipes = {
       [1] = {item = 2400, skill = 10, storage = 301, mats = {{2554, 1}, {2120, 1}}, time = 5, difficulty = 20, attr = {attack = 10,  defense = 10}},
       [2] = {item = 2432, skill = 15, storage = 302, mats = {{2148, 10}, {10608, 10}}, time = 5, difficulty = 20},
       [3] = {item = 2178, skill = 20, storage = 303, mats = {{2177, 1}, {1295, 1}, {2146, 3}}, time = 5, difficulty = 40},
       [4] = {item = 5944, skill = 20, storage = 304, mats = {{2177, 1}, {1295, 1}, {2150, 3}}, time = 5, difficulty = 40},
       [5] = {item = 2363, skill = 25, storage = 305, mats = {{2177, 1}, {2177, 1}, {1295, 1}, {2798, 1}, {2788, 1}}, time = 5, difficulty = 50},
       [6] = {item = 10092, skill = 30, storage = 306, mats = {{2677, 3}, {1685, 1}, {2013, 1}, {2015, 1}}, time = 5, difficulty = 60},
       [7] = {item = 4864, skill = 35, storage = 307, mats = {{4850, 1}, {2913, 1}, {2144, 1}}, time = 5, difficulty = 40}
     },
     message = "Crafting allows you to create ~"
   },
   [50504] = {
     skillName = "Tailoring",
     skillRecipes = {
       [1] = {item = 2400, skill = 10, storage = 401, mats = {{2554, 1}, {2120, 1}}, time = 5, difficulty = 20},
       [2] = {item = 2432, skill = 15, storage = 402, mats = {{2148, 10}, {10608, 10}}, time = 5, difficulty = 20},
       [3] = {item = 2178, skill = 20, storage = 403, mats = {{2177, 1}, {1295, 1}, {2146, 3}}, time = 5, difficulty = 40},
       [4] = {item = 5944, skill = 20, storage = 404, mats = {{2177, 1}, {1295, 1}, {2150, 3}}, time = 5, difficulty = 40},
       [5] = {item = 2363, skill = 25, storage = 405, mats = {{2177, 1}, {2177, 1}, {1295, 1}, {2798, 1}, {2788, 1}}, time = 5, difficulty = 50},
       [6] = {item = 10092, skill = 30, storage = 406, mats = {{2677, 3}, {1685, 1}, {2013, 1}, {2015, 1}}, time = 5, difficulty = 60},
       [7] = {item = 4864, skill = 35, storage = 407, mats = {{4850, 1}, {2913, 1}, {2144, 1}}, time = 5, difficulty = 40}
     },
     message = "Crafting allows you to create ~"
   },
   [50505] = {
     skillName = "Leatherworking",
     skillRecipes = {
       [1] = {item = 2400, skill = 10, storage = 501, mats = {{2554, 1}, {2120, 1}}, time = 5, difficulty = 20},
       [2] = {item = 2432, skill = 15, storage = 502, mats = {{2148, 10}, {10608, 10}}, time = 5, difficulty = 20},
       [3] = {item = 2178, skill = 20, storage = 503, mats = {{2177, 1}, {1295, 1}, {2146, 3}}, time = 5, difficulty = 40},
       [4] = {item = 5944, skill = 20, storage = 504, mats = {{2177, 1}, {1295, 1}, {2150, 3}}, time = 5, difficulty = 40},
       [5] = {item = 2363, skill = 25, storage = 505, mats = {{2177, 1}, {2177, 1}, {1295, 1}, {2798, 1}, {2788, 1}}, time = 5, difficulty = 50},
       [6] = {item = 10092, skill = 30, storage = 506, mats = {{2677, 3}, {1685, 1}, {2013, 1}, {2015, 1}}, time = 5, difficulty = 60},
       [7] = {item = 4864, skill = 35, storage = 507, mats = {{4850, 1}, {2913, 1}, {2144, 1}}, time = 5, difficulty = 40}
     },
     message = "Crafting allows you to create ~"
   },
   [50506] = {
     skillName = "Engineering",
     skillRecipes = {
       [1] = {item = 2400, skill = 10, storage = 601, mats = {{2554, 1}, {2120, 1}}, time = 5, difficulty = 20},
       [2] = {item = 2432, skill = 15, storage = 602, mats = {{2148, 10}, {10608, 10}}, time = 5, difficulty = 20},
       [3] = {item = 2178, skill = 20, storage = 603, mats = {{2177, 1}, {1295, 1}, {2146, 3}}, time = 5, difficulty = 40},
       [4] = {item = 5944, skill = 20, storage = 604, mats = {{2177, 1}, {1295, 1}, {2150, 3}}, time = 5, difficulty = 40},
       [5] = {item = 2363, skill = 25, storage = 605, mats = {{2177, 1}, {2177, 1}, {1295, 1}, {2798, 1}, {2788, 1}}, time = 5, difficulty = 50},
       [6] = {item = 10092, skill = 30, storage = 606, mats = {{2677, 3}, {1685, 1}, {2013, 1}, {2015, 1}}, time = 5, difficulty = 60},
       [7] = {item = 4864, skill = 35, storage = 607, mats = {{4850, 1}, {2913, 1}, {2144, 1}}, time = 5, difficulty = 40}
     },
     message = "Crafting allows you to create ~"
   },
   maxSkill = 200,
   baseRecipeStorage = 50500,
   extraData = {},
}
--[CustomSkill]-- By: Athern
function Player.getCustomSkill(self, storage)
    return self:getStorageValue(storage)
end
function Player.addCustomSkill(self, skillName, storage)
    local skillStorage = math.max(10, self:getStorageValue(storage))
    local skillTries =  math.max(0, self:getStorageValue(storage + 1))
    self:setStorageValue(storage, skillStorage + 1)
    self:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You advanced to " .. string.lower(skillName) .. " level "..self:getCustomSkill(storage)..".")
    self:setStorageValue(storage + 1, 0)
end
function Player.addCustomSkillTry(self, skillName, storage)
    local skillStorage = math.max(10, self:getStorageValue(storage))
    local skillTries =  math.max(0, self:getStorageValue(storage + 1))
    self:setStorageValue(storage + 1, skillTries + 1)
    if skillTries > math.floor(20 * math.pow(1.1, (skillStorage - 11)) / 10) then
        self:addCustomSkill(skillName, storage)
    end
end
function Player.getCustomSkillPercent(self, storage)
    local skillStorage = math.max(10, self:getStorageValue(storage))
    local skillTries =  math.max(0, self:getStorageValue(storage + 1))
    local triesNeeded = math.floor(20 * math.pow(1.1, (skillStorage - 11)) / 10)
    local percent = math.floor(100 * (1 - skillTries / triesNeeded))
    if percent > 1 and percent <= 100 then
        return percent
    else
        percent = 1
        return percent
    end
end
--[/CustomSkill]--

Abra data/global.lua e cole na primeira linha.

 

dofile("data/craftsystem.lua")

 

Editado por GM Vortex (veja o histórico de edições)
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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo