summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt5
-rw-r--r--conf-tmpl/battle/monster.conf8
-rw-r--r--src/map/battle.c4
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/mob.c16
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/status.c25
-rw-r--r--src/map/status.h4
8 files changed, 52 insertions, 14 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index f1676a269..244bff19f 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,11 @@ 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.
2006/05/05
+ * Being in Enjoyable Rest state will now also trigger the HP/SP Time skills
+ (even if there's no other TK around). [Skotlex]
+ * Added battle config settings view_range_rate and chase_range_rate to
+ adjust the view-range and chase-range (range2/range3) of the mob_db without
+ having to manually change them (battle/monster.conf) [Skotlex]
* Kaupe now will only block all skills of players, for non-players, only
normal attacks can be missed. [Skotlex]
* Moved the Kaite spell-reflect code after the damage calculation function,
diff --git a/conf-tmpl/battle/monster.conf b/conf-tmpl/battle/monster.conf
index dc9322f26..bb336074b 100644
--- a/conf-tmpl/battle/monster.conf
+++ b/conf-tmpl/battle/monster.conf
@@ -64,6 +64,14 @@ monster_max_aspd: 199
// players on them, instead of only for mobs who are in the vecinity of players.
monster_ai: 0
+// Mobs and Pets view-range adjustment (range2 column in the mob_db) (Note 2)
+view_range_rate: 100
+
+// Chase Range is the base minimum-chase that a mob gives before giving up
+// (as long as the target is outside their field of view). This is the range3
+// column in the mob_db. (Note 2)
+chase_range_rate: 100
+
// Allow monsters to be aggresive and attack first? (Note 1)
monster_active_enable: yes
diff --git a/src/map/battle.c b/src/map/battle.c
index b8426214a..db2b8be3f 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3592,6 +3592,8 @@ static const struct battle_data_short {
{ "mvp_hp_rate", &battle_config.mvp_hp_rate },
{ "monster_hp_rate", &battle_config.monster_hp_rate },
{ "monster_max_aspd", &battle_config.monster_max_aspd },
+ { "view_range_rate", &battle_config.view_range_rate },
+ { "chase_range_rate", &battle_config.chase_range_rate },
{ "atcommand_gm_only", &battle_config.atc_gmonly },
{ "atcommand_spawn_quantity_limit", &battle_config.atc_spawn_quantity_limit },
{ "atcommand_slave_clone_limit", &battle_config.atc_slave_clone_limit},
@@ -3984,6 +3986,8 @@ void battle_set_defaults() {
battle_config.mvp_hp_rate=100;
battle_config.monster_hp_rate=100;
battle_config.monster_max_aspd=199;
+ battle_config.view_range_rate=100;
+ battle_config.chase_range_rate=100;
battle_config.atc_gmonly=0;
battle_config.atc_spawn_quantity_limit=0;
battle_config.atc_slave_clone_limit=0;
diff --git a/src/map/battle.h b/src/map/battle.h
index 03d285f1a..145a14fc8 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -135,6 +135,8 @@ extern struct Battle_Config {
unsigned short mvp_hp_rate;
unsigned short monster_hp_rate;
unsigned short monster_max_aspd;
+ unsigned short view_range_rate;
+ unsigned short chase_range_rate;
unsigned short atc_gmonly;
unsigned short atc_spawn_quantity_limit;
unsigned short atc_slave_clone_limit;
diff --git a/src/map/mob.c b/src/map/mob.c
index 20afedab4..5e6c5765a 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3152,6 +3152,22 @@ static int mob_readdb(void)
mob_db_data[class_]->luk=atoi(str[19]);
mob_db_data[class_]->range2=atoi(str[20]);
mob_db_data[class_]->range3=atoi(str[21]);
+ if (battle_config.view_range_rate!=100)
+ {
+ mob_db_data[class_]->range2=
+ mob_db_data[class_]->range2
+ *battle_config.view_range_rate/100;
+ if (mob_db_data[class_]->range2<1)
+ mob_db_data[class_]->range2=1;
+ }
+ if (battle_config.chase_range_rate!=100)
+ {
+ mob_db_data[class_]->range3=
+ mob_db_data[class_]->range3
+ *battle_config.chase_range_rate/100;
+ if (mob_db_data[class_]->range3<mob_db_data[class_]->range2)
+ mob_db_data[class_]->range3=mob_db_data[class_]->range2;
+ }
mob_db_data[class_]->size=atoi(str[22]);
mob_db_data[class_]->race=atoi(str[23]);
mob_db_data[class_]->element=atoi(str[24]);
diff --git a/src/map/skill.c b/src/map/skill.c
index 7cb552ab9..a91e7cbfc 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -7625,7 +7625,7 @@ int skill_check_condition(struct map_session_data *sd,int skill, int lv, int typ
//Consume
sd->itemid = sd->itemindex = -1;
if(skill == WZ_EARTHSPIKE
- && sd->sc.data[SC_TKDORI].timer != -1 && rand()%100 > sd->sc.data[SC_TKDORI].val2) // [marquis007]
+ && sd->sc.data[SC_TKREST].timer != -1 && rand()%100 > sd->sc.data[SC_TKREST].val2) // [marquis007]
; //Do not consume item.
else
pc_delitem(sd,i,1,0);
diff --git a/src/map/status.c b/src/map/status.c
index ce195049d..f0b4797eb 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -247,7 +247,7 @@ void initChangeTables(void) {
set_sc(TK_READYTURN, SC_READYTURN, SI_READYTURN);
set_sc(TK_READYCOUNTER, SC_READYCOUNTER, SI_READYCOUNTER);
set_sc(TK_DODGE, SC_DODGE, SI_DODGE);
- set_sc(TK_SPTIME, SC_TKDORI, SI_BLANK);
+ set_sc(TK_SPTIME, SC_TKREST, SI_TKREST);
set_sc(TK_SEVENWIND, SC_GHOSTWEAPON, SI_GHOSTWEAPON);
set_sc(TK_SEVENWIND, SC_SHADOWWEAPON, SI_SHADOWWEAPON);
set_sc(SG_SUN_WARM, SC_WARM, SI_WARM);
@@ -1457,7 +1457,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
sd->nhealhp = sd->nhealhp*sd->hprecov_rate/100;
if(sd->nhealhp < 1) sd->nhealhp = 1;
- if(sd->nhealhp > 0x7fff) sd->nhealhp = 0x7fff;
+ if(sd->nhealhp > SHRT_MAX) sd->nhealhp = SHRT_MAX;
// Skill-related HP recovery
if((skill=pc_checkskill(sd,SM_RECOVERY)) > 0)
@@ -1465,11 +1465,12 @@ int status_calc_pc(struct map_session_data* sd,int first)
// Skill-related HP recovery (only when sit)
if((skill=pc_checkskill(sd,MO_SPIRITSRECOVERY)) > 0)
sd->nsshealhp = skill*4 + (sd->status.max_hp*skill/500);
- if((skill=pc_checkskill(sd,TK_HPTIME)) > 0 && sd->state.rest == 1)
+ if((skill=pc_checkskill(sd,TK_HPTIME)) > 0 &&
+ (sd->state.rest || sd->sc.data[SC_TKREST].timer!=-1))
sd->nsshealhp = skill*30 + (sd->status.max_hp*skill/500);
- if(sd->nshealhp > 0x7fff) sd->nshealhp = 0x7fff;
- if(sd->nsshealhp > 0x7fff) sd->nsshealhp = 0x7fff;
+ if(sd->nshealhp > SHRT_MAX) sd->nshealhp = SHRT_MAX;
+ if(sd->nsshealhp > SHRT_MAX) sd->nsshealhp = SHRT_MAX;
// ----- SP MAX AND REGEN CALCULATION -----
@@ -1524,7 +1525,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
sd->nhealsp = sd->nhealsp*sd->sprecov_rate/100;
if(sd->nhealsp < 1) sd->nhealsp = 1;
- if(sd->nhealsp > 0x7fff) sd->nhealsp = 0x7fff;
+ if(sd->nhealsp > SHRT_MAX) sd->nhealsp = SHRT_MAX;
// Skill-related SP recovery
if((skill=pc_checkskill(sd,MG_SRECOVERY)) > 0)
@@ -1534,13 +1535,15 @@ int status_calc_pc(struct map_session_data* sd,int first)
// Skill-related SP recovery (only when sit)
if((skill = pc_checkskill(sd,MO_SPIRITSRECOVERY)) > 0)
sd->nsshealsp = skill*2 + (sd->status.max_sp*skill/500);
- if((skill=pc_checkskill(sd,TK_SPTIME)) > 0 && sd->state.rest == 1) {
+ if((skill=pc_checkskill(sd,TK_SPTIME)) > 0 &&
+ (sd->state.rest || sd->sc.data[SC_TKREST].timer!=-1))
+ {
sd->nsshealsp = skill*3 + (sd->status.max_sp*skill/500);
if ((skill=pc_checkskill(sd,SL_KAINA)) > 0) //Power up Enjoyable Rest
sd->nsshealsp += (30+10*skill)*sd->nsshealsp/100;
}
- if(sd->nshealsp > 0x7fff) sd->nshealsp = 0x7fff;
- if(sd->nsshealsp > 0x7fff) sd->nsshealsp = 0x7fff;
+ if(sd->nshealsp > SHRT_MAX) sd->nshealsp = SHRT_MAX;
+ if(sd->nsshealsp > SHRT_MAX) sd->nsshealsp = SHRT_MAX;
}
// ----- MISC CALCULATIONS -----
@@ -4467,7 +4470,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
}
}
break;
- case SC_TKDORI:
+ case SC_TKREST:
val2 = 11-val1; //Chance to consume: 11-skilllv%
break;
case SC_RUN:
@@ -4849,7 +4852,7 @@ int status_change_clear(struct block_list *bl,int type)
// Do not reset Xmas status when killed. [Valaris]
if(sc->data[i].timer == -1 ||
(type == 0 &&
- (i == SC_EDP || i == SC_MELTDOWN || i == SC_XMAS || i == SC_NOCHAT || i == SC_FUSION)))
+ (i == SC_EDP || i == SC_MELTDOWN || i == SC_XMAS || i == SC_NOCHAT || i == SC_FUSION || i == SC_TKREST)))
continue;
status_change_end(bl, i, -1);
diff --git a/src/map/status.h b/src/map/status.h
index e625bbc07..9d14cddf6 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -228,7 +228,7 @@ enum {
SC_KAITE,
SC_SWOO, // [marquis007]
SC_SKA, // [marquis007]
- SC_TKDORI, // [marquis007]
+ SC_TKREST, // [marquis007]
SC_MIRACLE, //SG 'hidden' skill [Komurka]
//Ninja/GS states
SC_MADNESSCANCEL,
@@ -375,7 +375,7 @@ enum {
SI_CLOSECONFINE2 = 201,
SI_MADNESSCANCEL = 203, //[blackhole89]
SI_GATLINGFEVER = 204,
- // 205 = Gloria again
+ SI_TKREST = 205, // 205 = Gloria again (but TK- Happy State looks like it)
SI_MAEMI = 206,
// 207 = crash
SI_NEN = 208,