Group: Member
Posts: 3
Type: None
RM Skill: Undisclosed
I was trying not to ask for help my first day on these forums, but I'm getting a bit frustrated and impatient, haha. So the script below is one I found on the net by a man named Krade that when a certain Armor/Accessory is equipped, it gives a skill, in this case an Antidote Seal gives the skill Purge. The only problem is the skill stays greyed out and unusuable, but if I don't use the script/Antidote Seal and give them the skill via leveling, it works just fine. Scripting is still brand new to me, so I don't know if It's a simple error or not, but if someone could look it over I'd greatly appreciate it.
alias krade_es_setup setup def setup(actor_id) krade_es_setup(actor_id) check_equipment_skills end
alias krade_es_equip equip def equip(equip_type, id) krade_es_equip(equip_type, id) # New weapon/armor equipped, recheck skills check_equipment_skills end
def check_equipment_skills # Clear array @equipment_skills = [] # Add the skills of the current equipment @equipment_skills << EQUIPMENT_SKILLS::WEAPONS[@weapon_id] if EQUIPMENT_SKILLS::WEAPONS[@weapon_id] != nil @equipment_skills << EQUIPMENT_SKILLS::ARMORS[@armor1_id] if EQUIPMENT_SKILLS::ARMORS[@armor1_id] != nil @equipment_skills << EQUIPMENT_SKILLS::ARMORS[@armor2_id] if EQUIPMENT_SKILLS::ARMORS[@armor2_id] != nil @equipment_skills << EQUIPMENT_SKILLS::ARMORS[@armor3_id] if EQUIPMENT_SKILLS::ARMORS[@armor3_id] != nil @equipment_skills << EQUIPMENT_SKILLS::ARMORS[@armor4_id] if EQUIPMENT_SKILLS::ARMORS[@armor4_id] != nil end
def skills # Array containing all skills all_skills = @skills.clone # Add all equipment skills to the class skills if it doesn't have them yet for s in @equipment_skills all_skills << s if not all_skills.include? s end # Return all skills return all_skills end
alias krade_es_setup setup def setup(actor_id) krade_es_setup(actor_id) check_equipment_skills end
alias krade_es_equip equip def equip(equip_type, id) krade_es_equip(equip_type, id) # New weapon/armor equipped, recheck skills check_equipment_skills end
def check_equipment_skills # Clear array @equipment_skills = [] # Add the skills of the current equipment @equipment_skills << EQUIPMENT_SKILLS::WEAPONS[@weapon_id] if EQUIPMENT_SKILLS::WEAPONS[@weapon_id] != nil @equipment_skills << EQUIPMENT_SKILLS::ARMORS[@armor1_id] if EQUIPMENT_SKILLS::ARMORS[@armor1_id] != nil @equipment_skills << EQUIPMENT_SKILLS::ARMORS[@armor2_id] if EQUIPMENT_SKILLS::ARMORS[@armor2_id] != nil @equipment_skills << EQUIPMENT_SKILLS::ARMORS[@armor3_id] if EQUIPMENT_SKILLS::ARMORS[@armor3_id] != nil @equipment_skills << EQUIPMENT_SKILLS::ARMORS[@armor4_id] if EQUIPMENT_SKILLS::ARMORS[@armor4_id] != nil end
def skills # Array containing all skills all_skills = @skills.clone # Add all equipment skills to the class skills if it doesn't have them yet for s in @equipment_skills all_skills << s if not all_skills.include? s end # Return all skills return all_skills end
alias nr_es_skill_can_use? skill_can_use? def skill_can_use?(skill_id) # If it can use the skill, then do so return true if nr_es_skill_can_use?(skill_id) # If the skill can't normally be used, but the weapons allow it # say it can be used for weapon_skill_id in @equipment_skills return true if weapon_skill_id == skill_id end # Otherwise, it's definitely false return false end
end
That should fix it up.
__________________________
K.I.S.S. Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.