PHP Code:
USE [PS_GameData]
GO
/****** Object: Trigger [dbo].[Killtransfer] Script Date: 02.12.2014 19:32:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[Killtransfer]
on [PS_GameData].[dbo].[Chars]
for insert
as
DECLARE
@ActionType tinyint,
@AT int,
@UserUID int,
@ItemID int,
@K1 int
/*
Action_Trigger_v2.sql RELEASE: 2014-10-13
Scripted by blabla
Made for: blabla / Elitepvpers
*/
-- ActionType: 114 = Get Killtransfer by Selling Item to NPC
-- ActionType: 112 = Get Killtransfer by using it
SET @AT = 114
SET @ItemID = (SELECT Value2 FROM PS_GameLog.dbo.Actionlog)
SET @ActionType = (SELECT ActionType FROM PS_GameLog.dbo.Actionlog)
-- -------------------------------------------------
IF ( @ActionType = @AT )
BEGIN
-- -----------------------------------------
-- Killtransfer
IF (@ItemID = 100239)
BEGIN
SET @UserUID = (SELECT UserUID FROM PS_GameLog.dbo.Actionlog)
UPDATE PS_GameData.dbo.Chars
SET K1 = (SELECT top 5 K1 FROM [PS_GameData].[dbo].[Chars]
ORDER BY K1 DESC)
WHERE UserUID = @UserUID
END
-- -----------------------------------------
End
PHP Code:
USE [PS_GameLog]
GO
/****** Object: Trigger [dbo].[Killtransfer] Script Date: 02.12.2014 20:35:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[Killtransfer]
on [PS_GameLog].[dbo].[ActionLog]
for insert
as
DECLARE
@ActionType tinyint,
@AT int,
@UserUID int,
@ItemID int,
@K1 int
/*
Action_Trigger_v2.sql RELEASE: 2014-10-13
Scripted by blabla
Made for: blabla / Elitepvpers
*/
-- ActionType: 114 = Get Killtransfer by Selling Item to NPC
-- ActionType: 112 = Get Killtransfer by using it
SET @AT = 114
SET @ItemID = (SELECT Value2 FROM PS_GameLog.dbo.Actionlog)
SET @ActionType = (SELECT ActionType FROM PS_GameLog.dbo.Actionlog)
-- -------------------------------------------------
IF ( @ActionType = @AT )
BEGIN
-- -----------------------------------------
-- Killtransfer
IF (@ItemID = 100239)
BEGIN
SET @UserUID = (SELECT UserUID FROM inserted)
UPDATE PS_GameData.dbo.Chars
SET K1 = (SELECT top 5 K1 FROM [PS_GameData].[dbo].[Chars]
ORDER BY K1 DESC)
WHERE UserUID = @UserUID
END
-- -----------------------------------------
End