if horse . get_level ( ) == 20 then 
say_title ( gameforge . horse_levelup . _240_sayTitle ) 
say ( gameforge . horse_levelup . _250_say ) 
elseif pc . countitem ( "50050" ) < 1 then 
say_title ( gameforge . horse_levelup . _240_sayTitle ) 
say ( gameforge . horse_levelup . _260_say ) 
setstate ( "need_item50050" ) 
elseif horse . get_stamina_pct ( ) <= 10 then 
say_title ( gameforge . horse_levelup . _240_sayTitle ) 
say ( gameforge . horse_levelup . _280_say ) 
elseif horse . get_health_pct ( ) <= 10 then 
say_title ( gameforge . horse_levelup . _240_sayTitle ) 
say ( gameforge . horse_levelup . _290_say ) 
elseif horse . is_riding ( ) == 0 then 
say_title ( gameforge . horse_levelup . _240_sayTitle ) 
say ( gameforge . horse_levelup . _300_say ) 
elseif ( horse . get_level ( ) >= 11 and horse . get_level ( ) <= 19 ) then 
say_title ( gameforge . horse_levelup . _240_sayTitle ) 
say ( gameforge . horse_levelup . _310_say ) 
if horse . get_level ( ) == 11 then 
setstate ( "training1" ) 
elseif horse . get_level ( ) == 12 then 
setstate ( "training2" ) 
elseif horse . get_level ( ) == 13 then 
setstate ( "training3" ) 
elseif horse . get_level ( ) == 14 then 
setstate ( "training4" ) 
elseif horse . get_level ( ) == 15 then 
setstate ( "training5" ) 
elseif horse . get_level ( ) == 16 then 
setstate ( "training6" ) 
elseif horse . get_level ( ) == 17 then 
setstate ( "training7" ) 
elseif horse . get_level ( ) == 18 then 
setstate ( "training8" ) 
elseif horse . get_level ( ) == 19 then 
setstate ( "training9" ) 
end 
end 
