Advanced "Change Parameters" Script

● ARCHIVED · READ-ONLY
Started by IdkWhatsRc 1 posts View original ↗
  1. Advanced "Change Parameters"

    By IdkWhatsRc

    Features

    This script allows to use 4 different ways to use the Event command "Change Parameters".

    1. Set to a certain value

    2. Normally Increase/Decrease by a %.

    3. Specially Increase/Decrease by a %. (See script)

    4. Increase/Decrease by a certain value (Default)

    How to Use

    Check script.

    Demo

    http://www.mediafire...rgyg8979bdeclnw

    Script

    Spoiler
    #This is IdkWhatsRc's Advanced Parameter Change script.
    #This script is free to use for non-commercial and commercial games.
    #Please mention me in the credits section of your game if you use this script.
    #This is my first script ever. :D
    #
    #
    # ==Basics==
    # Normally, the formula used is:
    # New Stat = Old Stat + Value
    # Ex: actor.maxhp += value
    #
    # With this script, you can modify the formula:
    #
    # To Set the Stat equal to the Value. (The value MUST be positive. AKA set to Increase and not Decrease.)
    # New Stat = Value
    # Ex: actor.maxhp = value
    #
    # To Increase/Decrease the Stat by a %
    # Increase/Decrease : New Stat = Old Stat * (Value + 100) / 100
    # Ex: actor.maxhp = actor.maxhp * (value + 100) /100
    #
    #Note: Increasing then decreasing by the same value will not result in the initial stat value.
    # Ex: 1000 * 10% = 1000 + 1000*10% = 1000 + 100 = 1100
    # 1100 - 10% = 1100 - 1100*10% = 1100 - 110 = 990
    # Inital = 1000
    # Final = 990
    #
    #
    #If you want to increase then decrease and come back to the same number, then:
    #
    # Increase/Decrease : New Stat = Old Stat * 100 / (100 - Value)
    # Ex: actor.maxhp = actor.maxhp * 100 / (100 - value)
    #
    # Note: You need to increase normally, then decrease specially to come back to the same value.
    # Still, increasing then decreasing by the same value may not result in the exact initial stat value.
    # This is because the engine rounds number.
    # Your new stat may have a ±1 difference with your inital stat.
    #
    #
    #
    # ==How to Use It==
    # To choose which formula you want to be used, you need to activate a certain switch.
    #
    # When Switch 14 is ON => Set the Stats equal to the Value.
    # When Switch 15 is ON => Increase/Decrease the Stat by a %
    # When Switch 16 is ON => Specially Decrease the Stat by a % (Check lign 29)
    # By Default (Switch 14, 15, 16 OFF) => Increase/Decrease by a number
    #
    # To change the Switch ID, simply use Ctrl+H. XD
    #
    # Basically, right before changing a Parameter:
    # 1. Turn ON Switch 14/15/16 if needed
    # 2. Change the Stat
    # 3. Turn OFF the Switch you activated in #1.
    #
    # Check the events for more details.
    #

    class Game_Interpreter

    def command_317
    value = operate_value(@params[2], @params[3], @params[4])
    actor = $game_actors[@params[0]]
    if actor != nil
    case @params[1]
    ##########################################
    ##########################################
    when 0 # Maximum HP
    if $game_switches[14] == true
    actor.maxhp = value
    end

    if $game_switches[15] == true
    actor.maxhp = actor.maxhp * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.maxhp = actor.maxhp * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.maxhp += value
    end
    end
    end
    ##########################################
    ##########################################
    when 1 # Maximum MP
    if $game_switches[14] == true
    actor.maxmp = value
    end

    if $game_switches[15] == true
    actor.maxmp = actor.maxmp * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.maxmp = actor.maxmp * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.maxmp += value
    end
    end
    end

    ##########################################
    ##########################################
    when 2 # Attack
    if $game_switches[14] == true
    actor.atk = value
    end

    if $game_switches[15] == true
    actor.atk = actor.atk * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.atk = actor.atk * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.atk += value
    end
    end
    end
    ##########################################
    ##########################################
    when 3 # Defense
    if $game_switches[14] == true
    actor.def = value
    end

    if $game_switches[15] == true
    actor.def = actor.def * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.def = actor.def * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.def += value
    end
    end
    end
    ##########################################
    ##########################################
    when 4 # Spirit
    if $game_switches[14] == true
    actor.spi = value
    end

    if $game_switches[15] == true
    actor.spi = actor.spi * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.spi = actor.spi * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.spi += value
    end
    end
    end
    ##########################################
    ##########################################
    when 5 # Agility
    if $game_switches[14] == true
    actor.agi = value
    end

    if $game_switches[15] == true
    actor.agi = actor.agi * (value + 100) /100
    end

    if $game_switches[16] == true
    actor.agi = actor.agi * 100 / (100 - value)
    end

    if $game_switches[14] == false
    if $game_switches[15] == false
    if $game_switches[16] == false
    actor.agi += value
    end
    end
    end
    ##########################################
    ##########################################
    end
    return true

    end
    end
    end

    Code:
    Credit and Thanks

    -IdkWhatsRc

    Author's Notes

    This is my first script ever. :D