mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-28 08:14:29 +02:00
Make it possible to use pkmn data when spawning
This commit is contained in:
parent
a96c13f123
commit
eaa0c8d2c3
@ -182,9 +182,18 @@ Public Class Spawner
|
|||||||
level = CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100"))
|
level = CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100"))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim p As Pokemon
|
||||||
|
|
||||||
|
If Pokemons(i).StartsWith("{") = True Then
|
||||||
|
Dim data As String = Pokemons(i).Remove(0, Pokemons(i).IndexOf("{"))
|
||||||
|
p = Pokemon.GetPokemonByData(data.Replace("§", ",").Replace("«", "[").Replace("»", "]"))
|
||||||
|
p.Level = level
|
||||||
|
p.CalculateStats()
|
||||||
|
p.FullRestore()
|
||||||
|
Else
|
||||||
Dim PkID As Integer = CInt(Pokemons(i).Split(CChar("_"))(0))
|
Dim PkID As Integer = CInt(Pokemons(i).Split(CChar("_"))(0))
|
||||||
Dim PkAD As String = ""
|
Dim PkAD As String = ""
|
||||||
Dim p As Pokemon = Pokemon.GetPokemonByID(PkID)
|
p = Pokemon.GetPokemonByID(PkID)
|
||||||
For Each region As String In Screen.Level.RegionalForm.ToLower().Split(CChar(","))
|
For Each region As String In Screen.Level.RegionalForm.ToLower().Split(CChar(","))
|
||||||
If p.RegionalForms <> Nothing AndAlso p.RegionalForms.ToLower().Contains(region) Then
|
If p.RegionalForms <> Nothing AndAlso p.RegionalForms.ToLower().Contains(region) Then
|
||||||
PkAD = region
|
PkAD = region
|
||||||
@ -197,6 +206,8 @@ Public Class Spawner
|
|||||||
End If
|
End If
|
||||||
p = Pokemon.GetPokemonByID(PkID, PkAD)
|
p = Pokemon.GetPokemonByID(PkID, PkAD)
|
||||||
p.Generate(level, True, PkAD)
|
p.Generate(level, True, PkAD)
|
||||||
|
|
||||||
|
End If
|
||||||
p.ReloadDefinitions()
|
p.ReloadDefinitions()
|
||||||
p.CalculateStats()
|
p.CalculateStats()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user