Это мой текущий код для olympiad_operator.
Хочу добавить правило, чтобы персонаж мог быть вызван только если он жив и у него в инвентаре менее 80 предметов.
Это возможно сделать напрямую в ИИ? Кто-нибудь может мне помочь?
Хочу добавить правило, чтобы персонаж мог быть вызван только если он жив и у него в инвентаре менее 80 предметов.
Это возможно сделать напрямую в ИИ? Кто-нибудь может мне помочь?
Код:
class 1 olympiad_operator_basic : citizen
{
handler:
EventHandler TALKED( talker )
{
if( talker.nobless_type == @NOBLESS_ACTIVE )
{
myself::ShowPage( talker, "olympiad_operator001.htm" );
}
else
{
myself::ShowPage( talker, "olympiad_operator002.htm" );
}
}
EventHandler MENU_SELECTED( talker, ask, reply, fhtml0, i0, s0, s1 )
{
if( ask == -50 )
{
if( talker.nobless_type == @NOBLESS_ACTIVE )
{
myself::ShowPage( talker, "olympiad_operator001.htm" );
}
else
{
myself::ShowPage( talker, "olympiad_operator002.htm" );
}
}
else if( ask == -51 )
{
myself::ShowPage( talker, "olympiad_operator010.htm" );
}
else if( ask == -52 )
{
switch( reply )
{
case 0:
{
myself::ShowPage( talker, "olympiad_operator001.htm" );
break;
}
case 1:
{
if( gg::GetDateTime( 0, @DTF_HOUR ) >= 23 &&
gg::GetDateTime( 0, @DTF_MIN ) >= 50 )
{
myself::ShowPage( talker, "olympiad_operator010k.htm" );
}
else
{
myself::ShowPage( talker, "olympiad_operator010a.htm" );
}
break;
}
case 2:
{
if( gg::GetDateTime( 0, @DTF_HOUR ) >= 23 &&
gg::GetDateTime( 0, @DTF_MIN ) >= 50 )
{
myself::ShowPage( talker, "olympiad_operator010k.htm" );
}
else
{
myself::ShowPage( talker, "olympiad_operator010b.htm" );
}
break;
}
case 3:
{
myself::FHTML_SetFileName( fhtml0, "olympiad_operator010f.htm" );
i0 = myself::GetOlympiadWaitingCount();
if( i0 < 100 )
{
myself::FHTML_SetStr( fhtml0, "WaitingCount",
myself::MakeFString( 1000504, "100", "", "", "", "" ) );
}
else
{
myself::FHTML_SetStr( fhtml0, "WaitingCount",
myself::MakeFString( 1000505, "100", "", "", "", "" ) );
}
i0 = myself::GetClassFreeOlympiadWaitingCount();
if( i0 < 100 )
{
myself::FHTML_SetStr( fhtml0, "WaitingCount",
myself::MakeFString( 1000504, "100", "", "", "", "" ) );
}
else
{
myself::FHTML_SetStr( fhtml0, "WaitingCount",
myself::MakeFString( 1000505, "100", "", "", "", "" ) );
}
myself::ShowFHTML( talker, fhtml0 );
break;
}
case 4:
{
myself::ShowPage( talker, "olympiad_operator010g.htm" );
break;
}
case 5:
{
myself::FHTML_SetFileName( fhtml0, "olympiad_operator010h.htm" );
myself::FHTML_SetInt( fhtml0, "WaitingCount",
myself::GetOlympiadPoint( talker ) );
myself::ShowFHTML( talker, fhtml0 );
}
}
}
else if( ask == -53 )
{
if( reply == 0 )
{
myself::ShowPage( talker, "olympiad_operator001.htm" );
}
else if( reply == 1 )
{
if( myself::IsMainClass( talker ) == 1 )
{
if( myself::IsInCategory( @fourth_class_group, talker.occupation ) )
{
if( myself::GetOlympiadPoint( talker ) > 0 )
{
myself::AddClassFreeOlympiad( talker );
}
else
{
myself::ShowPage( talker, "olympiad_operator010i.htm" );
}
}
else
{
myself::ShowPage( talker, "olympiad_operator010j.htm" );
}
}
else
{
myself::ShowPage( talker, "olympiad_operator010c.htm" );
}
}
}
else if( ask == -54 )
{
if( reply == 0 )
{
myself::ShowPage( talker, "olympiad_operator001.htm" );
}
else if( reply == 1 )
{
if( myself::IsMainClass( talker ) == 1 )
{
if( myself::OwnItemCount( talker, 999 ) >= 10 )
{
if( myself::OwnItemCount( talker, 9878 ) >= 1 )
{
if( myself::IsInCategory( @fourth_class_group, talker.occupation ) )
{
if( myself::GetOlympiadPoint( talker ) > 0 )
{
myself::AddOlympiad( talker );
}
myself::DeleteItem1( talker, 999, 10 );
}
else
{
myself::ShowPage( talker, "olympiad_operator010j.htm" );
}
}
}
}
else
{
myself::ShowPage( talker, "olympiad_operator010c.htm" );
}
}
}
else if( ask == -55 )
{
myself::ShowPage( talker, "olympiad_operator030.htm" );
}
else if( ask == -56 )
{
}
else if( ask == -57 )
{
}
else if( ask == -58 )
{
myself::RemoveOlympiad( talker );
}
else if( ask == -59 )
{
myself::FHTML_SetFileName( fhtml0, "olympiad_operator020.htm" );
for( i0 = 1; i0 <= 22; i0 = i0 + 1 )
{
s0 = "";
s1 = "";
myself::FHTML_SetInt( fhtml0, "FI" + i0, i0 );
if( myself::GetStatusForOlympiadField( i0 ) == 0 )
{
myself::FHTML_SetStr( fhtml0, "Status" + i0, "&$906;" );
}
else
{
s0 = "&$829;" + " " + myself::GetPlayer1ForOlympiadField( i0 ) + " : " + myself::GetPlayer2ForOlympiadField( i0 );
myself::FHTML_SetStr( fhtml0, "Status" + i0, s0 );
}
}
myself::ShowFHTML( talker, fhtml0 );
}
else if( ask == -60 )
{
if( reply == 0 )
{
if( talker.nobless_type == @NOBLESS_ACTIVE )
{
myself::ShowPage( talker, "olympiad_operator001.htm" );
}
else
{
myself::ShowPage( talker, "olympiad_operator002.htm" );
}
}
}
else if( ask == -61 )
{
myself::ShowPage( talker, "olympiad_operator020.htm" );
}
else if( ask == -70 )
{
if( reply == 0 )
{
myself::ShowPage( talker, "olympiad_operator001.htm" );
}
else if( reply == 1 )
{
if( myself::GetPreviousOlympiadPoint( talker ) == 0 )
{
myself::ShowPage( talker, "olympiad_operator031a.htm" );
}
else if( myself::GetPreviousOlympiadPoint( talker ) < 40 )
{
if( talker.hero_type == @HERO_WAITING ||
talker.hero_type == @HERO_ACTIVE )
{
myself::ShowPage( talker, "olympiad_operator031.htm" );
}
else
{
myself::ShowPage( talker, "olympiad_operator031a.htm" );
}
}
else
{
myself::ShowPage( talker, "olympiad_operator031.htm" );
}
}
else if( reply == 513 )
{
myself::ShowMultisell( reply, talker );
}
}
else if( ask == -71 )
{
if( reply == 0 )
{
myself::ShowPage( talker, "olympiad_operator030.htm" );
}
else if( reply == 1 )
{
myself::DeletePreviousOlympiadPoint( talker,
myself::GetPreviousOlympiadPoint( talker ) );
}
}
else if( ask == -80 )
{
}
else if( ask == -110 )
{
myself::FHTML_SetFileName( fhtml0, "olympiad_operator_rank_class.htm" );
for( i0 = 1; i0 <= 15; i0 = i0 + 1 )
{
if( myself::GetRankByOlympiadRankOrder( reply, i0 ) == 0 )
{
break;
}
myself::FHTML_SetInt( fhtml0, "Rank" + i0,
myself::GetRankByOlympiadRankOrder( reply, i0 ) );
myself::FHTML_SetStr( fhtml0, "Name" + i0,
myself::GetNameByOlympiadRankOrder( reply, i0 ) );
}
myself::ShowFHTML( talker, fhtml0 );
}
else if( ask == -130 )
{
myself::ObserveOlympiad( talker, reply );
}
}
EventHandler DELETE_PREVIOUS_OLYMPIAD_POINT_RETURNED( talker, ask, reply, i0, i1 )
{
i1 = 0;
if( reply != 0 )
{
if( talker.hero_type == @HERO_WAITING ||
talker.hero_type == @HERO_ACTIVE )
{
i1 = 100;
}
if( ask > 2000 )
{
i0 = ( 2000 + i1 ) * 1000;
}
else if( ask < 40 )
{
i0 = i1 * 1000;
}
else
{
i0 = ( ask + i1 ) * 1000;
}
myself::AddLogEx( 1, talker, ask, i0 );
myself::GiveItem1( talker, 6651, i0 );
}
}
}