Add @Pokemon.AddToStorage() More Info below:

Usage:
@Pokemon.AddToStorage([BoxIndex], PokemonData)
@Pokemon.AddToStorage(PokemonID, Level, [Method], [BallID], [Location], [isEgg], [trainerName])

Paramenter in square bracket [] is optional.
BoxIndex is the selected box you wish to dump into. They start from 0.
This commit is contained in:
jianmingyong 2016-11-12 04:05:07 +08:00
parent 7eac4b34ef
commit c1d0e6f1d2

View File

@ -602,6 +602,93 @@
Core.Player.Pokemons.RemoveAt(PokemonIndex) Core.Player.Pokemons.RemoveAt(PokemonIndex)
End If End If
End If End If
Case "addtostorage"
' @Pokemon.AddToStorage([BoxIndex], PokemonData)
' @Pokemon.AddToStorage(PokemonID, Level, [Method], [BallID], [Location], [isEgg], [trainerName])
If argument.StartsWith("{") = True Or argument.Remove(0, 1).StartsWith(",{") = True Then
Dim insertIndex As Integer = Core.Player.Pokemons.Count
If argument.Remove(0, 1).StartsWith(",{") = True Then
insertIndex = int(argument.GetSplit(0))
End If
argument = argument.Remove(0, argument.IndexOf("{"))
Dim p As Pokemon = Pokemon.GetPokemonByData(argument.Replace("§", ","))
StorageSystemScreen.DepositPokemon(p, insertIndex)
Dim pokedexType As Integer = 2
If p.IsShiny = True Then
pokedexType = 3
End If
If p.IsEgg() = False Then
Core.Player.PokedexData = Pokedex.ChangeEntry(Core.Player.PokedexData, p.Number, pokedexType)
End If
Else
Dim commas As Integer = 0
For Each c As Char In argument
If c = "," Then
commas += 1
End If
Next
Dim PokemonID As Integer = int(argument.GetSplit(0))
Dim Level As Integer = int(argument.GetSplit(1))
Dim catchMethod As String = "random reason"
If commas > 1 Then
catchMethod = argument.GetSplit(2)
End If
Dim catchBall As Item = Item.GetItemByID(1)
If commas > 2 Then
catchBall = Item.GetItemByID(int(argument.GetSplit(3)))
End If
Dim catchLocation As String = Screen.Level.MapName
If commas > 3 Then
catchLocation = argument.GetSplit(4)
End If
Dim isEgg As Boolean = False
If commas > 4 Then
isEgg = CBool(argument.GetSplit(5))
End If
Dim catchTrainer As String = Core.Player.Name
If commas > 5 And argument.GetSplit(6) <> "<playername>" Then
catchTrainer = argument.GetSplit(6)
End If
Dim Pokemon As Pokemon = Pokemon.GetPokemonByID(PokemonID)
Pokemon.Generate(Level, True)
Pokemon.CatchTrainerName = catchTrainer
Pokemon.OT = Core.Player.OT
Pokemon.CatchLocation = catchLocation
Pokemon.CatchBall = catchBall
Pokemon.CatchMethod = catchMethod
If isEgg = True Then
Pokemon.EggSteps = 1
Pokemon.SetCatchInfos(Item.GetItemByID(5), "obtained at")
Else
Pokemon.EggSteps = 0
End If
StorageSystemScreen.DepositPokemon(Pokemon)
Dim pokedexType As Integer = 2
If Pokemon.IsShiny = True Then
pokedexType = 3
End If
If Pokemon.IsEgg() = False Then
Core.Player.PokedexData = Pokedex.ChangeEntry(Core.Player.PokedexData, Pokemon.Number, pokedexType)
End If
End If
End Select End Select
IsReady = True IsReady = True