Jump to content
  • 0

Anti-Cheat Stats


China

Question


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  152
  • Reputation:   4
  • Joined:  11/25/11
  • Last Seen:  

I am currently using this script:

The problem is, it checks ALL stats, I just want it to check just one stat that goes overboard and ban them for example it only bans a char if he/she has 256 all stats but if he/she has 256 str or above, it doesn't ban and broadcast him/her. Thanks in advance!

- script AntiCheat -1,{
OnPCLoginEvent:
if(getgmlevel() <= 50){ //GM Excemption
readparam(bStr);
readparam(bAgi);
readparam(bVit);
readparam(bInt);
readparam(bDex);
readparam(bLuk);
if (readparam(bStr) > 255 || readparam(bAgi) > 255 || readparam(bVit) > 255 || readparam(bInt) > 255 || readparam(Dex) > 255 || readparam(bLuk) > 255){
mes "[^FF0000Anti Cheat System^000000]";
mes "We have detected you having stats over the limit. You will be disconnected shortly. If this is an error please contact the Game Master immediately.";
sleep2 5000; //5 Seconds delay
atcommand "@block "+strcharinfo(0)+"";
announce strcharinfo(0) +" , You have been banned for having edited stats. Thank you for playing Union Ragnarok Online.",0;
end; 
} 
}
}
}

Link to comment
Share on other sites

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  10/18/12
  • Last Seen:  

thanks for reply :) how can i see like in your screenshot??

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

thanks for reply :) how can i see like in your screenshot??

2qaqph4.jpg

 

The screenshot is from clicking this script: statpointcount.txt

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  317
  • Reputation:   63
  • Joined:  11/13/11
  • Last Seen:  

What you need is a statpointcount() function that would count their StatusPoint, including points they already put into stats (similar to skillpointcount).

Here you go! statpointcount.txt 2qaqph4.jpg

The script functions are based on trunk/src/map/pc.c::pc_need_status_point() ~line 5900

/// Returns the number of stat points needed to change the specified stat by val.
/// If val is negative, returns the number of stat points that would be needed to
/// raise the specified stat from (current value - val) to current value.
int pc_need_status_point(struct map_session_data* sd, int type, int val)
{
PS: yes, we could have just created a 'statpointcount' script command with about 25 lines of code from pc_resetstate() (vs 600 lines of script) but writing the script was more fun!

You could trigger this script with OnPCLoginEvent by replacing lines 3-40 with this:

-	script	check_statpoints	-1,{
OnPCLoginEvent:
	if (getgmlevel() > 50) end;
	
	function pc_need_status_point; // src/map/pc.c
	function pc_maxparameter;
	function read_statpoint_table; // db/re/statpoint.txt OR db/pre-re/statpoint.txt
	
	set .@should_have, read_statpoint_table(BaseLevel) + ( Class&EAJ_UPPERMASK ? 52 : 0 );
	
	//==== statpointcount() ====================================================
	set .@actual_statpoint, 
		pc_need_status_point(bStr, 1-readparam(bStr)) + 
		pc_need_status_point(bAgi, 1-readparam(bAgi)) + 
		pc_need_status_point(bVit, 1-readparam(bVit)) + 
		pc_need_status_point(bInt, 1-readparam(bInt)) + 
		pc_need_status_point(bDex, 1-readparam(bDex)) + 
		pc_need_status_point(bLuk, 1-readparam(bLuk)) + 
		StatusPoint;
	//==========================================================================
	
	if (.@actual_statpoint > .@should_have) {
		set .@name$, strcharinfo(0);
		mes "We have detected your stats are over the limit.";
		mes "You will be disconnected shortly. Please contact a GM.";
		atcommand "@kick " + .@name$;
		atcommand "@block " + .@name$;
		debugmes .@name$ + " was blocked for having more stat points than normal.";
		atcommand "@request <-- was blocked for having more stat points than normal.";
	}
	end;

 

Somehow I knew this would be a bit complicated. I was looking for something like this too. Thanks Brian.

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