summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-15 00:24:12 +0100
committerHaru <haru@dotalux.com>2015-12-28 18:35:59 +0100
commitb871e0e9e360ede025dc25e500a9a4e85cc2d377 (patch)
tree95d422b2243fec5e1b8e1d81fdf53a7383c38218
parent09a2201e0d8563608a421378970f9d9ae6bc38bc (diff)
downloadhercules-b871e0e9e360ede025dc25e500a9a4e85cc2d377.tar.gz
hercules-b871e0e9e360ede025dc25e500a9a4e85cc2d377.tar.bz2
hercules-b871e0e9e360ede025dc25e500a9a4e85cc2d377.tar.xz
hercules-b871e0e9e360ede025dc25e500a9a4e85cc2d377.zip
Replaced some numeric mob IDs with the proper constants (Magc Decoy / Silver Sniper)
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/skill.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 68cd272f9..2e3d7957d 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -10769,11 +10769,8 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case NC_SILVERSNIPER:
{
- int class_ = 2042;
- struct mob_data *md;
-
- md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), class_, "", SZ_SMALL, AI_NONE);
- if( md ) {
+ struct mob_data *md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), MOBID_SILVERSNIPER, "", SZ_SMALL, AI_NONE);
+ if (md) {
md->master_id = src->id;
md->special_state.ai = AI_FLORA;
if( md->deletetimer != INVALID_TIMER )
@@ -14041,17 +14038,15 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
case NC_MAGICDECOY: {
int c = 0;
int maxcount = skill->get_maxcount(skill_id,skill_lv);
- int mob_class = 2042;
- if( skill_id == NC_MAGICDECOY )
- mob_class = 2043;
if( battle_config.land_skill_limit && maxcount > 0 && ( battle_config.land_skill_limit&BL_PC ) ) {
- if( skill_id == NC_MAGICDECOY ) {
+ if (skill_id == NC_MAGICDECOY) {
int j;
- for(j = mob_class; j <= 2046; j++)
+ for (j = MOBID_MAGICDECOY_FIRE; j <= MOBID_MAGICDECOY_WIND; j++)
map->foreachinmap(skill->check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, j, skill_id, &c);
- } else
- map->foreachinmap(skill->check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, mob_class, skill_id, &c);
+ } else {
+ map->foreachinmap(skill->check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, MOBID_SILVERSNIPER, skill_id, &c);
+ }
if( c >= maxcount ) {
clif->skill_fail(sd , skill_id, USESKILL_FAIL_LEVEL, 0);
return 0;
@@ -17586,7 +17581,7 @@ void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id) {
}
int skill_magicdecoy(struct map_session_data *sd, int nameid) {
- int x, y, i, class_, skill_id;
+ int x, y, i, class_ = 0, skill_id;
struct mob_data *md;
nullpo_ret(sd);
skill_id = sd->menuskill_val;
@@ -17606,7 +17601,20 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid) {
sd->sc.comet_x = sd->sc.comet_y = 0;
sd->menuskill_val = 0;
- class_ = (nameid == ITEMID_BOODY_RED || nameid == ITEMID_CRYSTAL_BLUE) ? 2043 + nameid - ITEMID_BOODY_RED : (nameid == ITEMID_WIND_OF_VERDURE) ? 2046 : 2045;
+ switch (nameid) {
+ case ITEMID_BOODY_RED:
+ class_ = MOBID_MAGICDECOY_FIRE;
+ break;
+ case ITEMID_CRYSTAL_BLUE:
+ class_ = MOBID_MAGICDECOY_WATER;
+ break;
+ case ITEMID_WIND_OF_VERDURE:
+ class_ = MOBID_MAGICDECOY_WIND;
+ break;
+ case ITEMID_YELLOW_LIVE:
+ class_ = MOBID_MAGICDECOY_EARTH;
+ break;
+ }
md = mob->once_spawn_sub(&sd->bl, sd->bl.m, x, y, sd->status.name, class_, "", SZ_SMALL, AI_NONE);
if( md ) {