From 8a7e51e73c3d15c1736d2d575a767904faa755e8 Mon Sep 17 00:00:00 2001 From: L0ne_W0lf Date: Thu, 9 Oct 2008 17:21:32 +0000 Subject: Updated NPC_REBIRTH. Has it's own values, and no longer leeches off SL_KAIZEL. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13272 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.c | 2 +- src/map/skill.c | 4 ++-- src/map/status.c | 14 +++++++++++++- src/map/status.h | 6 ++++-- 4 files changed, 20 insertions(+), 6 deletions(-) (limited to 'src/map') diff --git a/src/map/mob.c b/src/map/mob.c index 809ce3f77..0c6ada573 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2313,7 +2313,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) //Emperium destroyed by script. Discard mvp character. [Skotlex] mvp_sd = NULL; - if( !md->sc.data[SC_KAIZEL] ) + if( !md->sc.data[SC_REBIRTH] ) { // Only trigger event on final kill md->status.hp = 0; //So that npc_event invoked functions KNOW that mob is dead if( src ) diff --git a/src/map/skill.c b/src/map/skill.c index e4a4b1bbb..9dcdae732 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4610,8 +4610,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case NPC_REBIRTH: - //New rebirth System uses Kaizel [Skotlex] - sc_start(bl,type,100,skilllv,skill_get_time(SL_KAIZEL,skilllv)); + //Rebirth system now uses SC_REBIRTH instead of SC_KAIZEL. [L0ne_W0lf] + sc_start(bl,type,100,skilllv,skill_get_time(NPC_REBIRTH,skilllv)); break; case NPC_DARKBLESSING: diff --git a/src/map/status.c b/src/map/status.c index 61c60d9c8..1134c83da 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -216,7 +216,7 @@ void initChangeTables(void) add_sc( NPC_DEFENDER , SC_ARMOR ); add_sc( NPC_LICK , SC_STUN ); set_sc( NPC_HALLUCINATION , SC_HALLUCINATION , SI_HALLUCINATION , SCB_NONE ); - add_sc( NPC_REBIRTH , SC_KAIZEL ); + add_sc( NPC_REBIRTH , SC_REBIRTH ); add_sc( RG_RAID , SC_STUN ); set_sc( RG_STRIPWEAPON , SC_STRIPWEAPON , SI_STRIPWEAPON , SCB_WATK ); set_sc( RG_STRIPSHIELD , SC_STRIPSHIELD , SI_STRIPSHIELD , SCB_DEF ); @@ -793,6 +793,15 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s return hp+sp; } + if( !((TBL_MOB*)target)->state.rebirth && sc && sc->data[SC_REBIRTH] && target->type == BL_MOB ) + { // Ensure the monster has not already rebirthed before doing so. + int time = skill_get_time2(NPC_REBIRTH,sc->data[SC_REBIRTH]->val1); + status_revive(target, sc->data[SC_REBIRTH]->val2, 0); + status_change_clear(target,0); + ((TBL_MOB*)target)->state.rebirth = 1; + return hp+sp; + } + status_change_clear(target,0); if(flag&4) //Delete from memory. (also invokes map removal code) @@ -6077,6 +6086,9 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val case SC_MERC_SPUP: val2 = 5 * val1; break; + case SC_REBIRTH: + val2 = 20*val1; //% of life to be revived with + break; default: if( calc_flag == SCB_NONE && StatusSkillChangeTable[type] == 0 && StatusIconChangeTable[type] == 0 ) diff --git a/src/map/status.h b/src/map/status.h index f5e36ec88..b4b6dde61 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -287,7 +287,7 @@ typedef enum sc_type { SC_INCHEALRATE, SC_PNEUMA, SC_AUTOTRADE, - SC_KSPROTECTED, + SC_KSPROTECTED, //270 SC_ARMOR_RESIST, SC_SPCOST_RATE, SC_COMMONSC_RESIST, @@ -299,11 +299,13 @@ typedef enum sc_type { // Mercenary Only Bonus Effects SC_MERC_FLEEUP, SC_MERC_ATKUP, - SC_MERC_HPUP, + SC_MERC_HPUP, //280 SC_MERC_SPUP, SC_MERC_HITUP, SC_MERC_QUICKEN, + SC_REBIRTH, + SC_MAX, //Automatically updated max, used in for's to check we are within bounds. } sc_type; -- cgit v1.2.3-70-g09d2