'-----------------------
#org 0x1A0D5A
setvar 0x8004 0x0
special2 LASTRESULT 0xD4
copyvar 0x8008 0x8005
copyvar 0x8009 0x8006
copyvar 0x800A LASTRESULT
#raw 0x83
nop
jumpstd 0x80
#raw 0x83
nop
callstd 0x80
msgbox 0x81C61FA '"Mhmm...\pDunque, hai..."
callstd 0x4
call 0x81A0D4F
compare 0x800A 0x0
if 0x1 jump 0x1A1EF7
setvar 0x8004 0x1
special2 LASTRESULT 0xD4
copyvar 0x8008 0x8005
copyvar 0x8009 0x8006
#raw 0x83
nop
jumpstd 0x80
#raw 0x83
nop
callstd 0x80
msgbox 0x81C6809 '"Uhm...\nSu base nazi..."
callstd 0x4
return
'-----------------------
#org 0x1A0D4F
copyvar 0x8004 0x8009
special 0xD5
#raw 0x66
#raw 0x6D
return
'-----------------------
#org 0x1A1EF7
return
#org 0x1A0D5A
setvar 0x8004 0x0
special2 LASTRESULT 0xD4
copyvar 0x8008 0x8005
copyvar 0x8009 0x8006
copyvar 0x800A LASTRESULT
#raw 0x83
nop
jumpstd 0x80
#raw 0x83
nop
callstd 0x80
msgbox 0x81C61FA '"Mhmm...\pDunque, hai..."
callstd 0x4
call 0x81A0D4F
compare 0x800A 0x0
if 0x1 jump 0x1A1EF7
setvar 0x8004 0x1
special2 LASTRESULT 0xD4
copyvar 0x8008 0x8005
copyvar 0x8009 0x8006
#raw 0x83
nop
jumpstd 0x80
#raw 0x83
nop
callstd 0x80
msgbox 0x81C6809 '"Uhm...\nSu base nazi..."
callstd 0x4
return
'-----------------------
#org 0x1A0D4F
copyvar 0x8004 0x8009
special 0xD5
#raw 0x66
#raw 0x6D
return
'-----------------------
#org 0x1A1EF7
return
Luego seguí revisando y encontré uno para pokemon essentials, algo similar
def Come_back(shiny=nil, animation=nil)
events=$PokemonGlobal.dependentEvents
if $game_variables[Current_Following_Variable]==$Trainer.party.length
$game_variables[Current_Following_Variable]
else
$game_variables[Current_Following_Variable]
end
if $game_variables[Current_Following_Variable]==$Trainer.party.length
remove_sprite(false)
for i in 0...events.length
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents.x,@realEvents.y)
end
else
if $Trainer.party[0].isShiny?
shiny=true
else
shiny=false
end
change_sprite($Trainer.party[0].species, shiny, false)
end
for i in 0..$Trainer.party.length-1
if $Trainer.party.hp>0 && !$Trainer.party[0].egg?
$game_variables[Current_Following_Variable]=i
refresh_sprite
break
end
end
for i in 0...events.length
for i in 0..$Trainer.party.length-1
if $Trainer.party.hp<=0
id = $Trainer.party.species
else
id = $Trainer.party.species
end
end
if events && events[8]=="Dependent"
if shiny==true
events[6]=sprintf("%03ds",id)
if FileTest.image_exist?("Graphics/Characters/"+events[6])
@realEvents.character_name=sprintf("%03ds",id)
else
events[6]=sprintf("%03d",id)
@realEvents.character_name=sprintf("%03d",id)
end
else
events[6]=sprintf("%03d",id)
@realEvents.character_name=sprintf("%03d",id)
end
if animation==true
else
end
end
end
end
events=$PokemonGlobal.dependentEvents
if $game_variables[Current_Following_Variable]==$Trainer.party.length
$game_variables[Current_Following_Variable]
else
$game_variables[Current_Following_Variable]
end
if $game_variables[Current_Following_Variable]==$Trainer.party.length
remove_sprite(false)
for i in 0...events.length
$scene.spriteset.addUserAnimation(Animation_Come_Out,@realEvents.x,@realEvents.y)
end
else
if $Trainer.party[0].isShiny?
shiny=true
else
shiny=false
end
change_sprite($Trainer.party[0].species, shiny, false)
end
for i in 0..$Trainer.party.length-1
if $Trainer.party.hp>0 && !$Trainer.party[0].egg?
$game_variables[Current_Following_Variable]=i
refresh_sprite
break
end
end
for i in 0...events.length
for i in 0..$Trainer.party.length-1
if $Trainer.party.hp<=0
id = $Trainer.party.species
else
id = $Trainer.party.species
end
end
if events && events[8]=="Dependent"
if shiny==true
events[6]=sprintf("%03ds",id)
if FileTest.image_exist?("Graphics/Characters/"+events[6])
@realEvents.character_name=sprintf("%03ds",id)
else
events[6]=sprintf("%03d",id)
@realEvents.character_name=sprintf("%03d",id)
end
else
events[6]=sprintf("%03d",id)
@realEvents.character_name=sprintf("%03d",id)
end
if animation==true
else
end
end
end
end
Y por último uno donde revisan SURF
#----------------------------------------------------------------------------
# - check_surf(animation)
# - If current Pokemon is a water Pokemon, it is still following.
# - If current Pokemon is not a water Pokemon, remove sprite.
# - Require Water_Pokemon_Can_Surf = true to enable
#----------------------------------------------------------------------------
def check_surf(animation=nil)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events && events[8]=="Dependent"
events[6]=sprintf("nil")
@realEvents.character_name=sprintf("nil")
else
if $Trainer.party[0].hp>0 && !$Trainer.party[0].egg?
if $Trainer.party[0].hasType?(:WATER)
remove_sprite
else
remove_sprite
pbWait(20)
end
elsif $Trainer.party[0].hp<=0
end
end
end
end
# - check_surf(animation)
# - If current Pokemon is a water Pokemon, it is still following.
# - If current Pokemon is not a water Pokemon, remove sprite.
# - Require Water_Pokemon_Can_Surf = true to enable
#----------------------------------------------------------------------------
def check_surf(animation=nil)
events=$PokemonGlobal.dependentEvents
for i in 0...events.length
if events && events[8]=="Dependent"
events[6]=sprintf("nil")
@realEvents.character_name=sprintf("nil")
else
if $Trainer.party[0].hp>0 && !$Trainer.party[0].egg?
if $Trainer.party[0].hasType?(:WATER)
remove_sprite
else
remove_sprite
pbWait(20)
end
elsif $Trainer.party[0].hp<=0
end
end
end
end
Estos dos últimos son para pokemon essentials, y repito lo que me llamó la atención fue esa estructura donde trabajan con variables dependientes.
Flags and Special Commands [R/FR/E] [Archive] - The PokéCommunity Forums