Weapons Swap XP
by Kyonides
Introduction
The title makes it extremely clear, but just case here we go: your party members can now swap their weapons at any given time. It will do it either BY FORCE or Lazily (by running a couple of internal checks).
Just call:
Force? is a placeholder for true or false.
Code:
$game_party.swap_weapons(Force?, FirstPosition, SecondPosition)...and it will let you make the change swiftly!
It will ignore your request if for ANY REASON you provide it with identical positions.
To get the corresponding Skill Scripts, click Here!
XP Script
Code:
# * Weapons Swap XP * #
#   Scripter : Kyonides Arkanthes
#   2023-01-15
# - Free for use in Non Commercial Projects - #
# * Script Calls - #
# - Swap Weapons either by Force or by Unequipping Forbidden Weapons
#   Force? stands for true or false.
#   $game_party.swap_weapons(Force?, PartyIndex1, PartyIndex2)
# - Allow Dual Wield alias Two Swords Style
#   $game_actors[ActorID].dual_wield = true
class Game_Actor
  attr_writer :weapon_id, :armor1_id
  attr_accessor :dual_wield
  alias :two_swords_style :dual_wield
  alias :two_swords_style= :dual_wield=
  def equip_weapon?
    $data_classes[@class_id].weapon_set.include?(@weapon_id)
  end
    
  def equip_armor1?
    klass = $data_classes[@class_id]
    if @dual_wield
      return klass.weapon_set.include?(@weapon_id)
    else
      return klass.armor_set.include?(@armor1_id)
    end
  end
  def unequip_weapon
    $game_party.gain_weapon(@weapon_id, 1)
    @weapon_id = 0
    nil
  end
  def unequip_armor1
    $game_party.gain_armor(@armor1_id, 1)
    @armor1_id = 0
    nil
  end
  def swap_weapon(new_id, force=true)
    return unequip_weapon if equip_fix?(0) or (!force and equip_weapon?)
    @weapon_id = new_id
    true
  end
  def swap_armor1(new_id, force=true)
    return unequip_armor1 if equip_fix?(1) or (!force and !equip_armor1?)
    @armor1_id = new_id
    true
  end
end
class Game_Party
  def swap_weapons(force, *indexes)
    return if indexes[0] == indexes[1]
    heroes = indexes.map{|n| @actors[n] }
    r1, r2 = nil, nil
    if heroes[0].dual_wield and heroes[1].dual_wield
      r2 = swap_armor_ids(force, *heroes)
    end
    r1 = swap_weapon_ids(force, *heroes)
    return (r1 or r2)
  end
  private
  def swap_weapon_ids(force, hero1, hero2)
    w1, w2 = hero1.weapon_id, hero2.weapon_id
    r1 = hero1.swap_weapon(w2, force)
    r2 = hero2.swap_weapon(w1, force)
    return (r1 or r2)
  end
  def swap_armor_ids(force, hero1, hero2)
    a1, a2 = hero1.armor1_id, hero2.armor1_id
    r1 = hero1.swap_armor1(a2, force)
    r2 = hero2.swap_armor1(a1, force)
    return (r1 or r2)
  end
endTerms & Conditions
Check out the comments embedded in each script!
 
 Just keep in mind you should mention me in your game credits.

Do Not Repost It!
"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]](https://www.save-point.org/images/userbars/SP1-Scripter.png)
![[Image: SP1-Writer.png]](https://www.save-point.org/images/userbars/SP1-Writer.png)
![[Image: SP1-Poet.png]](https://www.save-point.org/images/userbars/SP1-Poet.png)
![[Image: SP1-PixelArtist.png]](https://www.save-point.org/images/userbars/SP1-PixelArtist.png)
![[Image: SP1-Reporter.png]](https://i.postimg.cc/GmxWbHyL/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!
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
	
	
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]](https://www.save-point.org/images/userbars/SP1-Scripter.png)
![[Image: SP1-Writer.png]](https://www.save-point.org/images/userbars/SP1-Writer.png)
![[Image: SP1-Poet.png]](https://www.save-point.org/images/userbars/SP1-Poet.png)
![[Image: SP1-PixelArtist.png]](https://www.save-point.org/images/userbars/SP1-PixelArtist.png)
![[Image: SP1-Reporter.png]](https://i.postimg.cc/GmxWbHyL/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!

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

 
 
 Weapons Swap XP
 Weapons Swap XP
 

