summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKisuka <Kisuka@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-11-29 07:18:35 +0000
committerKisuka <Kisuka@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-11-29 07:18:35 +0000
commitadfe051544021eac9278b1bc153e045e903df12b (patch)
tree37086e9b9104207aa3989f37f0aea5cfad36e327 /src
parent1dbfe55e921d79c745925b549c5903ce1595b02a (diff)
downloadhercules-adfe051544021eac9278b1bc153e045e903df12b.tar.gz
hercules-adfe051544021eac9278b1bc153e045e903df12b.tar.bz2
hercules-adfe051544021eac9278b1bc153e045e903df12b.tar.xz
hercules-adfe051544021eac9278b1bc153e045e903df12b.zip
- Official castle defense damage reduction/defense status changes. (bugreport:2901)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14175 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/status.c33
2 files changed, 27 insertions, 8 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index dd70de892..d5c79eef2 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -615,9 +615,11 @@ int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int dama
case NJ_ZENYNAGE:
break;
default:
+ /* Uncomment if you want god-mode Emperiums at 100 defense. [Kisuka]
if (md && md->guardian_data) {
damage -= damage * (md->guardian_data->castle->defense/100) * battle_config.castle_defense_rate/100;
}
+ */
if (flag & BF_SKILL) { //Skills get a different reduction than non-skills. [Skotlex]
if (flag&BF_WEAPON)
damage = damage * battle_config.gvg_weapon_damage_rate/100;
diff --git a/src/map/status.c b/src/map/status.c
index 479e77fd0..0870340eb 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1385,6 +1385,8 @@ int status_calc_mob_(struct mob_data* md, bool first)
if (md->guardian_data && md->guardian_data->guardup_lv)
flag|=4;
+ if (md->class_ == MOBID_EMPERIUM)
+ flag|=4;
if (battle_config.slaves_inherit_speed && md->master_id)
flag|=8;
@@ -1497,15 +1499,30 @@ int status_calc_mob_(struct mob_data* md, bool first)
if (!gc)
ShowError("status_calc_mob: No castle set at map %s\n", map[md->bl.m].name);
else {
- status->max_hp += 2000 * gc->defense;
- status->max_sp += 200 * gc->defense;
- status->hp = status->max_hp;
- status->sp = status->max_sp;
+ if(gc->castle_id > 23) {
+ if(md->class_ == MOBID_EMPERIUM) {
+ status->max_hp += 1000 * gc->defense;
+ status->max_sp += 200 * gc->defense;
+ status->hp = status->max_hp;
+ status->sp = status->max_sp;
+ status->def += (gc->defense+2)/3;
+ status->mdef += (gc->defense+2)/3;
+ }
+ }else{
+ status->max_hp += 1000 * gc->defense;
+ status->max_sp += 200 * gc->defense;
+ status->hp = status->max_hp;
+ status->sp = status->max_sp;
+ status->def += (gc->defense+2)/3;
+ status->mdef += (gc->defense+2)/3;
+ }
+ }
+ if(md->class_ != MOBID_EMPERIUM) {
+ status->batk += status->batk * 10*md->guardian_data->guardup_lv/100;
+ status->rhw.atk += status->rhw.atk * 10*md->guardian_data->guardup_lv/100;
+ status->rhw.atk2 += status->rhw.atk2 * 10*md->guardian_data->guardup_lv/100;
+ status->aspd_rate -= 100*md->guardian_data->guardup_lv;
}
- status->batk += status->batk * 10*md->guardian_data->guardup_lv/100;
- status->rhw.atk += status->rhw.atk * 10*md->guardian_data->guardup_lv/100;
- status->rhw.atk2 += status->rhw.atk2 * 10*md->guardian_data->guardup_lv/100;
- status->aspd_rate -= 100*md->guardian_data->guardup_lv;
}
if( first ) //Initial battle status