Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1. void main()
  2. {
  3.     object oPC = GetEnteringObject();
  4.  
  5.     if (!GetIsPC(oPC)) return;
  6.  
  7.     int iCounter = 1;
  8.     int iLoop;
  9.     int iRandom = Random(2);
  10.  
  11.     if (iRandom!=0) return;
  12.  
  13.     object oEncounter = GetNearestObject(OBJECT_TYPE_ENCOUNTER, oPC, iCounter);
  14.     while (GetIsObjectValid(oEncounter))
  15.     {
  16.         iCounter++;
  17.         SetEncounterActive(FALSE, oEncounter);
  18.         oEncounter = GetNearestObject(OBJECT_TYPE_ENCOUNTER, oPC, iCounter);
  19.     }
  20.  
  21.     for (iLoop = 0; iLoop < (Random(iCounter/4) + 1); iLoop++)
  22.     {
  23.         iRandom = Random(iCounter) + 1;
  24.         oEncounter = GetNearestObject(OBJECT_TYPE_ENCOUNTER, oPC, iRandom);
  25.         SetEncounterActive(TRUE, oEncounter);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement