![]() |
|
|
#1 |
|
Архивный участник
Join Date: Apr 2006
Posts: 554
|
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. Code:
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
Code:
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 |
|
|
|
|
#2 |
|
Архивный участник
Join Date: Dec 2006
Posts: 252
|
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.
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Jan 2006
Posts: 607
|
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
|
|
|
|
|
#4 |
|
Архивный участник
Join Date: Apr 2006
Posts: 118
|
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
|
|
|
|
|
#5 |
|
Архивный участник
Join Date: Sep 2005
Posts: 1,014
|
|
|
|
|
|
#6 |
|
Архивный участник
Join Date: Jan 2006
Posts: 607
|
yes sorry, my reasoning was wrong...
|
|
|
|
|