Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - Item Pack
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={} if $D13x==nil
- $D13x[:Item_Pack]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 16/11/2o13 - Bugfix, ($D13x Unique Equip)
- # 13/o6/2o13 - Started, Finished
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script allows for "item packs", this is basically an item, that when you
- # open it, has a "random" item inside..
- #
- # To create one of these items simply make a normal item, that triggers
- # a common event.
- # in the common event simply use the script call to trigger the pack opening.
- #
- # Can also be used in normal events. This could easily be used to create a
- # choice based crafting system using events in game.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ 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.
- # 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/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- #
- #===============================================================================
- # ☆ Script Calls
- #-------------------------------------------------------------------------------
- # ItemPack.open(symbol)
- # replace symbol with the Pack[:symbol] for the pack you wish to open.
- # eg. ItemPack.open(:basic_e)
- #
- #===============================================================================
- # ☆ Help
- #-------------------------------------------------------------------------------
- # N/A
- #
- #===============================================================================
- module ItemPack
- #===============================================================================
- Pack={}# << Keep
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ☆ Message Settings
- #-----------------------------------------------------------------------------
- def self.text(item,amount,packname)
- return "You gained #{amount} #{item.name} from opening #{packname}."
- end
- Msg_BG = 0 # 0, 1 or 2
- Msg_Pos = 1 # 0, 1 or 2
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ☆ Pack Settings
- #-----------------------------------------------------------------------------
- # Adjust range based on how "Rare" the item is.
- # ALL numbers from 0 -> 999 MUST be included within the Range!!
- # A 0..99 (100) range is 10% chance, 0..9 (10) range is 1% chance.
- # :name = "The Items Display Name Used In Message"
- # :loot = [array of available loot(items) this pack offers]
- # :loot format = [:type , id, amnt, range],
- Pack[:basic_e]={
- :name => "Basic Equipment Pack",
- :loot => [
- [:weapon, 1, 1, 0..399],
- [:armor , 1, 1, 400..499],
- [:armor , 2, 1, 500..599],
- [:armor , 3, 1, 600..699],
- [:armor , 4, 1, 700..799],
- [:armor , 5, 1, 800..899],
- [:armor , 6, 1, 900..999],
- ],
- }
- #-----------------------------------------------------------------------------
- Pack[:world]={
- :name => "World Adventurer Pack",
- :loot => [
- [:item , 1, 5, 0..99],
- [:item , 2, 4, 100..199],
- [:item , 3, 3, 200..299],
- [:item , 4, 2, 300..399],
- [:item , 5, 1, 400..499],
- [:item , 6, 5, 500..599],
- [:item , 7, 4, 600..699],
- [:item , 8, 3, 700..799],
- [:weapon, 1, 1, 800..899],
- [:armor , 1, 1, 900..999],
- ],
- }
- #-----------------------------------------------------------------------------
- Pack[:devil]={
- :name => "Devil Worshiper Pack",
- :loot => [
- [:item , 1, 5, 0..99],
- [:item , 2, 4, 100..199],
- [:item , 3, 3, 200..299],
- [:item , 4, 2, 300..399],
- [:item , 5, 1, 400..499],
- [:item , 6, 5, 500..599],
- [:item , 7, 4, 600..699],
- [:item , 8, 3, 700..799],
- [:weapon, 1, 1, 800..899],
- [:armor , 1, 1, 900..999],
- ],
- }
- #-----------------------------------------------------------------------------
- # ADD more Pack[:symbol] to suit your needs..
- # ALWAYS copy the code from above and then modify it
- # IF you are unsure what to do.
- #-----------------------------------------------------------------------------
- #####################
- # CUSTOMISATION END #
- #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # 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.\..\.. #
- #===============================================================================#
- #-----------------------------------------------------------------------------
- # Trigger Pack Opening
- #-----------------------------------------------------------------------------
- def self.open(sym)
- numb = rand(1000)
- Pack[sym][:loot].each do |item|
- next unless item != nil
- next unless item[3].include?(numb)
- case item[0]
- when :item
- newi = $data_items[item[1]]
- $game_party.gain_item(newi,item[2])
- show_message(sym,newi,item[2])
- when :weapon
- if $D13x[:UniEquip]
- item[2].times do
- newi = Cloning_101.start_clone(:weapon,item[1],nil,true)
- show_message(sym,newi,1)
- end
- else
- newi = $data_weapons[item[1]]
- $game_party.gain_item(newi,item[2])
- show_message(sym,newi,item[2])
- end
- when :armor
- if $D13x[:UniEquip]
- item[2].times do
- newi = Cloning_101.start_clone(:armor,item[1],nil,true)
- show_message(sym,newi,1)
- end
- else
- newi = $data_weapons[item[1]]
- $game_party.gain_item(newi,item[2])
- show_message(sym,newi,item[2])
- end
- end
- end
- end
- #-----------------------------------------------------------------------------
- # Trigger Pack Message
- #-----------------------------------------------------------------------------
- def self.show_message(sym,item,val)
- pack = Pack[sym]
- msge = text(item,val,pack[:name])
- $game_message.new_page
- $game_message.background = Msg_BG
- $game_message.position = Msg_Pos
- $game_message.add(msge)
- end
- end
- #===============================================================================
- # http://dekitarpg.wordpress.com/
- #===============================================================================
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement