DRom
Задание я вроде выполнил:
func void PC_Sleep(var int t,var int minute)
{
AI_StopProcessInfos (self);
PLAYER_MOBSI_PRODUCTION = MOBSI_NONE;
self.aivar[AIV_INVINCIBLE] = FALSE;
if (Wld_IsTime (0, 0, t, minute))
{
Wld_SetTime (t, minute);
}
else
{
t = t + 24;
Wld_SetTime (t, minute);
};
Wld_StopEffect ("DEMENTOR_FX");
if (SC_IsObsessed == TRUE)
{
PrintScreen (PRINT_SleepOverObsessed, -1, -1, FONT_Screen, 2);
}
else
{
PrintScreen (PRINT_SleepOver, -1, -1, FONT_Screen, 2);
hero.attribute[ATR_HITPOINTS] = hero.attribute[ATR_HITPOINTS_MAX];
hero.attribute[ATR_MANA] = hero.attribute[ATR_MANA_MAX];
};
PrintGlobals (PD_ITEM_MOBSI);
Npc_SendPassivePerc (hero, PERC_ASSESSENTERROOM, NULL, hero);
};
func void sleepabit_s1()
{
var C_Npc her;
var C_Npc rock;
her = Hlp_GetNpc (PC_Hero);
rock = Hlp_GetNpc (PC_Rockefeller);
if ((Hlp_GetInstanceID (self) == Hlp_GetInstanceID (her)) || (Hlp_GetInstanceID (self) == Hlp_GetInstanceID (rock)))
{
self.aivar[AIV_INVINCIBLE] = TRUE;
PLAYER_MOBSI_PRODUCTION = MOBSI_SleepAbit;
AI_ProcessInfos (her);
if (SC_IsObsessed == TRUE)
{
Wld_PlayEffect ("DEMENTOR_FX", hero, hero, 0, 0, 0, FALSE);
};
};
};
instance PC_SleepTime_Morning(C_Info)
{
npc = PC_Hero;
condition = PC_SleepTime_Morning_Condition;
information = PC_SleepTime_Morning_Info;
important = 0;
permanent = 1;
description = "Спать до утра";
};
func int PC_SleepTime_Morning_Condition()
{
if (PLAYER_MOBSI_PRODUCTION == MOBSI_SleepAbit)
{
return 1;
};
};
func void PC_SleepTime_Morning_Info()
{
var int value_haotic;
value_haotic = Hlp_Random (90);
if ((value_haotic >= 0) && (value_haotic < 15))
{
PC_Sleep (7,0);
}
else if ((value_haotic > 15) && (value_haotic <= 30))
{
PC_Sleep (7,15);
}
else if ((value_haotic > 30) && (value_haotic <= 40))
{
PC_Sleep (7,30);
}
else if ((value_haotic > 40) && (value_haotic <= 50))
{
PC_Sleep (8,0);
}
else if ((value_haotic > 50) && (value_haotic <= 60))
{
PC_Sleep (8,15);
}
else if ((value_haotic > 60) && (value_haotic <= 75))
{
PC_Sleep (8,30);
}
else if ((value_haotic > 75) && (value_haotic <= 90))
{
PC_Sleep (9,0);
}
else if (value_haotic == 75)
{
PC_Sleep (12,30);
};
};