Jump to content
  • 0

Source Code Help


Zharor

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  04/08/18
  • Last Seen:  

enum e_additem_result pc_additem(map_session_data *sd,struct item *item,int amount,e_log_pick_type log_type)
{
	struct item_data* data;
	struct homun_data* hd;
	int i;
	unsigned int w;
	int amt2 = 0;

	if (item->nameid > 8030 && item->nameid < 9001) {
		for (i = 8031; i < 9001; i++) { 
			amt2 += pc_countitem(sd, i);
		}

		amt2 += 1;
		if ((hd = sd->hd) == NULL) {
			amt2 -= 1;
		}

		if ((sd->status.lock) == 0)
			amt2 = 0;

		if (amt2 >= 6) {
			storage_storageadd(sd, item->nameid, 1, LOG_TYPE_NONE);
			return 7;
		}
	}
int pc_countitem(struct map_session_data* sd, int itemid)        //[Hold -brA]
{
	struct item_data* it_tmp;
	int i, id, amt = 0;

	if (!(it_tmp = item_db.exists(itemid)))
		return 0;

	id = it_tmp->nameid;

	for (i = 0; i < MAX_INVENTORY; i++)
		if (sd->inventory.u.items_inventory[i].nameid == id)
			amt += sd->inventory.u.items_inventory[i].amount;

	return amt;
}

Anyone can help me adapt this code for Reathena pls 

Code 01 ERROR - storage_storageadd(sd, item->nameid, 1, LOG_TYPE_NONE);

Code 02 ERROR - if(! (it_tmp = item_db.exists(itemid))) return 0 ;


 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.   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.

×
×
  • Create New...