• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pc_can_give_items函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中pc_can_give_items函数的典型用法代码示例。如果您正苦于以下问题:C++ pc_can_give_items函数的具体用法?C++ pc_can_give_items怎么用?C++ pc_can_give_items使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pc_can_give_items函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: mail_setitem

/**
* Attempt to set item or zeny to a mail
* @param sd : player attaching the content
* @param idx 0 - Zeny; >= 2 - Inventory item
* @param amount : amout of zeny or number of item
* @return True if item/zeny can be set, False if failed
*/
bool mail_setitem(struct map_session_data *sd, short idx, uint32 amount) {

	if( pc_istrading(sd) )
		return false;

	if( idx == 0 ) { // Zeny Transfer
		if( !pc_can_give_items(sd) )
			return false;

		if( amount > sd->status.zeny )
			amount = sd->status.zeny;

		sd->mail.zeny = amount;
		// clif_updatestatus(sd, SP_ZENY);
		return true;
	} else { // Item Transfer
		idx -= 2;
		mail_removeitem(sd, 0);

		if( idx < 0 || idx >= MAX_INVENTORY )
			return false;
		if( amount > sd->status.inventory[idx].amount )
			return false;
		if( !pc_can_give_items(sd) || sd->status.inventory[idx].expire_time
			|| !itemdb_available(sd->status.inventory[idx].nameid)
			|| !itemdb_canmail(&sd->status.inventory[idx],pc_get_group_level(sd))
			|| (sd->status.inventory[idx].bound && !pc_can_give_bounded_items(sd)) )
			return false;

		sd->mail.index = idx;
		sd->mail.nameid = sd->status.inventory[idx].nameid;
		sd->mail.amount = amount;
		return true;
	}
}
开发者ID:544a,项目名称:rathena,代码行数:42,代码来源:mail.c


示例2: trade_traderequest

/*==========================================
 * Initiates a trade request.
 *------------------------------------------*/
void trade_traderequest(struct map_session_data *sd, struct map_session_data *target_sd)
{
	nullpo_retv(sd);

	if (map[sd->bl.m].flag.notrade) {
		clif_displaymessage (sd->fd, msg_txt(272));
		return; //Can't trade in notrade mapflag maps.
	}

	if (target_sd == NULL || sd == target_sd) {
		clif_tradestart(sd, 1); // character does not exist
		return;
	}

	if (target_sd->npc_id)
	{	//Trade fails if you are using an NPC.
		clif_tradestart(sd, 2);
		return;
	}

	if (!battle_config.invite_request_check) {
		if (target_sd->guild_invite > 0 || target_sd->party_invite > 0 || target_sd->adopt_invite) {
			clif_tradestart(sd, 2);
			return;
		}
	}

	if ( sd->trade_partner != 0 ) { // If a character tries to trade to another one then cancel the previous one
		struct map_session_data *previous_sd = map_id2sd(sd->trade_partner);
		if( previous_sd ){
			previous_sd->trade_partner = 0;
			clif_tradecancelled(previous_sd);
		} // Once cancelled then continue to the new one.
		sd->trade_partner = 0;
		clif_tradecancelled(sd);
	}

	if (target_sd->trade_partner != 0) {
		clif_tradestart(sd, 2); // person is in another trade
		return;
	}

	if (!pc_can_give_items(sd) || !pc_can_give_items(target_sd)) //check if both GMs are allowed to trade
	{
		clif_displaymessage(sd->fd, msg_txt(246));
		clif_tradestart(sd, 2); // GM is not allowed to trade
		return;
	} 
	
	// Players can not request trade from far away, unless they are allowed to use @trade.
	if (!pc_can_use_command(sd, "trade", COMMAND_ATCOMMAND) &&
	    (sd->bl.m != target_sd->bl.m || !check_distance_bl(&sd->bl, &target_sd->bl, TRADE_DISTANCE))) {
		clif_tradestart(sd, 0); // too far
		return ;
	}
	
	target_sd->trade_partner = sd->status.account_id;
	sd->trade_partner = target_sd->status.account_id;
	clif_traderequest(target_sd, sd->status.name);
}
开发者ID:Judasu,项目名称:rAthena-1,代码行数:63,代码来源:trade.c


示例3: mail_setitem

unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount) {

	if( pc_istrading(sd) )
		return 1;

	if( idx == 0 ) { // Zeny Transfer
		if( amount < 0 || !pc_can_give_items(sd) )
			return 1;

		if( amount > sd->status.zeny )
			amount = sd->status.zeny;

		sd->mail.zeny = amount;
		// clif->updatestatus(sd, SP_ZENY);
		return 0;
	} else { // Item Transfer
		idx -= 2;
		mail->removeitem(sd, 0);

		if( idx < 0 || idx >= MAX_INVENTORY )
			return 1;
		if( amount < 0 || amount > sd->status.inventory[idx].amount )
			return 1;
		if( !pc_can_give_items(sd) || sd->status.inventory[idx].expire_time ||
			!itemdb_canmail(&sd->status.inventory[idx],pc_get_group_level(sd)) ||
			(sd->status.inventory[idx].bound && !pc_can_give_bound_items(sd)) )
			return 1;

		sd->mail.index = idx;
		sd->mail.nameid = sd->status.inventory[idx].nameid;
		sd->mail.amount = amount;

		return 0;
	}
}
开发者ID:AbbottWC,项目名称:Hercules,代码行数:35,代码来源:mail.c


示例4: vending_vendinglistreq

/*==========================================
 * Request a shop's item list
 *------------------------------------------*/
void vending_vendinglistreq(struct map_session_data* sd, int id)
{
	struct map_session_data* vsd;
	nullpo_retv(sd);

	if( (vsd = map_id2sd(id)) == NULL )
		return;
	if( !vsd->state.vending )
		return; // not vending

	if ( !pc_can_give_items(pc_isGM(sd)) || !pc_can_give_items(pc_isGM(vsd)) ) //check if both GMs are allowed to trade
	{	// GM is not allowed to trade
		clif_displaymessage(sd->fd, msg_txt(246));
		return;
	} 

	sd->vended_id = vsd->vender_id;  // register vending uid
	if( battle_config.vending_zeny_id && vsd->vend_coin )
	{ // Extended Vending System
		char output[256];
		sprintf(output,msg_txt(914),itemdb_jname(vsd->vend_coin));
		clif_displaymessage(sd->fd,output);
	}

	clif_vendinglist(sd, id, vsd->vending);
}
开发者ID:ranfs,项目名称:fa6d4ae1781f9a68f1a4d5,代码行数:29,代码来源:vending.c


示例5: trade_traderequest

/*==========================================
 * Initiates a trade request.
 *------------------------------------------*/
void trade_traderequest(struct map_session_data *sd, struct map_session_data *target_sd)
{
	int level;

	nullpo_retv(sd);

	if (map[sd->bl.m].flag.notrade) {
		clif_displaymessage (sd->fd, msg_txt(272));
		return; //Can't trade in notrade mapflag maps.
	}

	if (target_sd == NULL || sd == target_sd) {
		clif_tradestart(sd, 1); // character does not exist
		return;
	}

	if (target_sd->npc_id)
	{	//Trade fails if you are using an NPC.
		clif_tradestart(sd, 2);
		return;
	}

	if (!battle_config.invite_request_check) {
		if (target_sd->guild_invite > 0 || target_sd->party_invite > 0 || target_sd->adopt_invite) {
			clif_tradestart(sd, 2);
			return;
		}
	}

	if ((target_sd->trade_partner != 0) || (sd->trade_partner != 0)) {
		clif_tradestart(sd, 2); // person is in another trade
		return;
	}

	level = pc_isGM(sd);
	if ( !pc_can_give_items(level) || !pc_can_give_items(pc_isGM(target_sd)) ) //check if both GMs are allowed to trade
	{
		clif_displaymessage(sd->fd, msg_txt(246));
		clif_tradestart(sd, 2); // GM is not allowed to trade
		return;
	} 
	
	//Fixed. Only real GMs can request trade from far away! [Lupus] 
	if (level < battle_config.lowest_gm_level && (sd->bl.m != target_sd->bl.m ||
		!check_distance_bl(&sd->bl, &target_sd->bl, TRADE_DISTANCE)
	)) {
		clif_tradestart(sd, 0); // too far
		return ;
	}
	
	target_sd->trade_partner = sd->status.account_id;
	sd->trade_partner = target_sd->status.account_id;
	clif_traderequest(target_sd, sd->status.name);
}
开发者ID:KimKyung-wook,项目名称:ilathena-project,代码行数:57,代码来源:trade.c


示例6: storage_premiumStorage_load

