PDA

View Full Version : [Share] Anti Clan Penalty


Forcer
30.07.2007, 13:26
Hi, im just looking procedures and find nice one.
I only corrected it, not tested.
But seems it will be work correct.
When player ousted from clan, clan\player will not receive any penalty.
Test it please, and don't forget about DB backup!
Btw: Fix me pls, if i re-wrote something wrong.
Btw2: This proc is not affects ally penalty, clan & clan wars only.
And sry for my bad eng.

CREATE PROCEDURE [DBO].[lin_UpdatePledgeInfo]
(
@fieldName nvarchar(50),
@field_data INT,
@char_id INT
)
AS
SET NOCOUNT ON

IF @fieldName = N'pledge_dismiss_time' begin update user_data set pledge_dismiss_time = 0 where char_id = @char_id end
ELSE IF @fieldName = N'pledge_ousted_time' begin update user_data set pledge_ousted_time = 0 where char_id = @char_id end
ELSE IF @fieldName = N'pledge_withdraw_time' begin update user_data set pledge_withdraw_time = 0 where char_id = @char_id end
ELSE IF @fieldName = N'surrender_war_id' begin update user_data set surrender_war_id = @field_data where char_id = @char_id end
ELSE
BEGIN
RAISERROR ('lin_UpdatePledgeInfo : invalid field [%s]', 16, 1, @fieldName)
RETURN -1
END

GO


You also can create procedure that removes current penalties from clan, clan wars and ally.

CREATE PROC ClearPenalty
AS
UPDATE user_data SET pledge_withdraw_time=0 WHERE pledge_withdraw_time>0
UPDATE user_data SET pledge_ousted_time=0 WHERE pledge_ousted_time>0
UPDATE Pledge SET dismiss_reserved_time=0 WHERE dismiss_reserved_time>0
UPDATE Pledge SET alliance_withdraw_time=0 WHERE alliance_withdraw_time>0
UPDATE Pledge SET alliance_dismiss_time=0 WHERE alliance_dismiss_time>0
UPDATE Pledge SET alliance_ousted_time=0 WHERE alliance_ousted_time>0
UPDATE Pledge SET oust_time=0 WHERE oust_time>0
UPDATE Alliance SET oust_time=0 WHERE oust_time>0
GO


Add calling "ClearPenalty" to your scheduler, and don't forget to reboot server after "Clean"

~Marquis~
30.07.2007, 16:26
I guess you need a reboot to make the penalities be erased, but this is a great share, when i test it i'll report some bugs :P, thanks.

m4rk
30.07.2007, 18:22
the idea is that if you use it in a SP that cached uses when putting the clan penalty it will not be necessary to reboot

ateh
30.07.2007, 19:38
You can hex penalties in server's exe, just find good offset. Convert penalty time into 4 byte hex and find it in exe. You will spot the correct place cos those 4 bytes will exist few times near each other. Order is same as result of command //show_bp

FidoW
30.07.2007, 20:24
the idea is that if you use it in a SP that cached uses when putting the clan penalty it will not be necessary to reboot

Thats not really true, cached only execute a SP, and that SP can do anything...

In that case... im sure you need a reboot.

m4rk
31.07.2007, 14:10
yes sorry, my reasoning was wrong...