Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Since most delay-consume items involve using a "skill-type" target cursor,
- //perform a skill-use check before going through. [Skotlex]
- //resurrection was picked as testing skill, as a non-offensive, generic skill, it will do.
- //FIXME: Is this really needed here? It'll be checked in unit.c after all and this prevents skill items using when silenced [Inkfish]
- if( id->flag.delay_consume && ( sd->ud.skilltimer != INVALID_TIMER /*|| !status_check_skilluse(&sd->bl, &sd->bl, ALL_RESURRECTION, 0)*/ ) )
- return 0;
- if( id->delay > 0 && !pc_has_permission(sd,PC_PERM_ITEM_UNCONDITIONAL) ) {
- int i;
- ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == nameid );
- if( i == MAX_ITEMDELAYS ) /* item not found. try first empty now */
- ARR_FIND(0, MAX_ITEMDELAYS, i, !sd->item_delay[i].nameid );
- if( i < MAX_ITEMDELAYS ) {
- if( sd->item_delay[i].nameid ) {// found
- if( DIFF_TICK(sd->item_delay[i].tick, tick) > 0 ) {
- int e_tick = DIFF_TICK(sd->item_delay[i].tick, tick)/1000;
- char e_msg[100];
- if( e_tick > 99 )
- sprintf(e_msg,msg_txt(sd,379), // Item Failed. [%s] is cooling down. Wait %.1f minutes.
- itemdb_jname(sd->item_delay[i].nameid), (double)e_tick / 60);
- else
- sprintf(e_msg,msg_txt(sd,380), // Item Failed. [%s] is cooling down. Wait %d seconds.
- itemdb_jname(sd->item_delay[i].nameid), e_tick+1);
- clif_colormes(sd,color_table[COLOR_YELLOW],e_msg);
- return 0; // Delay has not expired yet
- }
- } else {// not yet used item (all slots are initially empty)
- sd->item_delay[i].nameid = nameid;
- }
- if( !(nameid == ITEMID_REINS_OF_MOUNT && sd->sc.option&(OPTION_WUGRIDER|OPTION_RIDING|OPTION_DRAGON|OPTION_MADOGEAR)) )
- sd->item_delay[i].tick = tick + sd->inventory_data[n]->delay;
- } else {// should not happen
- ShowError("pc_useitem: Exceeded item delay array capacity! (nameid=%hu, char_id=%d)\n", nameid, sd->status.char_id);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement