Módulo:Skill calc/bonusGenerator

De RuneScape Wiki
Ir para: navegação, pesquisa
Documentação do módulo
Esta documentação é transcluída de Predefinição:Sem documentação/doc. [editar] [atualizar]
Este módulo não possui nenhuma documentação. Por favor, considere adicionar uma documentação em Módulo:Skill calc/bonusGenerator/doc. [editar]
Módulo:Skill calc/bonusGenerator é solicitado por Módulo:Skill calc.

--[=[ bonus
-- These determine and return the bonus values for calculators.
-- To create a new one:
--   - if there is no 'object' category, add an 'elseif' catch for that category
--   - if the specific 'skill' for a category is missing, add an 'if' or 'elseif' 
--     catch for that skill
--   - each section should set the local bonus variable. Do not break or return early.
-- Inputs:
--   - Skill    :: The target skill
--   - Object   :: Type of bonus 
--   - Pieces   :: For most bonuses, this is how many pieces are used.
--                 For some, this is a specific item (E.G. tools)
--]=]

--[=[ TODO
--  Include Aura bonuses
--  Include Potion bonuses
--  Include Bonus exp bonuses
--  This module will need some drastic change based on this data: https://docs.google.com/spreadsheets/d/1LjLgtA61DiY5L_3tXZuW0qKsvA-zrKbOhDLnJdsQ1DQ/edit?usp=sharing
--]=]
 
