Merry Christmas script!
# Skill State Prerequisites
# By Pacman (25/12/11 - CHRISTAMAS SCRIPT!)
# Use the tag:
# <need state: x>
# <need state: x, y, z>
# where x (y and z) is (are) an integer(s) in the notebox of a skill to make
# the skill require the states with those IDs to work. Therefore, if you put
# <need state: 2> in a skill's notebox, the skill requires the state with ID
# 2 to work. If you put:
# <need state: 3, 6> in the notebox, it requires both states with IDs 3 and 6.
# Insert this near the bottom of your custom script list.
class RPG::Skill
def need_states
return @need_states if !@need_states.nil?
@need_states = []
self.note.split(/[\r\n]+/).each { |line|
case line
when /<(?:NEED STATE|need_state|NEEDSTATE):[ ](\d+(?:\s*,\s*\d+)*)>/i
$1.scan(/\d+/).each { |num|
@need_states.push($data_states[num.to_i]) if num.to_i > 0
}
end
}
return @need_states
end
end
class Game_Battler
alias skipre_skill_can_use? skill_can_use?
def skill_can_use?(skill, *args)
return false unless skill.is_a?(RPG::Skill)
sstates = skill.need_states
for state in sstates
return false unless states.include?(state)
end
return skipre_skill_can_use?(skill, *args)
end
end
I didn't do the currency thing, because I'm not quite sure what you meant by that.
MERRY CHRISTMAS (it might not be Christmas for you yet, but it is for me).