RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Added Actor Options

0 Members and 2 Guests are viewing this topic.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Added Actor Options
Version: 1.0b
Author: cozziekuns
Date: June 24, 2010

Version History


  • <Version 1.0b> 06.24.2011 - Fixed a major bug.
  • <Version 1.0a> 08.21.2010 - Released with Last Stand
  • <Version 1.0> 06.24.2010 - Original Release

Planned Future Versions

  • None.

Description


Before, there were only six actor options that you could choose from, and they were a bit dull. The only ones that most people actually used were two swords style and critical bonus, and even then they were used quite sparingly. I find that actor options add a lot of variety into the game, so I took it up as my job to create the best actor options I (and Square Enix, as most of them are ripped of FFTA2) could think of.

Note: The best way to use these skills would be with Modern Algebra's Editable actor options, or with that equipment skill that allowed equipment to have actor options (whoever wrote that script, contact me so I can credit you and your script)

Concentration: Gives the actor an added accuracy bonus.
Halve MP: Halves the MP for all skills. Does not stack with the armour option.
Immunity: Grants immunity to all states, good or bad.
Monkey Grip: Allows the actor to equip a shield regardless of whether their weapon is one-handed or two-handed.
Spellbound: States will stay in effect for two times as long.
Razzle Dazzle: Nice name for Auto-Regen.
Unscarred: When the actor is on full health, attack is increased.
Adrenaline: When the actor is on critical health, speed is increased.
Burdened Soul: When the actor is on critical health, he is knocked out and all other party members HP and MP is fully recovered.
Vigilance: When the actor is on critical health, defense is increased.
Blood Prince: Skills take up HP instead of MP.
Last Stand: When the actor is on critical health, both Critical Damage and Rate are increased.

Features

  • Basically said them in the description, so... yeah.

Instructions

See header.

Script


Code: [Select]
#===============================================================================
#
# Added Actor Options
# Last Date Updated: 6/24/2010
#
# Before, there were only six actor options that you could choose from, and they
# were a bit dull. The only ones that most people actually used were two swords
# style and critical bonus, and even then they were used quite sparingly. I find
# that actor options add a lot of variety into the game, so I took it up as my
# job to create the best actor options I (and Square Enix, as most of them are
# ripped of FFTA2) could think of.
#
# Note: The best way to use these skills would be with Modern Algebra's Editable
# actor options, or with that equipment skill that allowed equipment to have
# actor options (whoever wrote that script, contact me so I can credit you
# and your script)
#
# Concentration: Gives the actor an added accuracy bonus.
# Halve MP: Halves the MP for all skills. Does not stack with the armour option.
# Immunity: Grants immunity to all states, good or bad.
# Monkey Grip: Allows the actor to equip a shield regardless of whether their
#              weapon is one-handed or two-handed.
# Spellbound: States will stay in effect for two times as long.
# Razzle Dazzle: Nice name for Auto-Regen.
# Unscarred: When the actor is on full health, attack is increased.
# Adrenaline: When the actor is on critical health, speed is increased.
# Burdened Soul: When the actor is on critical health, he is knocked out and all
#                other party members are fully recovered,
# Vigilance: When the actor is on critical health, defense is increased.
# Blood Prince: Skills take up HP instead of MP.
# Last Stand: When the actor is on critical health, both Critical Damage and
#             Rate are increased.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 06/24/10 Started Script.
#===============================================================================
# What's to come?
# -----------------------------------------------------------------------------
# o Nothing! Suggest something.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#
# To change the modules, follow the correct syntax. For example, if I wanted
# Ulrika (who has the actor ID of 2) to have the ability IMMUNITY, I would
# scroll down to the line with immunity and place her ID in the brackets. Or,
# essentially:
#
# IMMUNITY = [2]
#===============================================================================

$imported = {} if $imported == nil
$imported["CozAddedActorOptions"] = true

