Added the ability to make dynamic cash/item/point shops (#5213)

This commit is contained in:
Daegaladh
2020-07-21 00:07:57 +02:00
committed by GitHub
parent 40e1e4e726
commit 187aa852be
2 changed files with 8 additions and 0 deletions

View File

@@ -1699,6 +1699,10 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, str
amount = item_list[i].amount = 1;
}
if( nd->master_nd ) { // Script-controlled shops decide by themselves, what can be bought and for what price.
continue;
}
switch( pc_checkadditem(sd,nameid,amount) )
{
case CHKADDITEM_NEW:
@@ -1712,6 +1716,9 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, str
w += itemdb_weight(nameid) * amount;
}
if (nd->master_nd) //Script-based shops.
return npc_buylist_sub(sd,count,(struct s_npc_buy_list*)item_list,nd->master_nd);
if( w + sd->weight > sd->max_weight )
return ERROR_TYPE_INVENTORY_WEIGHT;
if( pc_inventoryblank(sd) < new_ )