Ragnar Lothbrok
New member
can anyone edit this source?
I want to make the global announcement like this only : "'Admin' got Moonlight Flower Card (chance 1.00%)"
not like this : "'Admin' got Moonlight Flower's Moonlight Flower Card (chance 1.00%)"
Index: db/item_announce.txt
===================================================================
--- db/item_announce.txt (revision 0)
+++ db/item_announce.txt (working copy)
@@ -0,0 +1,6 @@
+//to set drop announce item id
+//@reloditemdb to reload all setting
+//format: item id
+//512
+//501
+//502
No newline at end of file
Index: src/map/itemdb.c
===================================================================
--- src/map/itemdb.c (revision 16146)
+++ src/map/itemdb.c (working copy)
@@ -1040,6 +1040,25 @@
}
/*====================================
+* 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;
+}
+
+
+/*====================================
* read all item-related databases
*------------------------------------*/
static void itemdb_read(void)
@@ -1055,6 +1074,8 @@
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);
+ sv->readdb(map->db_path, "item_announce.txt", ',', 1, 1, -1, &itemdb->read_announce);
+
}
/*==========================================
Index: src/map/itemdb.h
===================================================================
--- src/map/itemdb.h (revision 16146)
+++ src/map/itemdb.h (working copy)
@@ -125,6 +125,7 @@
unsigned autoequip: 1;
unsigned buyingstore : 1;
} flag;
+ unsigned ann: 1;//annouce flag
short gm_lv_trade_override; //GM-level to override trade_restriction
};
Index: src/map/mob.c
===================================================================
--- src/map/mob.c (revision 16146)
+++ src/map/mob.c (working copy)
@@ -2357,6 +2357,18 @@
//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
intif_broadcast(message,strlen(message)+1,0);
}
+ 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);
+
+ }
+
+ }
// Announce first, or else ditem will be freed. [Lance]
// By popular demand, use base drop rate for autoloot code. [skotlex]
mob_item_drop(md, dlist, ditem, 0, md->db->dropitem.p, homkillonly);
@@ -2484,6 +2496,19 @@
intif_broadcast(message,strlen(message)+1,0);
}
+ 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);
+
+ }
+
+ }
+
if((temp = pc_additem(mvp_sd,&item,1,LOG_TYPE_PICKDROP_PLAYER)) != 0) {
clif_additem(mvp_sd,0,0,temp);
map_addflooritem(&item,1,mvp_sd->bl.m,mvp_sd->bl.x,mvp_sd->bl.y,mvp_sd->status.char_id,(second_sd?second_sd->status.char_id:0),(third_sd?third_sd->status.char_id:0),1);
I want to make the global announcement like this only : "'Admin' got Moonlight Flower Card (chance 1.00%)"
not like this : "'Admin' got Moonlight Flower's Moonlight Flower Card (chance 1.00%)"