#===============================================================================
# Equips with skills
# r Atoaby atoa
#===============================================================================
module Atoa
Weapon_Skills = [] #do not chage this line
Armor_Skills = [] #do not chage this line
# Weapon_Skills[Weapon_ID] = [Skill_ID]
Weapon_Skills[1] = [1]
Weapon_Skills[2] = [2]
# Armor_Skills[Armor_ID] = [Skill_ID]
Armor_Skills[1] = [7]
Armor_Skills[2] = [10]
Armor_Skills[29] = [8]
#Adicione quantas linhas para armas ou armaduras você quiser
end
#===============================================================================
# Game_Actor
#===============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
alias equip_learn_skill_initialize initialize
alias equip_learn_skill_equip equip
#--------------------------------------------------------------------------
def initialize(*args)
@equipment_skills = []
equip_learn_skill_initialize(*args)
gain_equip_skills
end
#--------------------------------------------------------------------------
def equip(equip_type, id)
lose_equip_skills
equip_learn_skill_equip(equip_type, id)
gain_equip_skills
end
#--------------------------------------------------------------------------
def lose_equip_skills
for lose_skills in @equipment_skills
self.forget_skill(lose_skills)
end
@equipment_skills = []
end
#--------------------------------------------------------------------------
def gain_equip_skills
new_skills = Atoa::Weapon_Skills[@weapon_id]
get_new_equip_skill(new_skills)
new_skills = Atoa::Armor_Skills[@armor1_id]
get_new_equip_skill(new_skills)
new_skills = Atoa::Armor_Skills[@armor2_id]
get_new_equip_skill(new_skills)
new_skills = Atoa::Armor_Skills[@armor3_id]
get_new_equip_skill(new_skills)
new_skills = Atoa::Armor_Skills[@armor4_id]
get_new_equip_skill(new_skills)
end
#--------------------------------------------------------------------------
def get_new_equip_skill(new_skills)
if new_skills != nil
for learning in new_skills
if !self.skill_learn?(learning) and !@equipment_skills.include?(learning)
@equipment_skills.push(learning)
self.learn_skill(learning)
end
end
end
end
#--------------------------------------------------------------------------
def exp=(exp)
lose_equip_skills
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
while @exp < @exp_list[@level]
@level -= 1
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
gain_equip_skills
end
end