It took me 25 minutes to do it. A thanks would be appreciated;
Do the following:
Execute that query;
Code:
USE SRO_VT_LOG
CREATE TABLE _First100Chars (
CharID int,
CharName varchar(64),
Result varchar(64)
)
-- A log table to check the chars which got the silk
Add this query in _AddLogChar @ SRO_VT_LOG
Code:
IF @EventID = 9
BEGIN
declare @Amount int,
@JID int,
@CID int,
@Result int;
INSERT INTO _First100Chars
SELECT TOP 100 CharID, CharName16, 'NULL'
FROM _Char where CurLevel = 110 AND CharID > 0
SELECT @CID = CharID from _First100Chars where Result = 'NULL'
SELECT @JID = UserJID from SRO_VT_SHARD.._User where CharID in (@CID)
SELECT @Result = Result from _First100Chars WHERE Result in ('NULL','Success')
SELECT @Amount = CASE
WHEN @Result = 'NULL'
THEN 1000
WHEN @Result = 'Success'
THEN 0
ELSE 0
END
IF EXISTS (SELECT * FROM SRO_VT_ACCOUNT..SK_Silk where JID in (@JID))
update SRO_VT_ACCOUNT..SK_Silk set silk_own = silk_own + @Amount where JID in (@JID)
ELSE
INSERT INTO SRO_VT_ACCOUNT..SK_Silk
SELECT @JID, @Amount, 0, 0
UPDATE _First100Chars set Result = 'Success' where CharID in (@CID)
END
I dun really know if it'll work. I haven't tried it.
Please test it and let me know the result.