Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] Powerlevel Fix

Junior Spellweaver
Joined
Nov 23, 2004
Messages
125
Reaction score
2
Difficulty: Intermediate SQL Knowledge

The kill/death interval can be changed so if you wanted to you could autoban a player that happens to kill 10 players in under 2 seconds or whatever values you wish. Basically whatever you deem impossible for the average player. Script can also be modified to ban swappers too ;)

Not recommended for small servers. Not really a fix, just autobans powerlevelers.

Please backup your database first before putting in code.

First modify your Character table and add in these two columns (Don't save it!)

Name: LevelTime Datatype: datetime
Name: PlvlCount Datatype: INT (Uncheck Allow Null)

When your in MSSQL Manager click on the arrow beside LevelTime column.
Below youll see properties. In properties set "Default or binding value" to zero.
Then Save the table.

Secondly you must modify your spInsertChar proc,
In SQL Manager drop down "Programmability" -> "Procedures" and right-click then modify spInsertChar.

Once in spInsertChar proc, find the line

Code:
VALUES(@nAID,@szName,@cnt,1,@nSex,@nCostume,...........

at the end of this line you should see:
Code:
NULL)
change it too:
Code:
NULL, getdate(),0)

Then run the following query below:

spUpdateCharInfoData
Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[spUpdateCharInfoData]
	@nAddedXP BIGINT,
	@nAddedBP BIGINT,
	@nAddedKillCount INT,
	@nAddedDeathCount INT,
	@nCID INT
AS

DECLARE @CurrTime datetime
DECLARE @DATEDIFF INT
DECLARE @OldTime datetime
DECLARE @AID INT
DECLARE @Count INT

SET NOCOUNT ON;

-- //BEGIN POWERLEVEL AUTOBAN//

SELECT @OldTime = (SELECT LevelTime FROM Character WHERE CID = @nCID)
SELECT @CurrTime = getdate()
SELECT @DATEDIFF = DATEDIFF(second, @CurrTime, @OldTime)

-- =============================================
-- Author:  Mackintosh www.daemonsring.net
-- Description: This piece of code will autoban powerlevelers 
-- depending on how fast they kill/die by creating timestamps
-- between deaths.
-- =============================================

-- If player, kills someone within under 2 seconds enter if statement.
IF((abs(@DATEDIFF)) < 2)
BEGIN
	UPDATE Character
	SET @Count = PlvlCount = PlvlCount+1,
	LevelTime = @CurrTime
	WHERE CID = @nCID

        -- If player has killed 5 people in under 2 seconds, autoban.
	IF(@Count > 5)
	BEGIN
		SELECT @AID=AID FROM Character
		WHERE CID = @nCID		

		UPDATE Accounts
		SET UGradeID = 253 -- 253 (Ban User)
		WHERE AID = @AID
	END
END
-- //END POWERLEVL AUTOBAN//

ELSE
BEGIN
	UPDATE Character
	SET XP = XP+@nAddedXP,
	BP = BP+@nAddedBP,
	KillCount = KillCount+@nAddedKillCount,
	DeathCount = DeathCount+@nAddedDeathCount,
	PlvlCount = 0,
	LevelTime = @CurrTime
	
	WHERE CID = @nCID

END

The above method may seem very inefficient but with the buety of timestamps we can now display, Whos Online and much more other useful information about the server.

I'll probably write a whos online script tommorow. As for clan war procs having troubles with the Emblem will probably release an incomplete version tommorow.
 
Junior Spellweaver
Joined
Jan 5, 2007
Messages
182
Reaction score
0
hey i got a question how bout if ur killing like and afk user in Tdm or something and keep killing you can get bann for that to?..

*edit how about if ur like playing a deathmatch game and ur kiling like 3 in a row u can get bann for taht to?
 
Junior Spellweaver
Joined
Nov 23, 2004
Messages
125
Reaction score
2
hey i got a question how bout if ur killing like and afk user in Tdm or something and keep killing you can get bann for that to?..

*edit how about if ur like playing a deathmatch game and ur kiling like 3 in a row u can get bann for taht to?

-- If player, kills someone within under 2 seconds enter if statement.
IF((abs(@DATEDIFF)) < 2)

-- If player has killed 5 people in under 2 seconds, autoban.
IF(@Count > 5)


See these values, you can set your own interval between deaths.
Right now its set to if someone kills 5 people in under 2 seconds they get banned. If you wanted to enforce swapping you can make those values huge. And soemone killing an AFK user would be considered swapping xD If somones going to cheat my player ranking by killing someone for several hours straight.
 
RageZ Hell
Joined
Nov 17, 2006
Messages
511
Reaction score
0
LevelTime datetime Checked
PlvlCount int Checked

Right?
 
Junior Spellweaver
Joined
Jan 13, 2007
Messages
193
Reaction score
0
I Have to say Mack, You did a great job on this.
I Knew you were making somthing like this because you were talking to me on msn a few weeks ago about it (Btw im oblivion -.-)
 
Junior Spellweaver
Joined
Nov 23, 2004
Messages
125
Reaction score
2
Soooo does it work lol, seems to be working fine for me. It's autobanning them.
 
Newbie Spellweaver
Joined
Dec 27, 2006
Messages
24
Reaction score
0
What if someone throws a nade and kills 5 people in a Att & Def game?
 
Custom Title Activated
Loyal Member
Joined
Nov 5, 2006
Messages
1,358
Reaction score
15
why ban swapers? it's cool to be high level without waiting years, that's what i did with Maiet Gunz
 
Junior Spellweaver
Joined
Dec 30, 2006
Messages
124
Reaction score
0
Yes but banning swappers you could run into issues, say you were killing in a straight line and you kill two people in a row, then when you relog your banned.
Yay.
 
Legendary Battlemage
Joined
Jan 5, 2007
Messages
652
Reaction score
7
wil this ban admins and devl 2??
if they have super weapns and kill alot of ppl they get banned lol

nice release..
 
Back
Top