module COZZIEKUNS
  module AAO
  # Syntax: Option = [Actor ID's]
    CONCENTRAITON = [1]
    HALVE_MP = []
    IMMUNITY = []
    MONKEY_GRIP = []
    SPELLBOUND = []
    RAZZLE_DAZZLE = []
    UNSCARRED = []
    ADRENAILINE = []
    BURDENED_SOUL = []
    VIGILANCE = []
    BLOOD_PRINCE = []
    LAST_STAND = []
   
    CONCENTRATION_VARIABLE = 5
    RAZZLE_DAZZLE_WAIT = 90
    RAZZLE_DAZZLE_MESSAGE = "'s HP was restored by a bit!"
    UNSCARRED_VARIABLE = 150
    ADRENAILINE_VARIABLE = 150
    BURDENED_SOUL_WAIT = 90
    BURDENED_SOUL_MESSAGE = "'s soul was released!"
    CRITICAL_HP_VARIABLE = 15
    VIGILANCE_VARIABLE = 150
    LAST_STAND_DAMAGE_VARIABLE = 2  # New damage multiplier for Critical Hits. Stacks on to the original.
    LAST_STAND_RATE_VARIABLE = 2 # New rate multiplier for Critical Hits. Stacks on to the original.
  end
end

#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass of the Game_Actor
# and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Get [Spellbound] option
  #--------------------------------------------------------------------------
  def spellbound
    return false
  end
  #--------------------------------------------------------------------------
  # * Get [Burdened Soul] option
  #--------------------------------------------------------------------------
  def burdened_soul
    return false
  end
  #--------------------------------------------------------------------------
  # * Get [Blood Prince] option
  #--------------------------------------------------------------------------
  def blood_prince
    return false
  end
  #--------------------------------------------------------------------------
  # * Determine Usable Skills
  #     skill : skill
  #--------------------------------------------------------------------------
  def skill_can_use?(skill)
    return false unless skill.is_a?(RPG::Skill)
    return false unless movable?
    return false if silent? and skill.spi_f > 0
    if blood_prince
      return false if calc_mp_cost(skill) > hp
    end
    return false if calc_mp_cost(skill) > mp
    if $game_temp.in_battle
      return skill.battle_ok?
    else
      return skill.menu_ok?
    end
  end
  #--------------------------------------------------------------------------
  # * Natural Removal of States (called up each turn)
  #--------------------------------------------------------------------------
  def remove_states_auto
    clear_action_results
    for i in @state_turns.keys.clone
      if @state_turns[i] > 0
        if spellbound
          @state_turns[i] -= 0.5
        else
          @state_turns[i] -= 1
        end
      elsif rand(100) < $data_states[i].auto_release_prob
        remove_state(i)
        @removed_states.push(i)
      end
    end
  end
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :fatigue
  attr_accessor :razzle_dazzle_message
  attr_accessor :burdened_soul_message
  #--------------------------------------------------------------------------
  # * Setup
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  alias coz_aao_ga_setup setup
  def setup(actor_id)
    coz_aao_ga_setup(actor_id)
    @concentration = COZZIEKUNS::AAO::CONCENTRAITON
    @halve_mp = COZZIEKUNS::AAO::HALVE_MP
    @immunity = COZZIEKUNS::AAO::IMMUNITY
    @monkey_grip = COZZIEKUNS::AAO::MONKEY_GRIP
    @spellbound = COZZIEKUNS::AAO::SPELLBOUND
    @razzle_dazzle = COZZIEKUNS::AAO::RAZZLE_DAZZLE
    @unscarred = COZZIEKUNS::AAO::UNSCARRED
    @adrenailine = COZZIEKUNS::AAO::ADRENAILINE
    @burdened_soul = COZZIEKUNS::AAO::BURDENED_SOUL
    @vigilance = COZZIEKUNS::AAO::VIGILANCE
    @blood_prince = COZZIEKUNS::AAO::BLOOD_PRINCE
    @last_stand = COZZIEKUNS::AAO::LAST_STAND
    @critical_hp = 0
  end
  #--------------------------------------------------------------------------
  # * Get Added State Success Rate
  #     state_id : state ID
  #--------------------------------------------------------------------------
  alias coz_aao_ga_state_probability state_probability
  def state_probability(state_id)
    n = coz_aao_ga_state_probability(state_id)
    return 0 if @immunity.include?(id)
    return n
  end
  #--------------------------------------------------------------------------
  # * Get [Spellbound] option
  #--------------------------------------------------------------------------
  def spellbound
    return @spellbound.include?(id)
  end
  #--------------------------------------------------------------------------
  # * Check for [Critical HP]
  #--------------------------------------------------------------------------
  def critical_hp?
    @critical_hp = self.maxhp
    @critical_hp *= COZZIEKUNS::AAO::CRITICAL_HP_VARIABLE
    @critical_hp /= 100
    return self.hp <= @critical_hp
  end
  #--------------------------------------------------------------------------
  # * Check for [Burdened Soul] option
  #--------------------------------------------------------------------------
  def burdened_soul
    return true if @burdened_soul.include?(id)
    return false
  end
  #--------------------------------------------------------------------------
  # * Perform Burdened Soul (called at end of turn)
  #--------------------------------------------------------------------------
  def do_burdened_soul
    if @burdened_soul.include?(id) and not dead?
      if critical_hp?
        for i in 0...$game_party.members.size
          $game_party.members[i].hp += 9999
        end
        self.hp = 0
        @burdened_soul_message = "#{self.name}" + COZZIEKUNS::AAO::BURDENED_SOUL_MESSAGE
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Get [Blood Prince] option
  #--------------------------------------------------------------------------
  def blood_prince
    return @blood_prince.include?(id)
  end
  #--------------------------------------------------------------------------
  # * Get Basic Attack
  #--------------------------------------------------------------------------
  alias coz_aao_ga_base_atk base_atk
  def base_atk
    n = coz_aao_ga_base_atk
    if @unscarred.include?(id)
      if self.hp = self.maxhp
        n *= COZZIEKUNS::AAO::UNSCARRED_VARIABLE
        n /= 100
      end
    end
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Defense
  #--------------------------------------------------------------------------
  alias coz_aao_ga_base_def base_def
  def base_def
    n = coz_aao_ga_base_def
    if @vigilance
      if critical_hp?
        n *= COZZIEKUNS::AAO::VIGILANCE_VARIABLE
        n /= 100
      end
    end
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Agility
  #--------------------------------------------------------------------------
  alias coz_aao_ga_base_agi base_agi
  def base_agi
    n = coz_aao_ga_base_agi
    if @adrenailine.include?(id)
      n *= COZZIEKUNS::AAO::ADRENAILINE_VARIABLE
      n /= 100
    end
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Hit Rate
  #--------------------------------------------------------------------------
  alias coz_aao_ga_hit hit
  def hit
    n = coz_aao_ga_hit
    if @concentration.include?(id)
      n += COZZIEKUNS::AAO::CONCENTRATION_VARIABLE
    end
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Critical Ratio
  #--------------------------------------------------------------------------
  alias coz_aao_ga_cri cri
  def cri
    n = coz_aao_ga_cri
    if @last_stand.include?(id)
      if critical_hp?
        n += COZZIEKUNS::AAO::LAST_STAND_RATE_VARIABLE
      end
    end
    return n
  end
  #--------------------------------------------------------------------------
  # * Calculation of Damage From Normal Attack
  #     attacker : Attacker
  #    The results are substituted for @hp_damage
  #--------------------------------------------------------------------------
  def make_attack_damage_value(attacker)
    damage = attacker.atk * 4 - self.def * 2        # base calculation
    damage = 0 if damage < 0                        # if negative, make 0
    damage *= elements_max_rate(attacker.element_set)   # elemental adjustment
    damage /= 100
    if damage == 0                                  # if damage is 0,
      damage = rand(2)                              # half of the time, 1 dmg
    elsif damage > 0                                # a positive number?
      @critical = (rand(100) < attacker.cri)        # critical hit?
      @critical = false if prevent_critical         # criticals prevented?
      if @last_stand.include?(id)
        if critical_hp?
          damage *= (3 * COZZIEKUNS::AAO::LAST_STAND_DAMAGE_VARIABLE) if @critical # critical adjustment
        else
          damage *= 3 if @critical
        end
      else
        damage *= 3 if @critical                    # critical adjustment
      end
    end
    damage = apply_variance(damage, 20)             # variance
    damage = apply_guard(damage)                    # guard adjustment
    @hp_damage = damage                             # damage HP
  end
  #--------------------------------------------------------------------------
  # * Get [Auto HP Recovery]
  #--------------------------------------------------------------------------
  alias coz_aao_ga_auto_hp_recover auto_hp_recover
  def auto_hp_recover
    return true if @razzle_dazzle.include?(id)
    coz_aao_ga_auto_hp_recover
  end
  #--------------------------------------------------------------------------
  # * Get [Half MP cost]
  #--------------------------------------------------------------------------
  alias coz_aao_ga_half_mp_cost half_mp_cost
  def half_mp_cost
    return true if @halve_mp.include?(id)
    coz_aao_ga_half_mp_cost
  end
  #--------------------------------------------------------------------------
  # * Perform Automatic Recovery (called at end of turn)
  #--------------------------------------------------------------------------
  alias coz_aao_ga_do_auto_recovery do_auto_recovery
  def do_auto_recovery
    coz_aao_ga_do_auto_recovery
    @razzle_dazzle_message = "#{self.name}" + COZZIEKUNS::AAO::RAZZLE_DAZZLE_MESSAGE
  end
  #--------------------------------------------------------------------------
  # * Change Equipment (designate object)
  #     equip_type : Equip region (0..4)
  #     item       : Weapon or armor (nil is used to unequip)
  #     test       : Test flag (for battle test or temporary equipment)
  #--------------------------------------------------------------------------
  def change_equip(equip_type, item, test = false)
    last_item = equips[equip_type]
    unless test
      return if $game_party.item_number(item) == 0 if item != nil
      $game_party.gain_item(last_item, 1)
      $game_party.lose_item(item, 1)
    end
    item_id = item == nil ? 0 : item.id
    case equip_type
    when 0  # Weapon
      @weapon_id = item_id
      unless two_hands_legal?             # If two hands is not allowed
        unless @monkey_grip.include?(id)
          change_equip(1, nil, test)        # Unequip from other hand
        end
      end
    when 1  # Shield
      @armor1_id = item_id
      unless two_hands_legal?           # If two hands is not allowed
        unless @monkey_grip.include?(id)
          change_equip(0, nil, test)        # Unequip from other hand
        end
      end
    when 2  # Head
      @armor2_id = item_id
    when 3  # Body
      @armor3_id = item_id
    when 4  # Accessory
      @armor4_id = item_id
    end
  end
