Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 ArmorKlass
#1
ArmorKlass

XP + VX + ACE

by Kyonides Arkanthes


Introduction

Change your Hero's class by changing his Body Armor! Shocked

Setup Process
  • You will need to define a Default Class for the Hero.
  • All body armors should be available for everybody.
    VX & ACE
  • Leave a very specific note in all of the existing body armors!
    XP
  • Set the Range of Valid Element IDs that represent all of the available Classes!

XP Script

Code:
# * ArmorKlass XP * #
#   Scripter : Kyonides Arkanthes
#   2023-01-02

# Change a Hero's Class by changing his Body Armor!
# You will need to define a Default Class for the Hero.
# All body armors should be available for everybody.
# Create as many Extra Elements as the existing Classes.
# In the ELEMENT_IDS Constant set the Range of Element IDs.

module ArmorKlass
  ELEMENT_IDS = 17..25
  DEFAULT_CLASS_ID = 1
end

class Game_Actor
  alias :kyon_armor_klass_gm_actor_equip :equip
  def set_equip_class(equip_type, eid)
    return if equip_type != 3
    element_ids = ArmorKlass::ELEMENT_IDS
    if eid > 0
      element_set = $data_armors[@armor3_id].guard_element_set
      ary = element_ids.to_a & element_set
      klass_id = ary[0] - element_ids.first + 1
    else
      klass_id = ArmorKlass::DEFAULT_CLASS_ID
    end
    self.class_id = klass_id if @class_id != klass_id
  end

  def equip(equip_type, eid)
    kyon_armor_klass_gm_actor_equip(equip_type, eid)
    set_equip_class(equip_type, eid)
  end
end

VX Script

Code:
# * ArmorKlass VX * #
#  Scripter : Kyonides Arkanthes
#  2023-01-02

# Change a Hero's Class by changing his Body Armor!
# You will need to define a Default Class for the Hero.
# All body armors should be available for everybody.

# * Armor Note - N stands for a Class ID.
# <class id: N>

module ArmorKlass
  REGEX = /<class id: (\d+)>/i
  DEFAULT_CLASS_ID = 1
end

class Game_Actor
  alias :kyon_armor_klass_gm_actor_ch_eq :change_equip
  alias :kyon_armor_klass_gm_actor_disc_eq :discard_equip
  def set_equip_class(equip_type, item, force=nil)
    return if force.nil? and (item.nil? or equip_type != 3)
    item.note[ArmorKlass::REGEX] unless force
    klass_id = $1 ? $1.to_i : ArmorKlass::DEFAULT_CLASS_ID
    self.class_id = klass_id if @class_id != klass_id
  end

  def change_equip(equip_type, item, test=false)
    kyon_armor_klass_gm_actor_ch_eq(equip_type, item, test)
    set_equip_class(equip_type, item) unless test
  end

  def discard_equip(item)
    kyon_armor_klass_gm_actor_disc_eq(item)
    return unless item.is_a?(RPG::Armor) and @armor2_id == item.id
    set_equip_class(2, item, true)
  end
end

ACE Script

Code:
# * ArmorKlass ACE * #
#  Scripter : Kyonides Arkanthes
#  2023-01-02

# Change a Hero's Class by changing his Body Armor!
# You will need to define a Default Class for the Hero.
# All body armors should be available for everybody.

# * Armor Note - N stands for a Class ID.
# <class id: N>

module ArmorKlass
  REGEX = /<class id: (\d+)>/i
  DEFAULT_CLASS_ID = 1
end

class Game_Actor
  alias :kyon_armor_klass_gm_actor_ch_eq :change_equip
  alias :kyon_armor_klass_gm_actor_force_ch_eq :force_change_equip
  alias :kyon_armor_klass_gm_actor_disc_eq :discard_equip
  def set_equip_class(slot_id, item, force=nil)
    return if force.nil? and (item.nil? or slot_id != 3)
    item.note[ArmorKlass::REGEX] unless force
    klass_id = $1 ? $1.to_i : ArmorKlass::DEFAULT_CLASS_ID
    change_class(klass_id) if @class_id != klass_id
  end

  def change_equip(slot_id, item)
    kyon_armor_klass_gm_actor_ch_eq(slot_id, item)
    set_equip_class(slot_id, item)
  end

  def force_change_equip(slot_id, item)
    kyon_armor_klass_gm_actor_force_ch_eq(slot_id, item)
    set_equip_class(slot_id, item)
  end

  def discard_equip(item)
    kyon_armor_klass_gm_actor_disc_eq(item)
    set_equip_class(slot_id, item, true) if slot_id == 3
  end
end



Terms & Conditions

Free for use anywhere.
Just mention me in your game credits.
I really hope this won't be the only script of mine that you will include in your game project.
"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 }
#2
Some Light Armored Update! 

Well guys, I had to come back to this very same thread to make sure that all of the Ruby RGSS based Makers had their own version of my ArmorKlass script available here. And just before people would start complaining about not understanding such a simple Editor script, I have uploaded 3 demos to Mediafire already. Winking

Happy New Year!
"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 }




Users browsing this thread: