Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- Dekita's v1.0
- ★ Item Limits™ ★
- ================================================================================
- Script Information:
- ====================
- This is a simple script to enable different max item limits for different items
- via notetags.
- ================================================================================
- ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- ================================================================================
- 1. You must give credit to "Dekita"
- 2. You are NOT allowed to repost this script.(or modified versions)
- 3. You are NOT allowed to convert this script.(into other game engines e.g RGSS2)
- 4. You are NOT allowed to use this script for Commercial games.
- 5. ENJOY!
- "FINE PRINT"
- By using this script you hereby agree to the above terms and conditions,
- if any violation of the above terms occurs "legal action" may be taken.
- Not understanding the above terms and conditions does NOT mean that
- they do not apply to you.
- If you wish to discuss the terms and conditions in further detail you can
- contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
- ================================================================================
- History:
- =========
- D /M /Y
- 08/10/2o12 - Started/Finished Script,
- ================================================================================
- INSTRUCTIONS:
- ==============
- Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
- ================================================================================
- =end #######################
- # CUSTOMISATION BEGIN #
- #######################
- module Dekita__Item_Amount
- Default_Limit = 99
- Notetag = /<max amnt: (.*)>/i
- end # module Dekita__Item_Amount
- #####################
- # CUSTOMISATION END #
- #####################
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? #
- # WELL SLAP MY FACE AND CALL ME A DRAGON.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- $imported = {} if $imported.nil?
- $imported["DPB-Item-Limits"] = true
- #==============================================================================
- module DataManager
- #==============================================================================
- class <<self; alias load_database_item_count load_database; end
- def self.load_database
- load_database_item_count
- load_notetags_item_count
- end
- def self.load_notetags_item_count
- groups = [$data_weapons, $data_armors, $data_items]
- for group in groups
- for obj in group
- next if obj.nil?
- obj.load_notetags_item_count
- end
- end
- end
- end # DataManager
- #==============================================================================
- class RPG::Item < RPG::UsableItem
- #==============================================================================
- attr_accessor :max_item_amount_DPBz
- def load_notetags_item_count
- @max_item_amount_DPBz = Dekita__Item_Amount::Default_Limit
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when Dekita__Item_Amount::Notetag
- @max_item_amount_DPBz = $1.to_i
- end
- } # self.note.split
- end
- end # RPG::Item < RPG::UsableItem
- #==============================================================================
- class RPG::EquipItem < RPG::BaseItem
- #==============================================================================
- attr_accessor :max_item_amount_DPBz
- def load_notetags_item_count
- @max_item_amount_DPBz = Dekita__Item_Amount::Default_Limit
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when Dekita__Item_Amount::Notetag
- @max_item_amount_DPBz = $1.to_i
- end
- } # self.note.split
- end
- end # RPG::EquipItem < RPG::BaseItem
- #==============================================================================
- class Game_Party < Game_Unit
- #==============================================================================
- def max_item_number(item)
- return item.max_item_amount_DPBz
- end
- end # end class Game_Party
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement