Code: Select all
Sub EatChar( Sunduk, Nom, Add, TimeWait )
; сообщения при кормежке
UO.Print( 'TEST: eat ' + str( Nom ) + ' message ' + str( Add ) + ' add ' + str( TimeWait ) + ' minutes' )
VAR Eat1 = 'You eat the food, but are still extremely hungry'
VAR Eat2 = 'After eating the food, you fell much less hungry'
VAR Eat3 = 'You eat the food, and begin to feel more satiated'
VAR Eat4 = 'You are nearly stuffed, but manage to eat the food'
VAR Eat5 = 'You fell quite full after consuming the food'
VAR Eat6 = 'You are stuffed!'
VAR Eat7 = 'You are simply too full to eat any more!'
VAR Steak = '0x097B' ; тип меда для подкормки
VAR i, Eat, j
; проверим, пора ли кормиться
i = Val( UO.GetGlobal( 'TimeProcess' ) )
i = ( UO.Timer() - i ) / 600
If i < TimeWait Then
; рано кормиться
return
Endif
; пора кормиться
If Nom == 1 Then
Eat = Eat1
Endif
If Nom == 2 Then
Eat = Eat2
Endif
If Nom == 3 Then
Eat = Eat3
Endif
If Nom == 4 Then
Eat = Eat4
Endif
If Nom == 5 Then
Eat = Eat5
Endif
If Nom == 6 Then
Eat = Eat6
Endif
If Nom == 7 Then
Eat = Eat7
Endif
UO.FindType( Steak, '-1', Sunduk )
If UO.FindCount() == 0 Then
; мед кончился
UO.SetGlobal( 'TimeProcess', str( UO.Timer() ) )
return
Endif
UO.Grab( '60', 'finditem' )
Wait( 1000 )
repeat
DeleteJournal( Eat )
UO.UseType( Steak )
Wait( 1000 )
until NOT UO.InJournal( Eat )
If Add > 0 Then
For j = 1 To Add
UO.UseType( Steak )
Wait( 1000 )
Next
Endif
; хватит кормиться
; Сбросим счетчик
UO.SetGlobal( 'TimeProcess', str( UO.Timer() ) )
endsub