From b5f526d1ff2351011974c0e4f90e4996fb87c699 Mon Sep 17 00:00:00 2001 From: zephyrus Date: Thu, 15 Nov 2007 04:29:05 +0000 Subject: - Added 2 new status changes for Life and Regeneration Potions [Zephyrus] - Fixed some items boxes giving wrong tamings. - Fixed another item giving 48 gladius[3] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11738 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/status.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/map/status.c') diff --git a/src/map/status.c b/src/map/status.c index 2c9539b28..926b77162 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4949,6 +4949,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val if (sc->data[type].val2 > val2) return 0; break; + case SC_HPREGEN: case SC_STUN: case SC_SLEEP: case SC_POISON: @@ -5263,6 +5264,12 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val if (!val4) val4 = 1; tick = 10000; break; + case SC_HPREGEN: + // val1 = % of Max HP per tick + val4 = tick/(val2 * 1000); + if (!val4) val4 = 1; + tick = val2 * 1000; // val2 = seconds + break; case SC_HIDING: val2 = tick/1000; @@ -5860,6 +5867,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val //Place here SCs that have no SCB_* data, no skill associated, no ICON //associated, and yet are not wrong/unknown. [Skotlex] break; + case SC_INCHEALRATE: + if (val1 < 1) + val1 = 1; + break; default: if( calc_flag == SCB_NONE && StatusSkillChangeTable[type] == 0 && StatusIconChangeTable[type] == 0 ) { //Status change with no calc, no icon, and no skill associated...? @@ -6783,6 +6794,18 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) } break; + case SC_HPREGEN: + if( sd && (--sc->data[type].val4) >= 0 ) + { + if( status->hp < status->max_hp ) { + int hp = (int)(sd->status.max_hp * sc->data[type].val1 / 100.); + status_heal(bl, hp, 0, 2); + } + sc->data[type].timer = add_timer((sc->data[type].val2 * 1000) + tick, status_change_timer, bl->id, data ); + return 0; + } + break; + case SC_KNOWLEDGE: if (sd) { if(bl->m != sd->feel_map[0].m && bl->m != sd->feel_map[1].m && bl->m != sd->feel_map[2].m) -- cgit v1.2.3-70-g09d2