=begin #============================================================================== ** Effect: Strip Equip Author: Hime Date: Oct 6, 2012 ------------------------------------------------------------------------------ ** Change log Oct 6, 2012 - initial release ------------------------------------------------------------------------------ ** Terms of Use * Free to use in non-commercial projects * Contact me for commercial use * No real support. The script is provided as-is * Will do bug fixes, but no compatibility patches * Features may be requested but no guarantees, especially if it is non-trivial * Preserve this header ------------------------------------------------------------------------------ Adds a "Strip Equip" effect, which allows a skill to remove an equip. You can specify the equip type that should be removed as additional arguments Just tag your item/skill with Where chance is a probability of success, as a float, and x1, x2, x3, ... are etype ID's (eg: 0 is weapon, 1 is shield, ...) Nothing will happen if you don't specify etypes. #============================================================================== =end $imported = {} if $imported.nil? $imported["Effect_StripEquip"] = true #============================================================================== # ** Configuration #============================================================================== module Effect module Strip_Equip #============================================================================== # ** Rest of the script #============================================================================== Effect_Manager.register_effect(:strip_equip) end end module RPG class UsableItem def add_effect_strip_equip(code, data_id, args) args[0] = args[0].to_f (args.size - 1).times {|i| args[i+1] = args[i+1].to_i } @effects.push(RPG::UsableItem::Effect.new(code, data_id, args)) end end end # Enemies could devour actors as well I guess. Easy to implement if you want class Game_Battler < Game_BattlerBase def item_effect_strip_equip(user, item, effect) end end class Game_Actor < Game_Battler def item_effect_strip_equip(user, item, effect) # select random etype prob = effect.value1[0] etype = effect.value1[1..-1].sample if etype slot_id = equip_slots.index(etype) if slot_id > -1 && equips[slot_id] if rand(1) - prob < 0 equipName = equips[slot_id].name change_equip(slot_id, nil) @result.effect_results.push("%s's %s was removed!" %[self.name, equipName]) end end end @result.success = true end end