summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-10-26 09:42:44 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-10-26 09:42:44 +0000
commit313a28630c10e40ee2db0b0a8904d56149c0b3ce (patch)
tree863811253ac173d48b7023af1c2dbab00cddd83a /src
parent019d9618d50d3190a7b6fa3b8e9401add22beb8e (diff)
downloadhercules-313a28630c10e40ee2db0b0a8904d56149c0b3ce.tar.gz
hercules-313a28630c10e40ee2db0b0a8904d56149c0b3ce.tar.bz2
hercules-313a28630c10e40ee2db0b0a8904d56149c0b3ce.tar.xz
hercules-313a28630c10e40ee2db0b0a8904d56149c0b3ce.zip
Implemented NPC_VAMPIREGIFT and NPC_WIDESOULDRAIN.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14102 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c3
-rw-r--r--src/map/skill.c21
-rw-r--r--src/map/status.c2
3 files changed, 21 insertions, 5 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index a1105420a..e1ee7afa9 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1674,6 +1674,9 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
case HFLI_SBR44: //[orn]
skillratio += 100 *(skill_lv-1);
break;
+ case NPC_VAMPIRE_GIFT:
+ skillratio += ((skill_lv-1)%5+1)*100;
+ break;
}
ATK_RATE(skillratio);
diff --git a/src/map/skill.c b/src/map/skill.c
index ba897b7c2..a36168191 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2786,18 +2786,24 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
case NPC_EARTHQUAKE:
case NPC_PULSESTRIKE:
case NPC_HELLJUDGEMENT:
+ case NPC_VAMPIRE_GIFT:
if( flag&1 )
{ //Recursive invocation
// skill_area_temp[0] holds number of targets in area
// skill_area_temp[1] holds the id of the original target
// skill_area_temp[2] counts how many targets have already been processed
- int sflag = skill_area_temp[0] & 0xFFF;
+ int sflag = skill_area_temp[0] & 0xFFF, heal;
if( flag&SD_LEVEL )
sflag |= SD_LEVEL; // -1 will be used in packets instead of the skill level
if( skill_area_temp[1] != bl->id && !(skill_get_inf2(skillid)&INF2_NPC_SKILL) )
sflag |= SD_ANIMATION; // original target gets no animation (as well as all NPC skills)
- skill_attack(skill_get_type(skillid), src, src, bl, skillid, skilllv, tick, sflag);
+ heal = skill_attack(skill_get_type(skillid), src, src, bl, skillid, skilllv, tick, sflag);
+ if( skillid == NPC_VAMPIRE_GIFT && heal > 0 )
+ {
+ clif_skill_nodamage(NULL, src, AL_HEAL, heal, 1);
+ status_heal(src,heal,0,0);
+ }
}
else
{
@@ -3155,7 +3161,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if(status_isdead(src))
return 1;
- if(src!=bl && status_isdead(bl) && skillid != ALL_RESURRECTION && skillid != PR_REDEMPTIO)
+ if( src != bl && status_isdead(bl) && skillid != ALL_RESURRECTION && skillid != PR_REDEMPTIO && skillid != NPC_WIDESOULDRAIN )
return 1;
tstatus = status_get_status_data(bl);
@@ -3961,6 +3967,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case GS_SPREADATTACK:
case NPC_EARTHQUAKE:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ case NPC_VAMPIRE_GIFT:
case NPC_HELLJUDGEMENT:
case NPC_PULSESTRIKE:
skill_castend_damage_id(src, src, skillid, skilllv, tick, flag);
@@ -5663,8 +5670,14 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case NPC_WIDESTUN:
case NPC_SLOWCAST:
case NPC_WIDEHELLDIGNITY:
+ case NPC_WIDESOULDRAIN:
if (flag&1)
- sc_start(bl,type,100,skilllv,skill_get_time2(skillid,skilllv));
+ {
+ if( skillid == NPC_WIDESOULDRAIN )
+ status_percent_damage(src,bl,0,((skilllv-1)%5+1)*20,false);
+ else
+ sc_start(bl,type,100,skilllv,skill_get_time2(skillid,skilllv));
+ }
else {
skill_area_temp[2] = 0; //For SD_PREAMBLE
clif_skill_nodamage(src,bl,skillid,skilllv,1);
diff --git a/src/map/status.c b/src/map/status.c
index 84c396a9a..36bacf47d 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -654,7 +654,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
status = status_get_status_data(target);
- if (status == &dummy_status || !status->hp)
+ if( status == &dummy_status || (!status->hp && hp) )
return 0; //Invalid targets: no damage or dead
// Let through. battle.c/skill.c have the whole logic of when it's possible or