Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================#
- # #
- # Multi Type Apricorns #
- # By Ulithium_Dragon #
- # #
- #==============================================================================#
- # ------------------------------------------------------ #
- # Allows creating an Apricorn Ball from two different apricorns. #
- # ------------------------------------------------------ #
- #==============================================================================#
- #//////////////////////////////////////////////////////////////////////////////#
- #------------------------------------------------------------------------------#
- # ***NOTE*** You must create a dummy item for each multi apricorn combination! #
- # Edit your items.txt PSB file accordingly. The data for the item #
- # does not matter. The only thing that matters is that the name you #
- # use is the same as the one you put under "MultiApricorns_List". #
- #------------------------------------------------------------------------------#
- #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
- #==============================================================================#
- #Variable ID for the dummy item checks to use.
- WHT&BLUAPRICORN_VAR = 65
- RED&YLWAPRICORN_VAR = 66
- BLK&GRNAPRICORN_VAR = 67
- #Variables array. Add each of the variables you assigned above to this.
- # *NOTE: These MUST be in the same order as MultiApricorns_List!
- ApricornVairables_List=[
- WHT&BLUAPRICORN_VAR,
- RED&YLWAPRICORN_VAR,
- BLK&GRNAPRICORN_VAR
- ]
- #Add your multiple combo apricorns to this array.
- # *NOTE: These MUST be in the same order as ApricornVairables_List!
- #
- # USAGE: Each line should consist of a Multi Apricorn Dummy item,
- # followed by the two real Apricorns that it represents.
- MultiApricorns_List=[
- ":WHT&BLUAPRICORN",":WHTAPRICORN",":BLUAPRICORN",
- ":RED&YLWAPRICORN",":REDAPRICORN",":YLWAPRICORN",
- ":BLK&GRNAPRICORN",":BLKAPRICORN",":GRNAPRICORN"
- ]
- #*Run this before anything else in your Apricorn Creation Event/Script (i.e. Kurk).
- def pbGetDummyApricorns
- #Gets the total number Multi Apricorn types and stores it in a global variable.
- $apricorncombos_num = (MultiApricorns_List.length/3)
- apricorn_count = 0
- #Add the dummy items and sets the quantity variables for later use.
- while apricorn_count <= $apricorncombos_num
- #Makes sure the first spot on the array is used for line 1.
- if apricorn_count == 0
- multitype = MultiApricorns_List[apricorn_count] #Stores the multi type.
- else
- multitype = MultiApricorns_List[apricorn_count*3] #Stores the multi type.
- end
- #Grabs the apricorn sub types from the array and stores them in temp variables.
- subtype1 = MultiApricorns_List[apricorn_count*3+1]
- subtype2 = MultiApricorns_List[apricorn_count*3+2]
- #Checks if the player at least one of each Multi Apricorn subtype Apricorn in their bag.
- if ($PokemonBag.pbHasItem?(subtype1) && $PokemonBag.pbHasItem?(subtype2))
- $game_variables[1] = $PokemonBag.pbQuantity(subtype1)
- $game_variables[2] = $PokemonBag.pbQuantity(subtype2)
- #Gives the player a dummy item for each pair of Multi Apricorns subtypes they have.
- # E.g. if the player had 7 White and 6 Blue Apricorns, they are given 6 White/Blue dummy items.
- if pbGet(1) > pbGet(2)
- $PokemonBag.pbStoreItem(multitype,pbGet(2))
- pbSet(ApricornVairables_List[multitype],pbGet(2))
- else
- $PokemonBag.pbStoreItem(multitype,pbGet(1))
- pbSet(ApricornVairables_List[multitype],pbGet(1))
- end
- end
- apricorn_count=+1
- end
- end
- #*Run this in place of the usual "$PokemonBag.pbDeleteItem(pbGet(8))" script in
- # your Apricorn Creation Event/Script.
- def pbRemoveDummyApricorns
- #Gets the total number Multi Apricorn types and stores it in a global variable.
- $apricorncombos_num = (MultiApricorns_List.length/3)
- apricorn_count = 0
- #Checks what dummy items the player has left and removes their apricorn subtypes
- # from the player's bag if they chose to use some of them.
- while apricorn_count <= $apricorncombos_num
- #Makes sure the first spot on the array is used for line 1.
- if apricorn_count == 0
- multitype = MultiApricorns_List[apricorn_count] #Stores the multi type.
- else
- multitype = MultiApricorns_List[apricorn_count*3] #Stores the multi type.
- end
- #Grabs the apricorn sub types from the array and stores them in temp variables.
- subtype1 = MultiApricorns_List[apricorn_count*3+1]
- subtype2 = MultiApricorns_List[apricorn_count*3+2]
- #If the player has at least one dummy item...
- if $PokemonBag.pbHasItem?(multitype)
- #Check and store the number of dummy items the player still has.
- $game_variables[1] = $PokemonBag.pbQuantity(multitype)
- #If the player chose to convert the Multi Type Apricorn...
- if pbGet(8) == multitype
- dummyitems_total = pbGet(ApricornVairables_List[multitype])
- dummyitems_remaining = pbGet(1)
- dummyitems_removenum = (dummyitems_total - dummyitems_remaining)
- $PokemonBag.pbDeleteItem(subtype1,(dummyitems_removenum))
- $PokemonBag.pbDeleteItem(subtype2,(dummyitems_removenum))
- #Remove the Multi Type Apricorn dummy items.
- $PokemonBag.pbDeleteItem(multitype,pbGet(1))
- #Assign the name of the Multi Type Apricorn to the Variable (3).
- pbSet(3,PBItems.getName(pbGet(8)))
- else #If the player choose not to convert a the the Multi Type Apricorn...
- #Remove the Multi Type Apricorn dummy items.
- $PokemonBag.pbDeleteItem(multitype,pbGet(1))
- end
- end
- apricorn_count=+1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement