summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-15 04:29:05 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-15 04:29:05 +0000
commitb5f526d1ff2351011974c0e4f90e4996fb87c699 (patch)
treedeb3bd1017106c609d00428871df0ce71753469c /src/map
parent6f22f0352964d6d00deafbb8ccaf7145d6321865 (diff)
downloadhercules-b5f526d1ff2351011974c0e4f90e4996fb87c699.tar.gz
hercules-b5f526d1ff2351011974c0e4f90e4996fb87c699.tar.bz2
hercules-b5f526d1ff2351011974c0e4f90e4996fb87c699.tar.xz
hercules-b5f526d1ff2351011974c0e4f90e4996fb87c699.zip
- 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
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.c4
-rw-r--r--src/map/skill.c18
-rw-r--r--src/map/status.c23
-rw-r--r--src/map/status.h2
4 files changed, 43 insertions, 4 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 5c46708b1..9bf6c5d22 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5502,6 +5502,10 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
}
if(bonus!=100)
hp = hp * bonus / 100;
+
+ // Recovery Potion
+ if( sd->sc.count && sd->sc.data[SC_INCHEALRATE].timer!=-1 )
+ hp += (int)(hp * sd->sc.data[SC_INCHEALRATE].val1/100.);
}
if(sp) {
bonus = 100 + (sd->battle_status.int_<<1)
diff --git a/src/map/skill.c b/src/map/skill.c
index 0918eeed4..02df3b52a 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -257,8 +257,13 @@ int skill_calc_heal (struct block_list *src, struct block_list *target, int skil
heal += heal * skill * 2 / 100;
sc = status_get_sc(target);
- if (sc && sc->count && sc->data[SC_CRITICALWOUND].timer!=-1)
- heal -= heal * sc->data[SC_CRITICALWOUND].val2/100;
+ if (sc && sc->count)
+ {
+ if( sc->data[SC_CRITICALWOUND].timer!=-1 )
+ heal -= heal * sc->data[SC_CRITICALWOUND].val2/100;
+ if( sc->data[SC_INCHEALRATE].timer!=-1 )
+ heal += heal * sc->data[SC_INCHEALRATE].val1/100;
+ }
return heal;
}
@@ -6708,8 +6713,13 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
int heal = sg->val2;
if (tstatus->hp >= tstatus->max_hp)
break;
- if (tsc && tsc->data[SC_CRITICALWOUND].timer!=-1)
- heal -= heal * tsc->data[SC_CRITICALWOUND].val2 / 100;
+ if (tsc)
+ {
+ if( tsc->data[SC_INCHEALRATE].timer!=-1 )
+ heal += heal * tsc->data[SC_INCHEALRATE].val1 / 100;
+ if( tsc->data[SC_CRITICALWOUND].timer!=-1 )
+ heal -= heal * tsc->data[SC_CRITICALWOUND].val2 / 100;
+ }
if (status_isimmune(bl))
heal = 0; /* 黄金蟲カード(ヒール量0) */
clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
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)
diff --git a/src/map/status.h b/src/map/status.h
index 153b7288e..71f84e93d 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -281,6 +281,8 @@ enum sc_type {
SC_INCBASEATK,
SC_FASTCAST,
SC_INCMDEFRATE, // Mdef Potion
+ SC_HPREGEN, // Life Potion
+ SC_INCHEALRATE, // Regeneration Potion
SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
};
int SkillStatusChangeTable(int skill);