Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. int pc_useitem(struct map_session_data *sd,int n) {
  2. int64 tick = timer->gettick();
  3. int amount, nameid, i, char_id = 0;
  4. struct script_code *item_script;
  5.  
  6. nullpo_ret(sd);
  7.  
  8. if( sd->npc_id || sd->state.workinprogress&1 ){
  9. /* TODO: add to clif->messages enum */
  10. #ifdef RENEWAL
  11. clif->msg(sd, 0x783); // TODO look for the client date that has this message.
  12. #endif
  13. return 0;
  14. }
  15.  
  16. if( sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount <= 0 )
  17. return 0;
  18.  
  19. #ifdef ADELAYS
  20. //Adelays in pc_useitem
  21. if (!adelays_canuseitem(sd->status.inventory[n].nameid, sd->ud.canact_tick)){
  22. return 0;
  23. }
  24. #endif
  25.  
  26. if( sd->state.only_walk )
  27. return 0;
  28.  
  29. if( !pc->isUseitem(sd,n) )
  30. return 0;
  31.  
  32. // Store information for later use before it is lost (via pc->delitem) [Paradox924X]
  33. nameid = sd->inventory_data[n]->nameid;
  34. if( sd->status.inventory[n].card[0] == CARD0_CREATE )
  35. { // Do not allow use BG - Ancient Items on invalid maps
  36. char_id = MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3]);
  37. if( battle_config.bg_reserved_char_id && char_id == battle_config.bg_reserved_char_id && !map_bg_items(sd->bl.m) )
  38. return 0;
  39. if( battle_config.woe_reserved_char_id && char_id == battle_config.woe_reserved_char_id && !map_gvg_items(sd->bl.m) )
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement