Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

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

Experienced Elementalist
Joined
Dec 19, 2015
Messages
247
Reaction score
69
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 ...
 
Newbie Spellweaver
Joined
Jul 12, 2013
Messages
28
Reaction score
2
After query Insert into table Game.TblPcMailEx u must re-choose your character once and then it's working.
 
Put Community First
Loyal Member
Joined
Oct 2, 2014
Messages
1,115
Reaction score
833
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
 
Newbie Spellweaver
Joined
Jul 12, 2013
Messages
28
Reaction score
2
oh ok i understand. u need any items that query without reselecting the character. sry guys hehe :D
 
Put Community First
Loyal Member
Joined
Oct 2, 2014
Messages
1,115
Reaction score
833
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
 
Experienced Elementalist
Joined
Dec 19, 2015
Messages
247
Reaction score
69
have u added "RETURN" in the end?



cuz u said my command didnt work for u
 
Put Community First
Loyal Member
Joined
Oct 2, 2014
Messages
1,115
Reaction score
833
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!
 
Experienced Elementalist
Joined
Jan 21, 2015
Messages
235
Reaction score
201
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
 
Put Community First
Loyal Member
Joined
Oct 2, 2014
Messages
1,115
Reaction score
833
@hemaprince Thanks, that will be handy for my sending items via mail solution above, :). Where'd you find those mail types if I can ask, are they in a config someplace?
 
Experienced Elementalist
Joined
Jan 21, 2015
Messages
235
Reaction score
201
EDIT: Post no longer needed.
 
Last edited:
Experienced Elementalist
Joined
Sep 13, 2014
Messages
232
Reaction score
85
pm me too i want to know it too. so i don't need to ollydbg. :p
 
Newbie Spellweaver
Joined
Jan 9, 2016
Messages
16
Reaction score
0
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
 
Put Community First
Loyal Member
Joined
Oct 2, 2014
Messages
1,115
Reaction score
833
and what if i want to use that as a starter pack? if i will leave serial default will it work? like so
@cSerialNo

If I understand what you're saying, I'm not sure as I haven't messed around with starter packages. Experiment! :)
 
Back
Top