end

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold
# and items. The instance of this class is referenced by $game_party.
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Remove Battle States (called when battle ends)
  #--------------------------------------------------------------------------
  def do_burdened_soul
    for actor in members
      actor.do_burdened_soul
    end
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * End Turn
  #--------------------------------------------------------------------------
  def turn_end
    $game_troop.turn_ending = true
    $game_party.slip_damage_effect
    $game_troop.slip_damage_effect
    $game_party.do_auto_recovery
     for i in 0...$game_party.members.size
      if $game_party.members[i].auto_hp_recover and $game_party.members[i].dead? == false
        Sound.play_recovery
        $game_troop.screen.flash_color
        @message_window.replace_instant_text($game_party.members[i].razzle_dazzle_message)
        wait(COZZIEKUNS::AAO::RAZZLE_DAZZLE_WAIT)
      end
    end
    for i in 0...$game_party.members.size
      if $game_party.members[i].critical_hp? and $game_party.members[i].dead? == false
        if $game_party.members[i].burdened_soul
          Sound.play_actor_collapse
          $game_troop.screen.start_shake(5, 5, 10)
          @message_window.replace_instant_text($game_party.members[i].burdened_soul_message)
          wait(COZZIEKUNS::AAO::BURDENED_SOUL_WAIT)
        end
      end
    end
    $game_party.do_burdened_soul
    $game_troop.preemptive = false
    $game_troop.surprise = false
    process_battle_event
    $game_troop.turn_ending = false
    start_party_command_selection
  end
  #--------------------------------------------------------------------------
  # * Execute Battle Action: Skill
  #--------------------------------------------------------------------------
  def execute_action_skill
    skill = @active_battler.action.skill
    text = @active_battler.name + skill.message1
    @message_window.add_instant_text(text)
    unless skill.message2.empty?
      wait(10)
      @message_window.add_instant_text(skill.message2)
    end
    targets = @active_battler.action.make_targets
    display_animation(targets, skill.animation_id)
    if @active_battler.blood_prince
      @active_battler.hp -= @active_battler.calc_mp_cost(skill)
    else
      @active_battler.mp -= @active_battler.calc_mp_cost(skill)
    end
    $game_temp.common_event_id = skill.common_event_id
    for target in targets
      target.skill_effect(@active_battler, skill)
      display_action_effects(target, skill)
    end
  end
