Angelmelody 221 Posted July 15, 2014 http://ratemyserver.net/index.php?page=item_db&item_id=14586 A hard candy that feels like its jumping in your mouth when you eat it. You'll need to remember to brush your teeth after! 1 minute increase ATK + 20, Attack Speed + 25%, and permanent endure. Decreases 100HP per 10 seconds. Cooldown for 3 minutes. Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted July 15, 2014 solved by myself { Id: 14586 AegisName: "Spark_Candy" Name: "jumping candy" Type: 2 Buy: 0 Weight: 10 Upper: 63 Delay: 180000 Trade: { nodrop: true noselltonpc: true } Script: <" sc_start SC_INCBASEATK,60000,20; sc_start SC_INCASPDRATE,60000,25; sc_start SC_ENDURE,60000,1; sc_start4 SC_HPDRAIN,60000,100,10,0,0; ">},adding required sc state 4d6a9494405c271534390ae72db713bf0dcaaee db/const.txt | 2 ++ src/map/status.c | 26 +++++++++++++++++++++++++- src/map/status.h | 6 +++--- 3 files changed, 30 insertions(+), 4 deletions(-)diff --git a/db/const.txt b/db/const.txtindex fc1aa0f..88586ef 100644--- a/db/const.txt+++ b/db/const.txt@@ -953,6 +953,7 @@ SC_CASH_RECEIVEITEM 259 SC_CASH_BOSS_ALARM 260 SC_CASH_DEATHPENALTY 261 SC_CRITICALPERCENT 262+SC_INCBASEATK 264 SC_PROTECT_MDEF 266 SC_HEALPLUS 268 SC_PNEUMA 269@@ -971,6 +972,7 @@ SC_MER_SP 282 SC_MER_HIT 283 SC_MER_QUICKEN 284 SC_REBIRTH 285+SC_HPDRAIN 288 SC_ITEMSCRIPT 290 SC_S_LIFEPOTION 291 SC_L_LIFEPOTION 292diff --git a/src/map/status.c b/src/map/status.cindex 30907b5..340c598 100644--- a/src/map/status.c+++ b/src/map/status.c@@ -936,6 +936,7 @@ void initChangeTables(void) { status->ChangeFlagTable[SC_INCFLEE] |= SCB_FLEE; status->ChangeFlagTable[SC_INCFLEERATE] |= SCB_FLEE; status->ChangeFlagTable[SC_CRITICALPERCENT] |= SCB_CRI;+ status->ChangeFlagTable[SC_INCBASEATK] |= SCB_BATK; status->ChangeFlagTable[SC_INCASPDRATE] |= SCB_ASPD; status->ChangeFlagTable[SC_PLUSAVOIDVALUE] |= SCB_FLEE2; status->ChangeFlagTable[SC_INCMHPRATE] |= SCB_MAXHP;@@ -4522,6 +4523,8 @@ unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc, if(sc->data[SC_GS_GATLINGFEVER]) batk += sc->data[SC_GS_GATLINGFEVER]->val3; #endif+ if(sc->data[SC_INCBASEATK])+ batk += sc->data[SC_INCBASEATK]->val1; if(sc->data[SC_BATKFOOD]) batk += sc->data[SC_BATKFOOD]->val1; if(sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 2)@@ -7456,6 +7459,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t if (sce->val2 > val2) return 0; break;+ case SC_HPDRAIN: case SC_S_LIFEPOTION: case SC_L_LIFEPOTION: case SC_CASH_BOSS_ALARM:@@ -7836,6 +7840,16 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t if (!val4) val4 = 1; tick_time = 10000; // [GodLesZ] tick time break;+ case SC_HPDRAIN:+ if( val1 == 0 ) return 0;+ // val1 = heal percent/amout+ // val2 = seconds between heals+ // val4 = total of heals+ if( val2 < 1 ) val2 = 1;+ if( (val4 = tick/(val2 * 1000)) < 1 )+ val4 = 1;+ tick = val2 * 1000; // val2 = Seconds between heals+ break; case SC_S_LIFEPOTION: case SC_L_LIFEPOTION: if( val1 == 0 ) return 0;@@ -10632,7 +10646,17 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) { return 0; } break;-+ case SC_HPDRAIN:+ if( --(sce->val4) >= 0 ) {+ int flag, hp = (sce->val1 < 0) ? (int)(st->max_hp * -1 * sce->val1 / 100.) : sce->val1;+ map->freeblock_lock();+ status_fix_damage(NULL, bl, hp, 0);+ flag = !sc->data[type];+ map->freeblock_unlock();+ if( flag ) return 0;+ sc_timer_next((sce->val2 * 1000) + tick, status_change_timer, bl->id, data);+ }+ break; case SC_S_LIFEPOTION: case SC_L_LIFEPOTION: if( sd && --(sce->val4) >= 0 ) {diff --git a/src/map/status.h b/src/map/status.hindex 8028d8f..4ad2a95 100644--- a/src/map/status.h+++ b/src/map/status.h@@ -315,7 +315,7 @@ typedef enum sc_type { SC_HLIF_FLEET, SC_HLIF_SPEED, SC_HAMI_DEFENCE,- SC_INCASPDRATE,+ SC_INCASPDRATE, //248 SC_PLUSAVOIDVALUE, SC_JAILED, //250 SC_ENCHANTARMS,@@ -331,7 +331,7 @@ typedef enum sc_type { SC_CASH_DEATHPENALTY, SC_CRITICALPERCENT, //SC_INCDEF,- //SC_INCBASEATK = 264,+ SC_INCBASEATK = 264, //SC_FASTCAST, SC_PROTECT_MDEF = 266, //SC_HPREGEN,@@ -356,7 +356,7 @@ typedef enum sc_type { SC_REBIRTH, //SC_SKILLCASTRATE, //286 //SC_DEFRATIOATK,- //SC_HPDRAIN,+ SC_HPDRAIN = 288, //SC_SKILLATKBONUS, SC_ITEMSCRIPT = 290, SC_S_LIFEPOTION, 3 evilpuncker, Ehwaz and kyeme reacted to this Quote Share this post Link to post Share on other sites
0 evilpuncker 504 Posted July 16, 2014 solved by myself { Id: 14586 AegisName: "Spark_Candy" Name: "jumping candy" Type: 2 Buy: 0 Weight: 10 Upper: 63 Delay: 180000 Trade: { nodrop: true noselltonpc: true } Script: <" sc_start SC_INCBASEATK,60000,20; sc_start SC_INCASPDRATE,60000,25; sc_start SC_ENDURE,60000,1; sc_start4 SC_HPDRAIN,60000,100,10,0,0; ">},adding required sc state 4d6a9494405c271534390ae72db713bf0dcaaee db/const.txt | 2 ++ src/map/status.c | 26 +++++++++++++++++++++++++- src/map/status.h | 6 +++--- 3 files changed, 30 insertions(+), 4 deletions(-)diff --git a/db/const.txt b/db/const.txtindex fc1aa0f..88586ef 100644--- a/db/const.txt+++ b/db/const.txt@@ -953,6 +953,7 @@ SC_CASH_RECEIVEITEM 259 SC_CASH_BOSS_ALARM 260 SC_CASH_DEATHPENALTY 261 SC_CRITICALPERCENT 262+SC_INCBASEATK 264 SC_PROTECT_MDEF 266 SC_HEALPLUS 268 SC_PNEUMA 269@@ -971,6 +972,7 @@ SC_MER_SP 282 SC_MER_HIT 283 SC_MER_QUICKEN 284 SC_REBIRTH 285+SC_HPDRAIN 288 SC_ITEMSCRIPT 290 SC_S_LIFEPOTION 291 SC_L_LIFEPOTION 292diff --git a/src/map/status.c b/src/map/status.cindex 30907b5..340c598 100644--- a/src/map/status.c+++ b/src/map/status.c@@ -936,6 +936,7 @@ void initChangeTables(void) { status->ChangeFlagTable[SC_INCFLEE] |= SCB_FLEE; status->ChangeFlagTable[SC_INCFLEERATE] |= SCB_FLEE; status->ChangeFlagTable[SC_CRITICALPERCENT] |= SCB_CRI;+ status->ChangeFlagTable[SC_INCBASEATK] |= SCB_BATK; status->ChangeFlagTable[SC_INCASPDRATE] |= SCB_ASPD; status->ChangeFlagTable[SC_PLUSAVOIDVALUE] |= SCB_FLEE2; status->ChangeFlagTable[SC_INCMHPRATE] |= SCB_MAXHP;@@ -4522,6 +4523,8 @@ unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc, if(sc->data[SC_GS_GATLINGFEVER]) batk += sc->data[SC_GS_GATLINGFEVER]->val3; #endif+ if(sc->data[SC_INCBASEATK])+ batk += sc->data[SC_INCBASEATK]->val1; if(sc->data[SC_BATKFOOD]) batk += sc->data[SC_BATKFOOD]->val1; if(sc->data[SC_FIRE_INSIGNIA] && sc->data[SC_FIRE_INSIGNIA]->val1 == 2)@@ -7456,6 +7459,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t if (sce->val2 > val2) return 0; break;+ case SC_HPDRAIN: case SC_S_LIFEPOTION: case SC_L_LIFEPOTION: case SC_CASH_BOSS_ALARM:@@ -7836,6 +7840,16 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t if (!val4) val4 = 1; tick_time = 10000; // [GodLesZ] tick time break;+ case SC_HPDRAIN:+ if( val1 == 0 ) return 0;+ // val1 = heal percent/amout+ // val2 = seconds between heals+ // val4 = total of heals+ if( val2 < 1 ) val2 = 1;+ if( (val4 = tick/(val2 * 1000)) < 1 )+ val4 = 1;+ tick = val2 * 1000; // val2 = Seconds between heals+ break; case SC_S_LIFEPOTION: case SC_L_LIFEPOTION: if( val1 == 0 ) return 0;@@ -10632,7 +10646,17 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) { return 0; } break;-+ case SC_HPDRAIN:+ if( --(sce->val4) >= 0 ) {+ int flag, hp = (sce->val1 < 0) ? (int)(st->max_hp * -1 * sce->val1 / 100.) : sce->val1;+ map->freeblock_lock();+ status_fix_damage(NULL, bl, hp, 0);+ flag = !sc->data[type];+ map->freeblock_unlock();+ if( flag ) return 0;+ sc_timer_next((sce->val2 * 1000) + tick, status_change_timer, bl->id, data);+ }+ break; case SC_S_LIFEPOTION: case SC_L_LIFEPOTION: if( sd && --(sce->val4) >= 0 ) {diff --git a/src/map/status.h b/src/map/status.hindex 8028d8f..4ad2a95 100644--- a/src/map/status.h+++ b/src/map/status.h@@ -315,7 +315,7 @@ typedef enum sc_type { SC_HLIF_FLEET, SC_HLIF_SPEED, SC_HAMI_DEFENCE,- SC_INCASPDRATE,+ SC_INCASPDRATE, //248 SC_PLUSAVOIDVALUE, SC_JAILED, //250 SC_ENCHANTARMS,@@ -331,7 +331,7 @@ typedef enum sc_type { SC_CASH_DEATHPENALTY, SC_CRITICALPERCENT, //SC_INCDEF,- //SC_INCBASEATK = 264,+ SC_INCBASEATK = 264, //SC_FASTCAST, SC_PROTECT_MDEF = 266, //SC_HPREGEN,@@ -356,7 +356,7 @@ typedef enum sc_type { SC_REBIRTH, //SC_SKILLCASTRATE, //286 //SC_DEFRATIOATK,- //SC_HPDRAIN,+ SC_HPDRAIN = 288, //SC_SKILLATKBONUS, SC_ITEMSCRIPT = 290, SC_S_LIFEPOTION, great, pull it to git =P Quote Share this post Link to post Share on other sites
http://ratemyserver.net/index.php?page=item_db&item_id=14586
Share this post
Link to post
Share on other sites