fodev.net

FOnline Development => Questions and Answers => Topic started by: KingR on December 07, 2021, 12:01:02 am

Title: Special Encounter
Post by: KingR 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!
Title: Re: Special Encounter
Post by: KingR 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
Title: Re: Special Encounter
Post by: kompreSor 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));
Title: Re: Special Encounter
Post by: KingR on December 11, 2021, 07:18:20 pm
Thank you so much about the tip Kompressor! I will try it!