Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #═╦═════════════════════════════════════════════════════════════════════════════
- # ║ § Instance Items Anti-Bloat (v1.1) by Enelvon [License: CC BY-SA 3.0]
- # ║ <RMVX Ace>
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Change Log
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ v1.0 (February 16th, 2013) - Script Written
- # ║ v1.1 (February 17th, 2013) - Fixed bug that caused changing equipment to be
- # ║ impossible
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Summary
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ This is an add-on for my Instance Items script that will prevent old
- # ║ instances from being stored after being sold. I had allowed them to remain
- # ║ due to a couple of planned add-ons, but decided to write this for those
- # ║ who would like it.
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Required Scripts
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ SES Core
- # ║ SES - Instance Items
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Known Incompatibilities
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ None so far
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Installation
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ Place this below Materials, the SES Script Core, and Instance Items and
- # ║ above all other non-SES custom scripts (though make sure it's above any
- # ║ other Instance Item extensions, just to be safe).
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Configuration
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ None
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Aliased Methods
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ ● module DataManager
- # ║ self.create_game_objects
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Redefined Methods
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ ● class Game_Party
- # ║ new_item(item, type)
- # ║ lose_item(item, amount, include_equip = false)
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ ▼ module DataManager
- #═╩═════════════════════════════════════════════════════════════════════════════
- module DataManager
- class << self
- alias en_iiab_dm_cgo create_game_objects
- end
- def self.create_game_objects
- en_fs_dm_cgo
- $game_armors, $game_weapons, $game_items =
- {}, {}, {}
- $data_armors.each_with_index do |v,k|
- $game_armors[k] = v
- end
- $data_weapons.each_with_index do |v,k|
- $game_weapons[k] = v
- end
- $data_items.each_with_index do |v,k|
- $game_items[k] = v
- end
- end
- end
- #═╦═════════════════════════════════════════════════════════════════════════════
- # ║ ▲ module DataManager
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ ▼ class Game_Party
- #═╩═════════════════════════════════════════════════════════════════════════════
- class Game_Party < Game_Unit
- def new_item(item, type)
- newi = Marshal.load(Marshal.dump(item))
- newi.old_id = item.id
- #~ newi.instanced = true
- newi.id = eval("$game_#{type}s.keys.max + 1")
- newi = process_new_item(newi)
- eval("$game_#{type}s[newi.id] = newi
- return $game_#{type}s[newi.id]")
- end
- def lose_item(*args)
- args[1] *= -1
- trade_item(*args)
- item = args[0]
- if item && item.unique && !SceneManager.scene == Scene_Equip
- if item.is_a?(RPG::Item) then $game_items.delete(item.id)
- elsif item.is_a?(RPG::Weapon) then $game_weapons.delete(item.id)
- elsif item.is_a?(RPG::Armor) then $game_armors.delete(item.id) end
- end
- end
- end
- #═╦═════════════════════════════════════════════════════════════════════════════
- # ║ ▲ class Game_Party
- #═╩═════════════════════════════════════════════════════════════════════════════
Advertisement
Add Comment
Please, Sign In to add comment