• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ Event that puts everyone on the same level

Engradiel

Member
Joined
May 3, 2009
Messages
150
Reaction score
14
Location
Brazil
Hello friends, I'm having trouble writing a code to make all players have the same level. I use TFS 1.3.

The problem is that I can use addexperience or removeexperience and save the experience and level in a storage, but there is a risk of not reverting it, which is dangerous and this makes the ranking of powergamers' exp and level confusing.

Is there a way in Lua or C++ that makes you change the character's level only in the game temporarily, but on the website the level and experience remain the same.

So when the player relogs, the level returns to normal.

I wanted to make an event where all level 8 players go to level 100 when they enter, and level 200 players also go to level 100. However, when the event ends, everyone returns to their original level.

Thank you.
 
Yes, there is such a function.

However, it would be a custom script and someone would charge for it.

My project is based on TFS 1.3 too, but honestly?

TFS 1.3 HAS SO MANY BUGS/CRASHES that I can't even comment on them.

[GOOD LUCK]
 
It's just a matter of creating a new conditions to change the level and others, you can call it STAT_LEVEL, just duplicates the getLevel() function, with a new one for the base level, and then apply the modifier. You'll end up with something like VarStats[STAT_LEVEL]

It's not a mystery, it's just that everyone wants everything without even putting a little effort into thinking. You can do the same for the rest of the things for the event like MAGICPOINTS, SPEED, SKILLS, ETC. Just Conditions, that not affect higscores. Working with time, storage, or whatever you want.
 
Is there a way in Lua or C++ that makes you change the character's level only in the game temporarily, but on the website the level and experience remain the same.
Each player has save column in database table players. Simplest solution is to set player 'save' to '0' (with SQL query), then edit whatever you want (addExp, skill, items, whatever) and when event ends, restore their level/skill/items and then set 'save' to '1'. Changes to level won't be visible anywhere on website/powergames etc., as server will block 'save' function in C++.

In case of OTS crash during event, they also won't lose/gain anything. Just make sure, it 'sets save = 1' in some creaturescripts onLogin event or globalscripts onStartup (globally for all players), so if engine crashes during event, player will have 'save = 1' set in database, before they logout (save = 0, would block their progress [level, skills, items etc.]).
 
Back
Top