Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pc_useitem(struct map_session_data *sd,int n) {
- int64 tick = timer->gettick();
- int amount, nameid, i, char_id = 0;
- struct script_code *item_script;
- nullpo_ret(sd);
- if( sd->npc_id || sd->state.workinprogress&1 ){
- /* TODO: add to clif->messages enum */
- #ifdef RENEWAL
- clif->msg(sd, 0x783); // TODO look for the client date that has this message.
- #endif
- return 0;
- }
- if( sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount <= 0 )
- return 0;
- #ifdef ADELAYS
- //Adelays in pc_useitem
- if (!adelays_canuseitem(sd->status.inventory[n].nameid, sd->ud.canact_tick)){
- return 0;
- }
- #endif
- if( sd->state.only_walk )
- return 0;
- if( !pc->isUseitem(sd,n) )
- return 0;
- // Store information for later use before it is lost (via pc->delitem) [Paradox924X]
- nameid = sd->inventory_data[n]->nameid;
- if( sd->status.inventory[n].card[0] == CARD0_CREATE )
- { // Do not allow use BG - Ancient Items on invalid maps
- char_id = MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3]);
- if( battle_config.bg_reserved_char_id && char_id == battle_config.bg_reserved_char_id && !map_bg_items(sd->bl.m) )
- return 0;
- if( battle_config.woe_reserved_char_id && char_id == battle_config.woe_reserved_char_id && !map_gvg_items(sd->bl.m) )
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement