KBlueMage XP
#1
KBlueMage XP

Version: 1.2.1

by Kyonides (Kyonides-Arkanthos)


Introduction

This script is simple in premise, too. If you do not know what a blue mage is, then keep in mind that is a mage who learns skills after being hit by them. I know, it is kind of sadomasochist but Final Fantasy games might be as well. I am aware of the fact that there are other blue mage scripts but I did not care for some weird, unknown reason.

You may also like to pick some states to prevent blue mages from learning new skills. You may enable / disable this by editing the STATESSTOPBML constant boolean value.

Now you can make them fail to learn a new skill every so often, the success rates are configurable. Just take a look at the built-in instructive comments.

You could also force the blue mage to equip an specific accessory before learning a specific set of skills

Demo

Nah, it is not necessary, especially if you are using the XP Default BS.


Script Version 1.2.1

Code:
#  KBlueMage XP - Default BS Version
#  v 1.2.1 - 2012-12-23
#  v 1.0   - 2012-08-26
#  Scripter: Kyonides-Arkanthos

#  No script call needed

module BlueSys
  # Hero IDs - They will learn skills right after being hit by them
  BLUEMAGES = [8]
  # Skill IDs - 0 : all IDs, any other number : those skills can be learned
  BLUEMAGIC = [0]
  # Skill IDs - Any number : Blue mages cannot learn them
  NOBMLEARNING = []
  # State IDs - States that may prevent blue mages from learning skills
  ANTIBMSTATES = []#[3, 6, 12]
  # Boolean (true or false) - States may prevent you from learning skills
  STATESTOPBML = false#true
  # String - Tell the player that he or she learned a new skill
  BMLEARNED = ' aprendiĆ³ la habilidad de '
  # This version of my script adds the possibility of failing to learn a skill
  # Set to true if you want to always learn the skill, false if you feel lucky
  IGNORESUCCESSRATES = false
  # How probable is it for the Blue Mage to learn a skill after being hit
  # First Level..Last Level => Multiples of 5
  SUCCESSRATES = { 1..9 => 15, 10..21 => 20,
    22..38 => 25, 39..62 => 30,
    63..87 => 35, 88..100 => 40 }
  # NO NEED TO EQUIP ACCESSORIES to allow BM to learn some skills: true or false
  IGNOREACCESSORIES = false
  # Accessory ID => Array of Skill IDs
  ACCESSORIES = { 28 => [8, 11] }
  @bmlearned = [] # Leave It Alone!!
  def self.learned_skill(actor_name, skill)
    @bmlearned << [actor_name, $data_skills[skill].name]
  end

  def self.new_skills; @bmlearned end

  def self.clear_skills; @bmlearned.clear end
end

class Array
  def shuffle
    hsh = {}
    self.size.times {|n| index = rand(1000000)
      index = !hsh.keys.include?(index)? n : n + rand(1000000)
      hsh[index] = self[n] }
    hsh.values
  end

  def shuffle!() self[0..-1] = self.shuffle end
end

class Game_Actor
  alias kyon_blue_magic_gm_act_sk_eff skill_effect
  def skill_effect(user, skill)
    effective = kyon_blue_magic_gm_act_sk_eff(user, skill)
    afflicted = antibluemagic_states?
    learn_blue_magic(skill, afflicted, effective)
    return effective
  end

  def antibluemagic_states?
    return false if @states.empty? or !BlueSys::STATESTOPBML
    afflicted = @states.map {|s| break if BlueSys::ANTIBMSTATES.include?(s)}
    return afflicted.nil?
  end

  def learn_blue_magic(skill, afflicted, effective)
    if !afflicted and effective and BlueSys::BLUEMAGES.include?(self.id) and
        (BlueSys::BLUEMAGIC.include?(skill.id) or BlueSys::BLUEMAGIC[0] == 0)
      return if BlueSys::NOBMLEARNING.include?(skill.id)
      unless BlueSys::IGNORESUCCESSRATES
        key = BlueSys::SUCCESSRATES.keys.select {|k| k.include?(@level) }[0]
        success = [true] * (BlueSys::SUCCESSRATES[key] / 5)
        success += [nil] * (20 - success.size)
        success = success[rand(20)]
        return unless success
      end
      unless BlueSys::IGNOREACCESSORIES
        req = BlueSys::ACCESSORIES.select{|a, s| s.include?(skill.id)}.flatten
        armorid_ok = req.empty? ? nil : req[0] == @armor4_id
        return unless req.empty? or armorid_ok
      end
      learned = learn_skill(skill.id)
      BlueSys.learned_skill(self.name, skill.id) if learned
    end
  end
end

class Scene_Battle
  alias kyon_blue_magic_sc_bat_up_ph4_s6 update_phase4_step6
  def update_phase4_step6
    if @wait_count > 0
      @wait_count -= 1
      return
    end
    unless BlueSys.new_skills.empty?
      name, skill = BlueSys.new_skills.shift
      @help_window.set_text(name + BlueSys::BMLEARNED + skill, 1)
      @help_window.visible = true if !@help_window.visible
      @wait_count = 60
    end
    return if @wait_count > 0
    kyon_blue_magic_sc_bat_up_ph4_s6
  end
end


Script Version 1.1

Code:
#  KBlueMage XP - Default BS Version
#  v 1.1 - 2012-12-22
#  v 1.0 - 2012-08-26
#  Scripter: Kyonides-Arkanthos

#  No script call needed

module BlueSys
  # Hero IDs - They will learn skills right after being hit by them
  BLUEMAGES = [8]
  # Skill IDs - 0 : all IDs, any other number : those skills can be learned
  BLUEMAGIC = [0]
  # Skill IDs - Any number : Blue mages cannot learn them
  NOBMLEARNING = []
  # State IDs - States that may prevent blue mages from learning skills
  ANTIBMSTATES = []#[3, 6, 12]
  # Boolean (true or false) - States may prevent you from learning skills
  STATESTOPBML = false#true
  # String - Tell the player that he or she learned a new skill
  BMLEARNED = ' aprendiĆ³ la habilidad de '
  # This version of my script adds the possibility of failing to learn a skill
  # Set to true if you want to always learn the skill, false if you feel lucky
  IGNORESUCCESSRATES = false
  # How probable is it for the Blue Mage to learn a skill after being hit
  # First Level..Last Level => Multiples of 5
  SUCCESSRATES = {1..9 => 75, 10..21 => 20,
    22..38 => 25, 39..62 => 30,
    63..87 => 35, 88..100 => 40}
  @bmlearned = [] # Leave It Alone!!
  def self.learned_skill(actor_name, skill)
    @bmlearned << [actor_name, $data_skills[skill].name]
  end

  def self.new_skills; @bmlearned end

  def self.clear_skills; @bmlearned.clear end
end

class Array
  def shuffle
    hsh = {}
    self.size.times {|n| index = rand(1000000)
      index = !hsh.keys.include?(index)? n : n + rand(1000000)
      hsh[index] = self[n] }
    hsh.values
  end

  def shuffle!() self[0..-1] = self.shuffle end
end

class Game_Actor
  alias kyon_blue_magic_gm_act_sk_eff skill_effect
  def skill_effect(user, skill)
    effective = kyon_blue_magic_gm_act_sk_eff(user, skill)
    afflicted = antibluemagic_states?
    learn_blue_magic(skill, afflicted, effective)
    return effective
  end

  def antibluemagic_states?
    return false if @states.empty? or !BlueSys::STATESTOPBML
    afflicted = @states.map {|s| break if BlueSys::ANTIBMSTATES.include?(s)}
    return afflicted.nil?
  end

  def learn_blue_magic(skill, afflicted, effective)
    if !afflicted and effective and BlueSys::BLUEMAGES.include?(self.id) and
        (BlueSys::BLUEMAGIC.include?(skill.id) or BlueSys::BLUEMAGIC[0] == 0)
      return if BlueSys::NOBMLEARNING.include?(skill.id)
      key = BlueSys::SUCCESSRATES.keys.select {|k| k.include?(@level) }[0]
      success = [true] * (BlueSys::SUCCESSRATES[key] / 5)
      success += [nil] * (20 - success.size)
      success = success[rand(20)]
      return unless success or BlueSys::IGNORESUCCESSRATES
      learned = learn_skill(skill.id)
      BlueSys.learned_skill(self.name, skill.id) if learned
    end
  end
