summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2014-12-26 20:13:14 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2014-12-26 20:13:14 +0800
commit6205a2c3de94df7e5177a25b735fd5f2c0e56e98 (patch)
tree4bc14da48779785775562bd2dea470c37793493e /src/map
parent6dd08befa6064a652d0d98e7cb85f0e353992dd5 (diff)
downloadhercules-6205a2c3de94df7e5177a25b735fd5f2c0e56e98.tar.gz
hercules-6205a2c3de94df7e5177a25b735fd5f2c0e56e98.tar.bz2
hercules-6205a2c3de94df7e5177a25b735fd5f2c0e56e98.tar.xz
hercules-6205a2c3de94df7e5177a25b735fd5f2c0e56e98.zip
Follow up@6dd08befa6064a652d0d98e7cb85f0e353992dd5
Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.c5
-rw-r--r--src/map/pc.h9
-rw-r--r--src/map/skill.c22
-rw-r--r--src/map/status.c6
4 files changed, 24 insertions, 18 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 1aef4e1c2..e39ddbff2 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7004,7 +7004,10 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
//Reset ticks.
sd->hp_loss.tick = sd->sp_loss.tick = sd->hp_regen.tick = sd->sp_regen.tick = 0;
- RESET_SPIRITS(sd);
+ if ( sd->spiritball )
+ pc->delspiritball(sd, sd->spiritball, 0);
+ for ( i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++ )
+ pc->del_charm(sd, sd->spiritcharm[i], i);
if (src) {
switch (src->type) {
diff --git a/src/map/pc.h b/src/map/pc.h
index 28e6e4007..641a8ee7c 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -31,15 +31,6 @@
#define MAX_PC_FEELHATE 3
#define PVP_CALCRANK_INTERVAL 1000 // PVP calculation interval
-#define RESET_SPIRITS(target) do { \
- if ( target ) { \
- if ( target->spiritball ) \
- pc->delspiritball(target, target->spiritball, 0); \
- for ( int c = SPIRITS_TYPE_CHARM_WATER; c < SPIRITS_TYPE_SPHERE; c++ ) \
- pc->del_charm(target, target->spiritcharm[c], c); \
- } \
-}while ( 0 )
-
//Equip indexes constants. (eg: sd->equip_index[EQI_AMMO] returns the index
//where the arrows are equipped)
enum equip_index {
diff --git a/src/map/skill.c b/src/map/skill.c
index 098dc5d69..e70625866 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6041,18 +6041,22 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case MO_ABSORBSPIRITS:
{
int sp = 0;
- if (dstsd && dstsd->spiritball
- && (sd == dstsd || map_flag_vs(src->m) || (sd->duel_group && sd->duel_group == dstsd->duel_group))
- && ((dstsd->class_&MAPID_BASEMASK)!=MAPID_GUNSLINGER || (dstsd->class_&MAPID_UPPERMASK)!=MAPID_REBELLION)
- ) {
+ if ( dstsd && dstsd->spiritball
+ && (sd == dstsd || map_flag_vs(src->m) || (sd->duel_group && sd->duel_group == dstsd->duel_group))
+ && ((dstsd->class_&MAPID_BASEMASK) != MAPID_GUNSLINGER || (dstsd->class_&MAPID_UPPERMASK) != MAPID_REBELLION)
+ ) {
// split the if for readability, and included gunslingers in the check so that their coins cannot be removed [Reddozen]
sp = dstsd->spiritball * 7;
- RESET_SPIRITS(dstsd);
- } else if (dstmd && !(tstatus->mode&MD_BOSS) && rnd() % 100 < 20) {
+ pc->delspiritball(dstsd, dstsd->spiritball, 0);
+ } else if ( dstmd && !(tstatus->mode&MD_BOSS) && rnd() % 100 < 20 ) {
// check if target is a monster and not a Boss, for the 20% chance to absorb 2 SP per monster's level [Reddozen]
sp = 2 * dstmd->level;
mob->target(dstmd,src,0);
}
+ if ( dstsd ) {
+ for ( int i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++ )
+ pc->del_charm(dstsd, dstsd->spiritcharm[i], i);
+ }
if (sp) status->heal(src, 0, sp, 3);
clif->skill_nodamage(src,bl,skill_id,skill_lv,sp?1:0);
}
@@ -8914,9 +8918,13 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if( dstsd && dstsd->spiritball && (sd == dstsd || map_flag_vs(src->m)) && (dstsd->class_&MAPID_BASEMASK)!=MAPID_GUNSLINGER )
{
sp = dstsd->spiritball; //1%sp per spiritball.
- RESET_SPIRITS(dstsd);
+ pc->delspiritball(dstsd, dstsd->spiritball, 0);
status_percent_heal(src, 0, sp);
}
+ if ( dstsd ) {
+ for ( int i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++ )
+ pc->del_charm(dstsd, dstsd->spiritcharm[i], i);
+ }
clif->skill_nodamage(src, bl, skill_id, skill_lv, sp ? 1:0);
} else {
clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
diff --git a/src/map/status.c b/src/map/status.c
index d761e9202..3c2aeb939 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -8635,7 +8635,11 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
break;
case SC__ENERVATION:
val2 = 20 + 10 * val1; // ATK Reduction
- if ( sd ) RESET_SPIRITS(sd);
+ if ( sd ) {
+ pc->delspiritball(sd, sd->spiritball, 0);
+ for ( int i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++ )
+ pc->del_charm(sd, sd->spiritcharm[i], i);
+ }
break;
case SC__GROOMY:
val2 = 20 + 10 * val1; //ASPD. Need to confirm if Movement Speed reduction is the same. [Jobbie]