summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-14 00:05:13 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-14 00:05:13 +0000
commit5a1b01d69d45b054aef505abdb693c8fc3fdd213 (patch)
treea5c56c6e512a01c64d731c21f41d6ee6f76d6e2e /src/map/battle.c
parentb833ae56df9190c62169bd321a1ae0ee93f1ce7b (diff)
downloadhercules-5a1b01d69d45b054aef505abdb693c8fc3fdd213.tar.gz
hercules-5a1b01d69d45b054aef505abdb693c8fc3fdd213.tar.bz2
hercules-5a1b01d69d45b054aef505abdb693c8fc3fdd213.tar.xz
hercules-5a1b01d69d45b054aef505abdb693c8fc3fdd213.zip
- Modified map_foreachinrange so that you can also specify the max length of the path to use. The max_count field in the skill_db is used to specify this range for path-type skills (Sharpshooting, Kamaitachi and the NPC Breath skills.
- Implemented the 'new' NPC skills described here: http://ro.doddlercon.com/wiki/index.php?title=Monster_Skills . It is mostly complete, but the new status changes (slow cast, critical wounds, etc) don't have any visual effects yet (icon or opt changes? I don't know if they should have). Also I could not find the unit_id for Evil Land, so it looks just like Sanctuary for now. Apart from those, the only skills which I couldn't get to display properly are the Breath skills (with the exception of Fire Breath). - skill_calc_heal now takes the target as argument to properly support Critical Wounds - battle_calc_return_damage now takes a flag to know if the attack was direct or not, needed since Magic Mirror also reflects indirect attacks. - cleaned up the 'description' field in skill.c, added skill_get_desc to it - Removed 'splash' support from Lex Divina as it is no longer needed. - Modified the way Sight/Sightblaster work so that the skill id is no longer guessed (needed to properly acquire the splash range for Wide Sight) - Corrected gtb_sc_immunity setting not taking effect if your block value was the same (that is, if the config said 30%, then you would only get status change immunity at 31%, nor 30%) - Uncommented the 'new' npc skills from mob_skill_db as they are implemented now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11000 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 912aabd00..82cd85615 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1131,6 +1131,7 @@ static struct Damage battle_calc_weapon_attack(
case NPC_DARKNESSATTACK:
case NPC_UNDEADATTACK:
case NPC_TELEKINESISATTACK:
+ case NPC_BLEEDING:
hitrate += hitrate * 20 / 100;
break;
case KN_PIERCE:
@@ -1382,6 +1383,12 @@ static struct Damage battle_calc_weapon_attack(
case NPC_UNDEADATTACK:
case NPC_TELEKINESISATTACK:
case NPC_BLOODDRAIN:
+ case NPC_ACIDBREATH:
+ case NPC_DARKNESSBREATH:
+ case NPC_FIREBREATH:
+ case NPC_ICEBREATH:
+ case NPC_THUNDERBREATH:
+ case NPC_HELLJUDGEMENT:
skillratio += 100*(skill_lv-1);
break;
case RG_BACKSTAP:
@@ -2184,7 +2191,7 @@ struct Damage battle_calc_magic_attack(
{ //Calc base damage according to skill
case AL_HEAL:
case PR_BENEDICTIO:
- ad.damage = skill_calc_heal(src,skill_lv)/2;
+ ad.damage = skill_calc_heal(src, target, skill_lv)/2;
break;
case PR_ASPERSIO:
ad.damage = 40;
@@ -2192,6 +2199,9 @@ struct Damage battle_calc_magic_attack(
case PR_SANCTUARY:
ad.damage = (skill_lv>6)?388:skill_lv*50;
break;
+ case NPC_EVILLAND:
+ ad.damage = (skill_lv>6)?666:skill_lv*100;
+ break;
case ALL_RESURRECTION:
case PR_TURNUNDEAD:
//Undead check is on skill_castend_damageid code.
@@ -2211,6 +2221,12 @@ struct Damage battle_calc_magic_attack(
break;
default:
{
+ if (skill_num == NPC_EARTHQUAKE) {
+ if (sstatus->rhw.atk2 > sstatus->rhw.atk)
+ MATK_ADD(sstatus->rhw.atk + rand()%(1+sstatus->rhw.atk2-sstatus->rhw.atk))
+ else
+ MATK_ADD(sstatus->rhw.atk);
+ } else
if (sstatus->matk_max > sstatus->matk_min) {
MATK_ADD(sstatus->matk_min+rand()%(1+sstatus->matk_max-sstatus->matk_min));
} else {
@@ -2302,6 +2318,9 @@ struct Damage battle_calc_magic_attack(
case NPC_ENERGYDRAIN:
skillratio += 100*skill_lv;
break;
+ case NPC_EARTHQUAKE:
+ skillratio += 400 + 500*skill_lv;
+ break;
}
MATK_RATE(skillratio);
@@ -2661,7 +2680,8 @@ struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct bl
return d;
}
-int battle_calc_return_damage(struct block_list* bl, int* damage, int flag)
+//Calculates returned damage. direct is true if the skill was a direct attack (that is, not from another source, like a land spell
+int battle_calc_return_damage(struct block_list* bl, int* damage, int direct, int flag)
{
struct map_session_data* sd = NULL;
struct status_change* sc;
@@ -2669,8 +2689,10 @@ int battle_calc_return_damage(struct block_list* bl, int* damage, int flag)
BL_CAST(BL_PC, bl, sd);
sc = status_get_sc(bl);
+ if(sc && !sc->count)
+ sc = NULL;
- if(flag&BF_WEAPON) {
+ if(flag&BF_WEAPON && direct) {
//Bounces back part of the damage.
if (flag & BF_SHORT) {
if (sd && sd->short_weapon_damage_return)
@@ -2694,7 +2716,10 @@ int battle_calc_return_damage(struct block_list* bl, int* damage, int flag)
// magic_damage_return by [AppleGirl] and [Valaris]
if(flag&BF_MAGIC)
{
- if(sd && sd->magic_damage_return && rand()%100 < sd->magic_damage_return)
+ if(
+ (sd && sd->magic_damage_return && direct && rand()%100 < sd->magic_damage_return)
+ || (sc && sc->data[SC_MAGICMIRROR].timer != -1 && rand()%100 < sc->data[SC_MAGICMIRROR].val2)
+ )
{ //Bounces back full damage, you take none.
rdamage = *damage;
*damage = 0;
@@ -2886,7 +2911,7 @@ int battle_weapon_attack(struct block_list* src, struct block_list* target, unsi
damage = wd.damage + wd.damage2;
if (damage > 0 && src != target) {
- rdamage = battle_calc_return_damage(target, &damage, wd.flag);
+ rdamage = battle_calc_return_damage(target, &damage, 1, wd.flag);
if (rdamage > 0) {
rdelay = clif_damage(src, src, tick, wd.amotion, sstatus->dmotion, rdamage, 1, 4, 0);
//Use Reflect Shield to signal this kind of skill trigger. [Skotlex]