kyonides 5 Posted January 30 (edited) KSkillNeedsState XP + VX + ACE by Kyonides Arkanthes Introduction Do you need to restrict the usage of a skill by forcing the hero to get a specific state first? Now you can do that! In XP's case Adjust the Constants you can see below as deemed necessary. module KSkillNeedsState SKILL_IDS = [57] STATE_ID = 17 end In VX & VX ACE The only thing you need to do is leaving a very specific note in the skill's note box. _need state ID_ Replace ID with a number. Download the Demos! XP Version # * KSkillNeedsState XP * # # Scripter : Kyonides Arkanthes # 2023-01-29 # * Free as in Beer * # # Adjust the values of the SKILL_ID and STATE_ID Constants at will. module KSkillNeedsState SKILL_IDS = [57] STATE_ID = 17 end class Game_Battler alias :kyon_gm_btlr_skill_can_use? :skill_can_use? def skill_need_state?(skill_id) KSkillNeedsState::SKILL_IDS.include?(skill_id) end def has_state_dependent_skill? state?(KSkillNeedsState::STATE_ID) end def skill_can_use?(skill_id) result = kyon_gm_btlr_skill_can_use?(skill_id) if result and skill_need_state?(skill_id) result = has_state_dependent_skill? end result end end VX Version # * KSkillNeedsState VX * # # Scripter : Kyonides Arkanthes # 2023-01-29 # * Free as in Beer * # # Leave this note _need state ID_ in the Skill's Note box. # There ID stands for any existing State ID. module KSkillNeedsState SKILL_REGEX = /_need state (\d+)_/i end class Game_Battler alias :kyon_gm_btlr_skill_can_use? :skill_can_use? def skill_need_state?(skill) return true if skill.note[KSkillNeedsState::SKILL_REGEX] == nil state?($1.to_i) end def skill_can_use?(skill) result = kyon_gm_btlr_skill_can_use?(skill) result = skill_need_state?(skill) if result result end end VX ACE Version # * KSkillNeedsState ACE * # # Scripter : Kyonides Arkanthes # 2023-01-29 # * Free as in Beer * # # Leave this note _need state ID_ in the Skill's Note box. # There ID stands for any existing State ID. module KSkillNeedsState SKILL_REGEX = /_need state (\d+)_/i end class Game_Battler alias :kyon_gm_btlr_skill_cond_met? :skill_conditions_met? def skill_need_state?(skill) return true if skill.note[KSkillNeedsState::SKILL_REGEX] == nil state?($1.to_i) end def skill_conditions_met?(skill) result = kyon_gm_btlr_skill_cond_met?(skill) result = skill_need_state?(skill) if result result end end Terms & Conditions Free as in beer. Include my nickname in your game credits. Edited January 30 by kyonides Share this post Link to post Share on other sites