From 52bd4a502c919e789e8900820423a49a4343b3d7 Mon Sep 17 00:00:00 2001 From: Dastgir Pojee Date: Mon, 3 Oct 2016 19:17:38 +0530 Subject: Implemented SC_BITESCAR: Cannot be reset by dispell. Cannot be healed by item/NPC once in BITESCAR. Heal Skill would end the BiteScar Effect. --- src/map/pc.c | 3 +++ src/map/script.c | 7 +++++-- src/map/skill.c | 6 +++++- src/map/status.c | 13 +++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/map/pc.c b/src/map/pc.c index 8f6d3bcb0..bfd6c0ea5 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -8408,6 +8408,9 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp) if( sd->sc.data[SC_EXTREMITYFIST2] ) sp = 0; #endif + if (sd->sc.data[SC_BITESCAR]) { + hp = 0; + } } return status->heal(&sd->bl, hp, sp, 1); diff --git a/src/map/script.c b/src/map/script.c index d1aee29bf..2a39bc832 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6721,13 +6721,16 @@ BUILDIN(percentheal) } sd = script->rid2sd(st); - if( sd == NULL ) + if (sd == NULL) return true; #ifdef RENEWAL if( sd->sc.data[SC_EXTREMITYFIST2] ) sp = 0; #endif - pc->percentheal(sd,hp,sp); + if (sd->sc.data[SC_BITESCAR]) { + hp = 0; + } + pc->percentheal(sd, hp, sp); return true; } diff --git a/src/map/skill.c b/src/map/skill.c index 4be827572..73154d3ae 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -5589,6 +5589,9 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin else if (tsc->data[SC_BERSERK]) heal = 0; //Needed so that it actually displays 0 when healing. } + if (skill_id == AL_HEAL) { + status_change_end(bl, SC_BITESCAR, INVALID_TIMER); + } clif->skill_nodamage (src, bl, skill_id, heal, 1); if( tsc && tsc->data[SC_AKAITSUKI] && heal && skill_id != HLIF_HEAL ) heal = ~heal + 1; @@ -6751,7 +6754,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin status_change_end(bl, SC_SILENCE, INVALID_TIMER); status_change_end(bl, SC_BLIND, INVALID_TIMER); status_change_end(bl, SC_CONFUSION, INVALID_TIMER); - clif->skill_nodamage(src,bl,skill_id,skill_lv,1); + status_change_end(bl, SC_BITESCAR, INVALID_TIMER); + clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); break; case TF_DETOXIFY: diff --git a/src/map/status.c b/src/map/status.c index 508127cb6..ca1d6249d 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -7836,6 +7836,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_NETHERWORLD: case SC_FRESHSHRIMP: case SC_SV_ROOTTWIST: + case SC_BITESCAR: return 0; } } @@ -9822,6 +9823,11 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_TUNAPARTY: val2 = (st->max_hp * (val1 * 10) / 100); // %Max HP to absorb break; + case SC_BITESCAR: + val2 = 2 * val1; // MHP% damage + val4 = tick / 1000; + tick_time = 1000; + break; default: if (calc_flag == SCB_NONE && status->dbs->SkillChangeTable[type] == 0 && status->dbs->IconChangeTable[type] == 0) { //Status change with no calc, no icon, and no skill associated...? @@ -12095,6 +12101,13 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) sc_timer_next((10000 - ((sce->val1 - 1) * 1000)) + tick, status->change_timer, bl->id, data); } break; + case SC_BITESCAR: + if (--(sce->val4) >= 0) { + status_percent_damage(bl, bl, -(sce->val2), 0, 0); + sc_timer_next(1000 + tick, status->change_timer, bl->id, data); + return 0; + } + break; } // default for all non-handled control paths is to end the status -- cgit v1.2.3-70-g09d2