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

Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28
  1. #16
    Mod and Dev - C9, 4Story fallenfate is online now
    ModeratorRank
    Oct 2014 Join Date
    Arad DomanLocation
    1,046Posts

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


    RaGEZONE Recommends

    RaGEZONE Recommends

    EDIT: Post no longer needed.
    Last edited by fallenfate; 29-12-15 at 04:44 AM.
    If I helped you, please click the Like button at bottom-left of my posts. Thank you! :)
    I am also vasheni at deviantArt.com.

    Translating: Van Tien

    Will help translate projects, BUT I need working files and set-up instructions to examine mechanics to help translate functionality. As an example, sometimes names of skills in Chinese translate to things like Wind of Upward Cat. Which is obviously not correct. If I can run the game I can give it proper context.

  2. #17
    Account Upgraded | Title Enabled! hemaprince is offline
    True MemberRank
    Jan 2015 Join Date
    Gaza, PalestineLocation
    208Posts

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

    see PM
    Good FRIENDS are hard to find, harder to leave, and impossible to forget
    After clouds sun shine ... After a storm comes a calm

  3. #18
    Ultimate Member xlmansox is online now
    MemberRank
    Sep 2014 Join Date
    170Posts

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

    pm me too i want to know it too. so i don't need to ollydbg. :p

  4. #19
    Member C9ISR is offline
    MemberRank
    Jan 2016 Join Date
    17Posts

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

    Quote Originally Posted by fallenfate View Post
    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 (http://s29.postimg.org/t4q8rwbif/fallen_itemmail.jpg):



    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 (http://s2.postimg.org/mtbb1bg09/fallen_itemwork.jpg):

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

  5. #20
    Mod and Dev - C9, 4Story fallenfate is online now
    ModeratorRank
    Oct 2014 Join Date
    Arad DomanLocation
    1,046Posts

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

    Quote Originally Posted by C9ISR View Post
    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! :)
    If I helped you, please click the Like button at bottom-left of my posts. Thank you! :)
    I am also vasheni at deviantArt.com.

    Translating: Van Tien

    Will help translate projects, BUT I need working files and set-up instructions to examine mechanics to help translate functionality. As an example, sometimes names of skills in Chinese translate to things like Wind of Upward Cat. Which is obviously not correct. If I can run the game I can give it proper context.

  6. #21
    Member C9ISR is offline
    MemberRank
    Jan 2016 Join Date
    17Posts

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

    Quote Originally Posted by fallenfate View Post
    If I understand what you're saying, I'm not sure as I haven't messed around with starter packages. Experiment! :)
    ill try to add more info maybe you know either way ;)

    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)

    this line
    VALUES(2, 1, 0, 0, 'Keleen', 'RZItemWork', 'RZItemWork', 0, 658)
    instead of providing senders ID and name is it possible to leave it on defult @ <-- like so and just provide a false name so basically when a new char will be created he will be able to get his goodies from the mail area and not inventory


  7. #22
    Mod and Dev - C9, 4Story fallenfate is online now
    ModeratorRank
    Oct 2014 Join Date
    Arad DomanLocation
    1,046Posts

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

    Quote Originally Posted by C9ISR View Post
    ill try to add more info maybe you know either way ;)

    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)

    this line
    VALUES(2, 1, 0, 0, 'Keleen', 'RZItemWork', 'RZItemWork', 0, 658)
    instead of providing senders ID and name is it possible to leave it on defult @ <-- like so and just provide a false name so basically when a new char will be created he will be able to get his goodies from the mail area and not inventory

    You should be able to, yes, it's just a string value so you could call it 'Admin' or 'ItemsBot' or whatever you like. The only circumstance I can see using '@' being an issue is if the DB doesn't like storing symbol values in the string and refuses to parse it. But you won't know that until you try, ;). But yes, if you're running a web registration script you can just use those queries in PHP with a random 'From' user value, replace the content with 'Welcome to the game, enjoy a small welcome gift!' or similar, you'll just need to run a query to pick the highest ID value and then create the item.

    In my example I manually searched to know I needed to use 658, but if you have 10 people playing on the server they will be getting item drops and such, which will fill that table with new IDs and you might create a duplicate or the script may fail. So you need to do a query to select the MAX of the cSerialNo at the time the query runs and then make the new one that value + 1.
    If I helped you, please click the Like button at bottom-left of my posts. Thank you! :)
    I am also vasheni at deviantArt.com.

    Translating: Van Tien

    Will help translate projects, BUT I need working files and set-up instructions to examine mechanics to help translate functionality. As an example, sometimes names of skills in Chinese translate to things like Wind of Upward Cat. Which is obviously not correct. If I can run the game I can give it proper context.

  8. #23
    Member C9ISR is offline
    MemberRank
    Jan 2016 Join Date
    17Posts

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

    Quote Originally Posted by fallenfate View Post
    You should be able to, yes, it's just a string value so you could call it 'Admin' or 'ItemsBot' or whatever you like. The only circumstance I can see using '@' being an issue is if the DB doesn't like storing symbol values in the string and refuses to parse it. But you won't know that until you try, ;). But yes, if you're running a web registration script you can just use those queries in PHP with a random 'From' user value, replace the content with 'Welcome to the game, enjoy a small welcome gift!' or similar, you'll just need to run a query to pick the highest ID value and then create the item.

    In my example I manually searched to know I needed to use 658, but if you have 10 people playing on the server they will be getting item drops and such, which will fill that table with new IDs and you might create a duplicate or the script may fail. So you need to do a query to select the MAX of the cSerialNo at the time the query runs and then make the new one that value + 1.
    this is what i was talking about cSerialNo from what i know if it will stay @cSerialNo like so, it will not count any number am i correct? instead of provide a number ID like u did 658 if it will stay @cSerialNo it will be just blank am i correct?

  9. #24
    Mod and Dev - C9, 4Story fallenfate is online now
    ModeratorRank
    Oct 2014 Join Date
    Arad DomanLocation
    1,046Posts

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

    Quote Originally Posted by C9ISR View Post
    this is what i was talking about cSerialNo from what i know if it will stay @cSerialNo like so, it will not count any number am i correct? instead of provide a number ID like u did 658 if it will stay @cSerialNo it will be just blank am i correct?
    I think I understand you now. Are you saying if you make the item once in the DB, like cSerialNo 658, can you reuse it? I don't think so, because each item is assigned to a character value and has a limited span of days. You need to make the item each time, for each member, as the welcome gift.
    If I helped you, please click the Like button at bottom-left of my posts. Thank you! :)
    I am also vasheni at deviantArt.com.

    Translating: Van Tien

    Will help translate projects, BUT I need working files and set-up instructions to examine mechanics to help translate functionality. As an example, sometimes names of skills in Chinese translate to things like Wind of Upward Cat. Which is obviously not correct. If I can run the game I can give it proper context.

  10. #25
    Member C9ISR is offline
    MemberRank
    Jan 2016 Join Date
    17Posts

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

    Quote Originally Posted by fallenfate View Post
    I think I understand you now. Are you saying if you make the item once in the DB, like cSerialNo 658, can you reuse it? I don't think so, because each item is assigned to a character value and has a limited span of days. You need to make the item each time, for each member, as the welcome gift.
    so is it possible to make it update by itself per new character lets say as for rightnow the serial is 99 new player was created and it updates it automaticly to 100 serial and send him the gift another player was created now its 101 same item 102 103 .. hopefully i explained my self right lol thank you for the support tho.

  11. #26
    Mod and Dev - C9, 4Story fallenfate is online now
    ModeratorRank
    Oct 2014 Join Date
    Arad DomanLocation
    1,046Posts

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

    Quote Originally Posted by C9ISR View Post
    so is it possible to make it update by itself per new character lets say as for rightnow the serial is 99 new player was created and it updates it automaticly to 100 serial and send him the gift another player was created now its 101 same item 102 103 .. hopefully i explained my self right lol thank you for the support tho.
    Yep, I understand that, thanks for rephrasing, :). The only way I can think of doing this is the following:

    1) Make an additional field for the characters DB table; cWelcomeGift with a default of 0.
    2) Have a web script/stored procedure check this DB each minute for characters that have cWelcomeGift set to 0.
    3) Make the above web script/stored procedure check item DB table cSerialNo and add 1 to the max for the new item.
    4) Have the web script/stored procedure use a query to add the item to the character via the mail system where cWelcomeGift is 0.
    5) Make the web script/stored procedure set the cWelcomeGift for the relevant character/s to 1, meaning they received it.
    If I helped you, please click the Like button at bottom-left of my posts. Thank you! :)
    I am also vasheni at deviantArt.com.

    Translating: Van Tien

    Will help translate projects, BUT I need working files and set-up instructions to examine mechanics to help translate functionality. As an example, sometimes names of skills in Chinese translate to things like Wind of Upward Cat. Which is obviously not correct. If I can run the game I can give it proper context.

  12. #27
    Newbie hernancb17 is offline
    MemberRank
    Mar 2016 Join Date
    3Posts

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

    Hello guys, is it possible to add an option for when a new character is created, that it appears with full inv slots? (126). And how to add a specific legend to a character? Thank you.
    Last edited by hernancb17; 11-03-16 at 03:38 AM.

  13. #28
    Member riccokell is offline
    MemberRank
    Apr 2013 Join Date
    RussianLocation
    81Posts

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

    pliz help db Character ID




Page 2 of 2 FirstFirst 12

Advertisement