end

#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
#  This class performs the skill screen processing.
#==============================================================================

class Scene_Skill < Scene_Base
  #--------------------------------------------------------------------------
  # * Use Skill (apply effects to non-ally targets)
  #--------------------------------------------------------------------------
  def use_skill_nontarget
    Sound.play_use_skill
    if @actor.blood_prince
      @actor.hp -= @actor.calc_mp_cost(@skill)
    else
      @actor.mp -= @actor.calc_mp_cost(@skill)
    end
    @status_window.refresh
    @skill_window.refresh
    @target_window.refresh
    if $game_party.all_dead?
      $scene = Scene_Gameover.new
    elsif @skill.common_event_id > 0
      $game_temp.common_event_id = @skill.common_event_id
      $scene = Scene_Map.new
    end
  end
end

Credit


  • cozziekuns

Thanks

  • Final Fantasy Tactics A2: Grimore of the Rift
  • kawagiri, for suggesting some stuff.
  • modern algebra, for noticing an error.

Support


Just post down here.

Known Compatibility Issues

None known as of yet.

Author's Notes


Don't hunt me down, Square Enix.

Restrictions

:ccby:
« Last Edit: June 24, 2011, 06:47:45 PM by cozziekuns »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Wonderful idea cozzie. Very very nice :)