/**
 * Request to open premium storage
 * @param sd Player who request
 * @param num Storage number
 * @param mode Storage mode @see enum e_storage_mode
 * @return 1:Success to request, 0:Failed
 * @author [Cydh]
 **/
bool storage_premiumStorage_load(struct map_session_data *sd, uint8 num, uint8 mode) {
	nullpo_ret(sd);

	if (sd->state.storage_flag)
		return 0;

	if (sd->state.vending || sd->state.buyingstore || sd->state.prevend || sd->state.autotrade)
		return 0;

	if (sd->state.banking || sd->state.callshop)
		return 0;

	if (!pc_can_give_items(sd)) { // check is this GM level is allowed to put items to storage
		clif_displaymessage(sd->fd, msg_txt(sd,246));
		return 0;
	}

	if (!&sd->premiumStorage || sd->premiumStorage.stor_id != num)
		return intif_storage_request(sd, TABLE_STORAGE, num, mode);
	else {
		sd->premiumStorage.state.put = (mode&STOR_MODE_PUT) ? 1 : 0;
		sd->premiumStorage.state.get = (mode&STOR_MODE_GET) ? 1 : 0;
		storage_premiumStorage_open(sd);
	}
	return 1;
}
开发者ID:AtlantisRO,项目名称:rathena,代码行数:34,代码来源:storage.c


示例7: buyingstore_open

void buyingstore_open(struct map_session_data* sd, int account_id)
{
	struct map_session_data* pl_sd;

	if( !battle_config.feature_buying_store || pc_istrading(sd) )
	{// not allowed to sell
		return;
	}

	if( !pc_can_give_items(pc_isGM(sd)) )
	{// custom: GM is not allowed to sell
		clif_displaymessage(sd->fd, msg_txt(246));
		return;
	}

	if( ( pl_sd = map_id2sd(account_id) ) == NULL || !pl_sd->state.buyingstore )
	{// not online or not buying
		return;
	}

	if( !searchstore_queryremote(sd, account_id) && ( sd->bl.m != pl_sd->bl.m || !check_distance_bl(&sd->bl, &pl_sd->bl, AREA_SIZE) ) )
	{// out of view range
		return;
	}

	// success
	clif_buyingstore_itemlist(sd, pl_sd);
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:28,代码来源:buyingstore.c


示例8: storage_guild_storageopen

/*==========================================
* Attempt to open guild storage for sd
* return
* 	0 : success (open or req to create a new one)
* 	1 : fail
*	2 : no guild for sd
 *------------------------------------------*/
int storage_guild_storageopen(struct map_session_data* sd)
{
	struct guild_storage *gstor;

	nullpo_ret(sd);

	if(sd->status.guild_id <= 0)
		return 2;

	if(sd->state.storage_flag)
		return 1; //Can't open both storages at a time.

	if( !pc_can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
		clif_displaymessage(sd->fd, msg_txt(sd,246));
		return 1;
	}

	if((gstor = guild2storage2(sd->status.guild_id)) == NULL) {
		intif_request_guild_storage(sd->status.account_id,sd->status.guild_id);
		return 0;
	}
	if(gstor->storage_status)
		return 1;

	if( gstor->lock )
		return 1;

	gstor->storage_status = 1;
	sd->state.storage_flag = 2;
	storage_sortitem(gstor->items, ARRAYLENGTH(gstor->items));
	clif_storagelist(sd, gstor->items, ARRAYLENGTH(gstor->items));
	clif_updatestorageamount(sd, gstor->storage_amount, MAX_GUILD_STORAGE);
	return 0;
}
开发者ID:gigaguzel,项目名称:rAthena-1,代码行数:41,代码来源:storage.c


示例9: storage_guild_storageopen

int storage_guild_storageopen(struct map_session_data* sd)
{
	struct guild_storage *gstor;

	nullpo_retr(0, sd);

	if(sd->status.guild_id <= 0)
		return 2;

	if(sd->state.storage_flag)
		return 1; //Can't open both storages at a time.
	
	if( !pc_can_give_items(pc_isGM(sd)) ) { //check is this GM level can open guild storage and store items [Lupus]
		clif_displaymessage(sd->fd, msg_txt(246));
		return 1;
	}

	if((gstor = guild2storage2(sd->status.guild_id)) == NULL) {
		intif_request_guild_storage(sd->status.account_id,sd->status.guild_id);
		return 0;
	}
	if(gstor->storage_status)
		return 1;
	
	gstor->storage_status = 1;
	sd->state.storage_flag = 2;
	clif_guildstoragelist(sd,gstor);
	clif_updateguildstorageamount(sd,gstor->storage_amount);
	return 0;
}
开发者ID:anacondaqq,项目名称:Beginner-eAthena,代码行数:30,代码来源:storage.c


示例10: buyingstore_open

void buyingstore_open(struct map_session_data* sd, int account_id)
{
	struct map_session_data* pl_sd;

	nullpo_retv(sd);
	if( !battle_config.feature_buying_store || pc_istrading(sd) )
	{// not allowed to sell
		return;
	}

	if( !pc_can_give_items(sd) )
	{// custom: GM is not allowed to sell
		clif->message(sd->fd, msg_sd(sd,246)); // Your GM level doesn't authorize you to perform this action.
		return;
	}

	if( ( pl_sd = map->id2sd(account_id) ) == NULL || !pl_sd->state.buyingstore ) {
		// not online or not buying
		return;
	}

	if( !searchstore->queryremote(sd, account_id) && ( sd->bl.m != pl_sd->bl.m || !check_distance_bl(&sd->bl, &pl_sd->bl, AREA_SIZE) ) )
	{// out of view range
		return;
	}

	// success
	clif->buyingstore_itemlist(sd, pl_sd);
}
开发者ID:DeepBugs,项目名称:Hercules,代码行数:29,代码来源:buyingstore.c


示例11: mail_setitem

unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount)
{
	if (idx == 0)
	{ // Zeny Transfer
		if( amount < 0 )
			return 0;
		if( amount > sd->status.zeny )
			amount = sd->status.zeny;

		if( !pc_can_give_items(pc_isGM(sd)) )
			amount = 0;

		sd->mail.zeny = amount;
		// clif_updatestatus(sd, SP_ZENY);
		return 0;
	}
	else
	{ // Item Transfer
		idx -= 2;
		mail_removeitem(sd, 0);

		if( idx < 0 || idx >= MAX_INVENTORY )
			return 1;
		if( amount < 0 || amount > sd->status.inventory[idx].amount )
			return 1;
		if( !pc_candrop(sd, &sd->status.inventory[idx]) )
			return 1;

		sd->mail.index = idx;
		sd->mail.nameid = sd->status.inventory[idx].nameid;
		sd->mail.amount = amount;
		
		return 0;
	}
}
开发者ID:PiratGameInfo,项目名称:Eathena,代码行数:35,代码来源:mail.c


