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;