<Skill Prerequisites>
<December 24, 2011>
Summary<<I'm looking for a script that makes it so you can only use certain skills if the user is in a certain state. I know Yanfly has a script like that, the custom skill effects script... but it's not compatible with tankentai that I know of. It displays attack animations wrong when its implemented.>>
Features Desired
- Prerequisites for skills (states preferred)
- The ability to use gold or HP for skill currency would be cool... but optional
- Full compatibility with the newest version of Tankentai
Mockups<<I don't believe I could post a picture of this>>
Games its been inWhat other scripts are you using?
- These are the ones pertaining to battle~~
- Tankentai
- Regenerate HP/MP - RMVX Version
- Weapon Unleash
- YEZ Job System: Base, Classes, Skill Levels
- YEZ Weapon Mastery Skills
- YEZ Victory Aftermath
- YEZ Battler Stat: DEX, RES
Did you search?<<Yes>>
Where did you search?
- This database
- Google
- RPGRPG Revolution
What did you search for?
- RPMVX Skill Prerequisites
- Custom Skill Effects Compatibility
- Skill Prerequisites for RPG Maker VX
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).
Thanks, Pac! It is christmas here, or rather Christmas eve... By "currency" I mean that it costs gold, or HP instead of MP. But like i said, it was optional. Thank you so much :) I was all distraught cause it canned the whole Idea I had for my warrior. Merry Christmas :)