summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDastgir Pojee <dastgirp@gmail.com>2016-10-03 18:57:13 +0530
committerhemagx <ibrahem.h.basyone@gmail.com>2016-10-22 02:22:08 +0200
commit384ab01c3ea55f96277824b9c64d79dc060efcb3 (patch)
tree9a65e2ac4ea853296189fa3c2b38f6d7a2c3c597
parent8557afc9875ae5fcf46b17728cddab009aa5d472 (diff)
downloadhercules-384ab01c3ea55f96277824b9c64d79dc060efcb3.tar.gz
hercules-384ab01c3ea55f96277824b9c64d79dc060efcb3.tar.bz2
hercules-384ab01c3ea55f96277824b9c64d79dc060efcb3.tar.xz
hercules-384ab01c3ea55f96277824b9c64d79dc060efcb3.zip
Implemented SU_LUNATICCARROTBEAT Skill.
Atk +(200+100*SkillLv)%. When 1 Carrot is consumed, Add's a chance to stun enemy. Lv1-2: 3x3 AoE Lv3-4: 5x5 AoE Lv5: 7x7 AoE Added Item Constants in itemdb.h
-rw-r--r--src/map/battle.c3
-rw-r--r--src/map/itemdb.h2
-rw-r--r--src/map/skill.c27
-rw-r--r--src/map/status.c1
4 files changed, 30 insertions, 3 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 8ff376042..001da3edd 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1683,6 +1683,9 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
if ((status_get_max_hp(target) / 100) <= 50)
skillratio *= 2;
break;
+ case SU_LUNATICCARROTBEAT:
+ skillratio += 100 + 100 * skill_lv;
+ break;
/**
* Arch Bishop
**/
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index d33805174..16dca9e58 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -54,6 +54,7 @@ enum item_itemid {
ITEMID_WHITE_POTION = 504,
ITEMID_BLUE_POTION = 505,
ITEMID_APPLE = 512,
+ ITEMID_CARROT = 515,
ITEMID_HOLY_WATER = 523,
ITEMID_PUMPKIN = 535,
ITEMID_RED_SLIM_POTION = 545,
@@ -113,6 +114,7 @@ enum item_itemid {
ITEMID_GOLD_KEY77 = 7782,
ITEMID_SILVER_KEY77 = 7783,
ITEMID_TRAP_ALLOY = 7940,
+ ITEMID_CATNIP_FRUIT = 11602,
ITEMID_RED_POUCH_OF_SURPRISE = 12024,
ITEMID_BLOODY_DEAD_BRANCH = 12103,
ITEMID_PORING_BOX = 12109,
diff --git a/src/map/skill.c b/src/map/skill.c
index d3186e8ba..8d870881e 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1433,6 +1433,10 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
case SU_SCAROFTAROU:
sc_start(src, bl, SC_STUN, 10, skill_lv, skill->get_time2(skill_id, skill_lv)); // TODO: What's the chance/time?
break;
+ case SU_LUNATICCARROTBEAT:
+ if (skill->area_temp[3] == 1)
+ sc_start(src, bl, SC_STUN, 10, skill_lv, skill_get_time(skill_id, skill_lv)); // TODO: What's the chance/time?
+ break;
default:
skill->additional_effect_unknown(src, bl, &skill_id, &skill_lv, &attack_type, &dmg_lv, &tick);
break;
@@ -4047,6 +4051,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
case GN_ILLUSIONDOPING:
case MH_XENO_SLASHER:
case SU_SCRATCH:
+ case SU_LUNATICCARROTBEAT:
if (flag&1) { //Recursive invocation
// skill->area_temp[0] holds number of targets in area
// skill->area_temp[1] holds the id of the original target
@@ -4074,6 +4079,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
case LG_EARTHDRIVE:
case GN_CARTCANNON:
case SU_SCRATCH:
+ case SU_LUNATICCARROTBEAT:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case SR_TIGERCANNON:
@@ -4092,13 +4098,19 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
skill->area_temp[0] = 0;
skill->area_temp[1] = bl->id;
skill->area_temp[2] = 0;
- if( skill_id == WL_CRIMSONROCK ) {
+ if (skill_id == WL_CRIMSONROCK) {
skill->area_temp[4] = bl->x;
skill->area_temp[5] = bl->y;
}
+ if (skill_id == SU_LUNATICCARROTBEAT) {
+ skill->area_temp[3] = 0;
+ }
- if( skill_id == NC_VULCANARM )
- if (sd) pc->overheat(sd,1);
+ if (skill_id == NC_VULCANARM) {
+ if (sd != NULL) {
+ pc->overheat(sd,1);
+ }
+ }
// if skill damage should be split among targets, count them
//SD_LEVEL -> Forced splash damage for Auto Blitz-Beat -> count targets
@@ -4108,6 +4120,15 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
// recursive invocation of skill->castend_damage_id() with flag|1
map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), skill->splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
+
+ if (sd && skill_id == SU_LUNATICCARROTBEAT) {
+ short item_idx = pc->search_inventory(sd, ITEMID_CARROT);
+
+ if (item_idx >= 0) {
+ pc->delitem(sd, item_idx, 1, 0, 1, LOG_TYPE_CONSUME);
+ skill->area_temp[3] = 1;
+ }
+ }
}
break;
diff --git a/src/map/status.c b/src/map/status.c
index d842d91ea..7d94d729b 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -733,6 +733,7 @@ void initChangeTables(void)
add_sc(SU_SCAROFTAROU, SC_STUN );
status->set_sc(SU_SCAROFTAROU, SC_BITESCAR, SI_BITESCAR, SCB_NONE);
status->set_sc(SU_ARCLOUSEDASH, SC_ARCLOUSEDASH, SI_ARCLOUSEDASH, SCB_AGI | SCB_SPEED);
+ add_sc(SU_LUNATICCARROTBEAT, SC_STUN);
// Elemental Spirit summoner's 'side' status changes.
status->set_sc( EL_CIRCLE_OF_FIRE , SC_CIRCLE_OF_FIRE_OPTION, SI_CIRCLE_OF_FIRE_OPTION, SCB_NONE );