**
Rep: +0/-0Level 78
RMRK Junior

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Didn't think it was needed. It's pretty self explanatory.

**
Rep: +0/-0Level 78
RMRK Junior
Can I asked a question? Is it compatible with Kaduki Sideview Battle System?

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Don't see why it wouldn't be, give it a try and tell me what happens.

**
Rep: +0/-0Level 75
RMRK Junior
I tried and combined this with Tankentai Side Battle Script and it gives an error.

Replication:
1. Enter a battle
2. Attack an Enemy
3. After the attack scene it'll give an error
4. Error: ATB 1.2c line 344

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
May I ask which version you're using?

**
Rep:
Level 75
RMRK Junior
very nice script... i think alot of people will use this :D


"Planned Future Versions

    * None. Please suggest an actor option."

just some ideas if you want to implement in the future :3

* Last stand - increased critical damage and critical chance while HP is low
* Fatigue - stats lower each round of battle but return at the end of battle
* mana shield - when attacked, Mp gets drained before losing hp
* Soul Steal - When physically attacked only, some mana is stolen from the opponent and given to you


Spoiler for:
1. Last stand, simple enough many games increase stats at low life.

2. Fatigue, allows you to use a strong character but if a battle draws on too long he soon becomes weak.

3. Mana shield, simple enough, if you've played fable it had a spell which damaged your mana instead of your health.

4. Soul Steal, allows another kind of vampiric player or simply a boost for mages.


2,3 and 4 i don't know if they're possible but you wanted suggestions so thought i'd try and help =)

**
Rep:
Level 75
RMRK Junior
found an incompatibility



Equipment Constraints - Author: modern algebra & Tsunokiette

Spoiler for:
Code: [Select]
#==============================================================================
# ** Item/Equipment/Skill Conditions
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This script allows you to set stats and/or level requirements for weapons
#  and armor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Instructions:
#    Place above Main and below Materials
#
#    To configure this script, you have to place codes in the Notes Field of
#   the respective items. These codes are:
#   
#     \LVLR[<level_requirement>]           *Actor must be at least this level
#     \HPR[<hp_requirement>]               *Actor must have this much HP
#     \MPR[<mp_requirement>]               *Actor must have this much MP
#     \ATKR[<attack_requirement>]          *Actor must have this much Attack
#     \DEFR[<defense_requirement>]         *Actor must have this much Defense
#     \SPIR[<spirit_requirement>]          *Actor must have this much Spirit
#     \AGIR[<agility_requirement>]         *Actor must have this much Agility
#     \WPNR[<weapon_id>]                   *Weapon must be equipped
#     \ARMR[<armor_id>]                    *Armor must be equipped
#     \ITMR[<item_id>, <n>]                *At least n of item_id in possession
#     \ITMR[<item_id>, <n>]C               *As above and consumed upon use.
#     \PWPNR[<possession_weapon_id>, <n>]  *At least n of weapon_id in possession
#     \PWPNR[<possession_weapon_id>, <n>]C *As above and consumed upon use.
#     \PARMR[<possession_armor_id>, <n>]   *At least n of armor_id in possession
#     \PARMR[<possession_armor_id>, <n>]C  *As above and consumed upon use.
#     \SKLR[<skill_id>]                    *Skill must be learned
#     \STER[<state_id>]                    *State must be added
#
#    After any of them that make sense, you can also add these restrictions:
#      >= - greater than or equal to - default
#      <= - less than or equal to
#      >  - strictly greater than
#      <  - strictly less than
#      =  - strictly equal to
#
#    You can leave out any or all or none of them and the script will only
#   restrict the attributes you set
#
#   EXAMPLE:
#     If Club has a Notes Field like this:
#
#       \LVLR[6]<
#       \ATKR[37]
#       \AGIR[27]>
#
#      then an actor could only use that club if he was less than level 6, had
#     an Attack of at least 37 and an Agility of at least 28.
#==============================================================================
# ** RPG::BaseItem
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes
#    new method - requirements_field
#==============================================================================

