summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/const.txt2
-rw-r--r--db/item_db.txt4
-rw-r--r--src/map/status.c38
-rw-r--r--src/map/status.h19
4 files changed, 42 insertions, 21 deletions
diff --git a/db/const.txt b/db/const.txt
index cccd33ce5..bc54919bf 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -811,6 +811,8 @@ SC_DEFRATIOATK 286
SC_HPDRAIN 287
SC_SKILLATKBONUS 288
SC_ITEMSCRIPT 289
+SC_S_LIFEPOTION 290
+SC_L_LIFEPOTION 291
e_gasp 0
e_what 1
diff --git a/db/item_db.txt b/db/item_db.txt
index 0159ee3b9..32a010e37 100644
--- a/db/item_db.txt
+++ b/db/item_db.txt
@@ -4904,8 +4904,8 @@
14531,Accuracy_30_Scroll,Concentration Power Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCHIT,1800000,30; },{},{}
14532,Battle_Manual25,Field Manual 25%,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_EXPBOOST,1800000,25; },{},{}
14533,Battle_Manual100,Field Manual 100%,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_EXPBOOST,1800000,100; },{},{}
-14534,Small_Life_Potion,Small Life Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ specialeffect2 320; sc_start4 SC_HPREGEN,600000,-5,5,0,0; },{},{}
-14535,Med_Life_Potion,Medium Life Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ specialeffect2 320; sc_start4 SC_HPREGEN,600000,-7,4,0,0; },{},{}
+14534,Small_Life_Potion,Small Life Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ specialeffect2 320; sc_start4 SC_S_LIFEPOTION,600000,-5,5,0,0; },{},{}
+14535,Med_Life_Potion,Medium Life Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ specialeffect2 320; sc_start4 SC_L_LIFEPOTION,600000,-7,4,0,0; },{},{}
14536,Abrasive,Abrasive,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ specialeffect2 182; sc_start SC_INCCRI,300000,30; },{},{}
14537,Regeneration_Potion,Regeneration Potion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ specialeffect2 348; sc_start SC_INCHEALRATE,1800000,20; },{},{}
14538,Glass_of_Illusion,Glass of Illusion,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ specialeffect2 EF_STEAL; sc_start SC_INCFLEE2,60000,20; },{},{}
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