Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main()
- {
- object oPC = GetEnteringObject();
- if (!GetIsPC(oPC)) return;
- int iCounter = 1;
- int iLoop;
- int iRandom = Random(2);
- if (iRandom!=0) return;
- object oEncounter = GetNearestObject(OBJECT_TYPE_ENCOUNTER, oPC, iCounter);
- while (GetIsObjectValid(oEncounter))
- {
- iCounter++;
- SetEncounterActive(FALSE, oEncounter);
- oEncounter = GetNearestObject(OBJECT_TYPE_ENCOUNTER, oPC, iCounter);
- }
- for (iLoop = 0; iLoop < (Random(iCounter/4) + 1); iLoop++)
- {
- iRandom = Random(iCounter) + 1;
- oEncounter = GetNearestObject(OBJECT_TYPE_ENCOUNTER, oPC, iRandom);
- SetEncounterActive(TRUE, oEncounter);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement