# Ninja Throw script by LockeZ
# Allows any skill to consume either an item or a weapon
# Utilize for whatever you want, no credit necessary
class Game_BattlerBase
attr_accessor :ninja_throw_skill_items
attr_accessor :ninja_throw_skill_weapons
alias ninja_throw_initialize initialize
def initialize
@ninja_throw_skill_items = {}
@ninja_throw_skill_weapons = {}
# Add your game's skills that use up items below this line. Examples follow.
@ninja_throw_skill_items[30] = 3 # Skill #30 requires item #3
@ninja_throw_skill_items[31] = 5 # Skill #31 requires item #5
@ninja_throw_skill_weapons[32] = 5 # Skill #32 requires weapon #5
# Don't edit stuff below this line.
ninja_throw_initialize
end
alias ninja_throw_skill_cost_payable? skill_cost_payable?
def skill_cost_payable?(skill)
if @ninja_throw_skill_items[skill.id] != nil
unless $game_party.has_item?($data_items[@ninja_throw_skill_items[skill.id]])
return false
end
end
if @ninja_throw_skill_weapons[skill.id] != nil
unless $game_party.has_item?($data_weapons[@ninja_throw_skill_weapons[skill.id]])
return false
end
end
ninja_throw_skill_cost_payable?(skill)
end
alias ninja_throw_pay_skill_cost pay_skill_cost
def pay_skill_cost(skill)
if @ninja_throw_skill_items[skill.id] != nil
$game_party.lose_item($data_items[@ninja_throw_skill_items[skill.id]], 1)
end
if @ninja_throw_skill_weapons[skill.id] != nil
$game_party.lose_item($data_weapons[@ninja_throw_skill_weapons[skill.id]], 1)
end
ninja_throw_pay_skill_cost(skill)
end
end