PWE_PRC8/_module/nss/ff_pc_loops.nss
Jaysyn904 ee1dc35889 Initial Commit
Initial Commit
2025-04-03 10:29:41 -04:00

35 lines
1.2 KiB
Plaintext

// FastFrench 8 janvier 2003
// FF modifie le 13/1/03
// -> verifie la coherence d'un groupe, et ejecte (ou detruit si NPC) ceux qui s'eloignent d'au moins 5 niveaux
// FF modifie le 23/1/03 : memorise aussi la position du perso
#include "ff_include"
void PCLoop2()
{
float fDelayRandom = (FF_UPDATEDELAY * (1.0 + Random(200))/100.0);
SetLocalInt(OBJECT_SELF, "Time", GetLocalInt(OBJECT_SELF, "Time") + FloatToInt(fDelayRandom));
ff_FlushData(OBJECT_SELF);
// Avoid to save the PC if ShapeChanged or Polymorphed
int iApp = GetAppearanceType(OBJECT_SELF);
if (iApp == APPEARANCE_TYPE_DWARF ||
iApp == APPEARANCE_TYPE_ELF ||
iApp == APPEARANCE_TYPE_HALF_ELF ||
iApp == APPEARANCE_TYPE_HALF_ORC ||
iApp == APPEARANCE_TYPE_HALFLING ||
iApp == APPEARANCE_TYPE_HUMAN) ExportSingleCharacter(OBJECT_SELF);
DelayCommand(fDelayRandom,PCLoop2());
}
void main()
{
float fRandom = FF_UPDATEDELAY * (0.5 + Random(200)/100.0);
// Player Loop - introduction delai variable - execute seulement la premiere fois
if (GetIsPC(OBJECT_SELF))
{
SetLocalInt(OBJECT_SELF,"LocalNbSave",0);
DelayCommand(fRandom+0.1, PCLoop2());
}
}