Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 KDualWield & Accessory Skills
#1
KDualWield & Accessory Skills

XP + VX + ACE

by Kyonides


Introduction

Do you want to force your heroes to equip two weapons and probably even an accessory before they can use that super cool skill you have come up with? Thinking 
Now you can do it! Grinning

The XP port works in a totall different way so I am skipping publishing the code here for your minds' sake. Winking

You will need to use 1 out of 2 Note Tags on those Skill Note boxes to make it happen! Winking

VX Script

Code:
# * KDualWield & Accessory Skills VX * #
#  Scripter : Kyonides Arkanthes
#  2023-02-09

# * Free as in beer * #

# Force your heroes to equip specific weapons or even an accessory as well
# in order to be enabled to cast a specific skill.
# NOTE: The Weapons Order does NOT matter here!

# * Note Tags * #
# - For Dual Weapons:        _dual 1 2_
# - For Weapons & Accesory:  _dual 1 2 acc 1_

module KDualWield
  REGEX_WEAPONS = /_dual (\d+) (\d+)_/i
  REGEX_WEAPONS_ACCESSORY = /_dual (\d+) (\d+) acc (\d+)_/i
end

class Game_Battler
  alias :kyon_dual_wpn_skill_can_use? :skill_can_use?
  def skill_can_use?(skill)
    result = kyon_dual_wpn_skill_can_use?(skill)
    return result if self.class == Game_Enemy or !two_swords_style
    if skill.note[KDualWield::REGEX_WEAPONS]
      return both_weapons?($1.to_i, $2.to_i)
    elsif skill.note[KDualWield::REGEX_WEAPONS_ACCESSORY]
      return weapons_acessory?($1.to_i, $2.to_i, $3.to_i)
    end
    result
  end
end

class Game_Actor
  def weapon_ids
    [@weapon_id, @armor1_id]
  end

  def both_weapons?(w1, w2)
    weapon_ids.sort == [w1, w2].sort
  end

  def weapons_acessory?(w1, w2, a1)
    both_weapons?(w1, w2) and @armor4_id == a1
  end
end


VX Ace Script

Code:
# * KDualWield & Accessory Skills ACE * #
#   Scripter : Kyonides Arkanthes
#   2023-02-08

# * Free as in beer * #

# Force your heroes to equip specific weapons or even an accessory as well
# in order to be enabled to cast a specific skill.
# NOTE: The Weapons Order does NOT matter here!

# * Note Tags * #
# - For Dual Weapons:        _dual 1 2_
# - For Weapons & Accesory:  _dual 1 2 acc 1_

module KDualWield
  REGEX_WEAPONS = /_dual (\d+) (\d+)_/i
  REGEX_WEAPONS_ACCESSORY = /_dual (\d+) (\d+) acc (\d+)_/i
end

class Game_Battler
  alias :kyon_dual_wpn_skill_cond_met? :skill_conditions_met?
  def skill_conditions_met?(skill)
    result = kyon_dual_wpn_skill_cond_met?(skill)
    return result if self.class == Game_Enemy or !dual_wield?
    if skill.note[KDualWield::REGEX_WEAPONS]
      return both_weapons?($1.to_i, $2.to_i)
    elsif skill.note[KDualWield::REGEX_WEAPONS_ACCESSORY]
      return weapons_acessory?($1.to_i, $2.to_i, $3.to_i)
    end
    result
  end
end

class Game_Actor
  def equip_weapons
    @equips[0..1].map{|w| w.object ? w.object.id : -1 }
  end

  def both_weapons?(w1, w2)
    equip_weapons.sort == [w1, w2].sort
  end

  def weapons_acessory?(w1, w2, w3)
    both_weapons?(w1, w2) and @equips[4].object.id == w3
  end
end


Terms & Conditions

Free as in Beer beer.
Include me in your game credits!
Do not repost it anywhere!
"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
XP Has Not Been Neglected!

Just as you have read it above, XP has got its own port of KDualWield! Grinning
Happy with a sweat Yet, I have to admit that I have not included any custom equip scene there. I simply added the new methods dual_wield and dual_wield = true or false and that is pretty much all you should care about. Tongue sticking out

Indifferent Of course, you will need to setup a couple of Constants, but that is nothing you have not done before if you have become sort of an expert in using Editor XP Scripts. Laughing
"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 }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Klass Change & Skills kyonides 1 635 05-29-2023, 07:39 AM
Last Post: kyonides
   Draining Skills! / Compatible with ABSes and custom non-active BSes / No SDK required DrHouse93 0 4,350 06-24-2016, 11:43 AM
Last Post: DrHouse93
   DoubleX RMVXA Unison Skills/Items DoubleX 1 6,143 07-23-2015, 11:47 AM
Last Post: DoubleX
   Lycan Slip-Thru Items/Skills DerVVulfman 0 4,397 03-14-2013, 07:02 AM
Last Post: DerVVulfman
   Victor Engine - Cooperation Skills Victor Sant 2 7,905 02-14-2013, 04:44 PM
Last Post: Ace
   Skills : Replacements Kain Nobel 0 4,321 12-29-2012, 07:16 AM
Last Post: Kain Nobel
   MrMo's Item-Using Skills DerVVulfman 0 4,916 04-05-2012, 03:52 AM
Last Post: DerVVulfman
   Passive Skills DVV DerVVulfman 12 21,749 08-03-2011, 03:53 AM
Last Post: DerVVulfman
   Conditional + Combo Skills Trickster 1 7,998 10-21-2010, 04:17 AM
Last Post: DerVVulfman
   FFIX Skills Learning System aka Equipment Skills, NEW!!! v2.3 (8-8-2010) Charlie Fleed 13 26,995 10-13-2010, 05:17 PM
Last Post: Charlie Fleed



Users browsing this thread: