summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-15 00:23:15 +0100
committerHaru <haru@dotalux.com>2015-12-28 18:35:59 +0100
commit09a2201e0d8563608a421378970f9d9ae6bc38bc (patch)
tree00e3dacdd6818e5665cc440f25ef183c7c9b9eb9
parent08fc3deb0234208b0abf3ed7fb4eadba44456fdf (diff)
downloadhercules-09a2201e0d8563608a421378970f9d9ae6bc38bc.tar.gz
hercules-09a2201e0d8563608a421378970f9d9ae6bc38bc.tar.bz2
hercules-09a2201e0d8563608a421378970f9d9ae6bc38bc.tar.xz
hercules-09a2201e0d8563608a421378970f9d9ae6bc38bc.zip
Replaced some numeric mob IDs with the proper constants (MOBID_TREASURE_BOX*)
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/itemdb.c4
-rw-r--r--src/map/mob.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 54458d248..2894463de 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -2095,9 +2095,9 @@ void itemdb_reload(void) {
//Epoque's awesome @reloaditemdb fix - thanks! [Ind]
//- Fixes the need of a @reloadmobdb after a @reloaditemdb to re-link monster drop data
- for( i = 0; i < MAX_MOB_DB; i++ ) {
+ for (i = 0; i < MAX_MOB_DB; i++) {
struct mob_db *entry;
- if( !((i < 1324 || i > 1363) && (i < 1938 || i > 1946)) )
+ if ((i >= MOBID_TREASURE_BOX1 && i <= MOBID_TREASURE_BOX40) || (i >= MOBID_TREASURE_BOX41 && i <= MOBID_TREASURE_BOX49))
continue;
entry = mob->db(i);
for(d = 0; d < MAX_MOB_DROP; d++) {
diff --git a/src/map/mob.c b/src/map/mob.c
index 21ebea650..48f1e531e 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3832,7 +3832,7 @@ void mob_read_db_drops_sub(struct mob_db *entry, struct status_data *mstatus, in
continue;
}
type = id->type;
- if ((class_ >= 1324 && class_ <= 1363) || (class_ >= 1938 && class_ <= 1946)) {
+ if ((class_ >= MOBID_TREASURE_BOX1 && class_ <= MOBID_TREASURE_BOX40) || (class_ >= MOBID_TREASURE_BOX41 && class_ <= MOBID_TREASURE_BOX49)) {
//Treasure box drop rates [Skotlex]
rate_adjust = battle_config.item_rate_treasure;
ratemin = battle_config.item_drop_treasure_min;
@@ -3873,8 +3873,10 @@ void mob_read_db_drops_sub(struct mob_db *entry, struct status_data *mstatus, in
entry->dropitem[idx].p = mob->drop_adjust(value, rate_adjust, ratemin, ratemax);
//calculate and store Max available drop chance of the item
- if (entry->dropitem[idx].p && (class_ < 1324 || class_ > 1363) && (class_ < 1938 || class_ > 1946))
- { //Skip treasure chests.
+ if (entry->dropitem[idx].p
+ && (class_ < MOBID_TREASURE_BOX1 || class_ > MOBID_TREASURE_BOX40)
+ && (class_ < MOBID_TREASURE_BOX41 || class_ > MOBID_TREASURE_BOX49)) {
+ //Skip treasure chests.
if (id->maxchance == -1 || (id->maxchance < entry->dropitem[idx].p) ) {
id->maxchance = entry->dropitem[idx].p; //item has bigger drop chance or sold in shops
}