Author Topic: Special Encounter  (Read 5803 times)

Special Encounter
« on: December 07, 2021, 12:01:02 am »
Hi everyone!

In worldmap.fos there is a formula which I use to manage special encounters.

_CheckSpecialEncounter(LOCATION_SecretBunker, (zone.Terrain == TERRAIN_Desert && (uint(GetLvar(leader, LVAR_q_secret_vault)) <= ELAPSED_TIME) && (Random(1, 18000) == 1 && leader.Stat[ST_LEVEL] > Random(0, 23))), SetLvar(leader, LVAR_q_secret_vault, ELAPSED_TIME + REAL_HOUR(8)));

I wan't to make a special encouter unique, I imagine it is related to this formula and/or a variable, but i don't find the solution.
If I change this part of the formula:  ELAPSED_TIME + REAL_HOUR(8))); I wouldn't have any results, because it looks like this part manages the time before the test ....

The solution would be a variable?

Thanks for your help guys!

Re: Special Encounter
« Reply #1 on: December 07, 2021, 12:07:39 am »
ps : When I mean make it unique is that the special encounter would only happen once per player

Offline kompreSor

  • FOnline 3
Re: Special Encounter
« Reply #2 on: December 08, 2021, 11:59:25 pm »
just make var which wont end with timer
Code: [Select]
_CheckSpecialEncounter(LOCATION_SecretBunker, (zone.Terrain == TERRAIN_Desert && (uint(GetLvar(leader, LVAR_my_unique_encounter_var)) == 0) && (Random(1, 18000) == 1 && leader.Stat[ST_LEVEL] > Random(0, 23))), SetLvar(leader, LVAR_my_unique_encounter_var, 1));

Re: Special Encounter
« Reply #3 on: December 11, 2021, 07:18:20 pm »
Thank you so much about the tip Kompressor! I will try it!