diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-10-13 15:27:41 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-10-13 15:27:41 +0000 |
commit | 68697bf554e917e8b2e43884ff75ba572dd36d89 (patch) | |
tree | 3b28af7cd31f56b45b4b9e0cc307b5d7167563fc /src/map/skill.c | |
parent | 9e76ad31bc0435d209e87c61a483da6349df86f8 (diff) | |
download | hercules-68697bf554e917e8b2e43884ff75ba572dd36d89.tar.gz hercules-68697bf554e917e8b2e43884ff75ba572dd36d89.tar.bz2 hercules-68697bf554e917e8b2e43884ff75ba572dd36d89.tar.xz hercules-68697bf554e917e8b2e43884ff75ba572dd36d89.zip |
- Corrected Throw Arrow/Musical Strike's damage formula
- Altered Trick Dead. It doesn't prevents skills from being casted on you now, but damage-based skills will do no damage.
- Made the battle_config.attack_attr_none apply to pets when using the "fixed damage" pet skill scripts.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8978 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 8802a3678..03ef6ae79 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1822,30 +1822,36 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds sstatus = status_get_status_data(src); tstatus = status_get_status_data(bl); + sc= status_get_sc(bl); + if (sc && !sc->count) sc = NULL; //Don't need it. + // Is this check really needed? FrostNova won't hurt you if you step right where the caster is? if(skillid == WZ_FROSTNOVA && dsrc->x == bl->x && dsrc->y == bl->y) return 0; + //Trick Dead protects you from damage, but not from buffs and the like, hence it's placed here. + if (sc && sc->data[SC_TRICKDEAD].timer != -1 && !(sstatus->mode&MD_BOSS)) + return 0; dmg=battle_calc_attack(attack_type,src,bl,skillid,skilllv,flag&0xFFF); //Skotlex: Adjusted to the new system - if(src->type==BL_PET && (struct pet_data *)src) + if(src->type==BL_PET) { // [Valaris] - struct pet_data *pd = (struct pet_data *)src; + struct pet_data *pd = (TBL_PET*)src; if (pd->a_skill && pd->a_skill->div_ && pd->a_skill->id == skillid) { int element = skill_get_pl(skillid); if (skillid == -1) element = sstatus->rhw.ele; - dmg.damage=battle_attr_fix(src, bl, skilllv, element, tstatus->def_ele, tstatus->ele_lv); + if (element != ELE_NEUTRAL || !(battle_config.attack_attr_none&BL_PET)) + dmg.damage=battle_attr_fix(src, bl, skilllv, element, tstatus->def_ele, tstatus->ele_lv); + else + dmg.damage= skilllv; dmg.damage2=0; dmg.div_= pd->a_skill->div_; } } - sc= status_get_sc(bl); - if (sc && !sc->count) sc = NULL; //Don't need it. - if (attack_type&BF_MAGIC) { if(sc && sc->data[SC_KAITE].timer != -1 && (dmg.damage || dmg.damage2) && !(sstatus->mode&MD_BOSS) && (sd || status_get_lv(src) <= 80) ) |