#==============================================================================# # ** IEX(Icy Engine Xelion) - Equipment Skills #------------------------------------------------------------------------------# # ** Created by : IceDragon (http://www.rpgmakervx.net/) # ** Script-Status : Addon (Equipment) # ** Script Type : Skills from Equipment # ** Date Created : 10/22/2010 # ** Date Modified : 11/05/2010 # ** Version : 1.0 #------------------------------------------------------------------------------# #==============================================================================# # ** INTRODUCTION #------------------------------------------------------------------------------# # The script is a bit primitive, once a an item is equipped the wielder/equipee # will have access to whatever skill is stated. # If the item is removed, the skills go with it. # #------------------------------------------------------------------------------# #==============================================================================# # ** FEATURES #------------------------------------------------------------------------------# # V1.0 # Notetags! Can be placed in Equipment noteboxes #------------------------------------------------------------------------------# # (or) # #------------------------------------------------------------------------------# #==============================================================================# # ** HOW TO USE #------------------------------------------------------------------------------# # In an equipments notebox (Weapon or Armor) # put or # The actor will gain the skills marked by Id while that piece of equipment # is equipped. # #------------------------------------------------------------------------------# #==============================================================================# # ** CHANGE LOG #------------------------------------------------------------------------------# # # 10/22/2010 - V1.0 Finished Script # #------------------------------------------------------------------------------# #==============================================================================# # ** KNOWN ISSUES #------------------------------------------------------------------------------# # Non at the moment. # #------------------------------------------------------------------------------# $imported = {} if $imported == nil $imported["IEX_Equipment_Skills"] = true #============================================================================== # ** IEX::REGEXP::EQUIPMENT_SKILLS #------------------------------------------------------------------------------ #============================================================================== module IEX module REGEXP module EQUIPMENT_SKILLS EQUIPMENT_SKILL = /<(?:EQUIP_SKILL|equip skill)s?:?[ ]*(\d+(?:\s*,\s*\d+)*)>/i end end end #============================================================================== # ** RPG::BaseItem #------------------------------------------------------------------------------ #============================================================================== class RPG::BaseItem alias iex_equipment_skilss_rpgbi_initialize initialize unless $@ def initialize(*args) iex_equipment_skilss_rpgbi_initialize(*args) iex_skill_equipment_cache end def iex_skill_equipment_cache @iex_equip_skills = [] self.note.split(/[\r\n]+/).each { |line| case line when IEX::REGEXP::EQUIPMENT_SKILLS::EQUIPMENT_SKILL $1.scan(/\d+/).each { |skill_id| @iex_equip_skills.push(skill_id.to_i) } end } end def iex_equip_skills iex_skill_equipment_cache if @iex_equip_skills == nil return @iex_equip_skills end end #============================================================================== # ** Game_Actor #------------------------------------------------------------------------------ #============================================================================== class Game_Actor < Game_Battler def equipment_skills result = [] for eq in equips next if eq == nil for ski_id in eq.iex_equip_skills next if ski_id == nil result |= [$data_skills[ski_id]] end end return result end alias iex_equipment_skilss_ga_skills skills unless $@ def skills result = iex_equipment_skilss_ga_skills result |= equipment_skills return result end end