Help - Search - Members - Calendar
Full Version: Give all items
RPG RPG Revolution Forums > Scripting > Event Emporium
Pharonix
Is there an easier way of doing this, whether it is a code snippet for events or whatever.

I'm using
Final Fantasy IX - Equipment Overhaul By: LordHeinrich & Blackmorning
and I want to test out all my equipment changes.


Any help is appreciated.

I have a buttload of weapons / armors each clocking in about 100 items, I'd rather not have to do this line by line.
Alt_Jack
Aha ha aha ha. Ha. Sorry. sweat.gif That's what happens when you make a lot of stuff and then change all of them, then realise you don't know if they even work anymore. No, there probably isn't an easy way out. If there is, it's probably superflous in comparison to just testing it out. Your best bet is to just play through and see if any problems come up. You could make a bunch of sell-back shops so you don't max out your inventory.
Redd
It might help if you are making it give you all the items many times, if you make a common event so that you don't have to redo it over and over again.
Ty
Here you go. Add the script above into your script editor. Use as following:

1.) In an event command, use a 'Call Script' action and enter one (or all) of the following:
$game_party.add_items(amount, maxrange)
$game_party.add_weapons(amount, maxrange)
$game_party.add_armors(amount, maxrange)

Example:
$game_party.add_items(99, 32) will add 99 amount of all of the items from Item ID 1 to Item ID 32. But what if you want to add from Item ID 15 to item ID 20? Then you can use this:
$game_party.add_items(99,20,15). In this example, the '15' becomes the Starting Item ID (The first item to add) and the 20 becomes the last item ID (The last Item to Add). The same applies for adding weapons and/or armors.

CODE
#===============================================================================
# Add Mass Items
#===============================================================================
# Adds every single item, weapon and armor from the database to inventory
#-------------------------------------------------------------------------------
class Game_Party
  def add_items(amount,range, minrange=1)
    for i in minrange..range
      $game_party.gain_item(i, amount)
      if $data_items[i].name == ""
        $game_party.lose_item(i, amount)
      end
    end
  end
  def add_weapons(amount,range, minrange=1)
    for i in minrange..range
      $game_party.gain_weapon(i, amount)
      if $data_weapons[i].name == ""
        $game_party.lose_item(i, amount)
      end
    end
  end
  def add_armor(amount,range, minrange=1)
    for i in minrange..range
      $game_party.gain_armor(i, amount)
      if $data_armors[i].name == ""
        $game_party.lose_item(i, amount)
      end
    end
  end
end
Pharonix
Ty, you are the man

I freaking love you
Redd
Solved, Locked smile.gif
lock.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.