viewing paste topic/7184- questlog_party_level | Diff

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
 conf/battle/party.conf |  6 ++++++
 src/map/battle.c       |  1 +
 src/map/battle.h       |  1 +
 src/map/mob.c          |  2 +-
 src/map/quest.c        | 11 ++++++++++-
 5 files changed, 19 insertions(+), 2 deletions(-)
 
diff --git a/conf/battle/party.conf b/conf/battle/party.conf
index 14d5f47..751e678 100644
--- a/conf/battle/party.conf
+++ b/conf/battle/party.conf
@@ -52,3 +52,9 @@ party_even_share_bonus: 0
 // Display party name regardless if player is in a guild.
 // Official servers do not display party name unless the user is in a guild. (Note 1)
 display_party_name: no
+
+// When killing a questlog monster, allow how much the level gap to add the mob count ?
+// if set to 10, a player with level 50 will add the kill count to all party members from level 40~60 within sight-range
+// if -1, this feature is off, allows all party member within sight-range to add the kill count, regardless of their levels
+// Default : -1 (official)
+party_questkill_level_range: -1
\ No newline at end of file
diff --git a/src/map/battle.c b/src/map/battle.c
index 8930d3a..0b4bb6c 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6774,6 +6774,7 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int range
        { "case_sensitive_aegisnames",          &battle_config.case_sensitive_aegisnames,       1,      0,      1,              },
        { "guild_castle_invite",                                &battle_config.guild_castle_invite,                             0,              0,              1,                              },
        { "guild_castle_expulsion",                             &battle_config.guild_castle_expulsion,                  0,              0,              1,                              },
+       { "party_questkill_level_range",                &battle_config.party_questkill_level_range,             -1,             -1,             MAX_LEVEL,              },
 };
 #ifndef STATS_OPT_OUT
 /**
diff --git a/src/map/battle.h b/src/map/battle.h
index 161ddeb..1163d85 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -475,6 +475,7 @@ struct Battle_Config {
        int case_sensitive_aegisnames;
        int guild_castle_invite;
        int guild_castle_expulsion;
+       int party_questkill_level_range;
 };
 
 extern struct Battle_Config battle_config;
diff --git a/src/map/mob.c b/src/map/mob.c
index 3f1769d..58e18fa 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2569,7 +2569,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
                        }
 
                        if( sd->status.party_id )
-                               map->foreachinrange(quest->update_objective_sub,&md->bl,AREA_SIZE,BL_PC,sd->status.party_id,md->class_);
+                               map->foreachinrange(quest->update_objective_sub,&md->bl,AREA_SIZE,BL_PC,sd->status.party_id,md->class_,sd->status.base_level);
                        else if( sd->avail_quests )
                                quest->update_objective(sd, md->class_);
 
diff --git a/src/map/quest.c b/src/map/quest.c
index b76d6bc..dbf7a00 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -224,19 +224,28 @@ int quest_delete(TBL_PC *sd, int quest_id) {
  */
 int quest_update_objective_sub(struct block_list *bl, va_list ap) {
        struct map_session_data *sd;
-       int mob_id, party_id;
+       int mob_id, party_id, baselevel, range;
 
        nullpo_ret(bl);
        nullpo_ret(sd = (struct map_session_data *)bl);
 
        party_id = va_arg(ap,int);
        mob_id = va_arg(ap,int);
+       baselevel = va_arg(ap,int);
 
        if( !sd->avail_quests )
                return 0;
        if( sd->status.party_id != party_id )
                return 0;
 
+       if ( battle_config.party_questkill_level_range != -1 ) {
+               range = sd->status.base_level - baselevel;
+               if ( range < 0 )
+                       range = -range;
+               if ( range > battle_config.party_questkill_level_range )
+                       return 0;
+       }
+
        quest->update_objective(sd, mob_id);
 
        return 1;
 
Viewed 1024 times, submitted by AnnieRuru.