summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorL0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-06-01 23:01:54 +0000
committerL0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-06-01 23:01:54 +0000
commitf1c4780376953eae3c5e38b7615c06e07b178431 (patch)
treef174d175dbf283294387ae724a01ccb8e3756427 /src/map/battle.c
parentebab0958bab3daf5834d5805ef3425a11fffc3bb (diff)
downloadhercules-f1c4780376953eae3c5e38b7615c06e07b178431.tar.gz
hercules-f1c4780376953eae3c5e38b7615c06e07b178431.tar.bz2
hercules-f1c4780376953eae3c5e38b7615c06e07b178431.tar.xz
hercules-f1c4780376953eae3c5e38b7615c06e07b178431.zip
* Implemented the Manuk and Splendide item status effects, thanks to Epoque.
* Implemented Manuk and Splendide consumable items. * Added Splendide and Manuk merchants. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14327 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index a95e29079..b31847606 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -430,6 +430,23 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
damage >>= 2; //75% reduction
}
+ // Compressed code, fixed by map.h [Epoque]
+ if (src->type == BL_MOB) {
+ int i;
+ if (sc->data[SC_MANU_DEF])
+ for (i=0;ARRAYLENGTH(mob_manuk)>i;i++)
+ if (mob_manuk[i]==((TBL_MOB*)src)->class_) {
+ damage -= sc->data[SC_MANU_DEF]->val1*damage/100;
+ break;
+ }
+ if (sc->data[SC_SPL_DEF])
+ for (i=0;ARRAYLENGTH(mob_splendide)>i;i++)
+ if (mob_splendide[i]==((TBL_MOB*)src)->class_) {
+ damage -= sc->data[SC_SPL_DEF]->val1*damage/100;
+ break;
+ }
+ }
+
if((sce=sc->data[SC_ARMOR]) && //NPC_DEFENDER
sce->val3&flag && sce->val4&flag)
damage -= damage*sc->data[SC_ARMOR]->val2/100;
@@ -493,6 +510,28 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
{
if( sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] )
damage += damage * 75 / 100;
+ // [Epoque]
+ if (bl->type == BL_MOB)
+ {
+ int i;
+
+ if ( ((sce=sc->data[SC_MANU_ATK]) && (flag&BF_WEAPON)) ||
+ ((sce=sc->data[SC_MANU_MATK]) && (flag&BF_MAGIC))
+ )
+ for (i=0;ARRAYLENGTH(mob_manuk)>i;i++)
+ if (((TBL_MOB*)bl)->class_==mob_manuk[i]) {
+ damage += damage*sce->val1/100;
+ break;
+ }
+ if ( ((sce=sc->data[SC_SPL_ATK]) && (flag&BF_WEAPON)) ||
+ ((sce=sc->data[SC_SPL_MATK]) && (flag&BF_MAGIC))
+ )
+ for (i=0;ARRAYLENGTH(mob_splendide)>i;i++)
+ if (((TBL_MOB*)bl)->class_==mob_splendide[i]) {
+ damage += damage*sce->val1/100;
+ break;
+ }
+ }
}
if (battle_config.pk_mode && sd && bl->type == BL_PC && damage)