summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorJedzkie <jedzkie13@rocketmail.com>2017-04-25 16:44:27 +0800
committerHaru <haru@dotalux.com>2017-04-29 00:47:06 +0200
commit25e4f661211fc91a64a6e18d8ffd9d16581dfaf9 (patch)
tree69a41c87390593f0ca4e592a83037cf5b35ffcf8 /src/map
parente6c0203a6da6930d9c4a2b762190cd0428e106ca (diff)
downloadhercules-25e4f661211fc91a64a6e18d8ffd9d16581dfaf9.tar.gz
hercules-25e4f661211fc91a64a6e18d8ffd9d16581dfaf9.tar.bz2
hercules-25e4f661211fc91a64a6e18d8ffd9d16581dfaf9.tar.xz
hercules-25e4f661211fc91a64a6e18d8ffd9d16581dfaf9.zip
Fixes #994
Diffstat (limited to 'src/map')
-rw-r--r--src/map/itemdb.c3
-rw-r--r--src/map/itemdb.h3
-rw-r--r--src/map/mob.c15
3 files changed, 11 insertions, 10 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index a35aa67f1..4076e295c 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -2073,6 +2073,9 @@ int itemdb_readdb_libconfig_sub(struct config_setting_t *it, int n, const char *
if ((t = libconfig->setting_get_member(it, "KeepAfterUse")))
id.flag.keepafteruse = libconfig->setting_get_bool(t) ? 1 : 0;
+ if ((t = libconfig->setting_get_member(it, "DropAnnounce")))
+ id.flag.drop_announce = libconfig->setting_get_bool(t) ? 1 : 0;
+
if (itemdb->lookup_const(it, "Delay", &i32) && i32 >= 0)
id.delay = i32;
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 138a783ae..f77801e09 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -111,8 +111,6 @@ enum item_itemid {
ITEMID_FRAGMENT_OF_CRYSTAL = 7321,
ITEMID_SKULL_ = 7420,
ITEMID_TOKEN_OF_SIEGFRIED = 7621,
- ITEMID_GOLD_KEY77 = 7782,
- ITEMID_SILVER_KEY77 = 7783,
ITEMID_SPECIAL_ALLOY_TRAP = 7940,
ITEMID_CATNIP_FRUIT = 11602,
ITEMID_RED_POUCH_OF_SURPRISE = 12024,
@@ -510,6 +508,7 @@ struct item_data {
unsigned keepafteruse : 1;
unsigned force_serial : 1;
unsigned no_options: 1; // < disallows use of item options on the item. (non-equippable items are automatically flagged) [Smokexyz]
+ unsigned drop_announce : 1; // Official Drop Announce [Jedzkie]
} flag;
struct {// item stacking limitation
unsigned short amount;
diff --git a/src/map/mob.c b/src/map/mob.c
index 74d25b805..4f08cf38e 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2151,6 +2151,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
struct map_session_data *sd = BL_CAST(BL_PC, src);
struct map_session_data *tmpsd[DAMAGELOG_SIZE] = { NULL };
struct map_session_data *mvp_sd = sd, *second_sd = NULL, *third_sd = NULL;
+ struct item_data *id = NULL;
struct {
struct party_data *p;
@@ -2447,14 +2448,12 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
intif->broadcast(message, (int)strlen(message)+1, BC_DEFAULT);
}
- /* heres the thing we got the feature set up however we're still discussing how to best define the ids,
- * so while we discuss, for a small period of time, the list is hardcoded (yes officially only those 2 use it,
- * thus why we're unsure on how to best place the setting) */
- /* temp, will not be hardcoded for long thudu. */
- // TODO: This should be a field in the item db.
- if (mvp_sd != NULL
- && (it->nameid == ITEMID_GOLD_KEY77 || it->nameid == ITEMID_SILVER_KEY77)) /* for when not hardcoded: add a check on mvp bonus drop as well */
- clif->item_drop_announce(mvp_sd, it->nameid, md->name);
+ // Official Drop Announce [Jedzkie]
+ if (mvp_sd != NULL) {
+ if ((id = itemdb->search(it->nameid)) != NULL && id->flag.drop_announce) {
+ clif->item_drop_announce(mvp_sd, it->nameid, md->name);
+ }
+ }
// Announce first, or else ditem will be freed. [Lance]
// By popular demand, use base drop rate for autoloot code. [Skotlex]