summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-20 21:25:47 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-20 21:25:47 +0000
commit38d6992791ab2ee1713093be2cfb3077a689d28e (patch)
tree52d2efe662580f475fe29dc51fe1c1e2e3866b62 /src/map/battle.c
parent99f319c197d5e783eef978859535287b45c9f989 (diff)
downloadhercules-38d6992791ab2ee1713093be2cfb3077a689d28e.tar.gz
hercules-38d6992791ab2ee1713093be2cfb3077a689d28e.tar.bz2
hercules-38d6992791ab2ee1713093be2cfb3077a689d28e.tar.xz
hercules-38d6992791ab2ee1713093be2cfb3077a689d28e.zip
- The max level of NPC_SPLASHATTACK is now 1.
- Implemented NPC_DEFENDER. Reduces ranged Physical+Misc damage by 80% - Improved the battle config reader so it accepts hexadecimal values. Updated the monster_ai description to make use of this. - Added monster_ai&0x200. When set, mob skill delays are shared. That is, if the mob has several lines with the same skill, when the skill is used, the delay will be set to all of them, not just the one entry used. - Cleaned mob.c to use hex values when refering mob_ai - Corrected NPC_BARRIER so it grants 100 def/mdef (and not just mdef) - Weapon ATK bonuses will now only apply to watk and NOT watk2 on players (on players watk2 is refine bonus) - Corrected NPC_KEEPING. it should give 90 def, not 100 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9277 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 819e4be65..93829cb6e 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -390,6 +390,12 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
damage >>= 2; //75% reduction
}
+ if(sc->data[SC_ARMOR].timer != -1 &&
+ sc->data[SC_ARMOR].val3&flag &&
+ sc->data[SC_ARMOR].val4&flag)
+ //NPC_DEFENDER
+ damage -= damage*sc->data[SC_ARMOR].val2/100;
+
if(sc->data[SC_ENERGYCOAT].timer!=-1 && flag&BF_WEAPON){
struct status_data *status = status_get_status_data(bl);
int per = 100*status->sp / status->max_sp -1; //100% should be counted as the 80~99% interval
@@ -3463,7 +3469,7 @@ int battle_config_switch(const char *str) {
strncmpi(str, "non",3) == 0 ||
strncmpi(str, "nein",4) == 0)
return 0;
- return atoi(str);
+ return (int)strtol(str,NULL,0);
}
static const struct battle_data_short {