From a7ad6a99f24c1701dcd9085b623716bed62bcedf Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 23 Jul 2018 19:42:34 -0300 Subject: [skip ci] attempt to best performance for #ADD_LVL handler --- npc/functions/clientversion.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'npc') diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt index c2e85c791..6638a2c9e 100644 --- a/npc/functions/clientversion.txt +++ b/npc/functions/clientversion.txt @@ -55,6 +55,11 @@ function script checkclientversion { mesc l("Anyway, ##Bwelcome##b, and have fun! If you need anything, we are a keypress from distance!"), 3; //atcommand "@blvl "+#ADD_LVL; getitem TimeFlask, 1; + do { + .@v=readparam(NextBaseExp)-readparam(BaseExp); + getexp .@v, 0; + #ADD_LVL-=.@v; + } while (readparam(BaseExp)+#ADD_LVL > readparam(NextBaseExp)); getexp #ADD_LVL, 0; #ADD_LVL=0; // TODO: Use @super debug functions and force player to join a guild. We will need the guild ID, though. -- cgit v1.2.3-70-g09d2