|
You last visited: Today at 10:35
Advertisement
[How]Send items to warehouse and ivnetnory?
Discussion on [How]Send items to warehouse and ivnetnory? within the Shaiya Private Server forum part of the Shaiya category.
04/26/2014, 14:29
|
#1
|
elite*gold: 0
Join Date: Oct 2012
Posts: 89
Received Thanks: 4
|
[How]Send items to warehouse and ivnetnory?
Hello!
I need query how tu send items to wh/inventory to empty bag and slot ;(
|
|
|
04/26/2014, 16:37
|
#2
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,456
|
You need to go learn your shit and stop begging on elitepvpers. You're asking us to write you some basic SQL queries, and you don't even bother to correct the typo in the thread name.
First, execute these 2:
Code:
USE PS_GameData
GO
CREATE VIEW NewID
AS
SELECT NewID() AS NewID
Code:
USE [PS_GameData]
GO
/****** Object: UserDefinedFunction [dbo].[ItemUID] Script Date: 31.07.2013 00:03:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Euphoria Dev Team
-- =============================================
CREATE FUNCTION [dbo].[ItemUID]
()
RETURNS BIGINT
AS
BEGIN
DECLARE @ItemUID BIGINT
NEWUID:
SET @ItemUID = ABS(CAST(HASHBYTES('SHA1',CAST((SELECT NewID FROM PS_GameData.dbo.NewID) AS NVARCHAR(MAX))) AS BIGINT))
IF EXISTS(SELECT * FROM PS_GameData.dbo.CharItems WHERE ItemUID = @ItemUID) OR
EXISTS(SELECT * FROM PS_GameData.dbo.GuildStoredItems WHERE ItemUID = @ItemUID) OR
EXISTS(SELECT * FROM PS_GameData.dbo.MarketItems WHERE ItemUID = @ItemUID) OR
EXISTS(SELECT * FROM PS_GameData.dbo.UserStoredItems WHERE ItemUID = @ItemUID)
GOTO NEWUID
RETURN @ItemUID
END
GO
And here's the code to insert an item in a character's inventory:
Code:
USE PS_GameData
DECLARE @CharID INT = 1,
@ItemID INT = 1001,
@ItemCount TINYINT = 1,
@MinBag TINYINT = 1,
@MinSlot TINYINT = 0
IF (SELECT COUNT(*) FROM CharItems WHERE CharID = @CharID AND Bag != 0) >= 120
BEGIN
PRINT 'The character''s inventory is full.'
RETURN
END
WHILE @MinBag <= 5
BEGIN
WHILE @MinSlot <= 23
BEGIN
IF NOT EXISTS (SELECT * FROM CharItems WHERE CharID = @CharID AND Bag = @MinBag AND Slot = @MinSlot)
BEGIN
INSERT INTO CharItems (CharID, ItemID, ItemUID, Type, TypeID, Bag, Slot, Quality, Gem1, Gem2, Gem3, Gem4, Gem5, Gem6, Craftname, Count, Maketime, Maketype, Del)
VALUES (@CharID, @ItemID, dbo.ItemUID(), @ItemID / 1000, @ItemID % 1000, @MinBag, @MinSlot, (SELECT Quality FROM PS_GameDefs.dbo.Items WHERE ItemID = @ItemID), 0, 0, 0, 0, 0, 0, '00000000000000000000', @ItemCount, GETDATE(), 'S', 0)
IF @@ERROR = 0 AND @@ROWCOUNT = 1
PRINT 'Item inserted successfully in Bag ' + CAST(@MinBag AS VARCHAR(1)) + ', Slot ' + CAST(@MinSlot AS VARCHAR(2)) + '.'
ELSE PRINT 'An error occured while attempting to insert the item.'
RETURN
END
SET @MinSlot += 1
END
SET @MinSlot = 0
SET @MinBag += 1
END
For the warehouse part, try to figure it out on your own without begging.
|
|
|
04/26/2014, 18:48
|
#3
|
elite*gold: 0
Join Date: Oct 2012
Posts: 89
Received Thanks: 4
|
Thanks.
For wh if someone needs
Code:
USE PS_GameData
DECLARE @ServerID TINYINT = 1,
@UserUID INT = 1,
@ItemID INT = 17215,
@ItemCount TINYINT = 1,
@MinSlot TINYINT = 1
IF (SELECT COUNT(*) FROM UserStoredItems WHERE UserUID = @UserUID AND Slot != 0) >= 239
BEGIN
PRINT 'The character''s warehouse is full.'
RETURN
END
WHILE @MinSlot <= 239
BEGIN
IF NOT EXISTS (SELECT * FROM UserStoredItems WHERE UserUID = @UserUID AND Slot = @MinSlot)
BEGIN
INSERT INTO UserStoredItems (ServerID, UserUID, ItemID, ItemUID, Type, TypeID, Slot, Quality, Gem1, Gem2, Gem3, Gem4, Gem5, Gem6, Craftname, Count, Maketime, Maketype, Del)
VALUES (@ServerID, @UserUID, @ItemID, dbo.ItemUID(), @ItemID / 1000, @ItemID % 1000, @MinSlot, (SELECT Quality FROM PS_GameDefs.dbo.Items WHERE ItemID = @ItemID), 0, 0, 0, 0, 0, 0, '00000000000000000000', @ItemCount, GETDATE(), 'S', 0)
IF @@ERROR = 0 AND @@ROWCOUNT = 1
PRINT 'Item inserted successfully in Slot ' + CAST(@MinSlot AS VARCHAR(3)) + '.'
ELSE PRINT 'An error occured while attempting to insert the item.'
RETURN
END
SET @MinSlot += 1
END
SET @MinSlot = 0
|
|
|
04/27/2014, 00:19
|
#4
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,456
|
For the warehouse inserting PRINT comment, you should cast the @MinSlot variable as a VARCHAR(3) not VARCHAR(2), because it can have 3-digit values.
|
|
|
04/27/2014, 10:29
|
#5
|
elite*gold: 0
Join Date: Feb 2011
Posts: 295
Received Thanks: 19
|
where istyping the item id to execute the quiry?
|
|
|
04/27/2014, 11:11
|
#6
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,456
|
I think people like you should get banned, seriously. Have you even read the query ? It's in the first lines, in the declaration part.
|
|
|
04/27/2014, 16:52
|
#7
|
elite*gold: 0
Join Date: Oct 2012
Posts: 89
Received Thanks: 4
|
I try Nubness change you script to insert items in wh. And in Database that is. You' Admin Panel see ItemUID But in game Warehouse is empty.
I try put items on a specific Slot but still wh is empty.
Code:
USE PS_GameData
DECLARE @ServerID TINYINT = 1,
@UserUID INT = 1,
@ItemID INT = 17215,
@ItemCount TINYINT = 1,
@Slot TINYINT = 1
INSERT INTO UserStoredItems (ServerID, UserUID, ItemID, ItemUID, Type, TypeID, Slot, Quality, Gem1, Gem2, Gem3, Gem4, Gem5, Gem6, Craftname, Count, Maketime, Maketype, Del)
VALUES (@ServerID, @UserUID, @ItemID, dbo.ItemUID(), @ItemID / 1000, @ItemID % 1000, @Slot, (SELECT Quality FROM PS_GameDefs.dbo.Items WHERE ItemID = @ItemID), 0, 0, 0, 0, 0, 0, '00000000000000000000', @ItemCount, GETDATE(), 'S', 0)
|
|
|
04/27/2014, 16:56
|
#8
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,456
|
It's best to insert items into inventories and warehouses when the character is offline.
Make sure you're writing in the correct UserUID.
|
|
|
04/27/2014, 17:00
|
#9
|
elite*gold: 0
Join Date: Oct 2012
Posts: 89
Received Thanks: 4
|
I konw and i did insert offline
UserUID 1 is ok
|
|
|
04/27/2014, 17:03
|
#10
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,456
|
Place an item in the warehouse from in game, log off and see how the row looks like. Then make sure your query inserts the same.
|
|
|
04/27/2014, 17:11
|
#11
|
elite*gold: 0
Join Date: Oct 2012
Posts: 89
Received Thanks: 4
|
Still empty.
For you that is work?
|
|
|
04/27/2014, 17:12
|
#12
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,456
|
Did you actually go in game and place an item into your warehouse ?
|
|
|
04/27/2014, 17:17
|
#13
|
elite*gold: 0
Join Date: Oct 2012
Posts: 89
Received Thanks: 4
|
Yes i did
|
|
|
04/27/2014, 17:21
|
#14
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,456
|
I don't have time to mess with this at the moment, but you should keep trying. Try a basic insert query for the UserStoredItems. Maybe you find where the problem is.
|
|
|
04/27/2014, 17:24
|
#15
|
elite*gold: 0
Join Date: Oct 2012
Posts: 89
Received Thanks: 4
|
Ok.
Thanks for trying
|
|
|
 |
|
Similar Threads
|
Classic[4267] Warehouse items
04/18/2014 - CO2 Private Server - 21 Replies
the Warehouse items is not showing correctly here is the packet structure :-
public class WarehousePacket : TQPacket
{
int offset = 16;
public WarehousePacket(int count)
: base(PacketType.Warehouse, (ushort)(16 + (count * 20)))
{
// WriteByte(9, 10);
WriteUInt32(12, (uint)count);
}
|
[REQUEST] a hack to get items form guild warehouse
04/04/2013 - Shaiya - 3 Replies
I'm asking if anyone have or know how to make a hack or exploit to get items from guild warehouse without beeing a rank 2 if it's possible or if it's already done sorry for opening another topic coz I dident find anything. tnx
|
What can cause certain players to loose items from warehouse or the ones equipped?
12/10/2012 - CO2 Private Server - 0 Replies
As the title says, some players complained that some equipped items or from warehouses are disappearing.I am aware that might be some mysql issue that's why i installed MYSQL Community Server(I have set him on Server not developing machine), most of that cases disappeared but some times players complain that it might still happen.
The problem is isolated, not all players reported it and only after server restart.
|
Items not stored in the warehouse! Help!
03/03/2012 - Shaiya Private Server - 2 Replies
Dear friends, I'm in trouble on my Private Server Ep 4.5, when I put the items in the warehouse and out the game and playing back the items back to my inventory, or if I happen to change cities and log the game when appear to play back in the old location where he had stored the items in the warehouse and the new items in my inventory.
Could anyone help me with this? Thank you in advance for your attention!:(
|
WareHouse Items, DragonSoul Offset
05/21/2011 - CO2 Private Server - 3 Replies
Anyone has the DragonSoulID Offset for WareHouse Items ?
|
All times are GMT +1. The time now is 10:37.
|
|