class RPG::BaseItem
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Requirement Field
  #--------------------------------------------------------------------------
  #  This method returns an array of restrictions on using each item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def requirement_field
    r_field = []
    # Dissect Note
    text = self.note.dup
    text.sub! (/\\lvlr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # HP Requirement
    text.sub! (/\\hpr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # MP Requirement
    text.sub! (/\\mpr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Attack Requirement
    text.sub! (/\\atkr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Defense Requirement
    text.sub! (/\\defr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Spirit Requirement
    text.sub! (/\\spir\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Agility Requirement
    text.sub! (/\\agir\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    r_field.push ([], [], [], [], [], [], [], [], [], [])
    # Weapon Requirement
    r_field[7].push ($1.to_i) while text.sub! (/\\wpnr\[(\d+?)\]/i) {''} != nil
    # Armor Requirement
    r_field[8].push ($1.to_i) while text.sub! (/\\armr\[(\d+?)\]/i) {''} != nil
    # Item Possession Requirement
    while text.sub! (/\\itmr\[(\d+),*\s*(\d*)\](C*)(<*>*=*)/i) { '' } != nil
      r_field[9].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s])
      # Consumable items
      r_field[14].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s]) if $3 != ""
    end
    # Weapon Possession Requirement
    while text.sub! (/pwpnr\[(\d+),*\s*(\d*)\](C*)(<*>*=*)/i) {''} != nil
      r_field[10].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s])
      # Consumable weapons
      r_field[15].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s]) if $3 != nil
    end
    # Armor Possession Requirement
    while text.sub! (/parmr\[(\d+),*\s*(\d*)\](C*)(<*>*=*)/i) {''} != nil
      r_field[11].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s])
      # Consumable Armors\
      r_field[16].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s]) if $3 != nil
    end
    # Skill Requirement
    r_field[12].push ($1.to_i) while text.sub! (/\\sklr\[(\d+?)\]/i) {''} != nil
    # State Requirement
    r_field[13].push ($1.to_i) while text.sub! (/\\ster\[(\d+?)\]/i) {''} != nil
    return r_field
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Check requirements
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def check_reqs (user)
    actor_stats = [user.level, user.maxhp, user.maxmp, user.atk, user.def, user.spi, user.agi]
    reqs = self.requirement_field
    # Stats
    for i in 0...7
      case reqs[i][1]
      when "" # Assume Greater than or Equal to
        return false unless actor_stats[i] >= reqs[i][0]
      else # Other
        begin
          eval ("return false unless actor_stats[i] #{reqs[i][1]} reqs[i][0]")
        rescue
        end
      end
    end
    data = [$data_items, $data_weapons, $data_armors]
    # Weapons and Armor equips
    for i in 7...9
      reqs[i].each { |j|
        return false unless user.equips.include? (data[i-6][j])
      }
    end
    # Items, Weapons, Armors in possession
    for i in 9...12
      reqs[i].each { |j|
        case j[2]
        when ""
          return false unless $game_party.item_number (data[i-9][j[0]]) >= j[1]
        else
          begin
            eval ("return false unless $game_party.item_number (data[i-9][j[0]]) #{j[2]} j[1]")
          rescue
          end
        end
      }
    end
    # Skills learned
    self.requirement_field[12].each { |i| return false unless user.skill_learn? ($data_skills[i]) }
    # States
    self.requirement_field[13].each { |i| return false unless user.state? (i) }
    return true
  end
end
 
