laphine_synthesis script command update (#7222)

* Added the item ID/name as parameter for laphine_synthesis script command

Thanks to @Lemongrass3110 !
This commit is contained in:
Atemo
2022-08-31 21:39:34 +02:00
committed by GitHub
parent 177d57ee68
commit 9be64f55dc
3 changed files with 52 additions and 23 deletions

View File

@@ -23246,21 +23246,24 @@ void clif_parse_laphine_synthesis( int fd, struct map_session_data* sd ){
}
}
int16 index = pc_search_inventory( sd, sd->state.laphine_synthesis );
// If triggered from item
if( sd->itemid == sd->state.laphine_synthesis ){
int16 index = pc_search_inventory( sd, sd->state.laphine_synthesis );
if( index < 0 ){
clif_laphine_synthesis_result( sd, LAPHINE_SYNTHESIS_ITEM );
return;
}
if( ( sd->inventory_data[index]->flag.delay_consume & DELAYCONSUME_NOCONSUME ) == 0 ){
if( pc_delitem( sd, index, 1, 0, 0, LOG_TYPE_LAPHINE ) != 0 ){
if( index < 0 ){
clif_laphine_synthesis_result( sd, LAPHINE_SYNTHESIS_ITEM );
return;
}
if( ( sd->inventory_data[index]->flag.delay_consume & DELAYCONSUME_NOCONSUME ) == 0 ){
if( pc_delitem( sd, index, 1, 0, 0, LOG_TYPE_LAPHINE ) != 0 ){
return;
}
}
}
for( size_t i = 0; i < count; i++ ){
index = server_index( p->items[i].index );
int16 index = server_index( p->items[i].index );
if( pc_delitem( sd, index, p->items[i].count, 0, 0, LOG_TYPE_LAPHINE ) != 0 ){
return;