1개이상의 악세사리 슬롯 혹은 더많은 장비 슬롯이 필요할때 사용하면 좋을듯 ^^
=begin
Custom Equipment Slots Script
by Fomar0153
Version 1.1
----------------------
Notes
----------------------
No requirements
Allows you to customise what equipment characters can equip
e.g. add new slots or increase the number of accessories.
----------------------
Instructions
----------------------
You will need to edit the script in two locations both are near
the top of the script look for:
Slots[7] = "Spell Tomes"
return [0,0,2,3,4,4,4,7] if dual_wield?
and follow the instructions where they are.
----------------------
Changle Log
----------------------
1.0 -> 1.1 : Fixed a bug that caused a crash when equipping a weapon.
----------------------
Known bugs
----------------------
None
=end
#--------------------------------------------------------------------------
# ● New Module Extra_Slots
#--------------------------------------------------------------------------
module Extra_Slots
Slots = []
# Edit here to add new slot types
# Slots[armour_type_id] = "name"
# I know it is named in the database but I don't believe you can access
# that name through Vocab
Slots[7] = "Spell Tomes"
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● Rewrites equip_slots
#--------------------------------------------------------------------------
# Edit here to change what slots are available to your characters
# 0 - Weapon
# 1 - Shield
# 2 - Head
# 3 - Body
# 4 - Accessory
# 5+ a custom slot
def equip_slots
return [0,0,2,3,4,4,4,7] if dual_wield?
return [0,1,2,3,4,4,4,7]
end
#--------------------------------------------------------------------------
# ● Rewrites change_equip
#--------------------------------------------------------------------------
def change_equip(slot_id, item)
return unless trade_item_with_party(item, equips[slot_id])
if item == nil
return if item && equip_slots[slot_id] != item.etype_id
else
if item.is_a?(RPG::Armor)
if Extra_Slots::Slots[item.atype_id] == nil
return if item && equip_slots[slot_id] != item.etype_id
else
return if item && equip_slots[slot_id] != item.atype_id
end
else
return if item && equip_slots[slot_id] != item.etype_id
end
end
@equips[slot_id].object = item
refresh
end
#--------------------------------------------------------------------------
# ● Rewrites release_unequippable_items
#--------------------------------------------------------------------------
def release_unequippable_items(item_gain = true)
@equips.each_with_index do |item, i|
if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
if item.is_armor?
unless Extra_Slots::Slots[equip_slots[i]] == nil
unless item.object.atype_id == equip_slots[i]
trade_item_with_party(nil, item.object) if item_gain
item.object = nil
end
else
trade_item_with_party(nil, item.object) if item_gain
item.object = nil
end
else
trade_item_with_party(nil, item.object) if item_gain
item.object = nil
end
end
end
end
end
class Window_EquipSlot < Window_Selectable
#--------------------------------------------------------------------------
# ● Rewrites slot_name
#--------------------------------------------------------------------------
def slot_name(index)
if @actor.equip_slots[index] >= 5
Extra_Slots::Slots[@actor.equip_slots[index]]
else
@actor ? Vocab::etype(@actor.equip_slots[index]) : ""
end
end
end
class Window_EquipItem < Window_ItemList
#--------------------------------------------------------------------------
# ● Rewrites include?
#--------------------------------------------------------------------------
def include?(item)
return true if item == nil
return false unless item.is_a?(RPG::EquipItem)
return false if @slot_id < 0
if item.is_a?(RPG::Armor)
if Extra_Slots::Slots[item.atype_id] == nil
return false if item.etype_id != @actor.equip_slots[@slot_id]
else
return false if item.atype_id != @actor.equip_slots[@slot_id]
end
else
return false if item.etype_id != @actor.equip_slots[@slot_id]
end
return @actor.equippable?(item)
end
end
class Scene_Equip < Scene_MenuBase
#--------------------------------------------------------------------------
# ● Aliases create_slot_window
#--------------------------------------------------------------------------
alias custom_slots_create_slot_window create_slot_window
def create_slot_window
custom_slots_create_slot_window
@slot_window.create_contents
@slot_window.refresh
end
#--------------------------------------------------------------------------
# ● Aliases on_actor_change
#--------------------------------------------------------------------------
alias custom_slots_on_actor_change on_actor_change
def on_actor_change
custom_slots_on_actor_change
@slot_window.create_contents
@slot_window.refresh
end
end