#==============================================================================
# ** Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new method - check_reqs, consume_reagants
#    aliased_methods - equippable?, setup, level_down, maxhp=, maxmp=, atk=,
#                      def=, spi=, agi=
#    modified super - skill_effect, item_effect, skill_can_use?, item_effective?
#==============================================================================

class Game_Actor < Game_Battler
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Setup
  #     actor_id : actor ID
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_equip_required_actor_stp_7ht1 setup
  def setup (actor_id)
    # Run Original Method
    modalg_equip_required_actor_stp_7ht1 (actor_id)
    # Make sure all starting items are allowed to be on the hero
    check_equip_reqs
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Determine if Equippable
  #     item : item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_eqp_reqs_actor_check_equip_5js9 equippable?
  def equippable?(item)
    return false if item == nil
    return modalg_eqp_reqs_actor_check_equip_5js9 (item) & item.check_reqs (self)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Determine Usable Skills
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def skill_can_use? (skill)
    test = super (skill)
    return skill.check_reqs (self) if test
    return test
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Determine if an Item can be Used
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def item_effective?(user, item)
    return super (user, item) if user.is_a? (Game_Enemy)
    return super (user, item) & item.check_reqs (user)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Apply Item Effects
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def item_effect(user, item)
    super (user, item)
    # Consume reagants if consumable
    consume_reagants (item)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Apply Skill Effects
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def skill_effect(user, skill)
    super (user, skill)
    # Consume reagants if consumable
    consume_reagants (skill)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Check Equipment Requirements
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def check_equip_reqs
    @checking_equipment = true
    equip_array = equips.dup
    for i in 0...5
      # Unequip everything
      change_equip (i, nil, true)
      test = equippable? (equip_array[i])
      change_equip (i, equip_array[i], true)
      # Unequip item for real if requirements not met
      change_equip (i, nil) unless test
    end
    @checking_equipment = false
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Consume Reagants
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def consume_reagants (item)
    unless @skipped || @missed || @evaded
      # Remove items, weapons, and armors
      item.requirement_field[14].each { |i| $game_party.lose_item ($data_items[i[0]], i[1]) }
      item.requirement_field[15].each { |i| $game_party.lose_item ($data_weapons[i[0]], i[1]) }
      item.requirement_field[16].each { |i| $game_party.lose_item ($data_armors[i[0]], i[1]) }
    end
  end
  #--------------------------------------------------------------------------
  # * Make sure requirements still met if stats decrease in any way
  #--------------------------------------------------------------------------
  alias modalg_eqpreqs_lvlup_check_9dn4 level_up
  def level_up
    modalg_eqpreqs_lvlup_check_9dn4
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_changelvl_check_5hy2 level_down
  def level_down
    modalg_equip_reqs_changelvl_check_5hy2
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_changemaxhp_check_h83d maxhp=
  def maxhp=(new_maxhp)
    modalg_equip_reqs_changemaxhp_check_h83d (new_maxhp)
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_changemxmp_check_8fjq maxmp=
  def maxmp=(new_maxmp)
    modalg_equip_reqs_changemxmp_check_8fjq (new_maxmp)
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_change_atk_94nd atk=
  def atk=(new_atk)
    modalg_equip_reqs_change_atk_94nd (new_atk)
    check_equip_reqs
  end
 
  alias modernalg_chck_reqs_def_73ij def=
  def def=(new_def)
    modernalg_chck_reqs_def_73ij (new_def)
    check_equip_reqs
  end
 
  alias modalgebra_reqs_chck_sprit_8dsn spi=
  def spi=(new_spi)
    modalgebra_reqs_chck_sprit_8dsn (new_spi)
    check_equip_reqs
  end
 
  alias modalgebra_requirements_equipment_agi_6hdt agi=
  def agi=(new_agi)
    modalgebra_requirements_equipment_agi_6hdt (new_agi)
    check_equip_reqs
  end
 
  alias ma_chck_eqp_reqs_chnge_equip_7fn change_equip
  def change_equip (equip_type, item, test = false)
    ma_chck_eqp_reqs_chnge_equip_7fn (equip_type, item, test)
    check_equip_reqs if @checking_equipment == nil || !@checking_equipment && !test
  end
 
  alias ma_frgt_skill_check_eqp_reqs_8her forget_skill
  def forget_skill (skill_id)
    ma_frgt_skill_check_eqp_reqs_8her (skill_id)
    check_equip_reqs if @checking_equipment == nil || !@checking_equipment
  end
end

#==============================================================================
# ** Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased methods - item_can_use?
#==============================================================================

class Game_Party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Item Can Use?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_req_itm_party_use_9m43 item_can_use?
  def item_can_use? (item)
    # Run Original Method
    test = modalg_req_itm_party_use_9m43 (item)
    return false unless test
    if $game_temp.in_battle
      return test & item.check_reqs ($scene.active_battler)
    else
      $game_party.members.each { |i| return test if item.check_reqs (i) }
      return false
    end
  end
end

#==============================================================================
# ** Scene_Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    makes public - active_battler
#==============================================================================

class Scene_Battle < Scene_Base
  attr_reader :active_battler
end

#==============================================================================
# ** Scene_Item
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased method - use_item_nontarget
#==============================================================================

class Scene_Item < Scene_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Use Item (apply effects to non-ally targets)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_eqp_reqs_consume_regnts_refresh_rn4 use_item_nontarget
  def use_item_nontarget
    # Run Original Method
    modalg_eqp_reqs_consume_regnts_refresh_rn4
    # Refresh Item Window
    @item_window.refresh
  end
end


when i have an event to add an actor on screen or try to add an actor it seems to crash and do this.
Spoiler for:
script 'added actor options' line239: NoMethodError occured
undefined method 'include?' for nil:NilClass

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
For the first one, try switching the order of the Equipment Constraints and this script. I'm not so sure about the other one though, when I add an actor in it seems to be fine.

**
Rep:
Level 75
RMRK Junior
i'll try... it was the adding of the actor what triggered the non-compatablility... i'll try switching order and get back to you

**
Rep:
Level 75
RMRK Junior
yeah it's fine with order switched... i thought i tried switching around it earlier lol

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Added Last Stand, which was probably the easiest one to do out of there. I have a lot going on right now, so the others might not come in a while.

**
Rep:
Level 75
RMRK Junior
Added Last Stand, which was probably the easiest one to do out of there. I have a lot going on right now, so the others might not come in a while.

awesome didn't expect you doing it any time soon, it was just ideas for your next release ^^

***
Rep:
Level 77
RMRK Junior
Problem: Use with Yanfly's Dexterity stat makes stack levels too deep, can someone tell me what this means?

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Well, it seems to work for me. Can you tell me how you got the problem?

***
Rep:
Level 77
RMRK Junior
I just had the script inserted along with Yanfly Engine Melody - New Battle Stats, which affects the critical hit ratio.







Also, if you want ore ideas for actor options, take a look at the abilities in the Pokemon games.

***
Rep:
Level 77
RMRK Junior
You still there, or having RL problems? I need to iron out this incompatibility.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Well when I inserted "Yanfly Engine Melody - New Battle Stats" it worked for me. Try switching around the order, otherwise replace alias coz_aao_ga_cri cri with alias coz_aao_ga_cri cri unless $@.

**
Rep: +0/-0Level 69
RMRK Junior
Sorry for 'ressurecting' this thread.. but this is very relevant to the topic at hand. I'm using Tankentai SBS (ATB) and I am recieving the stacking error. Your fix for melody didn't work with the tankentai. Any way of fixing this?

***
Rep:
Level 74
I'm baaack!
Sorry for 'ressurecting' this thread.. but this is very relevant to the topic at hand. I'm using Tankentai SBS (ATB) and I am recieving the stacking error. Your fix for melody didn't work with the tankentai. Any way of fixing this?

Im using that too and I planned to use your script. I was wondering if it was possible to set these options to states and skills as well as actors...   <(>.>)>

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Which Tankentai battle system are you using? ATB? Without ATB? Kaduki?

**
Rep: +0/-0Level 69
RMRK Junior
ATB - version 3.4. =) (Not Kaduki)

Edit: I did notice something however. If you use the critical damage/rate when below 25% life aspect of the script, you get errors in battle. If you remove all reference to that particular option (like I did) and set the script ABOVE tankentai then the script works perfectly fine.... just without that option.
« Last Edit: June 23, 2011, 06:06:07 PM by Verzen »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Hey cozzie, the error is at line 296 of your script. You are accidentally calling the cri method inside the cri method here:

Code: [Select]
  n = coz_aao_ga_cri cri

Just delete the second cri and it should fix the error. You must have accidentally copied it when you copied the alias line.