return function(data)
    
    -- Define and set local variables
    local bonus, bonus2, pieces = 0, 0, 0
    local object, skill, setting, item = "", "", "", ""
    local category, name, subSetting = "", "", ""

    -- Find what we've passed
    if data.object then     object  = data.object end
    if data.skill then      skill   = data.skill end
    if data.pieces then     pieces  = data.pieces end
    if data.setting then    setting = data.setting end
    if data.item then       item    = data.item end
    if data.name then       name    = data.name end
    if data.subSetting then subSetting = data.subSetting end

    --[=[ Variable usage
    --      skill:      Skill being used
    --      object:     Specific type of bonus
    --      item:       Any additional objects within an object
    --      pieces:     Number to be considered with object
    --      category:   Any specific subset within a skill
    --      setting:    Any specific settings required to distinguish between bonuses
    --      name:       Name of specific items effected by a bonus
    --]=]
    
    -- Figure out what bonus is being searched
    if object == "roupa" then
        if skill == "Arte do Fogo" then
            if pieces == 1 then bonus = (2 / 100)
            elseif pieces == 2 then bonus = (5 / 100) end
        elseif (skill == "Pesca" or
                skill == "Criação de Runas" or
                skill == "Roubo" or
                skill == "Corte de Lenha") then
            if pieces < 4 then bonus = (pieces / 100)
            elseif pieces == 4 then bonus = (5 / 100) end
        else
            if pieces < 5 then bonus = (pieces / 100)
            elseif pieces == 5 then bonus = (6 / 100) end
        end
    
    -- This section is named 'elite' for the sake of having a relatable in-game set as a guide. This set is used in this calculator as a work around when an 'outfit' would otherwise typically be ignored based on the module's logic. It doesn't come up often enough to change the logic, but enough to have a back door.
    elseif object == "elite" then
        if pieces < 5 then bonus = (pieces / 100)
        elseif pieces == 4 then bonus = (5 / 100) 
        elseif pieces == 5 then bonus = (6 / 100) end
        
    elseif object == "portável" then
        if skill == "Culinária" then bonus = (21 / 100)
        elseif skill == "Arte do Fogo" then bonus = (15 / 100)
        else bonus = (10 / 100) end
    
    elseif object == "ferramenta" then
        if skill == "Culinária" and item == "Multi-Machado Anão" then
            bonus = 3
        elseif skill == "Caça" and item == "Bastão Yaktwee aprimorado" then
            bonus = (5 / 100)
        end

    elseif object == "abismo" then
        if item == "Sim" then
            bonus = (250 / 100)
        elseif item == "Crânio demoníaco" then
            bonus = (350 / 100)
        end

    elseif object == "extra" then
        if not (category == "Batendo" or category == "Fermentando") then
            if category == "Carne" and item == "Fogueira" then
                bonus = (10 / 100)
            elseif item == "Fogão portátil" and not (category == "Coquetéis Gnômicos") then 
                bonus = (21 / 100)
            elseif skill == "Divinação" then
            	if item == "1" then
                    bonus = (10 / 100)
	            --elseif item == "Enriched" and category == "Harvest" then
	    	        --bonus = 2
	    	    end
            elseif skill == "Mineração" and item == "1" then
                bonus = (10 / 100)
            end
        end

	-- Anachronia spa (should only work with the Anachronia Agility Course)
	--elseif object == "spa" and skill == "Agility" then
		--bonus                                                 = (item / 100)

    -- This will allow the user to set a bonus value from random events and items (BXP,
    -- advanced pulse cores, etc)
    elseif object == "personalizado" then	bonus                     = (item / 100)

    elseif object == "altar" then
        
        if item == "Teca" then bonus                          = (110 / 100)
        elseif item == "Pano" then bonus                     = (125 / 100)
        elseif item == "Carvalho - 1 incensário" or
               item == "Mogno" then bonus                  = (150 / 100)
        elseif item == "Teca - 1 incensário" then bonus          = (160 / 100)
        elseif item == "Pano - 1 incensário" or
               item == "Pedra calcária" then bonus                 = (175 / 100)
        elseif item == "Carvalho - 2 incensários" or
               item == "Mogno - 1 incensário" or
               item == "Mármore" then bonus                    = (200 / 100)
        elseif item == "Teca - 2 incensários" then bonus          = (210 / 100)
        elseif item == "Pano - 2 incensários" or
               item == "Pedra calcária - 1 incensário" then bonus     = (225 / 100)
        elseif item == "Mogno - 2 incensários" or
        	   item == "Cremação" or
               item == "Mármore - 1 incensário" or
               item == "Dourado" then bonus                    = (250 / 100)
        elseif item == "Pedra calcária - 2 incensários" then bonus     = (275 / 100)
        elseif item == "Mármore - 2 incensários" or
               item == "Dourado - 1 incensário" then bonus        = (300 / 100)
        elseif item == "Dourado - 2 incensários" or
               item == "Caos" then bonus                     = (350 / 100)
        elseif item == "Ectofuntus" then bonus                = (400 / 100)
        elseif item == "Nenhum" then bonus                      = 1
        end
        if setting and setting == "Ossos para Cremação" then
        	bonus											  = 1
        end
    elseif object == "wild" then -- Agility
        if item == "Crânio demoníaco" then bonus                 = (4 / 100)
        elseif item == "Espada da Terra Selvagem 2+" then bonus       = (5 / 100)
        elseif item == "Ambos" then bonus                      = (4 / 100)
                                   bonus2                     = (5 / 100) -- this doesn't seem to work
        end
    elseif object == "idade" and skill == "Agricultura" then -- Player-owned farm curing
    	if item == "Bebê" then bonus						  = (5 / 1000)
    	elseif item == "Adolescente" then bonus				  = (75 / 10000)
    	elseif item == "Adulto" then bonus					  = (15 / 1000)
    	elseif item == "Idoso" then bonus					  = (45 / 10000)
    	end
    -- This section intentionally verbose in case of future expansions
    -- This will be multiplied directly to experience; must be atleast 1.
    elseif object == "poção" then
        bonus = 1 -- Must be atleast 1
        
        if item == "juju perfeita" then
            if (skill == "Oração") then
                if name == "Cristal de limpeza" then
                    if setting == "VozDeSeren" then
                        if subsetting == "AvgOverTime" then
                            bonus = (140.3 / 100)
                        else
                            bonus = (126 / 100)
                        end
                    else
                        bonus = (105 / 100)
                    end
                elseif string.find(name, "Dourado") then
                    bonus = (105 / 100)
                end
            elseif (skill == "Herbologia") then
                if (category == "Poção de combinação") then
                    
                    -- To be assessed
                    
                end
            end
        end
    
    -- This will be multiplied directly to experience; must be atleast 1.
    elseif object == "VozDeSeren" then
        bonus = 1 -- Must be atleast 1
        if not (setting == "juju perfeita") then
            if name == "Cristal de limpeza" then
                if subSetting == "AvgOverTime" then
                    bonus = (103.3 / 100)
                else
                    bonus = (120 / 100)
                end
            end
        end
    
    -- This will be multiplied directly to experience; must be atleast 1.
    elseif object == "aura" then
        bonus = 1 -- Must be atleast 1
        if item == "Básica" then         bonus = (101 / 100)
        elseif item == "Superior" then   bonus = (101.5 / 100)
        elseif item == "Mestre" then    bonus = (102 / 100)
        elseif item == "Suprema" then   bonus = (102.5 / 100)
        end
    else
        bonus = (tonumber(pieces) / 100)
    end

    return bonus, bonus2
end