- AddLogItem
Code:
if (@ItemRefID = 43054)BEGINEXEC SRO_VT_SHARDLOG.dbo._NOVA_SWITCHER @CharIDEND
- Query
Code:
USE [SRO_VT_SHARDLOG]GO/****** Object: StoredProcedure [dbo].[_NOVA_SWITCHER] Script Date: 6/6/2015 2:42:04 PM ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO/****** Object: StoredProcedure [dbo].[_NOVA_SWITCHER] Script Date: 6/6/2015 8:10:36 AM ******/CREATE PROCEDURE [dbo].[_NOVA_SWITCHER]-- =============================================/*Eslam Galull*/-- =============================================@CharID INTASBEGIN--//---------------------------------------------------------------DECLARE @INVSIZE TINYINT,@Top1Wep int,@OldItm intSet @InvSize = (select InventorySize from sro_vt_shard.._char where charid = @charid)set @Top1Wep = (select top 1 inv.itemid from sro_vt_shard.._inventory inv inner join sro_vt_shard.._items itm on inv.itemid = itm.id64where itm.refitemid in (select ItemID from _ModelSwitcher) and itm.serial64 > 0 and inv.itemid <> 0 and inv.slot between 13 and @InvSize and inv.charid = @charid )Set @OldItm = (select top 1 refitemid from sro_vt_shard.._items where id64 <> 0 and id64 = @Top1Wep and serial64 > 0)if @Top1Wep > 0BeginDeclare @NewItm int = caseWhen @olditm in (select ItemID from _ModelSwitcher)then (select top 1 Newitemid from _ModelSwitcher where ItemID = @olditm )end /* will destroy any item that he tries to switch if he dont have required items */update sro_vt_shard.._items set RefItemID = @NewItm where RefItemID = @OldItm and ID64 = @Top1Wep and Serial64 > 0EndENDGO
- table ( so here u should put the olditem id .. and the new one id ) thats all
like that
Code:
USE [SRO_VT_SHARDLOG]GO/****** Object: Table [dbo].[_ModelSwitcher] Script Date: 6/6/2015 2:43:23 PM ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO SET ANSI_PADDING ON GOCREATE TABLE [dbo].[_ModelSwitcher]([ItemID] [int] NOT NULL,[ItemCode] [varchar](max) NOT NULL,[NewitemID] [int] NULL) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]GOSET ANSI_PADDING OFFGO
- All Copyrights Reserved to Eslam Galull @galullians.com 2015