Tutorial :how to ADD Item to players on your server by query.

Experienced Elementalist
Joined
Dec 19, 2015
Messages
249
Reaction score
71
If you want to add a item to any player on your server, you just need to go to database , open a new query , copy this code and execute it :

INSERT INTO Game.TblPcMailEx(cPcNo, cMailType, cFromPcName, cSubject, cContent, cItemId, cStackCount)
VALUES ("Character ID", 1, 1, 1, 1, "ITEM ID", "quantity")


RETURN


And its done .

Obs : Dont need to restart server or sql , player dont need to logout( he just gotta check his mailbox and it will be on his cash pocket), you can execute alot of times ( no error) .

Major Obs : ITS ITEM ID, not Product ID , if you want Product ID , change "cItemId" to "cProductId".

"Dont need to change 1, 1, 1, 1, , leave it as it is" .

Doubts : You can find Character Id on Database/C9World/Game.TblPcBase , its (cPcNo)

end : Without quotes(".") please ...
 
Why are these queries not working? I see no item, despite the Item ID extracted from GameData.c9t saying this is an item. Testing with: 11350|Rebellious Treasure Hunter Chestpiece + Soul:

USE C9World

INSERT INTO Game.TblPcMail(cPcNo, cMailType, cSubjectKey, cContentKey, cFromPcName, cSubject, cContent, cMoney, cSerialNo)
VALUES(2, 1, 0, 0, 'Keleen', 'Item', 'This is a test for item mail. Enjoy!', 0, 0)

INSERT INTO Game.TblPcMailEx(cPcNo, cMailType, cSubjectKey, cContentKey, cFromPcName, cSubject, cContent, cItemId, cStackCount)
VALUES(2, 1, 0, 0, 'Keleen', 'Item', 'This is a test for item mail. Enjoy!', 11350, 1)


It shows a mail in my mailbox without any item attached. This happens still when reselecting the character.

Stunn - Tutorial :how to ADD Item to players on your server by query. - RaGEZONE Forums
 
FIXED.

Here's the solution everyone:

Okay, so sending items via mail uses TWO tables, TblPcMail AND TblItem. TblItem contains items the game makes with a unique ID (cSerialNo) which is what assigns that version of the item to the player. So when sending a custom mail with an item, you need to insert a new record into TblItem as well.

For example, let's say I want to give myself a Red Gift Box, which has an Item ID of 15677. First, I need to check TblItem and see what the last cSerialNo is so that the next one I make is in order:

USE C9World
SELECT * FROM Game.TblItem ORDER BY cSerialNo DESC

That shows me this (
Stunn - Tutorial :how to ADD Item to players on your server by query. - RaGEZONE Forums
):

Stunn - Tutorial :how to ADD Item to players on your server by query. - RaGEZONE Forums


So, the last item added is 657. My new one needs to be 658. So now I can use that in my query when adding the item:

USE C9World

INSERT INTO Game.TblPcMail(cPcNo, cMailType, cSubjectKey, cContentKey, cFromPcName, cSubject, cContent, cMoney, cSerialNo)
VALUES(2, 1, 0, 0, 'Keleen', 'RZItemWork', 'RZItemWork', 0, 658)

INSERT INTO Game.TblItem (cItemId, cPosition, cOwnerNo, cStckCnt, cDur, cOwnerTabNo, cGuildGrade, cIsSealed)
VALUES(15677, 6, 2, 1, 30, 0, 0, 0)

cItemId - this is the actual item ID which you can get from .c9t files converted to .csv (see my other release post).
cPosition - set this to 6.
cOwnerNo - this is the ID of the owner, my player is ID 2, so I set it to 2.
cStckCnt - amount of items in the stack
cDur - item durability

Now it works! You can accept the item into your inventory (
Stunn - Tutorial :how to ADD Item to players on your server by query. - RaGEZONE Forums


Stunn - Tutorial :how to ADD Item to players on your server by query. - RaGEZONE Forums
 
Okay, this needs a bit of clarification.

The method Stunn uses (https://forum.ragezone.com/f933/tut...-server-1089287-post8557468/#post8557468)lets you send a player an item as a 'gift', accessible by an icon at the lower-right of the bottom next to the Cash Shop icon (shaped like a flashing bag).

My method (https://forum.ragezone.com/f933/tutorial-add-item-players-server-1089287-post8557741/#post8557741) lets you mimic sending it as an actual mail item via the mail system.

Happy item sending!
 
if u can specify mail type here is supported Mail Types :)
attach it in ur post if it help so everyone can see it :) @Stunn
ADMIN = 0
BILLING = 1
USER = 2
NA = 3
BILLING NEW = 4
AUCTION BUY ITEM = 5
AUCTION SELL ITEM = 6
AUCTION REGISTER ITEM = 7
GUILD BATTLE PRIZE = 8
EXCHANGEBANK EXPIRED MONEY = 9
EXCHANGEBANK EXPIRED CB = 10
EXCHANGEBANK BUY MONEY = 11
EXCHANGEBANK BUY CB = 12
BIGBONUS = 13
 
FIXED.

Here's the solution everyone:

Okay, so sending items via mail uses TWO tables, TblPcMail AND TblItem. TblItem contains items the game makes with a unique ID (cSerialNo) which is what assigns that version of the item to the player. So when sending a custom mail with an item, you need to insert a new record into TblItem as well.

For example, let's say I want to give myself a Red Gift Box, which has an Item ID of 15677. First, I need to check TblItem and see what the last cSerialNo is so that the next one I make is in order:

USE C9World
SELECT * FROM Game.TblItem ORDER BY cSerialNo DESC

That shows me this (
Stunn - Tutorial :how to ADD Item to players on your server by query. - RaGEZONE Forums
):

Stunn - Tutorial :how to ADD Item to players on your server by query. - RaGEZONE Forums


So, the last item added is 657. My new one needs to be 658. So now I can use that in my query when adding the item:

USE C9World

INSERT INTO Game.TblPcMail(cPcNo, cMailType, cSubjectKey, cContentKey, cFromPcName, cSubject, cContent, cMoney, cSerialNo)
VALUES(2, 1, 0, 0, 'Keleen', 'RZItemWork', 'RZItemWork', 0, 658)

INSERT INTO Game.TblItem (cItemId, cPosition, cOwnerNo, cStckCnt, cDur, cOwnerTabNo, cGuildGrade, cIsSealed)
VALUES(15677, 6, 2, 1, 30, 0, 0, 0)

cItemId - this is the actual item ID which you can get from .c9t files converted to .csv (see my other release post).
cPosition - set this to 6.
cOwnerNo - this is the ID of the owner, my player is ID 2, so I set it to 2.
cStckCnt - amount of items in the stack
cDur - item durability

Now it works! You can accept the item into your inventory (
Stunn - Tutorial :how to ADD Item to players on your server by query. - RaGEZONE Forums


Stunn - Tutorial :how to ADD Item to players on your server by query. - RaGEZONE Forums

and what if i want to use that as a starter pack? if i will leave serial default will it work? like so
@cSerialNo
 
Back