Try this:
#==============================================================================
# Skill Teaching Weapons
# Version 1.0
# Author: modern algebra (rmrk.net)
# Date: January 27, 2008
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Instructions:
# Insert this script just above Main. To configure your database, see the
# Configuration Section at line 23
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** RPG::Weapon
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Adds an additional stat, skill id, to the weapon object
#==============================================================================
class RPG::Weapon
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Skill ID
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def skill_id
learn_skill = 0
case @id
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * CONFIGURATION
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# It is very easy to configure the database. All that you need to do
# is write:
#
# when <weapon ID>
# learn_skill = <skill_id>
#
# For every weapon that you want to teach skills. To discover what the
# ID of a weapon or a skill, look at the number directly to the left
# of their names in the Database. There are two examples below. Feel
# free to delete them once you understand what you need to do.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
when 1 # Bronze Sword
learn_skill = 1 # Heal
when 2 # Iron Sword
learn_skill = 69 # Poison Edge
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * END CONFIGURATION
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
end
return learn_skill
end
end
#==============================================================================
# ** Game_Actor (addition for skill teaching weapons)
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Change Equipment
# equip_type : type of equipment
# id : weapon or armor ID (If 0, remove equipment)
#--------------------------------------------------------------------------
alias ma_skill_teaching_weapons_change_equipment equip
def equip (equip_type, id)
# Forget the skill from the previously equipped weapon
forget_skill ($data_weapons[@weapon_id].skill_id) if equip_type == 0 && @weapon_id != 0
# Run original method
ma_skill_teaching_weapons_change_equipment (equip_type, id)
# Learn the skill from the weapon just equipped
learn_skill ($data_weapons[@weapon_id].skill_id) if equip_type == 0 && @weapon_id != 0
end
#--------------------------------------------------------------------------
# * Setup
# actor_id : actor ID
#--------------------------------------------------------------------------
alias ma_skill_teaching_weapons_actor_setup setup
def setup(actor_id)
# Run original method
ma_skill_teaching_weapons_actor_setup (actor_id)
# If there is a skill attached to weapon, learn it
learn_skill ($data_weapons[@weapon_id].skill_id) if @weapon_id != 0
end
end
I think I will put that in my scriptlets too :<
EDIT:: Tell me if anything goes wrong :O)