示例12: storage_storageopen

/*==========================================
 * Opens a storage. Returns:
 * 0 - success
 * 1 - fail
 * 2 - Storage requested from char-server (will open automatically later)
 *------------------------------------------
 */
int storage_storageopen(struct map_session_data *sd)
{
	struct storage *stor;
	nullpo_retr(0, sd);

	if(sd->state.finalsave) //Refuse to open storage when you had your last save done.
		return 1;

	if(sd->state.storage_flag)
		return 1; //Already open?
	
	if(pc_can_give_items(pc_isGM(sd)))
  	{ //check is this GM level is allowed to put items to storage
		clif_displaymessage(sd->fd, msg_txt(246));
		return 1;
	}
	
	if((stor = idb_get(storage_db,sd->status.account_id)) == NULL)
  	{	//Request storage.
		intif_request_storage(sd->status.account_id);
		return 2;
	}
  
	if (stor->storage_status)
  		return 1; //Already open/player already has it open...

	stor->storage_status = 1;
	sd->state.storage_flag = 1;
	clif_storagelist(sd,stor);
	clif_updatestorageamount(sd,stor);
	return 0;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:39,代码来源:storage.c


示例13: mail_setitem

/**
* Attempt to set item or zeny
* @param sd
* @param idx 0 - Zeny; >= 2 - Inventory item
* @param amount
* @return True if item/zeny can be set, False if failed
*/
bool mail_setitem(struct map_session_data *sd, short idx, int amount) {
	if( sd->state.secure_items )
	{
		clif_displaymessage(sd->fd, "You can't attach. Blocked with @security");
		return 1;
	}

	if( pc_istrading(sd) )
		return false;

	if( battle_config.super_woe_enable )
	{
		clif_displaymessage(sd->fd, "Super WoE don't allow send items/zeny with attachments");
		return 1;
	}

	if( idx == 0 )
	{ // Zeny Transfer
		if( !pc_can_give_items(sd) )
			return false;

		if( amount > sd->status.zeny )
			amount = sd->status.zeny;

		sd->mail.zeny = amount;
		// clif_updatestatus(sd, SP_ZENY);
		return true;
	} else { // Item Transfer
		idx -= 2;
		mail_removeitem(sd, 0);

		if( idx < 0 || idx >= MAX_INVENTORY )
			return false;
		if( amount > sd->status.inventory[idx].amount )
			return false;
		if( !pc_can_give_items(sd) || sd->status.inventory[idx].expire_time
			|| !itemdb_available(sd->status.inventory[idx].nameid)
			|| !itemdb_canmail(&sd->status.inventory[idx],pc_get_group_level(sd))
			|| (sd->status.inventory[idx].bound && !pc_can_give_bounded_items(sd)) )
			return false;

		sd->mail.index = idx;
		sd->mail.nameid = sd->status.inventory[idx].nameid;
		sd->mail.amount = amount;
		return true;
	}
}
开发者ID:Chocolate31,项目名称:eamod,代码行数:54,代码来源:mail.c


示例14: vending_vendinglistreq

/*==========================================
 * Request a shop's item list
 *------------------------------------------*/
void vending_vendinglistreq(struct map_session_data* sd, int id)
{
    struct map_session_data* vsd;
    nullpo_retv(sd);

    if( (vsd = map_id2sd(id)) == NULL )
        return;
    if( vsd->vender_id == 0 )
        return; // not vending

    if ( !pc_can_give_items(pc_isGM(sd)) || !pc_can_give_items(pc_isGM(vsd)) ) //check if both GMs are allowed to trade
    {   // GM is not allowed to trade
        clif_displaymessage(sd->fd, msg_txt(246));
        return;
    }

    clif_vendinglist(sd, id, vsd->vending);
}
开发者ID:anacondaqq,项目名称:Beginner-eAthena,代码行数:21,代码来源:vending.c


示例15: vending_vendinglistreq

/*==========================================
 * Request a shop's item list
 *------------------------------------------*/
void vending_vendinglistreq(struct map_session_data *sd, unsigned int id) {
	struct map_session_data *vsd;
	nullpo_retv(sd);

	if((vsd = map->id2sd(id)) == NULL)
		return;
	if(!vsd->state.vending)
		return; // not vending

	if(!pc_can_give_items(sd) || !pc_can_give_items(vsd)) { //check if both GMs are allowed to trade
		// GM is not allowed to trade
		clif_displaymessage(sd->fd, msg_txt(246));
		return;
	}

	sd->vended_id = vsd->vender_id;  // register vending uid

	clif_vendinglist(sd, id, vsd->vending);
}
开发者ID:Mateuus,项目名称:brathena-1,代码行数:22,代码来源:vending.c


示例16: vending_vendinglistreq

/*==========================================
 * Request a shop's item list
 *------------------------------------------*/
void vending_vendinglistreq(struct map_session_data* sd, unsigned int id)
{
	struct map_session_data* vsd;
	nullpo_retv(sd);

	if( (vsd = map->id2sd(id)) == NULL )
		return;
	if( !vsd->state.vending )
		return; // not vending

	if (!pc_can_give_items(sd) || !pc_can_give_items(vsd)) { //check if both GMs are allowed to trade
		clif->message(sd->fd, msg_sd(sd,246)); // Your GM level doesn't authorize you to perform this action.
		return;
	}

	sd->vended_id = vsd->vender_id;  // register vending uid

	clif->vendinglist(sd, id, vsd->vending);
}
开发者ID:SamuelHercules,项目名称:Hercules,代码行数:22,代码来源:vending.c


示例17: vending_vendinglistreq

/*==========================================
 * Solicitando uma lista de itens de venda
 *------------------------------------------*/
void vending_vendinglistreq(struct map_session_data* sd, unsigned int id) {
	struct map_session_data* vsd;
	nullpo_retv(sd);

	if( (vsd = map->id2sd(id)) == NULL )
		return;
	if( !vsd->state.vending )
		return; // nao vendendo

	if (!pc_can_give_items(sd) || !pc_can_give_items(vsd)) { //checando se ambos GMs sao permitidos negociar
		// GM nao esta permitido negociar
		clif->message(sd->fd, msg_txt(246));
		return;
	}

	sd->vended_id = vsd->vender_id;  // registra uid de venda

	clif->vendinglist(sd, id, vsd->vending);
}
开发者ID:Cronus-Emulator,项目名称:Cronus,代码行数:22,代码来源:vending.c


示例18: trade_traderequest

/*==========================================
 * 取引要請を相手に送る
 *------------------------------------------
 */
void trade_traderequest(struct map_session_data *sd, int target_id) {
	struct map_session_data *target_sd;
	int level;

	nullpo_retv(sd);

	if (map[sd->bl.m].flag.notrade) {
		clif_displaymessage (sd->fd, msg_txt(272));
		return; //Can't trade in notrade mapflag maps.
	}

	if ((target_sd = map_id2sd(target_id)) != NULL) {
		if (!battle_config.invite_request_check) {
			if (target_sd->guild_invite > 0 || target_sd->party_invite > 0) {
				clif_tradestart(sd, 2); // 相手はPT要請中かGuild要請中
				return;
			}
		}
		level = pc_isGM(sd);
		if ( pc_can_give_items(level) || pc_can_give_items(pc_isGM(target_sd)) ) //check if both GMs are allowed to trade
		{
			clif_displaymessage(sd->fd, msg_txt(246));
			trade_tradecancel(sd); // GM is not allowed to trade
		} else if ((target_sd->trade_partner != 0) || (sd->trade_partner != 0)) {
			trade_tradecancel(sd); // person is in another trade
		} else {
			//Fixed. Only real GMs can request trade from far away! [Lupus] 
			if (level < lowest_gm_level && (sd->bl.m != target_sd->bl.m ||
			    (sd->bl.x - target_sd->bl.x <= -5 || sd->bl.x - target_sd->bl.x >= 5) ||
			    (sd->bl.y - target_sd->bl.y <= -5 || sd->bl.y - target_sd->bl.y >= 5))) {
				clif_tradestart(sd, 0); // too far
			} else if (sd != target_sd) {
				target_sd->trade_partner = sd->status.account_id;
				sd->trade_partner = target_sd->status.account_id;
				clif_traderequest(target_sd, sd->status.name);
			}
		}
	} else {
		clif_tradestart(sd, 1); // character does not exist
	}
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:45,代码来源:trade.c


示例19: mail_setitem

unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount)
{
	if( sd->state.secure_items )
	{
		clif_displaymessage(sd->fd, "You can't attach. Blocked with @security");
		return 1;
	}

	if( battle_config.super_woe_enable )
	{
		clif_displaymessage(sd->fd, "Super WoE don't allow send items/zeny with attachments");
		return 1;
	}
	
	if( idx == 0 )
	{ // Zeny Transfer
		if( amount < 0 || !pc_can_give_items(pc_isGM(sd)) )
			return 1;

		if( amount > sd->status.zeny )
			amount = sd->status.zeny;

		sd->mail.zeny = amount;
		// pc_onstatuschanged(sd, SP_ZENY);
		return 0;
	}
	else
	{ // Item Transfer
		idx -= 2;
		mail_removeitem(sd, 0);

		if( idx < 0 || idx >= MAX_INVENTORY )
			return 1;
		if( amount < 0 || amount > sd->status.inventory[idx].amount )
			return 1;
		if( !pc_candrop(sd, &sd->status.inventory[idx]) )
			return 1;

		sd->mail.index = idx;
		sd->mail.nameid = sd->status.inventory[idx].nameid;
		sd->mail.amount = amount;
		
		return 0;
	}
}
开发者ID:Chocolate31,项目名称:eamod,代码行数:45,代码来源:mail.c


示例20: storage_storageopen

/**
 * Player attempt tp open his storage.
 * @param sd : player
 * @return 0 : success, 1 : fail
 */
int storage_storageopen(struct map_session_data *sd)
{
	nullpo_ret(sd);

	if (sd->state.storage_flag)
		return 1; //Already open?

	if (!pc_can_give_items(sd)) { //Check is this GM level is allowed to put items to storage
		clif_displaymessage(sd->fd, msg_txt(246));
		return 1;
	}

	sd->state.storage_flag = 1;
	storage_sortitem(sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
	clif_storagelist(sd, sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
	clif_updatestorageamount(sd, sd->status.storage.storage_amount, sd->storage_size);
	return 0;
}
开发者ID:MStr3am,项目名称:idathena,代码行数:23,代码来源:storage.c



注:本文中的pc_can_give_items函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pc_delitem函数代码示例发布时间:2022-05-30
下一篇:
C++ pcRel函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap