- Joined
- Sep 12, 2014
- Messages
- 152
- Reaction score
- 69
Well.
We are here again.
Script release so that your trade center is ''working''. This works with the DB that I released a while ago.
You will have other problems but I think they will be easier to solve.
Credits? To those that appear in the script.
Enjoy it. (your friend copy and paste favorite.)
We are here again.
Script release so that your trade center is ''working''. This works with the DB that I released a while ago.
You will have other problems but I think they will be easier to solve.
Credits? To those that appear in the script.
Enjoy it. (your friend copy and paste favorite.)
Code:
USE [atum2_db_1]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[atum_Market_BuyTradeItem]
@i_MarketUID BIGINT,
@i_ItemUID BIGINT,
@i_ItemNum INT,
@i_ItemCount INT,
@i_BuyerAccountUID INT,
@i_BuyerCharUID INT,
@i_IsCountableAndHaveItem TINYINT
AS
-- by Inetpub
BEGIN
SET NOCOUNT ON;
DECLARE @nSellerUID INT
DECLARE @State TINYINT
DECLARE @Pref INT
DECLARE @Suf INT
DECLARE @Color INT
DECLARE @Shape INT
SET @Color = (Select ColorCode from td_Market where MarketUID = @i_MarketUID and ItemUID =@i_ItemUID)
SET @Shape = (Select ShapeItemNum from td_Market where MarketUID = @i_MarketUID and ItemUID =@i_ItemUID)
SET @Pref = (Select PrefixCodeNum from td_Market where MarketUID = @i_MarketUID and ItemUID =@i_ItemUID)
SET @Suf = (Select SuffixCodeNum from td_Market where MarketUID = @i_MarketUID and ItemUID =@i_ItemUID)
SET @State = (Select MarketState from td_Market where MarketUID = @i_MarketUID and ItemUID =@i_ItemUID)
SET @nSellerUID = (Select c.UniqueNumber from td_Market m , td_Character c where m.CharacterUniqueNumber = c.UniqueNumber and m.MarketUID = @i_MarketUID)
IF(@nSellerUID = @i_BuyerCharUID)
BEGIN
SELECT 3,0,0,0;
RETURN;
END
IF (@i_IsCountableAndHaveItem = 1)
BEGIN
UPDATE td_store set currentcount = currentcount + @i_ItemCount where Possess = @i_BuyerCharUID and ItemStorage = 0 and AccountUniqueNumber = @i_BuyerAccountUID and ItemNum = @i_ItemNum
END
ELSE
BEGIN
delete from td_Store where uniquenumber = @i_ItemUID
SET IDENTITY_INSERT td_store ON
INSERT INTO dbo.td_Store(UniqueNumber,AccountUniqueNumber,Possess,ItemStorage,Wear,CurrentCount,ItemWindowIndex,ItemNum,NumOfEnchants,PrefixCodeNum,SuffixCodeNum,CurrentEndurance,ColorCode,UsingTimeStamp,CreatedTime,ShapeItemNum,MainSvrItemUID,CoolingTime)
SELECT @i_ItemUID,c.accountUniqueNumber, c.UniqueNumber, 0, 0, @i_ItemCount, 99,
@i_ItemNum, 0, @Pref, @Suf, 0, @Color, 0, GetDate(), @Shape, 0, 0
FROM td_Character c
WHERE c.uniquenumber = @i_BuyerCharUID
SET IDENTITY_INSERT td_store OFF
END
END
Select m.MarketState,m.Count,m.CharacterUniqueNumber,c.Level from td_Market m,td_Character c where m.MarketUID = @i_MarketUID and m.ItemUID = @i_ItemUID and m.CharacterUniqueNumber = c.UniqueNumber
IF(@State = 1)
BEGIN
UPDATE td_Market set MarketState = 2 where MarketUID = @i_MarketUID and ItemUID =@i_ItemUID
END

