Don't forget to add this table to your sql database.
CREATE TABLE `hercules_mainsql`.`buyback` ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `char_id` INT(11) UNSIGNED NOT NULL, `nameid` INT(11) UNSIGNED NOT NULL DEFAULT 501, `amount` INT(11) UNSIGNED NOT NULL DEFAULT 1, `identify` INT(11) UNSIGNED NOT NULL DEFAULT 1, `refine` INT(11) UNSIGNED NOT NULL DEFAULT 0, `attribute` INT(11) UNSIGNED NOT NULL DEFAULT 0, `card1` INT(11) UNSIGNED NOT NULL DEFAULT 0, `card2` INT(11) UNSIGNED NOT NULL DEFAULT 0, `card3` INT(11) UNSIGNED NOT NULL DEFAULT 0, `card4` INT(11) UNSIGNED NOT NULL DEFAULT 0, `bound` INT(11) UNSIGNED NOT NULL DEFAULT 0, `expire_time` INT(11) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`id`));
.... Maybe in the future i'll see about just placing this in SRC release D: till then, I feel it's not quite up-to par to be a release lol.
Currently NPC's can only display a normal item in the BUY window, meaning it's currently not possible to buy upgraded/carded items through a normal NPC shop without doing something like a dynamic shop. However, the client is capable of displaying the item's true information when attempting to sell to an npc.
So, really I'm trying to figure out how to get the client to display the items in the shop windows, if I can find that then, it might be possible to create something like a buyback system on the src side rather than the script side, by creating a sql log that tracks when players sell items, and storing that information. Only the last 10-20items will need to be stored, after that we just replace the list as we go. We could also maybe store this information on the server's ram as an alternative so that it wipes when the player logs rather than on a semi-permanent sql log.
Seeing as how this is possible to have the npc display the information, how can I feed it information stored from a sql-table or temp-stored ram (preferred since this usually wipes on player logout), and would I need to make a new npc function in npc.c that tells the server what type of BUY npc it is (I'm assuming yes, since we did this for different type of shop npcs already like MARKET and CASHSHOP).
Edit: Ultimately I suck at all things src related in RO, since I have like 1% knowledge in C. But I'm trying to learn, and I've been wanting this in RO for years now, figure I'd do my part and make an attempt instead of just waiting around being a leech !!. So help me out if you can, and let me know if it's not possible xD. Thanks everyone.
Edit: Hiding the post in a spoiler since this is solved already.
But here is the patch in case anyone wants to try and use it: buybackfeatureV0.1.patch
Don't forget to add this table to your sql database.
.... Maybe in the future i'll see about just placing this in SRC release D: till then, I feel it's not quite up-to par to be a release lol.
Currently NPC's can only display a normal item in the BUY window, meaning it's currently not possible to buy upgraded/carded items through a normal NPC shop without doing something like a dynamic shop.
However, the client is capable of displaying the item's true information when attempting to sell to an npc.
So, really I'm trying to figure out how to get the client to display the items in the shop windows, if I can find that then, it might be possible to create something like a buyback system on the src side rather than the script side, by creating a sql log that tracks when players sell items, and storing that information.
Only the last 10-20items will need to be stored, after that we just replace the list as we go. We could also maybe store this information on the server's ram as an alternative so that it wipes when the player logs rather than on a semi-permanent sql log.
Currently that snippet code block just searchs if the item is an actual item, where as the sell_list uses our inventory:
Seeing as how this is possible to have the npc display the information, how can I feed it information stored from a sql-table or temp-stored ram (preferred since this usually wipes on player logout), and would I need to make a new npc function in npc.c that tells the server what type of BUY npc it is (I'm assuming yes, since we did this for different type of shop npcs already like MARKET and CASHSHOP).
Edit:
Ultimately I suck at all things src related in RO, since I have like 1% knowledge in C. But I'm trying to learn, and I've been wanting this in RO for years now, figure I'd do my part and make an attempt instead of just waiting around being a leech !!. So help me out if you can, and let me know if it's not possible xD. Thanks everyone.
Share this post
Link to post
Share on other sites