Jump to content
  • 0
Sign in to follow this  
Javanese

sell binded equip

Question

12 answers to this question

Recommended Posts

  • 0

Requires a src edit.

Open CLIF.C & find:

/// Presents list of items, that can be sold to an NPC shop (ZC_PC_SELL_ITEMLIST)./// 00c7 <packet len>.W { <index>.W <price>.L <overcharge price>.L }*void clif_selllist(struct map_session_data *sd){	int fd,i,c=0,val;	nullpo_retv(sd);	fd=sd->fd;	WFIFOHEAD(fd, MAX_INVENTORY * 10 + 4);	WFIFOW(fd,0)=0xc7;	for( i = 0; i < MAX_INVENTORY; i++ )	{		if( sd->status.inventory[i].nameid > 0 && sd->inventory_data[i] )		{			if( !itemdb_cansell(&sd->status.inventory[i], pc_get_group_level(sd)) )				continue;			if( sd->status.inventory[i].expire_time )				continue; // Cannot Sell Rental Items 			if( sd->status.inventory[i].bound && !pc_can_give_bound_items(sd))				continue; // Don't allow sale of bound items			val=sd->inventory_data[i]->value_sell;			if( val < 0 )				continue;			WFIFOW(fd,4+c*10)=i+2;			WFIFOL(fd,6+c*10)=val;			WFIFOL(fd,10+c*10)=pc->modifysellvalue(sd,val);			c++;		}	}	WFIFOW(fd,2)=c*10+4;	WFIFOSET(fd,WFIFOW(fd,2));}

 

Comment out these lines: ( e.g: // This is commented.

			if( sd->status.inventory[i].bound && !pc_can_give_bound_items(sd))				continue; // Don't allow sale of bound items

 

Should look like this:

/// Presents list of items, that can be sold to an NPC shop (ZC_PC_SELL_ITEMLIST)./// 00c7 <packet len>.W { <index>.W <price>.L <overcharge price>.L }*void clif_selllist(struct map_session_data *sd){	int fd,i,c=0,val;	nullpo_retv(sd);	fd=sd->fd;	WFIFOHEAD(fd, MAX_INVENTORY * 10 + 4);	WFIFOW(fd,0)=0xc7;	for( i = 0; i < MAX_INVENTORY; i++ )	{		if( sd->status.inventory[i].nameid > 0 && sd->inventory_data[i] )		{			if( !itemdb_cansell(&sd->status.inventory[i], pc_get_group_level(sd)) )				continue;			if( sd->status.inventory[i].expire_time )				continue; // Cannot Sell Rental Items //			if( sd->status.inventory[i].bound && !pc_can_give_bound_items(sd))//				continue; // Don't allow sale of bound items			val=sd->inventory_data[i]->value_sell;			if( val < 0 )				continue;			WFIFOW(fd,4+c*10)=i+2;			WFIFOL(fd,6+c*10)=val;			WFIFOL(fd,10+c*10)=pc->modifysellvalue(sd,val);			c++;		}	}	WFIFOW(fd,2)=c*10+4;	WFIFOSET(fd,WFIFOW(fd,2));}

 

Save and Recompile. All done. you can now sell bound items.

Edited by GmOcean

Share this post


Link to post
Share on other sites
  • 0

Thank you GM Ocean. Now i can sell the items.

 

Another problem is. Why they make bound items cannot store to storage? i mean if i bound many items with some weight, this would be troublesome right?

Share this post


Link to post
Share on other sites
  • 0

Yes it would but i'd have to look up the storage info to see how it's blocked first.

 

Edit: Okay it seems that the clif_storageitemadded to add items, doesn't support bound item types in it's packet.

However, I can't seem to find that actual code that limits or performs the check on whether or not a bound item can be placed or not.

 

Edit2: Okay I found it, but understand that without further modifications you'd be able to effectively: store a bound item into storage -> grab it on a different character and then equip it. Making Character Bound type items useless. Your going to need to modify the way bound items work as whole.

 

Because you see currently all bound items check is for a number 0->4. If it's 1->4 it's bound, 0 it's not. Each number determines what TYPE of bound item it is. But nothing is stored to check WHO the item is bound to.

We just decided it'd be simpler to just say, " hey your item is character bound, you can't remove it from your inventory.".

At anyrate here is the code that deals with storage. Find it and then comment out the section regarding bound items.

/*========================================== * Internal add-item function. *------------------------------------------*/int storage_additem(struct map_session_data* sd, struct item* item_data, int amount) {	struct storage_data* stor = &sd->status.storage;	struct item_data *data;	int i;	if( item_data->nameid <= 0 || amount <= 0 )		return 1;		data = itemdb->search(item_data->nameid);	if( data->stack.storage && amount > data->stack.amount )	{// item stack limitation		return 1;	}	if( !itemdb_canstore(item_data, pc_get_group_level(sd)) )	{	//Check if item is storable. [Skotlex]		clif->message (sd->fd, msg_txt(264));		return 1;	}		if( item_data->bound > IBT_ACCOUNT && !pc_can_give_bound_items(sd) ) {		clif->message(sd->fd, msg_txt(294));		return 1;	}	if( itemdb->isstackable2(data) )	{//Stackable		for( i = 0; i < MAX_STORAGE; i++ )		{			if( compare_item(&stor->items[i], item_data) )			{// existing items found, stack them				if( amount > MAX_AMOUNT - stor->items[i].amount || ( data->stack.storage && amount > data->stack.amount - stor->items[i].amount ) )					return 1;				stor->items[i].amount += amount;				clif->storageitemadded(sd,&stor->items[i],i,amount);				return 0;			}		}	}	// find free slot	ARR_FIND( 0, MAX_STORAGE, i, stor->items[i].nameid == 0 );	if( i >= MAX_STORAGE )		return 1;	// add item to slot	memcpy(&stor->items[i],item_data,sizeof(stor->items[0]));	stor->storage_amount++;	stor->items[i].amount = amount;	clif->storageitemadded(sd,&stor->items[i],i,amount);	clif->updatestorageamount(sd, stor->storage_amount, MAX_STORAGE);	return 0;}

Comment out this section:

//	if( item_data->bound > IBT_ACCOUNT && !pc_can_give_bound_items(sd) ) {//		clif->message(sd->fd, msg_txt(294));//		return 1;//	}
Edited by GmOcean

Share this post


Link to post
Share on other sites
  • 0

Thanks again GM Ocean. I actually understand that maybe the hercules team actually make that way. But it would be a great if they made additional storage for determine to whom the equip  binded and implement this.

Share this post


Link to post
Share on other sites
  • 0

Hello Javanese,

 

Thank you GM Ocean. Now i can sell the items.

 

Another problem is. Why they make bound items cannot store to storage? i mean if i bound many items with some weight, this would be troublesome right?

 

As far as I know there is a setting for that. if you only read the documentation. It states that.

 

*getitembound <item id>,<amount>,<bound type>{,<account ID>};*getitembound "<item name>",<amount>,<bound type>{,<account ID>};This command behaves identically to 'getitem', but the items created will bebound to the target character as specified by the bound type. All items createdin this manner cannot be dropped, sold, vended, auctioned, or mailed, and insome cases cannot be traded or stored.Valid bound types are: 1 - Account Bound 2 - Guild Bound 3 - Party Bound 4 - Character Bound

So if the boundtype is = 4, It cannot be store. if = 3 it can share to a party but cannot be store. if = 2 it can share to guild and add to guild storage but cannot store in your own storage. if = 1 it can store in your storage and share to all your character.

 

NOTE:Editing source is not advisable since we have the HPM Features :)

Share this post


Link to post
Share on other sites
  • 0

I"d write a plugin for it if I could but I'm not that skilled at src lol. But yeah, I understand what the bound types do, it's just I think in some cases servers bind items to indivisual characters so as to make the quest or process of aquiring that item, not a 1 time thing. Making them have to redo it to gear out their other characters. I myself use this sort of tactic to add replay value for my players.

Edited by GmOcean

Share this post


Link to post
Share on other sites
  • 0

Thank you for response

Mhalicot and GmOcean,

Yeah but what i need is to treat the binded equip just like any ordinary equip, except its not transferable (trade, vending, mail, drop, etc). And cannot be equipped to other char on the same account. Just like game World of Warcraft :lol:

 

well i cant do src modif, but like GMOcean said, if they add extra storage to store whom equip is binded it would be great to implement that

Edited by Javanese

Share this post


Link to post
Share on other sites
  • 0

It'd probably just be better to create a " third " storage for characters. Much like we did for guildstorage. Although, that would take up alot of storage space on server's since, now there'd be a storage for every character, account and guild.

On average thats about:

Every 20 accounts = 1 Guild storage

Every 1 Account = 1 Account Storage

Every 1 Account = 3-9 Character Storage.

 

It'll be alot of data added in but better in the long run.

 

Also, an alternative would be to store the ID inside of a data space which we add it items. So instead of it saying item.bound = 1->4. We can have it check against character ID / Account id if not then bound type.

 

if( item.bound == 2 ){ guild bound; }

else if( item.bound == 3 ){ party bound; }

else if( item.bound >= 150000 && item.bound <= 1999999 ) { char bound; }

else if( item.bound >= 2000000 ){ account bound; }

else { not bound; }

 

But, thats meh. Just my thoughts.

Share this post


Link to post
Share on other sites
  • 0

It'd probably just be better to create a " third " storage for characters. Much like we did for guildstorage. Although, that would take up alot of storage space on server's since, now there'd be a storage for every character, account and guild.

On average thats about:

Every 20 accounts = 1 Guild storage

Every 1 Account = 1 Account Storage

Every 1 Account = 3-9 Character Storage.

 

It'll be alot of data added in but better in the long run.

 

Also, an alternative would be to store the ID inside of a data space which we add it items. So instead of it saying item.bound = 1->4. We can have it check against character ID / Account id if not then bound type.

 

if( item.bound == 2 ){ guild bound; }

else if( item.bound == 3 ){ party bound; }

else if( item.bound >= 150000 && item.bound <= 1999999 ) { char bound; }

else if( item.bound >= 2000000 ){ account bound; }

else { not bound; }

 

But, thats meh. Just my thoughts.

Your second thoughts seems more promising.

 

 

lol, why not just use the old item_trade.txt feature that got moved to item_db.conf ?

 

Well, Bound items mechanic and yellow font seems interesting for me :D

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
Answer this question...

×   Pasted as rich text.   Restore formatting

  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  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.