summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/status.c38
-rw-r--r--src/map/status.h19
2 files changed, 38 insertions, 19 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 6c1a1029e..04e01b8ba 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -193,7 +193,7 @@ void initChangeTables(void)
set_sc( MG_ENERGYCOAT , SC_ENERGYCOAT , SI_ENERGYCOAT , SCB_NONE );
set_sc( NPC_EMOTION , SC_MODECHANGE , SI_BLANK , SCB_MODE );
add_sc( NPC_EMOTION_ON , SC_MODECHANGE );
- set_sc( NPC_ATTRICHANGE , SC_ELEMENTALCHANGE , SI_ARMOR_RESIST , SCB_DEF_ELE );
+ set_sc( NPC_ATTRICHANGE , SC_ELEMENTALCHANGE , SI_ARMOR_PROPERTY , SCB_DEF_ELE );
add_sc( NPC_CHANGEWATER , SC_ELEMENTALCHANGE );
add_sc( NPC_CHANGEGROUND , SC_ELEMENTALCHANGE );
add_sc( NPC_CHANGEFIRE , SC_ELEMENTALCHANGE );
@@ -472,11 +472,12 @@ void initChangeTables(void)
StatusIconChangeTable[SC_DEF_RATE] = SI_DEF_RATE;
StatusIconChangeTable[SC_MDEF_RATE] = SI_MDEF_RATE;
StatusIconChangeTable[SC_INCCRI] = SI_INCCRI;
+ StatusIconChangeTable[SC_INCFLEE2] = SI_PLUSAVOIDVALUE;
StatusIconChangeTable[SC_INCHEALRATE] = SI_INCHEALRATE;
- StatusIconChangeTable[SC_HPREGEN] = SI_HPREGEN;
- StatusIconChangeTable[SC_SPCOST_RATE] = SI_SPCOST_RATE;
- StatusIconChangeTable[SC_COMMONSC_RESIST] = SI_COMMONSC_RESIST;
- StatusIconChangeTable[SC_ARMOR_RESIST] = SI_ARMOR_RESIST;
+ StatusIconChangeTable[SC_S_LIFEPOTION] = SI_S_LIFEPOTION;
+ StatusIconChangeTable[SC_L_LIFEPOTION] = SI_L_LIFEPOTION;
+ StatusIconChangeTable[SC_SPCOST_RATE] = SI_ATKER_BLOOD;
+ StatusIconChangeTable[SC_COMMONSC_RESIST] = SI_TARGET_BLOOD;
// Mercenary Bonus Effects
StatusIconChangeTable[SC_MERC_FLEEUP] = SI_MERC_FLEEUP;
StatusIconChangeTable[SC_MERC_ATKUP] = SI_MERC_ATKUP;
@@ -5123,6 +5124,8 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_HPREGEN:
case SC_HPDRAIN:
case SC_SPREGEN:
+ case SC_S_LIFEPOTION:
+ case SC_L_LIFEPOTION:
case SC_BOSSMAPINFO:
case SC_STUN:
case SC_SLEEP:
@@ -5454,6 +5457,8 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_HPREGEN:
case SC_HPDRAIN:
case SC_SPREGEN:
+ case SC_S_LIFEPOTION:
+ case SC_L_LIFEPOTION:
if( val1 == 0 ) return 0;
// val1 = heal percent/amout
// val2 = seconds between heals
@@ -7059,17 +7064,28 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr data)
break;
case SC_HPREGEN:
- case SC_SPREGEN:
+ case SC_S_LIFEPOTION:
+ case SC_L_LIFEPOTION:
if( sd && --(sce->val4) >= 0 )
{
// val1 < 0 = per max% | val1 > 0 = exact amount
- int hp = 0, sp = 0;
- if( type == SC_HPREGEN && status->hp < status->max_hp )
+ int hp = 0;
+ if( status->hp < status->max_hp )
hp = (sce->val1 < 0) ? (int)(sd->status.max_hp * -1 * sce->val1 / 100.) : sce->val1 ;
- else if( type == SC_SPREGEN && status->sp < status->max_sp )
- sp = (sce->val1 < 0) ? (int)(sd->status.max_sp * -1 * sce->val1 / 100.) : sce->val1 ;
+ status_heal(bl, hp, 0, 2);
+ sc_timer_next((sce->val2 * 1000) + tick, status_change_timer, bl->id, data);
+ return 0;
+ }
+ break;
- status_heal(bl, hp, sp, 2);
+ case SC_SPREGEN:
+ if( sd && --(sce->val4) >= 0 )
+ {
+ // val1 < 0 = per max% | val1 > 0 = exact amount
+ int sp = 0;
+ if( status->sp < status->max_sp )
+ sp = (sce->val1 < 0) ? (int)(sd->status.max_sp * -1 * sce->val1 / 100.) : sce->val1 ;
+ status_heal(bl, 0, sp, 2);
sc_timer_next((sce->val2 * 1000) + tick, status_change_timer, bl->id, data);
return 0;
}
diff --git a/src/map/status.h b/src/map/status.h
index bae20055f..2893bbe5d 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -310,6 +310,8 @@ typedef enum sc_type {
SC_HPDRAIN,
SC_SKILLATKBONUS,
SC_ITEMSCRIPT,
+ SC_S_LIFEPOTION,
+ SC_L_LIFEPOTION,
SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
} sc_type;
@@ -485,15 +487,16 @@ enum si_type {
SI_CRITICALWOUND = 286,
SI_DEF_RATE = 290,
SI_MDEF_RATE = 291,
- SI_INCCRI = 292,
- SI_INCHEALRATE = 293,
- SI_HPREGEN = 294,
- // 295 Sword ?
- // 296 4 chars up ?
+
+ SI_INCHEALRATE = 292,
+ SI_S_LIFEPOTION = 293,
+ SI_L_LIFEPOTION = 294,
+ SI_INCCRI = 295,
+ SI_PLUSAVOIDVALUE = 296,
SI_SPCOST_RATE = 298,
- // 300 Stars ?
- SI_COMMONSC_RESIST = 301,
- SI_ARMOR_RESIST = 302,
+ SI_ATKER_BLOOD = 300,
+ SI_TARGET_BLOOD = 301,
+ SI_ARMOR_PROPERTY = 302,
};
// JOINTBEAT stackable ailments