Sign in to follow this  
Akinari

r17351: Account/Guild/Party Item Bound System

Recommended Posts

Item Bound System

r17351 adds in a new feature which allows characters to have specific items bounded to their account, guild, or party.

Suggestion topic: http://rathena.org/board/topic/70372-item-account-bound-proposal/

 

Features:

  • Items can be bounded 3 different ways.
  • New script commands 'getitembound' and 'getitembound2' creates bounded items.
  • New script command 'countbound' counts number of bounded items, also placing them automatically into an array.

 

*getitembound <item id>,<amount>,<bound_type>{,<account ID>};
*getitembound "<item name>",<amount>,<bound_type>{,<account ID>};

This command will give an amount of specified items to the invoking character.
If an optional account ID is specified, and the target character is currently
online, items will be created in their inventory instead. If they are not
online, nothing will happen.

It works essentially the same as 'getitem', except that items created using
this command will bound the item to the player's account. Depending on the bound type issued,
the character may not be able to trade or store these items, however all bounded types
cannot be sold, vended, auctioned, or mailed.

Bound Types:
    1 - Account Bound
    2 - Guild Bound
    3 - Party Bound
    4 - Character Bound

---------------------------------------

*getitembound2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound_type>{,<account ID>};
*getitembound2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound_type>{,<account ID>};

This command will give an amount of specified items to the invoking character.
If an optional account ID is specified, and the target character is currently
online, items will be created in their inventory instead. If they are not
online, nothing will happen.

It works essentially the same as 'getitem2', except that items created using
this command will bound the item to the player's account. Depending on the bound type issued,
the character may not be able to trade or store these items, however all bounded types
cannot be sold, vended, auctioned, or mailed.

Bound Types:
    1 - Account Bound
    2 - Guild Bound
    3 - Party Bound
    4 - Character Bound

---------------------------------------

*countbound({<bound_type>})

This function will return a number of bounded items on the character.
Optionally, you may count a specific type of bounded item on the character.

countbound will also build an array of items in the form of @bound_items.
Using countbound without a type counts all types of bounded items.

Available types are:
    1 - Account Bound
    2 - Guild Bound
    3 - Party Bound
    4 - Character Bound

Example:
    mes "[bound Counter]";
    mes "I see you currently have "+countbound+" bounded items.";
    next;
    mes "The list of bounded items include:";
    for([email protected] = 0; [email protected]<getarraysize(@bound_items); [email protected]++)
        mes getitemname(@bound_items[[email protected]]);
    close;
 
  • New at commands @itembound and @itembound2 used to create bounded items on the fly.

 

@itembound <item name/ID> <amount> <bound_type>

Creates the specified item and bounds it to the account.
bound_type: 1 = Account, 2 = Guild, 3 = Party, 4 = Character

---------------------------------------

@itembound2 <item name/ID> <quantity> <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4> <bound_type>

Creates an item with the given parameters (the 'cards' can be any item) and bounds it to the account.
identify_flag: 0 = unidentified, 1 = identified
attribute: 0 = not broken, 1 = broken
bound_type: 1 = Account, 2 = Guild, 3 = Party, 4 = Character
  • Account bound items can be stored in account storage and in cart.
  • Guild bound items can be stored in guild storage and traded to other guild members.
    • When a character leaves or is expelled from the guild, these bounded items are automatically returned to guild storage.
  • Party bound items cannot be stored but only traded to other party members.  These are temporary and will be deleted on party deletion or when leaving the party.

 

Credits to Xantara for the initial diff and Lighta for helping with the guild bound system.

Please report all issues/bugs in the proper bug report section.

 

Don't forget to update your SQL tables with upgrade_svn17351.sql!

  • Upvote 4

Share this post


Link to post
Share on other sites

In r17361:

  • Added configuration option to disable Guild/Party bound retrieval/removal system in core.h
  • Added support for Character Bound items
  • Upvote 2

Share this post


Link to post
Share on other sites

Thanks/thx

 

and i want to suggest,

please make account, guild, party, character bound item different

 

such as add different color

 

thanks /thx

Share this post


Link to post
Share on other sites

character bound works well?

 

Create a simple script to test.
In my GM account make an item.


getitembound 2366,1,4;

The item I can put it in the Storage.
And I can make another character and this OTHER character can use the item.

 

Is it wrong or is that the GMs can ignore bounditem types?

Share this post


Link to post
Share on other sites

why i can still put items in my storage even i set my script like this 'getitembound 501,1,4;' 4 = Character Bound

Share this post


Link to post
Share on other sites

why i can still put items in my storage even i set my script like this 'getitembound 501,1,4;' 4 = Character Bound

 

 

