diff options
-rw-r--r-- | Changelog-Trunk.txt | 4 | ||||
-rw-r--r-- | conf-tmpl/battle/misc.conf | 4 | ||||
-rw-r--r-- | conf-tmpl/battle/skill.conf | 3 | ||||
-rw-r--r-- | src/map/battle.c | 27 | ||||
-rw-r--r-- | src/map/battle.h | 3 | ||||
-rw-r--r-- | src/map/skill.c | 8 |
6 files changed, 37 insertions, 12 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 0ca720c74..82331be13 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/02/15
+ * Added battle config option pk_level_range for specifying valid level
+ ranges to engage in PK (battle/misc.conf) [Skotlex]
+ * Added battle config allow_es_magic_player to enable SL_S* skills to work
+ on non-mobs. (battle/skill.conf) [Skotlex]
* Fixed the char servers to store correctly exp as uints. They are also
capped to LONG_MAX before being sent to the client. [Skotlex]
* TK_DODGE now dodges all ranged attacks, when used with SPURT, dodges
diff --git a/conf-tmpl/battle/misc.conf b/conf-tmpl/battle/misc.conf index 6f7479351..d767e829f 100644 --- a/conf-tmpl/battle/misc.conf +++ b/conf-tmpl/battle/misc.conf @@ -39,6 +39,10 @@ manner_system: yes // For PK Server Mode. Change this to define the minimum level players can start PK-ing pk_min_level: 55 +// For PK Server Mode. It specifies the maximum level difference between +// players to let them attack each other. 0 disables said limit. +pk_level_range: 0 + // Allow muting of players? muting_players: yes diff --git a/conf-tmpl/battle/skill.conf b/conf-tmpl/battle/skill.conf index ca67ff0f3..9c61ab6d2 100644 --- a/conf-tmpl/battle/skill.conf +++ b/conf-tmpl/battle/skill.conf @@ -215,3 +215,6 @@ skip_teleport_lv1_menu: no // Allow use of SG skills without proper day (Sun/Moon/Star) ? allow_skill_without_day: no + +// Allow use of ES-type magic on players? +allow_es_magic_player: no 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;
|