Jump to content
  • 0
Brynner

R>Script that will automatically reset all stats of all character?

Question

is it possible to make it work? because i noticed one of my gm adjusted the stats of some players i just want to make it automatically reset if the stats is not normal?specially on 99 max level only. the normal stats is 2 99 and 1 9.

 

ex.

str 99

agi 99

dex 9

 

which is normal.

 

and if the stats is

str 99

agi 99

dex 9

vit 50

 

it will bring back to normal stats. so it would be reset to 1.

Share this post


Link to post
Share on other sites

26 answers to this question

Recommended Posts

  • 0
function    script    checkstatepoint    { // only for  pre-re mode    for(.@j=13;.@j<=18;.@j++){        set .@temp,readparam(.@j);        if (.@temp < 2 ) continue;        set .@size,.@temp/10 + (.@temp %10 ?1:0);        for(.@i=1;.@i<=.@size;.@i++){             if( .@temp > (.@i*10+1) )                set .@tp,.@tp + (.@i+1)* 10;            else                set .@tp,.@tp + (.@i+1) * (.@temp -((.@i-1)*10 +2)+1);        }    }    set .@tp,.@tp+StatusPoint;    return .@tp}-    script    asdf12345    -1,{OnPCLoginEvent:    if( Upper==1 && BaseLevel==99 && callfunc("checkstatepoint") > 1325){        resetstatus;        set StatusPoint,1325    }end;}

 

I m not sure  how many statepoint  the baselevel 99 2nd job (T)  has , you can modify 1325  to correct  number

 

edit: fix  bug

Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

Here's my method. This verifies max stat parameter and the total stat count.
 

-    script    verifystats    -1,{    OnPCLoginEvent:        // Check and verify all stats        for (.@i = bStr; .@i <= bLuk; .@i++)        {            // Add and count stat points            .@StatCount += readparam(.@i);                        // Verify stats            if (readparam(.@i) > .MaxStat || .@StatCount > .MaxCount)            {                // Reset status points                ResetStatus;                                // Reset skill points (if enabled)                if (.SkillReset)                    ResetSkill;                                    // Display error message                message strcharinfo(0), "Verification System : Your stats have been reset.";            }        }            end;            OnInit:        // Configuration        .MaxStat = 99;        // Max stat parameter        .MaxCount = 210;    // Max stat count (ex: 99 + 99 + 9 + 1 + 1 + 1)        .SkillReset = 0;    // Reset skills? (0 = off, 1 = on)            end;    }

Share this post


Link to post
Share on other sites
  • 0

thanks. but how to change this only the normal player will reset the stats? but if you are gm account it will not reset your stats.

Edited by bgamez23

Share this post


Link to post
Share on other sites
  • 0

there is a bug on this script. the stats still reset even your stats is not over stats.

 

Are you using my script on a Hercules server?

Share this post


Link to post
Share on other sites
  • 0

 

there is a bug on this script. the stats still reset even your stats is not over stats.

 

Are you using my script on a Hercules server?

 

1325 statpoint can be distributed as the pic , its over 210

 

A42UFD.jpg

Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

 

there is a bug on this script. the stats still reset even your stats is not over stats.

 

Are you using my script on a Hercules server?

yup. the stats will be reset event the stats is not over stats.

just try to distribute the stats. don't max the other one. only 1 99 stats.

Share this post


Link to post
Share on other sites
  • 0

Revised.

 

 

-    script    verifystats    -1,{    OnPCLoginEvent:        // Check and verify all stats        for (.@i = bStr; .@i <= bLuk; .@i++)        {            // Add and count stat points            .@StatCount += readparam(.@i);                        // Count max stat parameters            if (readparam(.@i) == .MaxStat)                .@MaxStatCount++;                        // Verify stats            if (readparam(.@i) > .MaxStat || .@MaxStatCount >= .ParamCount && .@StatCount > .MaxCount)            {                // Reset status points                ResetStatus;                                // Reset skill points (if enabled)                if (.SkillReset)                    ResetSkill;                                    // Display error message                message strcharinfo(0), "Verification System : Your stats have been reset.";            }        }            end;            OnInit:        // Configuration        .MaxStat = 99;        // Max stat parameter        .ParamCount = 2;    // Max stat parameter count        .MaxCount = 210;    // Max stat count (ex: 99 + 99 + 9 + 1 + 1 + 1)        .SkillReset = 0;    // Reset skills? (0 = off, 1 = on)            end;    }

Share this post


Link to post
Share on other sites
  • 0

 

Revised.

 

 

-    script    verifystats    -1,{    OnPCLoginEvent:        // Check and verify all stats        for (.@i = bStr; .@i <= bLuk; .@i++)        {            // Add and count stat points            .@StatCount += readparam(.@i);                        // Count max stat parameters            if (readparam(.@i) == .MaxStat)                .@MaxStatCount++;                        // Verify stats            if (readparam(.@i) > .MaxStat || .@MaxStatCount >= .ParamCount && .@StatCount > .MaxCount)            {                // Reset status points                ResetStatus;                                // Reset skill points (if enabled)                if (.SkillReset)                    ResetSkill;                                    // Display error message                message strcharinfo(0), "Verification System : Your stats have been reset.";            }        }            end;            OnInit:        // Configuration        .MaxStat = 99;        // Max stat parameter        .ParamCount = 2;    // Max stat parameter count        .MaxCount = 210;    // Max stat count (ex: 99 + 99 + 9 + 1 + 1 + 1)        .SkillReset = 0;    // Reset skills? (0 = off, 1 = on)            end;    }

how can i set only one notification only?

image.jpg

Share this post


Link to post
Share on other sites
  • 0

 

Revised.

 

 

-    script    verifystats    -1,{    OnPCLoginEvent:        // Check and verify all stats        for (.@i = bStr; .@i <= bLuk; .@i++)        {            // Add and count stat points            .@StatCount += readparam(.@i);                        // Count max stat parameters            if (readparam(.@i) == .MaxStat)                .@MaxStatCount++;                        // Verify stats            if (readparam(.@i) > .MaxStat || .@MaxStatCount >= .ParamCount && .@StatCount > .MaxCount)            {                // Reset status points                ResetStatus;                                // Reset skill points (if enabled)                if (.SkillReset)                    ResetSkill;                                    // Display error message                message strcharinfo(0), "Verification System : Your stats have been reset.";            }        }            end;            OnInit:        // Configuration        .MaxStat = 99;        // Max stat parameter        .ParamCount = 2;    // Max stat parameter count        .MaxCount = 210;    // Max stat count (ex: 99 + 99 + 9 + 1 + 1 + 1)        .SkillReset = 0;    // Reset skills? (0 = off, 1 = on)            end;    }

i want to use it but can you add/change it alittle bit like , it will only detect when character is abnormal stats not every time they reconnect and if they where detected they will get DC within 3 secs.. and GM accounts are not affected on this script..

 

Thanks

Edited by P r o p e r t i e s

Share this post


Link to post
Share on other sites
  • 0

 

 

 

 

Revised.

 

 

-    script    verifystats    -1,{    OnPCLoginEvent:        // Check and verify all stats        for (.@i = bStr; .@i <= bLuk; .@i++)        {            // Add and count stat points            .@StatCount += readparam(.@i);                        // Count max stat parameters            if (readparam(.@i) == .MaxStat)                .@MaxStatCount++;                        // Verify stats            if (readparam(.@i) > .MaxStat || .@MaxStatCount >= .ParamCount && .@StatCount > .MaxCount)            {                // Reset status points                ResetStatus;                                // Reset skill points (if enabled)                if (.SkillReset)                    ResetSkill;                                    // Display error message                message strcharinfo(0), "Verification System : Your stats have been reset.";            }        }            end;            OnInit:        // Configuration        .MaxStat = 99;        // Max stat parameter        .ParamCount = 2;    // Max stat parameter count        .MaxCount = 210;    // Max stat count (ex: 99 + 99 + 9 + 1 + 1 + 1)        .SkillReset = 0;    // Reset skills? (0 = off, 1 = on)            end;    }

how can i set only one notification only?

image.jpg

 

 

 

Here's a revised version (again) to fix the multiple messages:

-    script    verifystats    -1,{    OnPCLoginEvent:        // Check and verify all stats        for (.@i = bStr; .@i <= bLuk; .@i++) {            // Add and count stat points            .@StatCount += readparam(.@i);                        // Count max stat parameters            if (readparam(.@i) == .MaxStat) {                .@MaxStatCount++;			}                        // Verify stats            if (readparam(.@i) > .MaxStat || .@MaxStatCount >= .ParamCount && .@StatCount > .MaxCount) {                // Reset status points                ResetStatus;                                // Reset skill points (if enabled)                if (.SkillReset) {                    ResetSkill;										// Display error message					message strcharinfo(0), "Verification System : Your stats have been reset.";				}            }        }            end;            OnInit:        // Configuration        .MaxStat = 99;        // Max stat parameter        .ParamCount = 2;    // Max stat parameter count        .MaxCount = 210;    // Max stat count (ex: 99 + 99 + 9 + 1 + 1 + 1)        .SkillReset = 0;    // Reset skills? (0 = off, 1 = on)            end;    }

Disclaimer: Untested.

 

 

 

 

 

 

Revised.

 

 

-    script    verifystats    -1,{    OnPCLoginEvent:        // Check and verify all stats        for (.@i = bStr; .@i <= bLuk; .@i++)        {            // Add and count stat points            .@StatCount += readparam(.@i);                        // Count max stat parameters            if (readparam(.@i) == .MaxStat)                .@MaxStatCount++;                        // Verify stats            if (readparam(.@i) > .MaxStat || .@MaxStatCount >= .ParamCount && .@StatCount > .MaxCount)            {                // Reset status points                ResetStatus;                                // Reset skill points (if enabled)                if (.SkillReset)                    ResetSkill;                                    // Display error message                message strcharinfo(0), "Verification System : Your stats have been reset.";            }        }            end;            OnInit:        // Configuration        .MaxStat = 99;        // Max stat parameter        .ParamCount = 2;    // Max stat parameter count        .MaxCount = 210;    // Max stat count (ex: 99 + 99 + 9 + 1 + 1 + 1)        .SkillReset = 0;    // Reset skills? (0 = off, 1 = on)            end;    }

i want to use it but can you add/change it alittle bit like , it will only detect when character is abnormal stats not every time they reconnect and if they where detected they will get DC within 3 secs.. and GM accounts are not affected on this script..

 

Thanks

 

 

 

Add this code at line 4 for the GM bypass:

if (getgmlevel()) {	end;}

 

Add this code at line 28 for the timer and kick:

for (.@i = 0; .@i < 3; .@i++) {	message strcharinfo(0), "You will be disconnected in "+ (3 - .@i) +" seconds.";	sleep2 1000;}atcommand "@kick "+ strcharinfo(0);

Share this post


Link to post
Share on other sites
  • 0

 

 

 

 

 

Revised.

 

 

-    script    verifystats    -1,{    OnPCLoginEvent:        // Check and verify all stats        for (.@i = bStr; .@i <= bLuk; .@i++)        {            // Add and count stat points            .@StatCount += readparam(.@i);                        // Count max stat parameters            if (readparam(.@i) == .MaxStat)                .@MaxStatCount++;                        // Verify stats            if (readparam(.@i) > .MaxStat || .@MaxStatCount >= .ParamCount && .@StatCount > .MaxCount)            {                // Reset status points                ResetStatus;                                // Reset skill points (if enabled)                if (.SkillReset)                    ResetSkill;                                    // Display error message                message strcharinfo(0), "Verification System : Your stats have been reset.";            }        }            end;            OnInit:        // Configuration        .MaxStat = 99;        // Max stat parameter        .ParamCount = 2;    // Max stat parameter count        .MaxCount = 210;    // Max stat count (ex: 99 + 99 + 9 + 1 + 1 + 1)        .SkillReset = 0;    // Reset skills? (0 = off, 1 = on)            end;    }

how can i set only one notification only?

image.jpg

 

 

 

Here's a revised version (again) to fix the multiple messages:

-    script    verifystats    -1,{    OnPCLoginEvent:        // Check and verify all stats        for (.@i = bStr; .@i <= bLuk; .@i++) {            // Add and count stat points            .@StatCount += readparam(.@i);                        // Count max stat parameters            if (readparam(.@i) == .MaxStat) {                .@MaxStatCount++;			}                        // Verify stats            if (readparam(.@i) > .MaxStat || .@MaxStatCount >= .ParamCount && .@StatCount > .MaxCount) {                // Reset status points                ResetStatus;                                // Reset skill points (if enabled)                if (.SkillReset) {                    ResetSkill;										// Display error message					message strcharinfo(0), "Verification System : Your stats have been reset.";				}            }        }            end;            OnInit:        // Configuration        .MaxStat = 99;        // Max stat parameter        .ParamCount = 2;    // Max stat parameter count        .MaxCount = 210;    // Max stat count (ex: 99 + 99 + 9 + 1 + 1 + 1)        .SkillReset = 0;    // Reset skills? (0 = off, 1 = on)            end;    }

Disclaimer: Untested.

 

 

 

 

>> 

 

Revised.

 

 

-    script    verifystats    -1,{    OnPCLoginEvent:        // Check and verify all stats        for (.@i = bStr; .@i <= bLuk; .@i++)        {            // Add and count stat points            .@StatCount += readparam(.@i);                        // Count max stat parameters            if (readparam(.@i) == .MaxStat)                .@MaxStatCount++;                        // Verify stats            if (readparam(.@i) > .MaxStat || .@MaxStatCount >= .ParamCount && .@StatCount > .MaxCount)            {                // Reset status points                ResetStatus;                                // Reset skill points (if enabled)                if (.SkillReset)                    ResetSkill;                                    // Display error message                message strcharinfo(0), "Verification System : Your stats have been reset.";            }        }            end;            OnInit:        // Configuration        .MaxStat = 99;        // Max stat parameter        .ParamCount = 2;    // Max stat parameter count        .MaxCount = 210;    // Max stat count (ex: 99 + 99 + 9 + 1 + 1 + 1)        .SkillReset = 0;    // Reset skills? (0 = off, 1 = on)            end;    }

i want to use it but can you add/change it alittle bit like , it will only detect when character is abnormal stats not every time they reconnect and if they where detected they will get DC within 3 secs.. and GM accounts are not affected on this script..

 

Thanks

 

 

 

Add this code at line 4 for the GM bypass:

if (getgmlevel()) {	end;}

 

Add this code at line 28 for the timer and kick:

for (.@i = 0; .@i < 3; .@i++) {	message strcharinfo(0), "You will be disconnected in "+ (3 - .@i) +" seconds.";	sleep2 1000;}atcommand "@kick "+ strcharinfo(0);

 

Thanks! i try to add those line, but when i try to edit the stats of normal char using gm char the normal character was not detected unless until he will reconnect..

Edited by P r o p e r t i e s

Share this post


Link to post
Share on other sites
  • 0

here is what i did and it works now. thank you

-    script    verifystats    -1,{     OnPCLoginEvent:        // Check and verify all stats        for (.@i = bStr; .@i <= bLuk; .@i++) {            // Add and count stat points            .@StatCount += readparam(.@i);			 }            // Count max stat parameters            if (readparam(.@i) == .MaxStat)                .@MaxStatCount++;                        // Verify stats            if (readparam(.@i) > .MaxStat || .@MaxStatCount >= .ParamCount && .@StatCount > .MaxCount)            {                // Reset status points                ResetStatus;                                // Reset skill points (if enabled)                if (.SkillReset)                    ResetSkill;										// Display error message					message strcharinfo(0), "Verification System : Your stats have been reset.";		            }        }            end;            OnInit:        // Configuration        .MaxStat = 99;        // Max stat parameter        .ParamCount = 2;    // Max stat parameter count        .MaxCount = 210;    // Max stat count (ex: 99 + 99 + 9 + 1 + 1 + 1)        .SkillReset = 0;    // Reset skills? (0 = off, 1 = on)            end;    }
Edited by bgamez23

Share this post


Link to post
Share on other sites
  • 0

Thanks! i try to add those line, but when i try to edit the stats of normal char using gm char the normal character was not detected unless until he will reconnect..

 

that is intended since the script only runs on login

Edited by Mumbles
Reduced quote level.

Share this post


Link to post
Share on other sites
  • 0

that is intended since the script only runs on login

 

i see, but can you please add that can detect also when a GM edit the stats of the normal character, then the normal character will be disconnected within 3 secs.. thank you!

Edited by Mumbles
Reduced quote level.

Share this post


Link to post
Share on other sites
  • 0

i see, but can you please add that can detect also when a GM edit the stats of the normal character, then the normal character will be disconnected within 3 secs.. thank you!

 

not possible to check on run time without src edit, btw why not just don't make GMs unable to edit those?

Edited by Mumbles
Reduced quote level.

Share this post


Link to post
Share on other sites
  • 0

not possible to check on run time without src edit, btw why not just don't make GMs unable to edit those?

 

Actually, it is possible to check on run; you just have to get creative. d:

 

 

-	script	modstats	-1,{		OnInit:		.at_lvl = 40;		// Atcommand level		.ch_lvl = 80;		// Charcommand level		.max_param = 99;	// Max parameter allowed				// Command names		setarray .command$[0], "str", "agi", "vit", "dex", "int", "luk";				// Stats		setarray .stats[0], bStr, bAgi, bVit, bDex, bInt, bLuk;					// Bind commands		for (.@i = 0; .@i < getarraysize(.command$); .@i++) {			bindatcmd .command$[.@i], strnpcinfo(3) +"::OnCommand", .at_lvl, .ch_lvl;		}				end;					// Syntax: checkparam(<param>, <stat name>)	function checkparam {		// Loop through all parameters		for (.@i = 0; .@i < getarraysize(.command$); .@i++) {			// Check if max parameter has been reached			if (getarg(1) == .command$[.@i] && getarg(0) - readparam(.stats[.@i]) <= .max_param) {				return true;			}		}				return false;	}			OnCommand:		// Save invoking GM name		.@gm_name$ = strcharinfo(0);				// Charcommand issued		if (.@atcmd_numparameters == 2 && checkparam(atoi(.atcmd_parameters$[1]), replacestr(.@atcmd_command$, "@", ""))) {			attachrid getcharid(3, .atcmd_parameters$[0]);			atcommand .@atcmd_command$ +" "+ atoi(.atcmd_parameters$[1]);					// Atcommand issued		} else if (.@atcmd_numparameters == 1 && atoi(.atcmd_parameters$[0]) <= .max_param) {			atcommand .@atcmd_command$ +" "+ atoi(.atcmd_parameters$[0]);					// Invalid parameters		} else {			message .@gm_name$, "Invalid parameters (syntax: "+ .@atcmd_command$ +" <0 - "+ .max_param +">";			message .@gm_name$, .@atcmd_command$ +" failed.";		}				end;} 

 

 

 

Although you should probably disable the charcommand privilege if it's an issue, honestly.

 

 

Disclaimer: Untested.

Share this post


Link to post
Share on other sites
  • 0

bindatcmd is case sensitive,that means gm still can use the original commands @str 、 @agi 、@vit 、

@dex、@int、@luk  by converting some  letters of cmd to uppercase/lowercase
e.g.
#aGI  player01 100
 
 
modify one word  in atcmmand.c ,the bindatcmd will work properly

 

diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex 719b140..2b0770d 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -64,7 +64,7 @@ struct atcmd_binding_data* get_atcommandbind_byname(const char* name) { 	if( *name == atcommand->at_symbol || *name == atcommand->char_symbol ) 		name++; // for backwards compatibility -	ARR_FIND( 0, atcommand->binding_count, i, strcmp(atcommand->binding[i]->command, name) == 0 );+	ARR_FIND( 0, atcommand->binding_count, i, strcmpi(atcommand->binding[i]->command, name) == 0 );  	return ( i < atcommand->binding_count ) ? atcommand->binding[i] : NULL; }

my testing script

-	script	asdfghjkl	-1,{OnInit:	bindatcmd "STR",strnpcinfo(3)+"::OnAtcommand",60,60;	bindatcmd "AGI",strnpcinfo(3)+"::OnAtcommand",60,60;	bindatcmd "INT",strnpcinfo(3)+"::OnAtcommand",60,60;	bindatcmd "VIT",strnpcinfo(3)+"::OnAtcommand",60,60;	bindatcmd "DEX",strnpcinfo(3)+"::OnAtcommand",60,60;	bindatcmd "LUK",strnpcinfo(3)+"::OnAtcommand",60,60;	end;OnAtcommand:	if(charat(.@atcmd_command$,0) =="#") set .@cc,1;	set .@atcmd_command$,replacestr(.@atcmd_command$, "#", "@", 0);	if ( .@atcmd_numparameters )		atcommand .@atcmd_command$ +" "+ implode( .@atcmd_parameters$, " " );	else		atcommand .@atcmd_command$ ;	if(.@cc != 1 && getgmlevel()) end;	sleep2 3000;	atcommand "@kick "+ strcharinfo(0);	end;}


#aGI  player01 100
 

 

Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

 

that is intended since the script only runs on login

 

i see, but can you please add that can detect also when a GM edit the stats of the normal character, then the normal character will be disconnected within 3 secs.. thank you!

Okei! 1st sorry for this reply.. I think it misunderstand what i want to be.. my bad...

 

this script nothing to do w/ gm commands no need to disable.. 

 

I want something like this,

 

When a GM edit the stats of a Character, the character will be automatically detected as abnormal stats and he will be disconnected and the stats will reset..

 

And when a GM edit the stats of low lvl character, the character will still automatically detected bec, every lvl has equivalent of stats points..

 

Sorry for my bad english..

Share this post


Link to post
Share on other sites
  • 0

i think this script will ignore baby character since baby character max stats is 108 right, i hope u can revise this script so that all character are included which is including 2nd job, and baby job.. since if i setup it for 3rd job stats, those jobs will be ignored because of their max stat is 108 and 99

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.