src/map/itemdb.h
find
unsigned autoequip: 1;
unsigned buyingstore : 1;
} flag;
short gm_lv_trade_override; //GM-level to override trade_restriction
};
replace with
unsigned autoequip: 1;
unsigned buyingstore : 1;
} flag;
unsigned ann: 1;//annouce flag
short gm_lv_trade_override; //GM-level to override trade_restriction
};
src/map/item.c
find
/*====================================
* read all item-related databases
*------------------------------------*/
add above
/*====================================
* read item_announce.txt
*------------------------------------*/
static bool itemdb_read_announce(char* fields[], int columns, int current)
{
unsigned short nameid;
struct item_data* id;
nameid = (unsigned short)strtoul(fields[0], NULL, 10);
if( ( id = itemdb_exists(nameid) ) == NULL )
{
ShowWarning("itemdb_read_announce: Unknow item id '%hu'.\n", nameid);
return false;
}
id->ann=1;
return true;
}
/*====================================
item.c
find
sv_readdb(db_path, DBPATH"item_trade.txt", ',', 3, 3, -1, &itemdb_read_itemtrade);
sv_readdb(db_path, "item_delay.txt", ',', 2, 2, -1, &itemdb_read_itemdelay);
sv_readdb(db_path, "item_buyingstore.txt", ',', 1, 1, -1, &itemdb_read_buyingstore);
add after
sv_readdb(db_path, "item_announce.txt", ',', 1, 1, -1, &itemdb_read_announce);
src/map/mob.c
find
//A Rare Drop Global Announce by Lupus
if( mvp_sd && drop_rate <= battle_config.rare_drop_announce )
{
struct item_data *i_data;
char message[128];
i_data = itemdb_search(ditem->item_data.nameid);
sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, i_data->jname, (float)drop_rate/100);
//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
intif_broadcast(message,strlen(message)+1,0);
}
add after
if(mvp_sd) {//specify drop item announce
struct item_data *dd = NULL;
char anme[128];
dd = itemdb_search(ditem->item_data.nameid);
if(dd->ann==1){
sprintf (anme, msg_txt(541), mvp_sd->status.name, md->name, dd->jname, (float)drop_rate/100);
//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
intif_broadcast(anme,strlen(anme)+1,0);
}
}
find
//A Rare MVP Drop Global Announce by Lupus
if(temp<=battle_config.rare_drop_announce) {
struct item_data *i_data;
char message[128];
i_data = itemdb_exists(item.nameid);
sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, i_data->jname, temp/100.);
//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
intif_broadcast(message,strlen(message)+1,0);
}
add after
if(mvp_sd) {//specify drop item announce
struct item_data *dd = NULL;
char anme[128];
dd = itemdb_search(item.nameid);
if(dd->ann==1){
sprintf (anme, msg_txt(541), mvp_sd->status.name, md->name, dd->jname, (float)temp/100);
//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
intif_broadcast(anme,strlen(anme)+1,0);
}
}
db/
create a doc named item_announce.txt
//to set drop announce item id
//@reloditemdb to reload all setting
//format: item id
//512
//501
//502
don't forgot to recompile
sida.patch