end

class Scene_Battle
  alias kyon_blue_magic_sc_bat_up_ph4_s6 update_phase4_step6
  def update_phase4_step6
    if @wait_count > 0
      @wait_count -= 1
      return
    end
    unless BlueSys.new_skills.empty?
      name, skill = BlueSys.new_skills.shift
      @help_window.set_text(name + BlueSys::BMLEARNED + skill, 1)
      @help_window.visible = true if !@help_window.visible
      @wait_count = 60
    end
    return if @wait_count > 0
    kyon_blue_magic_sc_bat_up_ph4_s6
  end
end

Script Version 1.0

Code:
#  KBlueMage XP - Default BS Version
#  v 1.0 - 2012-08-26
#  Scripter: Kyonides

#  No script call needed

module BlueSys
  # Hero IDs - They will learn skills right after being hit by them
  BLUEMAGES = [5]
  # Skill IDs - 0 : all IDs, any other number : those skills can be learned
  BLUEMAGIC = [0]
  # Skill IDs - Any number : Blue mages cannot learn them
  NOBMLEARNING = []
  # State IDs - States that may prevent blue mages from learning skills
  ANTIBMSTATES = [3, 6, 12]
  # Boolean (true or false) - States may prevent you from learning skills
  STATESTOPBML = true
  # String - Tell the player that he or she learned a new skill
  BMLEARNED = ' aprendiĆ³ la habilidad de '
  @bmlearned = [] # Leave It Alone!!
  def self.learned_skill(actor_name, skill)
    @bmlearned << [actor_name, $data_skills[skill].name]
  end

  def self.new_skills; @bmlearned end

  def self.clear_skills; @bmlearned.clear end
end

class Game_Actor
  alias kyon_blue_magic_gm_act_sk_eff skill_effect
  def skill_effect(user, skill)
    effective = kyon_blue_magic_gm_act_sk_eff(user, skill)
    afflicted = antibluemagic_states?
    learn_blue_magic(skill, afflicted, effective)
    return effective
  end

  def antibluemagic_states?
    return false if @states.empty? or !BlueSys::STATESTOPBML
    afflicted = @states.map {|s| break if BlueSys::ANTIBMSTATES.include?(s)}
    return afflicted.nil? ? true : false
  end

  def learn_blue_magic(skill, afflicted, effective)
    if !afflicted and effective and BlueSys::BLUEMAGES.include?(self.id) and
        (BlueSys::BLUEMAGIC.include?(skill.id) or BlueSys::BLUEMAGIC[0] == 0)
      return if BlueSys::NOBMLEARNING.include?(skill.id)
      learned = learn_skill(skill.id)
      BlueSys.learned_skill(self.name, skill.id) if learned
    end
  end
end

class Scene_Battle
  alias kyon_blue_magic_sc_bat_up_ph4_s6 update_phase4_step6
  def update_phase4_step6
    if @wait_count > 0
      @wait_count -= 1
      return
    end
    unless BlueSys.new_skills.empty?
      name, skill = BlueSys.new_skills.shift
      @help_window.set_text(name + BlueSys::BMLEARNED + skill, 1)
      @help_window.visible = true if !@help_window.visible
      @wait_count = 60
    end
    return if @wait_count > 0
    kyon_blue_magic_sc_bat_up_ph4_s6
  end
end


Instructions

Paste below Scene_Debug and above Main. After that, check the Constants included in BlueSys module, edit them and that is pretty much all you need to do besides testing your demo.


FAQ

Nothing to say, yet.


Compatibility

Designed for RPG Maker XP. The little window telling you about having learned a new skill as a blue mage is just for XP Default BS.


Terms and Conditions

Free for use but not meant for commercial projects. Due credit is not optional but a must.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Messages In This Thread
KBlueMage XP - by kyonides - 08-26-2012, 08:53 PM
RE: KBlueMage XP - by kyonides - 12-23-2012, 05:04 AM
RE: KBlueMage XP - by kyonides - 12-23-2012, 09:58 AM



Users browsing this thread: 2 Guest(s)