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

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

 
Last edited by a moderator:
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?

 
Last edited by a moderator:
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.

 
Last edited by a moderator:
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->command, name) == 0 );+ ARR_FIND( 0, atcommand->binding_count, i, strcmpi(atcommand->binding->command, name) == 0 ); return ( i < atcommand->binding_count ) ? atcommand->binding : 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
 


 
Last edited by a moderator:
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..

 
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

 
Back
Top