Hi there, it's been a while ;)
I'd like to share an alternative Trijob Anti Cheat (simple query in SP) based on Syloxx's idea in this thread.
The difference is, his procedure based on "item pickup" (Operation 114), and the query sequence will run on each item pickups. I wrote this one based on the usage of "Bandit den return scroll" (Operation 41), and it will only run 1 time after the bandit scroll is used.
The outcome is pretty much the same, so you can use either both.
How does it work? When a thief used bandit den return scroll, this query will detect the region where the scroll is used. If it was a safe zone, then all items will be deleted from the transport (database side). So when the character arrived in thief town all items will be gone.
First things first, make sure that:
- Your db is vSRO db (i haven't try in other db)
- Your server is currently writing logs to "_LogEventItem" table (IF you use Chernobyl's Evangelion GS, you have to set "disableLog = 0" on "[misc]" section in the GS configuration file, otherwise your server won't log anything and the _AddLogItem procedure won't work)
- The MaxStack of your bandit den return scroll (ITEM_ETC_SCROLL_RETURN_THIEFDEN_01) is "1", (There's a funny part where the Game Server won't log the scroll usage IF its current stack is more than 1). If you have more, then put only 1 scroll in your inventory slot when testing this procedure.
And here's the boring part:
Add these lines into _AddLogItem Stored Procedure in your SHARD_VT_LOG database:
Code:
-- Begin: Operation 41 = Scroll is used
IF (@Operation = 41)
BEGIN
IF (@ItemRefID = 2128) -- Bandit den return scroll (ITEM_ETC_SCROLL_RETURN_THIEFDEN_01), will work only when MaxStack is 1
BEGIN
/*
* Get latest region of character
*/
DECLARE @IsBattleField BIT
SELECT @IsBattleField = IsBattleField
FROM [SRO_VT_SHARD].[dbo].[_Char]
INNER JOIN [SRO_VT_SHARD].[dbo].[_RefRegion]
ON [SRO_VT_SHARD].[dbo].[_Char].LatestRegion = [SRO_VT_SHARD].[dbo].[_RefRegion].wRegionID
WHERE [SRO_VT_SHARD].[dbo].[_Char].CharID = @CharID
/*
* Scroll is used inside town
*/
IF (@IsBattleField = 0)
BEGIN
DECLARE @COSID BIGINT
DECLARE @ReFCharID INT
DECLARE @TypeID4 INT
/*
* Get any summoned COS by current character
*
* It's actually fine not to use CURSOR, so far I noticed that any summoned COS
* won't set "OwnerCharID", except for transport COS.
* But just to be sure, I put CURSOR in use.
*/
SET NOCOUNT ON;
DECLARE CurCOS CURSOR FOR SELECT ID, RefCharID FROM [SRO_VT_SHARD].[dbo].[_CharCOS] WHERE OwnerCharID = @CharID ORDER BY ID ASC;
OPEN CurCOS;
FETCH NEXT FROM CurCOS INTO @COSID, @ReFCharID;
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @TypeID4 = TypeID4 FROM [SRO_VT_SHARD].[dbo].[_RefObjCommon] WHERE ID = @ReFCharID
/*
* If current COS is a transport COS, erase all items
* TypeID4 = 2 = Transport COS
*/
IF (@TypeID4 = 2)
BEGIN
UPDATE [SRO_VT_SHARD].[dbo].[_InvCOS] SET ItemID = 0 WHERE COSID = @COSID
END
FETCH NEXT FROM CurCOS INTO @COSID, @ReFCharID;
END;
CLOSE CurCOS;
DEALLOCATE CurCOS;
END
END
END
Don't forget to adjust database names according to your settings.
Oh well this will probably useless but what the heck :P, have fun ;)