Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ○ Get all items Ver1.00
- # for RGSS2, also VX Ace
- # 西瓜 / Space not far
- # http://muspell.raindrop.jp/
- # Get 99 items, weapons and armor. For debugging.
- #==============================================================================
- # Use snf_getallitem as a script call in the event command.
- # Get all items. However, items with blank names are ignored.
- module SNF
- ALLITEM_NONAMESKIP = true
- # Whether or not to skip blank name items? (true/false)
- ALLITEM_TESTPLAYONLY = true
- # Is the effect happens only during test play? (true/false)
- end
- class Game_Interpreter
- def snf_getallitem
- if SNF::ALLITEM_TESTPLAYONLY
- return unless $TEST # End if not test play
- end
- items = []
- items += $data_items
- items += $data_weapons
- items += $data_armors
- for item in items.compact
- next if item.name == "" and SNF::ALLITEM_NONAMESKIP # Skip blank items
- $game_party.gain_item(item, 99)
- end
- end
- end
- class Game_Interpreter
- SNF_RANDOMITEM_EXCEPTION = "<random item exception>"
- def snf_randomget(kind = rand(3), array= 1..999, sze = 1)
- items = []
- randomlist = []
- # Array initialization
- for i in array
- case kind
- when 0 # Item
- items.push($data_items[i])
- when 1 # Weapon
- items.push($data_weapons[i])
- when 2 # Armor
- items.push($data_armors[i])
- end
- end
- for item in items.compact
- next if item.name == "" and SNF::RANDOMITEM_NONAMESKIP # Skip blank items
- if SNF::RANDOMITEM_EXCEPETITE # Handling exception items
- next if item.note.include?(SNF_RANDOMITEM_EXCEPTION)
- else
- next unless item.note.include?(SNF_RANDOMITEM_EXCEPTION)
- end
- randomlist.push(item)
- end
- return if randomlist.size == 0 # End if there are no candidates
- getitem = randomlist[rand(randomlist.size)] # randomly select
- $game_variables[SNF::RANDOMITEM_NAME_ID] = getitem.name if SNF::RANDOMITEM_SUBSTITUTENAME
- $game_party.gain_item(getitem, sze)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement