diff options
author | Asheraf <acheraf1998@gmail.com> | 2018-07-27 02:35:05 +0100 |
---|---|---|
committer | Asheraf <acheraf1998@gmail.com> | 2018-07-27 02:35:05 +0100 |
commit | aea2b9fa2dab244ac74668c2f832d0383737ac91 (patch) | |
tree | dbe346e91c2653093ba43e50fc545e9c37147702 | |
parent | 40f015d43eb87a6680b4ce53b1ca88c0dec641e3 (diff) | |
download | hercules-aea2b9fa2dab244ac74668c2f832d0383737ac91.tar.gz hercules-aea2b9fa2dab244ac74668c2f832d0383737ac91.tar.bz2 hercules-aea2b9fa2dab244ac74668c2f832d0383737ac91.tar.xz hercules-aea2b9fa2dab244ac74668c2f832d0383737ac91.zip |
Add support for doram restriction in stylist shop
-rw-r--r-- | src/map/clif.c | 6 | ||||
-rw-r--r-- | src/map/clif.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 82507a84a..6805fa778 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -21220,6 +21220,9 @@ static bool clif_stylist_read_db_libconfig_sub(struct config_setting_t *it, int if (itemdb->lookup_const(it, "BoxItemID", &i32)) entry.boxid = i32; + if (libconfig->setting_lookup_bool(it, "AllowDoram", &i32)) + entry.allow_doram = (i32 == 0) ? false : true; + VECTOR_ENSURE(stylist_data[type], 1, 1); VECTOR_PUSH(stylist_data[type], entry); return true; @@ -21236,6 +21239,9 @@ static bool clif_style_change_validate_requirements(struct map_session_data *sd, entry = &VECTOR_INDEX(stylist_data[type], idx); + if (sd->status.class == JOB_SUMMONER && (entry->allow_doram == false)) + return false; + if (entry->id >= 0) { if (entry->zeny != 0) { if (sd->status.zeny < entry->zeny) diff --git a/src/map/clif.h b/src/map/clif.h index 0077566b5..8d967e6fd 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -645,6 +645,7 @@ struct stylist_data_entry { int32 zeny; int itemid; int boxid; + bool allow_doram; }; VECTOR_DECL(struct stylist_data_entry) stylist_data[MAX_STYLIST_TYPE]; |