sorry it didnt show i changed it, i am pretty sure it would work so put it to the test...
#dynamic 0xoffset
#org @start
lock
faceplayer
msgbox @hello 0x6
trainerbattle 0x0 0x(trainer ID) 0x0 @challenge @end
checkflag 0x(xxx)
if 0x1 goto @gave
givepokemon 0x(113 in hex) 0x(pokemon lvl in hex) 0x0 0x0 0x0 0x0
msgbox @beaten 0x6
setflag 0x(a free flag named xxx)
release
end
#org @gave
msgbox @end 0x6
end
#org @hello
= i am nurse joy, are you a rocket?\nif you are, get ready to lose!
#org @challenge
= team rocket is doomed!!!
#org @end
= go away!\n I despise team rocket
#org @beaten
= aaaaaaaa\naaaaaagh!\pi lost... take chansey and\ndont harm me.