By default, group 99 can trade bounded items: 'can_trade_bounded'

trunk/conf/groups.conf

Share this post


Link to post
Share on other sites

Well.. I really like about this new feature. The thing is, I wanted to make all monster drop items to be account bounded. While certain items like, from the donation box or vote should be the only items which are not bounded. Is this possible? That also includes all items that can be bought from npcs. That would be awesome.

Edited by retroflav

Share this post


Link to post
Share on other sites
 

The players can't trade the bound items to GMs.

 

By default, group 99 can trade bounded items: 'can_trade_bounded'
trunk/conf/groups.conf

 

Try adding this on the specific group id of the gm concerned?

 

can_trade_bounded: true

Share this post


Link to post
Share on other sites

There is a problem with this itembound thing 

For example 

@itembound Poring_coin 100 <empty>

 

this would be tradable i wish this could be fixed it should not be traded it must be

 

SUGGESTION you must atleast make this scripts unusable if the informations is less than expected :) it should be complete

 

it should be like this @itembound poring_coin 1 1

and should not work if this was typed @itembound poring_coin 1

 

reason of this suggestion because it is really stated that it must be bounded :)

 

and extra suggestion make the stackable cannot be bounded

src/map/atcommand.c

ACMD_FUNC(item)
{
	char item_name[100];
	int number = 0, flag = 0, bound = 0;
	struct item item_tmp;
	struct item_data *item_data[10];
	int get_count, i, j=0;
	char *itemlist;

	nullpo_retr(-1, sd);
	memset(item_name, '\0', sizeof(item_name));

	if (!strcmpi(command+1,"itembound") && (!message || !*message || (
		sscanf(message, "\"%99[^\"]\" %d %d", item_name, &bound, &number) < 2 &&
		sscanf(message, "%99s %d %d", item_name, &bound, &number) < 2
	))) {
		clif_displaymessage(fd, msg_txt(sd,295)); // Please enter an item name or ID (usage: @item <item name/ID> <bound_type> <quantity>).
		return -1;
	} else if (!message || !*message || (
		sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 &&
		sscanf(message, "%99s %d", item_name, &number) < 1
	)) {
		clif_displaymessage(fd, msg_txt(sd,983)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity>).
		return -1;
	}
	itemlist = strtok(item_name, ":");
	while (itemlist != NULL && j<10) {
		if ((item_data[j] = itemdb_searchname(itemlist)) == NULL &&
		    (item_data[j] = itemdb_exists(atoi(itemlist))) == NULL){
			clif_displaymessage(fd, msg_txt(sd,19)); // Invalid item ID or name.
			return -1;
		}
		itemlist = strtok(NULL, ":"); //next itemline
		j++;
	}

	if( bound < 0 || bound > 4 ) {
		clif_displaymessage(fd, msg_txt(sd,298)); // Invalid bound type
		return -1;
	}

	if (number <= 0)
		number = 1;
	get_count = number;

	for(j--; j>=0; j--){ //produce items in list
		int16 item_id = item_data[j]->nameid;
		//Check if it's stackable.
		if (!itemdb_isstackable2(item_data[j]))
			get_count = 1;

		for (i = 0; i < number; i += get_count) {
			// if not pet egg
			if (!pet_create_egg(sd, item_id)) {
				memset(&item_tmp, 0, sizeof(item_tmp));
				item_tmp.nameid = item_id;
				item_tmp.identify = 1;
				item_tmp.bound = bound;

				if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
					clif_additem(sd, 0, 0, flag);
			}
		}
	}

	if (flag == 0)
		clif_displaymessage(fd, msg_txt(sd,18)); // Item created.
	return 0;
}

made some configuration so that it would work perfect

Edited by Ceejay Abne

Share this post


Link to post
Share on other sites

That make sense @Ceejay Abne. I can't really what you have add directly but I suppose it was a number after the scanf.

sscanf(message, "\"%99[^\"]\" %d %d", item_name, &number, &bound) < 3

That should fix your data requirement.

About stackable not able to being bounded, I don't see you will want to make this ? I think that will remove a big possibility of usage.

Let say you have done a new instances, that require party to go in etc and you give 100 condensed white potion to everyone in the team to help to do it.

You may want to itembound it to party so those new potion wont stored and kafra and used for another purpose.

(It doesn't totally force to be used here but it's a little constraint).

Or if you organize a TvT tournament etc, in that case is even better cause you could chose to break their party in the end and the item will be destroy.

 

@retroflag, this is possible and you have the base to do it but it will require little src edit and to finish the design. 1 problem about your idea is currently when a monster drop there is 3 priority pickup, then everyone can loot the item, how will you deal with that or do you want to be bounded only when it was looted ?

