#==============================================================================
# ** [VX]Passive_Skills
#------------------------------------------------------------------------------
# By: Gando
# 27/5 2008
#------------------------------------------------------------------------------
# INTRODUCTION
#------------------------------------------------------------------------------
#
# With this script you will be able to create Passive skills.
# And for those of you that doesn't know what passive skills are,
# here is a short explaination:
#
# A passive skill is a skill that cannot be used.
# It just gives "support" to the skills owner, like bonus def, agi, spi, hp etc.
#
#---
#
# I've also added a little feature that removes the "0" from the skill window,
# when a skill doesn't cost any sp. If you for some reason don't want this
# feature, just remove the whole Window_Skill at the bottom of this script.
#
#------------------------------------------------------------------------------
# SETUP
#------------------------------------------------------------------------------
#
# PASSIVE_SKILL - Here are all the passive skills. To add a new skill,
# put the skills id from the database here.
#
# ATTRIBUTES - Here is where you do your passive skills setup.
# The numbers to the left(1=>..., 2=>... etc.) are the id's
# of the skills in PASSIVE_SKILLS. To add a new passive skill
# in ATTRIBUTES, put a comma at the end of the last skill setup
# and put this line below it, and set it up as you want it:
# skill_id => [max_hp, max_mp, def, spi, agi, atk]
#
#
# max_hp - Increaces the max health.
# max_mp - Increaces the max mana.
# def - Increaces the defense.
# spi - Increaces the spirit.
# agi - Increaces the agility.
# atk - Increaces the attack power.
#
#------------------------------------------------------------------------------
# REMEMBER!
#------------------------------------------------------------------------------
#
# Since passive skills are supposed to be "support" skills, they are not meant
# to be used in battle or the menu.
# So remember to Change the Database/Skills/Occasion to never.
# Also remember to change the mp cost of the skill to 0.
#
# Of course you can have regular, usable skills and still have the passive bonus.
# It's all up to you how you want the skills to work.
#
#------------------------------------------------------------------------------
# CREDITS: Gando
#==============================================================================
PASSIVE_SKILLS = [1, 2, 3, 4, 5, 57]
#skill_id => [max_hp, max_mp, def, spi, agi, atk]
ATTRIBUTES =
{
1 => [999, 999, 999, 999, 999, 999, 999] ,
2 => [0, 100, 0, 0, 0, 0, 0] ,
3 => [1, 1, 1, 1, 1, 1, 1] ,
4 => [0, 0, 0, 0, 0, 0, 0] ,
5 => [10, 10, 5, 5, 5, 5, 5] ,
57 => [0, 0, 100, 100, 100, 100, 100]
}
class Game_Actor < Game_Battler
alias passive_skill_learn learn_skill
alias passive_skill_forget forget_skill
#--------------------------------------------------------------------------
# * Get Actor ID
#--------------------------------------------------------------------------
def learn_skill(skill_id)
passive_skill_learn(skill_id)
if PASSIVE_SKILLS.include?(skill_id)
@maxhp_plus += ATTRIBUTES[skill_id][0]
@maxmp_plus += ATTRIBUTES[skill_id][1]
@def_plus += ATTRIBUTES[skill_id][2]
@spi_plus += ATTRIBUTES[skill_id][3]
@agi_plus += ATTRIBUTES[skill_id][4]
@atk_plus += ATTRIBUTES[skill_id][5]
end
end
def forget_skill(skill_id)
passive_skill_forget(skill_id)
if PASSIVE_SKILLS.include?(skill_id)
@maxhp_plus -= ATTRIBUTES[skill_id][0]
@maxmp_plus -= ATTRIBUTES[skill_id][1]
@def_plus -= ATTRIBUTES[skill_id][2]
@spi_plus -= ATTRIBUTES[skill_id][3]
@agi_plus -= ATTRIBUTES[skill_id][4]
@atk_plus -= ATTRIBUTES[skill_id][5]
end
end
end
#==============================================================================
# ** Window_Skill
#------------------------------------------------------------------------------
# This will hide the zero if the skill doesn't cost any SP.
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
skill = @data[index]
if skill != nil
rect.width -= 4
enabled = @actor.skill_can_use?(skill)
draw_item_name(skill, rect.x, rect.y, enabled)
if @data[index].mp_cost != 0
self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2)
end
end
end
end