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
- ]
- #The Display names given to your dummy items in items.txt need to go here.
- # *NOTE: These MUST be in the same order as ApricornVairables_List!
- DisplayNames_List=[
- "White and Blue Apricorns",
- "Red and Yellow Apricorns",
- "Black and Green Apricorns"
- ]
- #*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)
- #p $apricorncombos_num #Debug
- #pbPopulateApriconRealNameArray
- apricorn_count = 0
- #Add the dummy items and sets the quantity variables for later use.
- while apricorn_count < $apricorncombos_num
- if apricorn_count == 0 #Makes sure the first spot on the array is used for line 1.
- multitype = MultiApricorns_List[apricorn_count] #Stores the multi type.
- multitypevar = 0 #Temp var.
- else
- multitype = MultiApricorns_List[apricorn_count*3] #Stores the multi type.
- multitypevar = apricorn_count #Temp var.
- 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.
- tmpapricornvar = ApricornVairables_List[multitypevar]
- if pbGet(1) > pbGet(2)
- $PokemonBag.pbStoreItem(multitype,pbGet(2))
- pbSet(tmpapricornvar,pbGet(2))
- else
- $PokemonBag.pbStoreItem(multitype,pbGet(1))
- pbSet(tmpapricornvar,pbGet(1))
- end
- end
- apricorn_count+=1
- #p apricorn_count #Debug
- end
- end
- #*Run this instead 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)
- #p $apricorncombos_num #Debug
- #pbPopulateApriconRealNameArray
- 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
- if apricorn_count == 0 #Makes sure the first spot on the array is used for line 1.
- multitype = MultiApricorns_List[apricorn_count] #Stores the multi type.
- multitypevar = 0 #Temp var.
- else
- multitype = MultiApricorns_List[apricorn_count*3] #Stores the multi type.
- multitypevar = apricorn_count #Temp var.
- 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.
- $PokemonBag.pbDeleteItem(multitype,1)
- $game_variables[1] = $PokemonBag.pbQuantity(multitype)
- #If the player chose to convert the Multi Type Apricorn...
- if PBItems.getName(pbGet(8)) == DisplayNames_List[apricorn_count]
- dummyitems_total = pbGet(ApricornVairables_List[multitypevar])
- 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
- =begin
- #::::DECREPIT::::
- def pbPopulateApriconRealNameArray
- #displayNamesList = Array.new
- arraylength = (MultiApricorns_List.length/3)
- displayNamesList = Array.new(arraylength,"Name")
- itterationcount = 0
- for n in MultiApricorns_List
- for i in displayNamesList
- if itterationcount == 0
- tempname = MultiApricorns_List[n]
- puts PBItems.getName(tempname)
- end
- itterationcount+=1
- end
- if itterationcount == 2
- itterationcount = 0
- end
- end
- # p displayNamesList
- return displayNamesList
- end
- =end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement