Skill Verbs (RPG Maker VX Ace Script)

I should have been finishing an intro to a game instead now my skill names (and icons) change based on my equipped weapon.

=begin
Skill Verbs
by Fomar0153
Version 1.0
----------------------
Notes
----------------------
This script lets you change skill names (and icons) based on your equipped weapon.
----------------------
Instructions
----------------------
Change the three settings below.
VERB_ICON is what identifies the skills that this script should apply to.
VERB_STRING is what you want to change in the skill name.
WEAPONS is an array in the same order of the weapon types.
So far example I have a skill called "Power Verb" if I equip a sword it becomes "Power Slash".
The skill icon will become my weapon's icon.

=end
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Constants
  #--------------------------------------------------------------------------
  VERB_ICON = 528
  VERB_STRING = "Verb"
  WEAPONS = [
  "Attack", # no weapon equipped
  "Chop",
  "Slash",
  "Stab",
  "Slash",
  "Slash",
  "Shot",
  "Stab",
  "Smash",
  "Blow",
  "Shot"
  ]
  #--------------------------------------------------------------------------
  # * Draw Item Name
  #     enabled : Enabled flag. When false, draw semi-transparently.
  #--------------------------------------------------------------------------
  alias verbs_draw_item_name draw_item_name
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    return verbs_draw_item_name(item, x, y, enabled, width) unless item.icon_index == VERB_ICON && @actor
    if @actor.weapons[0]
      draw_icon(@actor.weapons[0].icon_index, x, y, enabled)
      change_color(normal_color, enabled)
      draw_text(x + 24, y, width, line_height, item.name.gsub(VERB_STRING,WEAPONS[@actor.weapons[0].wtype_id]))
    else
      change_color(normal_color, enabled)
      draw_text(x + 24, y, width, line_height, item.name.gsub(VERB_STRING,WEAPONS[0]))
    end
  end
end

Leave a comment