Jump to content
  • 0

How to do a global stat reset?


sietse11

Question


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  127
  • Reputation:   7
  • Joined:  02/10/13
  • Last Seen:  

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?

Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  100
  • Topics Per Day:  0.03
  • Content Count:  333
  • Reputation:   7
  • Joined:  03/01/14
  • Last Seen:  

 

 

 

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 :P

 

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;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  100
  • Topics Per Day:  0.03
  • Content Count:  333
  • Reputation:   7
  • Joined:  03/01/14
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  


if (getgmlevel() >= 99){

    mes "Do you want to reset Stats for everyone?";

    if(select("Yes:No") == 1){

        addrid(0);

resetstatus;

    }

}

close;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  100
  • Topics Per Day:  0.03
  • Content Count:  333
  • Reputation:   7
  • Joined:  03/01/14
  • Last Seen:  

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. :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  127
  • Reputation:   7
  • Joined:  02/10/13
  • Last Seen:  

Pretty decent. My only problem now is I cant use the defaulth options as a GM.

But thats easily fixed /meh

 

Ill add the full code later.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  127
  • Reputation:   7
  • Joined:  02/10/13
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  100
  • Topics Per Day:  0.03
  • Content Count:  333
  • Reputation:   7
  • Joined:  03/01/14
  • Last Seen:  

 

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 by Greyford
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

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. 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  127
  • Reputation:   7
  • Joined:  02/10/13
  • Last Seen:  

 

 

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 :P

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  127
  • Reputation:   7
  • Joined:  02/10/13
  • Last Seen:  

Spank you!

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...