diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-28 17:58:56 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-28 17:58:56 +0000 |
commit | bfb4c510052f56c0af3f7fbca417ce23d0fd2203 (patch) | |
tree | c1c0f5ec941a9dfb09b9d20293c822082b124475 /src/map/status.c | |
parent | ff2af609b86f5c35007fc30d0ef69214bd76bc12 (diff) | |
download | hercules-bfb4c510052f56c0af3f7fbca417ce23d0fd2203.tar.gz hercules-bfb4c510052f56c0af3f7fbca417ce23d0fd2203.tar.bz2 hercules-bfb4c510052f56c0af3f7fbca417ce23d0fd2203.tar.xz hercules-bfb4c510052f56c0af3f7fbca417ce23d0fd2203.zip |
- Added functions status_revive, pc_revive and mob_revive to handle revival (it doesn't handles player respawning, though)
- Corrected alive, raisemap, raiseall to use these functions.
- Updated resurrection/mob-kaizel to use status_revive
- Added SC_BLADESTOP to the skill enum at the beginning of status.c (fixes Bladestop causing an unknown status change message)
- Fixed MSS_DEAD state skills not triggering.
- Corrected some compilation warnings on the merc.* files.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6807 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/src/map/status.c b/src/map/status.c index 2c408b47b..24821895a 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -216,6 +216,7 @@ void initChangeTables(void) { set_sc(CR_SPEARQUICKEN, SC_SPEARQUICKEN, SI_SPEARQUICKEN, SCB_ASPD); set_sc(MO_STEELBODY, SC_STEELBODY, SI_STEELBODY, SCB_DEF|SCB_MDEF|SCB_ASPD|SCB_SPEED); add_sc(MO_BLADESTOP, SC_BLADESTOP_WAIT); + add_sc(MO_BLADESTOP, SC_BLADESTOP); set_sc(MO_EXPLOSIONSPIRITS, SC_EXPLOSIONSPIRITS, SI_EXPLOSIONSPIRITS, SCB_CRI); add_sc(MO_EXTREMITYFIST, SC_EXTREMITYFIST); add_sc(SA_MAGICROD, SC_MAGICROD); @@ -595,9 +596,6 @@ int status_heal(struct block_list *bl,unsigned int hp,unsigned int sp, int flag) } if(sp) { - if (bl->type != BL_PC) - sp = 0; //Only players get SP changes - if(sp > status->max_sp - status->sp) sp = status->max_sp - status->sp; } @@ -656,6 +654,39 @@ int status_percent_change(struct block_list *src,struct block_list *target,char return status_damage(src, target, hp, sp, 0, (!src||src==target?5:1)); } +int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per_sp) +{ + struct status_data *status; + unsigned int hp, sp; + if (!status_isdead(bl)) return 0; + + status = status_get_status_data(bl); + if (status == &dummy_status) + return 0; //Invalid target. + + hp = status->max_hp * per_hp/100; + sp = status->max_sp * per_hp/100; + + if(hp > status->max_hp - status->hp) + hp = status->max_hp - status->hp; + + if(sp > status->max_sp - status->sp) + sp = status->max_sp - status->sp; + + status->hp += hp; + status->sp += sp; + + clif_resurrection(bl, 1); + switch (bl->type) { + case BL_MOB: + mob_revive((TBL_MOB*)bl, hp); + break; + case BL_PC: + pc_revive((TBL_PC*)bl, hp, sp); + break; + } + return 1; +} /*========================================== * Checks whether the src can use the skill on the target, * taking into account status/option of both source/target. [Skotlex] |