summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorDastgir Pojee <dastgirp@gmail.com>2016-10-03 19:52:19 +0530
committerhemagx <ibrahem.h.basyone@gmail.com>2016-10-22 02:22:16 +0200
commitf42e558870c1d3e267ff39b6de2841c08750c4e8 (patch)
treee3ad09feb7b68cc0a8231a1ec63c30e856e8bd9c /src/map
parent6b1fea716f09d316fe6d475114d4a08f8e112580 (diff)
downloadhercules-f42e558870c1d3e267ff39b6de2841c08750c4e8.tar.gz
hercules-f42e558870c1d3e267ff39b6de2841c08750c4e8.tar.bz2
hercules-f42e558870c1d3e267ff39b6de2841c08750c4e8.tar.xz
hercules-f42e558870c1d3e267ff39b6de2841c08750c4e8.zip
Implemented UNT_CATNIPPOWDER.
Implemented SC_CATNIPPOWDER: Increases WAtk%, MAtk% and Reduces Movement Speed. Increases Natural Hp/Sp Recovery
Diffstat (limited to 'src/map')
-rw-r--r--src/map/skill.c7
-rw-r--r--src/map/status.c14
2 files changed, 21 insertions, 0 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 4ba8b34ef..30b9f4c0a 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -12113,6 +12113,13 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick
sc_start(ss, bl, SC_VOLCANIC_ASH, 100, sg->skill_lv, skill->get_time(MH_VOLCANIC_ASH, sg->skill_lv));
break;
+ case UNT_CATNIPPOWDER:
+ if (sg->src_id == bl->id || (status_get_mode(bl)&MD_BOSS))
+ break; // Does not affect the caster or Boss.
+ if (sce == NULL && battle->check_target(&src->bl, bl, BCT_ENEMY) > 0)
+ sc_start(ss, bl, type, 100, sg->skill_lv, skill->get_time(sg->skill_id, sg->skill_lv));
+ break;
+
case UNT_GD_LEADERSHIP:
case UNT_GD_GLORYWOUNDS:
case UNT_GD_SOULCOLD:
diff --git a/src/map/status.c b/src/map/status.c
index 643401109..46df84473 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -3626,6 +3626,10 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
regen->rate.hp += regen->rate.hp * sc->data[SC_BUCHEDENOEL]->val1 / 100;
regen->rate.sp += regen->rate.sp * sc->data[SC_BUCHEDENOEL]->val2 / 100;
}
+ if (sc->data[SC_CATNIPPOWDER]) {
+ regen->rate.hp *= 2;
+ regen->rate.sp *= 2;
+ }
}
#define status_get_homstr(st, hd) ((st)->str + (hd)->homunculus.str_value)
@@ -5056,6 +5060,8 @@ unsigned short status_calc_watk(struct block_list *bl, struct status_change *sc,
watk += watk * sc->data[SC_ANGRIFFS_MODUS]->val2/100;
if( sc->data[SC_FLASHCOMBO] )
watk += sc->data[SC_FLASHCOMBO]->val2;
+ if (sc->data[SC_CATNIPPOWDER])
+ watk -= watk * sc->data[SC_CATNIPPOWDER]->val2 / 100;
return (unsigned short)cap_value(watk,0,USHRT_MAX);
}
@@ -5771,6 +5777,8 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc
if (sc->data[SC_DEC_AGI] || sc->data[SC_QUAGMIRE] || sc->data[SC_DONTFORGETME])
return 0;
}
+ if (sc->data[SC_CATNIPPOWDER])
+ val = max(val, sc->data[SC_CATNIPPOWDER]->val3);
if( sd && sd->bonus.speed_rate + sd->bonus.speed_add_rate > 0 ) // permanent item-based speedup
val = max( val, sd->bonus.speed_rate + sd->bonus.speed_add_rate );
@@ -9836,6 +9844,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_SHRIMP:
val2 = 10; // BATK%, MATK%
break;
+ case SC_CATNIPPOWDER:
+ val2 = 50; // WATK%, MATK%
+ val3 = 25 * val1; // Move speed reduction
+ break;
default:
if (calc_flag == SCB_NONE && status->dbs->SkillChangeTable[type] == 0 && status->dbs->IconChangeTable[type] == 0) {
//Status change with no calc, no icon, and no skill associated...?
@@ -12317,6 +12329,8 @@ void status_get_matk_sub(struct block_list *bl, int flag, unsigned short *matk_m
if ( (st->rhw.matk + st->lhw.matk) > 0 ) {
int wMatk = st->rhw.matk + st->lhw.matk; // Left and right matk stacks
int variance = wMatk * st->rhw.wlv / 10; // Only use right hand weapon level
+ if (sc != NULL && sc->data[SC_CATNIPPOWDER])
+ wMatk -= wMatk * sc->data[SC_CATNIPPOWDER]->val2 / 100;
*matk_min += wMatk - variance;
*matk_max += wMatk + variance;
}