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

Brynner

Community Contributors
Messages
563
Points
0
Github
https://github.com/bgamez23
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.

 
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

 
Last edited by a moderator:
Here's my method. This verifies max stat parameter and the total stat count.
 

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

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


 
Last edited by a moderator:
Revised.

Code:
-    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;    }
 
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


 
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

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

Code:
for (.@i = 0; .@i < 3; .@i++) {	message strcharinfo(0), "You will be disconnected in "+ (3 - .@i) +" seconds.";	sleep2 1000;}atcommand "@kick "+ strcharinfo(0);
 
Last edited by a moderator:
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..

 
Last edited by a moderator:
here is what i did and it works now. thank you

Code:
-    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;    }
 
Last edited by a moderator:
Back
Top