Kain Nobel
Member
Okay, I'll keep this short.
I'm basically using a hash to assign weapon ID's with certain skills, what I need to know is how do I pull all the skill id's from the array within the hash? Here's the code snippet I barely started, should speak for itself. If actor is equipped with Weapon ID, then actor learns Skill ID.
I'm basically using a hash to assign weapon ID's with certain skills, what I need to know is how do I pull all the skill id's from the array within the hash? Here's the code snippet I barely started, should speak for itself. If actor is equipped with Weapon ID, then actor learns Skill ID.
Code:
#===============================================================================
# ~** Weapon Skills Script **~
#-------------------------------------------------------------------------------
# Written by : Kain Nobel
# Version : 0.1
# Last Update : 07/09/2008
# Created On : 07/09/2008
#===============================================================================
module Weapons
Skills = {
1 => [1, 2, 3],
2 => [4, 5, 6]
}
end
#===============================================================================
# ** Game_Actor
#-------------------------------------------------------------------------------
# This class has been enhaced to so the actor will 'learn' the skills assigned
# within the Weapon::Skills module.
#===============================================================================
class Game_Actor
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :kn_wpnskills_game_actor_setup, :setup
#-----------------------------------------------------------------------------
# * Object Initialization (*Aliased*)
#-----------------------------------------------------------------------------
def setup(actor_id)
kn_wpnskills_game_actor_setup(actor_id)
for i in 0...$data_weapons.size
if @weapon_id == Weapons::Skills[i]
self.learn_skill(Weapons::Skills[i])
end
end
end
end