summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorKomurka <Komurka@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-18 13:16:21 +0000
committerKomurka <Komurka@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-18 13:16:21 +0000
commit05f88e6753ee38eb54be04bece08ad7b1a8382fd (patch)
tree7c1dfa31ec01f218c68213bb9a5fd5b358e77e10 /src/map/battle.c
parentb59572d87acb01a6d813b83e6eb7bbe15759858a (diff)
downloadhercules-05f88e6753ee38eb54be04bece08ad7b1a8382fd.tar.gz
hercules-05f88e6753ee38eb54be04bece08ad7b1a8382fd.tar.bz2
hercules-05f88e6753ee38eb54be04bece08ad7b1a8382fd.tar.xz
hercules-05f88e6753ee38eb54be04bece08ad7b1a8382fd.zip
* Implemented SG_MIRACLE (Miracle of the Sun, Moon and Stars)
- duration is stored in battle_config.sg_miracle_skill_duration (currently it's set to 10 minutes) - ratio is stored in battle_config.sg_miracle_skill_ratio (currently it's set to 0.01% chance per character move) - this skill enables you usage of all Warmth skills, Comfort skills, and also all mobs will be target of the Stars regardless of the day and map - you'll see message "[Miracle of the Sun, Moon and Stars]" when skill kicks in git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5323 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index f7965a5b7..7439760b5 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1995,7 +1995,12 @@ static struct Damage battle_calc_weapon_attack(
{ //SG Anger bonus - ATK_ADDRATE [Komurka]
static int type[] = { SG_SUN_ANGER, SG_MOON_ANGER, SG_STAR_ANGER };
short t_class = status_get_class(target);
- for (i = 0; i < 3; i++)
+ if (sc->data && sc->data[SC_MIRACLE].timer!=-1 && (skill = pc_checkskill(sd,type[2])))
+ {
+ skillratio = (sd->status.base_level + status_get_str(src) + status_get_dex(src)+ status_get_luk(src))/(skill<4?12-3*skill:1);
+ ATK_ADDRATE(skillratio);
+ }
+ else for (i = 0; i < 3; i++)
{
if (t_class == sd->hate_mob[i] && (skill = pc_checkskill(sd,type[i])))
{
@@ -3826,6 +3831,7 @@ static const struct battle_data_short {
{ "mob_status_def_rate", &battle_config.mob_sc_def_rate },
{ "pc_max_status_def", &battle_config.pc_max_sc_def },
{ "mob_max_status_def", &battle_config.mob_max_sc_def },
+ { "sg_miracle_skill_ratio", &battle_config.sg_miracle_skill_ratio },
};
static const struct battle_data_int {
@@ -3861,6 +3867,8 @@ static const struct battle_data_int {
{ "day_duration", &battle_config.day_duration }, // added by [Yor]
{ "night_duration", &battle_config.night_duration }, // added by [Yor]
{ "mob_remove_delay", &battle_config.mob_remove_delay },
+ { "sg_miracle_skill_duration", &battle_config.sg_miracle_skill_duration },
+
};
int battle_set_value(char *w1, char *w2) {
@@ -4221,6 +4229,8 @@ void battle_set_defaults() {
battle_config.mob_sc_def_rate = 100;
battle_config.pc_max_sc_def = 10000;
battle_config.mob_max_sc_def = 5000;
+ battle_config.sg_miracle_skill_ratio=1;
+ battle_config.sg_miracle_skill_duration=600000;
}
void battle_validate_conf() {
@@ -4413,6 +4423,9 @@ void battle_validate_conf() {
battle_config.pc_max_sc_def = 10000;
if (battle_config.mob_max_sc_def > 10000)
battle_config.mob_max_sc_def = 10000;
+ if (battle_config.sg_miracle_skill_ratio > 10000)
+ battle_config.sg_miracle_skill_ratio = 10000;
+
#ifdef CELL_NOSTACK
if (battle_config.cell_stack_limit < 1)
battle_config.cell_stack_limit = 1;