From aec48a9a849d8b5b092d41fb483aedef1f756d7e Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 14 Oct 2022 23:54:58 -0300 Subject: Add boundaries: The account conversion feature will never put you above the TOP 3 average level. --- npc/functions/clientversion.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'npc') diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt index 78e81feed..87ff89f9f 100644 --- a/npc/functions/clientversion.txt +++ b/npc/functions/clientversion.txt @@ -1135,18 +1135,22 @@ function script clientupdater { // Permanent Level Boost // #ADD_LVL means the user have to right to get some levels. This is a sketch. The code might be deleted. if (#ADD_LVL) { + //logmes "[Merger] EXP +"+#ADD_LVL, LOGMES_ATCOMMAND; if ((readparam(BaseExp)+#ADD_LVL > readparam(NextBaseExp))) { do { + if (BaseLevel >= TOP3AVERAGELVL()) break; // Boundaries .@v=readparam(NextBaseExp)-readparam(BaseExp); getexp .@v, 0; #ADD_LVL-=.@v; } while (readparam(BaseExp)+#ADD_LVL > readparam(NextBaseExp)); } - logmes "[Merger] EXP +"+#ADD_LVL, LOGMES_ATCOMMAND; - getexp #ADD_LVL, 0; - #ADD_LVL=0; + // Only give remaining EXP if you did not hit the boundary + if (BaseLevel < TOP3AVERAGELVL()) { + getexp #ADD_LVL, 0; + #ADD_LVL=0; + } //rodex_sendmail(getcharid(0), "TMW2 Team", "Welcome to Moubootaur Legends", "Hey, thanks for believing on us! We hope to have a great time together. Any problem, ask for help in #world - the Discord bridge! Enjoy our game!", 20); - // TODO: Maybe an item which lets you open the storage anywhere? + // TODO: Maybe give an item which lets you open the storage anywhere? } if (.@dg) { -- cgit v1.2.3-70-g09d2