Share this post


Link to post
Share on other sites

That make sense @Ceejay Abne. I can't really what you have add directly but I suppose it was a number after the scanf.

sscanf(message, "\"%99[^\"]\" %d %d", item_name, &number, &bound) < 3

That should fix your data requirement.

About stackable not able to being bounded, I don't see you will want to make this ? I think that will remove a big possibility of usage.

Let say you have done a new instances, that require party to go in etc and you give 100 condensed white potion to everyone in the team to help to do it.

You may want to itembound it to party so those new potion wont stored and kafra and used for another purpose.

(It doesn't totally force to be used here but it's a little constraint).

Or if you organize a TvT tournament etc, in that case is even better cause you could chose to break their party in the end and the item will be destroy.

 

@retroflag, this is possible and you have the base to do it but it will require little src edit and to finish the design. 1 problem about your idea is currently when a monster drop there is 3 priority pickup, then everyone can loot the item, how will you deal with that or do you want to be bounded only when it was looted ?

 

I supposed that i have change this 

sscanf(message, "\"%99[^\"]\" %d %d", item_name, &number, &bound)

 

i have made some changes about that thing 

to: sscanf(message, "\"%99[^\"]\" %d %d", item_name, &bound&number)

Share this post


Link to post
Share on other sites

Items can be mailed.

Is it just me?

How to fix this? x_X

Share this post


Link to post
Share on other sites

Items can be mailed.

Is it just me?

How to fix this? x_X

 

I guess items can't be mailed if they're acc/char/guild/party bound. Tested on rev 17704.

 

2 - Guild Bound

 

When a guild breaks the items loose their bound, this will ruin the market of the servers which provide guild packages with high-end gears & donation items using getitembound.

 

http://rathena.org/board/topic/95205-request-script-to-counter-bugsexploits/

when a guild breaks, the items created by guild bound (getitembound) should automatically become account bound items from the guild master's account & also those items which are stored in the guild storage.

 

I hope its changed to something like this. If the creator wishes to update it. Just like when a player leaves guild the items are automatically stored in the guild storage, can it be made like when a guild disbands the all the items got from guild bound become account bound.

 

Anyways thanks for such a nice mod!

Edited by Veracious

Share this post


Link to post
Share on other sites

Hi,

How about cards?

i produce a account bound card and when i compounded it.
It return to normal card (Not bounded anymore).

Share this post


Link to post
Share on other sites

You are both right,

@Veracious about the disband of the entity (guild, party, ...) we didn't tought about this but yeah it could be added quite easely to destroy those item.

If all work fine they should when the guild disband either be in guild_storage or in guild_leader inventory as he must be alone in guild to disband it. Looping his storage to search and destroy those item ain't much a big deal to procede.

 

@Ako Si Ranz,

Now about card is another story but you once again right, compon card will curerntly broke the bound system, and if you can't compon a card it's quite useless, so that quite a big flaw.

Currently however it's not possible to retain this information about boud item for compon card.

I suppose the item struct could be modified to not only a

int card[4] anomore but a s_card card[4], which then will hold bound info.

Now this will quite increase the ram requiered manage item wich could potentiability overreach mmo_char_status limit, bringing once again the necessity to move storage out of this...

 

In short both are fesable and quite interesting project, the 1st one is really easy, second might take a bit more time, what would be nice is to motivated Akinari to do it but otherwise it will be dealt later. (Unless someone want to do a pull request)

 

Share this post


Link to post
Share on other sites

@Veracious about the disband of the entity (guild, party, ...) we didn't tought about this but yeah it could be added quite easely to destroy those item.

If all work fine they should when the guild disband either be in guild_storage or in guild_leader inventory as he must be alone in guild to disband it. Looping his storage to search and destroy those item ain't much a big deal to procede.

 

Yes, its easy and at the time of breaking a Guild the Guild Bound items can be found at Guild Leader's inventory and Guild Storage(when a player leaves guild who's having Guild Bound items, the items will be transferred directly into the Guild Storage)

 

http://rathena.org/board/topic/95205-request-script-to-counter-bugsexploits/?p=260188

Skorm had made onguildbreak.patch, ill test it again to confirm how it actually works.

 

@Ako si Ranz I agree, but its tough since Bound takes 1 slot. But, we can expect the cards to keep the bound if it works like what Lighta said!

Share this post


Link to post
Share on other sites

@

Lighta && Veracious

ahaaha im not really good at scripting, actually i did not 100% understand what lighta said. xD
but i hope that akinari will update for that xD

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this