# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Actor Default Equipment ║ Version: 1.00 ║
# ║ Author: Roninator2 ║ ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function: ║ Date Created ║
# ║ ╠════════════════════╣
# ║ Equip basic equipment on actor ║ 18 Sep 2021 ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ When an actor has a slot unequipped, this will ║
# ║ automatically equip a base item for that slot. ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions: ║
# ║ Specify the equipment for each actor ║
# ║ { # actor 1 ║
# ║ :slot1 => [1,1], # short sword ║
# ║ 0 = items, 1 = weapons, 2 = armour : item number ║
# ║ items are included in case you have items equippable ║
# ║ :slot2 => [2,46], # wood shield ║
# ║ :slot3 => [2,6], # Bandana ║
# ║ :slot4 => [2,1], # casual clothes ║
# ║ :slot5 => [2,51], # amulet ║
# ║ }, ║
# ║ ║
# ║ Add or remove slots to accomdate your game. ║
# ║ Add or remove sections to accomdate your game. ║
# ║ ║
# ║ Always remember the comma after each closing ║
# ║ curly bracket ║
# ║ ║
# ║ You are responsible for making sure the actor can equip ║
# ║ the item, otherwise the slot will be blank when ║
# ║ removing the item in the current slot. ║
# ║ ║
# ║ Due to the nature of equipping items, it is recommended ║
# ║ that you use items the player cannot sell, and cannot ║
# ║ obtain anywhere. That way the default items are not ║
# ║ saved in the inventory. ║
# ║ ║
# ║ This script will delete items from the party inventory ║
# ║ if the player tries to remove the item intended to be ║
# ║ a base item. This is to prevent someone from simply ║
# ║ trying to remove the item to an empty slot and gaining ║
# ║ the base items for free, since this script does not ║
# ║ check party inventory. ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use: ║
# ║ Free for all uses in RPG Maker ║
# ╚═════════════════════════════════════╝
module R2_Equip_defaults
# actors 1-10 included here
ACTORS = [
{ # actor 0 - not used - example
:slot0 => [1,1], # short sword
:slot1 => [2,46], # wood shield
:slot2 => [2,6], # bandana
:slot3 => [2,1], # casual clothes
:slot4 => [2,51], # amulet
},
{ # actor 1
:slot0 => [1,1],
:slot1 => [2,46],
:slot2 => [2,6],
:slot3 => [2,1],
:slot4 => [2,51],
},
{ # actor 2
:slot0 => [1,1],
:slot1 => [2,46],
:slot2 => [2,6],
:slot3 => [2,1],
:slot4 => [2,51],
},
{
:slot0 => [1,1],
:slot1 => [2,46],
:slot2 => [2,6],
:slot3 => [2,1],
:slot4 => [2,51],
},
{
:slot0 => [1,1],
:slot1 => [2,46],
:slot2 => [2,6],
:slot3 => [2,1],
:slot4 => [2,51],
},
{
:slot0 => [1,1],
:slot1 => [2,46],
:slot2 => [2,6],
:slot3 => [2,1],
:slot4 => [2,51],
},
{
:slot0 => [1,1],
:slot1 => [2,46],
:slot2 => [2,6],
:slot3 => [2,1],
:slot4 => [2,51],
},
{
:slot0 => [1,1],
:slot1 => [2,46],
:slot2 => [2,6],
:slot3 => [2,1],
:slot4 => [2,51],
},
{
:slot0 => [1,1],
:slot1 => [2,46],
:slot2 => [2,6],
:slot3 => [2,1],
:slot4 => [2,51],
},
{
:slot0 => [1,1],
:slot1 => [2,46],
:slot2 => [2,6],
:slot3 => [2,1],
:slot4 => [2,51],
},
]
end
# ╔═════════════════════════════════════╗
# ║ Do not edit past here ║
# ╚═════════════════════════════════════╝
class Game_Actor < Game_Battler
def change_equip(slot_id, item)
return unless trade_item_with_party(item, equips[slot_id])
return if item && equip_slots[slot_id] != item.etype_id
@equips[slot_id].object = item
eslot = R2_Equip_defaults::ACTORS[id]
case slot_id
when 0
data = eslot[:slot0]
when 1
data = eslot[:slot1]
when 2
data = eslot[:slot2]
when 3
data = eslot[:slot3]
when 4
data = eslot[:slot4]
end
slottype = data[0]
case slottype
when 0
item2 = $data_items[data[1]]
when 1
item2 = $data_weapons[data[1]]
when 2
item2 = $data_armors[data[1]]
end
if item == nil
@equips[slot_id].object = item2
$game_party.lose_item(item2, 1, false) if $game_party.has_item?(item2, false)
end
if $game_party.has_item?(item2, false)
$game_party.lose_item(item2, 1, false)
end
refresh
end
end