"onSetForm"=>proc{|pokemon,form|
pbSeenForm(pokemon)
if !pokemon.forceform
moves=[
:OVERHEAT, # Heat, Microwave
:HYDROPUMP, # Wash, Washing Machine
:BLIZZARD, # Frost, Refrigerator
:AIRSLASH, # Fan
:LEAFSTORM # Mow, Lawnmower
]
hasoldmove=-1
for i in 0...4
for j in 0...moves.length
if isConst?(pokemon.moves[i].id,PBMoves,moves[j])
hasoldmove=i; break
end
end
break if hasoldmove>=0
end
if form>0
newmove=moves[form-1]
if newmove!=nil && hasConst?(PBMoves,newmove)
if hasoldmove>=0
# Automatically replace the old form's special move with the new one's
oldmovename=PBMoves.getName(pokemon.moves[hasoldmove].id)
newmovename=PBMoves.getName(getID(PBMoves,newmove))
pokemon.moves[hasoldmove]=PBMove.new(getID(PBMoves,newmove))
Kernel.pbMessage(_INTL("\\se[]1,\\wt[4] 2,\\wt[4] and...\\wt[8] ...\\wt[8] ...\\wt[8] Poof!\\se[balldrop]\1"))
Kernel.pbMessage(_INTL("{1} forgot how to\r\nuse {2}.\1",pokemon.name,oldmovename))
Kernel.pbMessage(_INTL("And...\1"))
Kernel.pbMessage(_INTL("\\se[]{1} learned {2}!\\se[itemlevel]",pokemon.name,newmovename))
else
# Try to learn the new form's special move
pbLearnMove(pokemon,getID(PBMoves,newmove),true)
end
end
else
if hasoldmove>=0
# Forget the old form's special move
oldmovename=PBMoves.getName(pokemon.moves[hasoldmove].id)
pbDeleteMove(pokemon,hasoldmove)
Kernel.pbMessage(_INTL("{1} forgot {2}...",pokemon.name,oldmovename))
if pokemon.moves.find_all{|i| i.id!=0}.length==0
pbLearnMove(pokemon,getID(PBMoves,:THUNDERSHOCK))
end
end
end
end
}