sietse11 Posted March 23, 2014 Posted March 23, 2014 How do I perform a global stat reset? I wanne add a bit of code to the stat resetter giving GM's of gm lvl 99+ the possibibilty to do a global stat reset. How would I add this to euphies stat resetter? Quote
Yuka Posted April 4, 2014 Posted April 4, 2014 if (getgmlevel() >= 99){ mes "Do you want to reset Stats for everyone?"; if(select("Yes:No") == 1){ addrid(0); resetstatus; } } close; It seems this only works for online characters. I need it to work for the entire character database. Any easy fix for this? You can use my script for this. It will reset a player's stats on login. (only once every time you reset) Can you please add the full code I should be using in your next reply, cause im confused if (getgmlevel() >= 99){ mes "Do you want to reset Stats for everyone?"; if(select("Yes:No") == 1){ goto L_reset; close; end; } } OnInterIfInitOnce: set $statreset, 0; end; OnPCLoginEvent: if (statreset != $statreset){ dispbottom "Your stats have been resetted."; resetstatus; set statreset, $statreset; } end; L_reset: set $statreset, statreset+1; dispbottom "Everyone's Stats have been resetted."; end; Quote
Yuka Posted March 23, 2014 Posted March 23, 2014 I don't know the script, but basically it should look like this: if (getgmlevel() >= 99){ mes "Do you want to reset Stats for everyone?"; if(select("Yes:No") == 1){ goto L_reset; close; end; } } OnInterIfInitOnce: set $statreset, 0; end; OnPCLoginEvent: if (statreset != $statreset){ dispbottom "Your stats have been resetted."; resetstatus; set statreset, $statreset; } end; L_reset: set $statreset, statreset+1; dispbottom "Everyone's Stats have been resetted."; end; Just put it at the beginning of your script. You might need to replace "OnInterIfInitOnce" with "OnInit" (watch out if there already is an OnInit or OnInterIfInitOnce) for the first time and then change it back. It should pop a NPC dialouge with the quesion "Do you want to reset Stats for everyone?" for GMs with GM-Level >98 and just the usual stuff for everyone else. When you select "No" it should continue with the normal script. Quote
Patskie Posted March 24, 2014 Posted March 24, 2014 if (getgmlevel() >= 99){ mes "Do you want to reset Stats for everyone?"; if(select("Yes:No") == 1){ addrid(0); resetstatus; } } close; Quote
Yuka Posted March 24, 2014 Posted March 24, 2014 if (getgmlevel() >= 99){ mes "Do you want to reset Stats for everyone?"; if(select("Yes:No") == 1){ addrid(0); resetstatus; } } close; Oh wow, addrid is pretty cool. Quote
sietse11 Posted March 27, 2014 Author Posted March 27, 2014 Pretty decent. My only problem now is I cant use the defaulth options as a GM. But thats easily fixed Ill add the full code later. Quote
sietse11 Posted April 2, 2014 Author Posted April 2, 2014 if (getgmlevel() >= 99){ mes "Do you want to reset Stats for everyone?"; if(select("Yes:No") == 1){ addrid(0); resetstatus; } } close; It seems this only works for online characters. I need it to work for the entire character database. Any easy fix for this? Quote
Yuka Posted April 2, 2014 Posted April 2, 2014 (edited) if (getgmlevel() >= 99){ mes "Do you want to reset Stats for everyone?"; if(select("Yes:No") == 1){ addrid(0); resetstatus; } } close; It seems this only works for online characters. I need it to work for the entire character database. Any easy fix for this? You can use my script for this. It will reset a player's stats on login. (only once every time you reset) Edited April 2, 2014 by Greyford Quote
EL Dragon Posted April 3, 2014 Posted April 3, 2014 Open your mysql database and use the "ragnarok" db, execute this code: UPDATE `char` SET `str`=1, `agi`=1, `vit`=1, `int`=1, `dex`=1, `luk`=1; NOTE: This code will set every stat of ALL PLAYERS (listed inside the `char` table) to 1, but will not give the players statpoints. Quote
sietse11 Posted April 4, 2014 Author Posted April 4, 2014 if (getgmlevel() >= 99){ mes "Do you want to reset Stats for everyone?"; if(select("Yes:No") == 1){ addrid(0); resetstatus; } } close; It seems this only works for online characters. I need it to work for the entire character database. Any easy fix for this? You can use my script for this. It will reset a player's stats on login. (only once every time you reset) Can you please add the full code I should be using in your next reply, cause im confused Quote
Capuche Posted April 9, 2014 Posted April 9, 2014 Another way - script reset_all -1,{ OnInit: bindatcmd "resetall", strnpcinfo(3) + "::OnCmd",99,99; end; OnCmd: .@config$ = checkre(3) ? "prere" : "re"; .group_limit = ( atoi(.@atcmd_parameters$[0]) < 1 ) ? 99 : atoi( .@atcmd_parameters$[0] ); query_sql "update `char` set status_point = ( select points from `status_points_"+ .@config$ +"` where `status_points_"+ .@config$ +"`.`base_level` = `char`.`base_level` ), "+ "`str` = 1, `agi` = 1, `vit` = 1, `int` = 1, `dex` = 1, `luk` = 1 "+ "where online = 0 and account_id not in ( select account_id from login where group_id >= "+ .group_limit +" )"; announce "[GM] " + strcharinfo(0) + " reset all the stats.", bc_all; addrid 0; if ( getgroupid() < .group_limit ) resetstatus; end; } [paste=79h03exenzoq] [paste=cks0m5eejyj] This one instantly resets the stats and give the status points to all players (online/offline) below the specific group level (99 by default) ex @resetall 80 Quote
Question
sietse11
How do I perform a global stat reset?
I wanne add a bit of code to the stat resetter giving GM's of gm lvl 99+ the possibibilty to do a global stat reset.
How would I add this to euphies stat resetter?
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.