summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c27
-rw-r--r--src/map/battle.h3
-rw-r--r--src/map/skill.c8
3 files changed, 26 insertions, 12 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index e5f591649..cb878a1d2 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3463,15 +3463,22 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
else
state |= BCT_ENEMY;
}
- if (state&BCT_ENEMY && battle_config.pk_mode && !map_flag_gvg(m) && s_bl->type == BL_PC && t_bl->type == BL_PC)
+ if (state&BCT_ENEMY && battle_config.pk_mode && !map_flag_gvg(m) &&
+ s_bl->type == BL_PC && t_bl->type == BL_PC)
{ //Prevent novice engagement on pk_mode (feature by Valaris)
- struct map_session_data* sd;
- if ((sd = (struct map_session_data*)s_bl) &&
- ((sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE || sd->status.base_level < battle_config.pk_min_level))
- state&=~BCT_ENEMY;
- else
- if ((sd = (struct map_session_data*)t_bl) &&
- ((sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE || sd->status.base_level < battle_config.pk_min_level))
+ struct map_session_data* sd = (struct map_session_data*)s_bl,
+ *sd2 = (struct map_session_data*)t_bl;
+ if (
+ (sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
+ (sd2->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
+ sd->status.base_level < battle_config.pk_min_level ||
+ sd2->status.base_level < battle_config.pk_min_level ||
+ (battle_config.pk_level_range && (
+ sd->status.base_level > sd2->status.base_level ?
+ sd->status.base_level - sd2->status.base_level :
+ sd2->status.base_level - sd->status.base_level )
+ > battle_config.pk_level_range)
+ )
state&=~BCT_ENEMY;
}
} else { //Non pvp/gvg, check party/guild settings.
@@ -3753,6 +3760,7 @@ static const struct battle_data_short {
{ "equip_self_break_rate", &battle_config.equip_self_break_rate },
{ "equip_skill_break_rate", &battle_config.equip_skill_break_rate },
{ "pk_mode", &battle_config.pk_mode }, // [Valaris]
+ { "pk_level_range", &battle_config.pk_level_range },
{ "manner_system", &battle_config.manner_system }, // [Komurka]
{ "pet_equip_required", &battle_config.pet_equip_required }, // [Valaris]
{ "multi_level_up", &battle_config.multi_level_up }, // [Valaris]
@@ -3827,6 +3835,7 @@ static const struct battle_data_short {
{ "skip_teleport_lv1_menu", &battle_config.skip_teleport_lv1_menu}, // [LuzZza]
{ "allow_skill_without_day", &battle_config.allow_skill_without_day}, // [Komurka]
+ { "allow_es_magic_player", &battle_config.allow_es_magic_pc },
{ "skill_caster_check", &battle_config.skill_caster_check },
{ "status_cast_cancel", &battle_config.sc_castcancel },
{ "pc_status_def_rate", &battle_config.pc_sc_def_rate },
@@ -4145,6 +4154,7 @@ void battle_set_defaults() {
battle_config.equip_self_break_rate = 100; // [Valaris], adapted by [Skotlex]
battle_config.equip_skill_break_rate = 100; // [Valaris], adapted by [Skotlex]
battle_config.pk_mode = 0; // [Valaris]
+ battle_config.pk_level_range = 0; // [Skotlex]
battle_config.manner_system = 1; // [Valaris]
battle_config.pet_equip_required = 0; // [Valaris]
battle_config.multi_level_up = 0; // [Valaris]
@@ -4219,6 +4229,7 @@ void battle_set_defaults() {
battle_config.skip_teleport_lv1_menu = 0;
battle_config.allow_skill_without_day = 0;
+ battle_config.allow_es_magic_pc = 0;
battle_config.skill_caster_check = 1;
battle_config.sc_castcancel = 0;
diff --git a/src/map/battle.h b/src/map/battle.h
index ba631bdca..92828223e 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -303,6 +303,8 @@ extern struct Battle_Config {
unsigned short multi_level_up;
unsigned short max_exp_gain_rate; //Max amount of exp bar % you can get in one go.
unsigned short pk_mode;
+ unsigned short pk_level_range;
+
unsigned short manner_system;
unsigned short show_mob_hp; // end additions [Valaris]
@@ -415,6 +417,7 @@ extern struct Battle_Config {
unsigned short skip_teleport_lv1_menu; // possibility to disable (skip) Teleport Lv1 menu, that have only two lines `Random` and `Cancel` [LuzZza]
unsigned short allow_skill_without_day; // [Komurka]
+ unsigned short allow_es_magic_pc; // [Skotlex]
unsigned short skill_wall_check; // [Skotlex]
unsigned short cell_stack_limit; // [Skotlex]
unsigned short skill_caster_check; // [Skotlex]
diff --git a/src/map/skill.c b/src/map/skill.c
index fd7f676a2..56260bb47 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2974,7 +2974,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s
case SL_STIN:
case SL_STUN:
case SL_SMA:
- if (sd && bl->type != BL_MOB) {
+ if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8);
clif_skill_fail(sd,skillid,0,0);
break;
@@ -5436,7 +5436,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
case SL_SKA: // [marquis007]
- if (sd && bl->type != BL_MOB) {
+ if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8);
clif_skill_fail(sd,skillid,0,0);
break;
@@ -5451,7 +5451,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
break;
case SL_SWOO:
- if (sd && bl->type != BL_MOB) {
+ if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8);
clif_skill_fail(sd,skillid,0,0);
break;
@@ -5462,7 +5462,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
case SL_SKE:
- if (sd && bl->type != BL_MOB) {
+ if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
status_change_start(src,SC_STUN,100,skilllv,0,0,0,3000,8);
clif_skill_fail(sd,skillid,0,0);
break;