diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-28 23:48:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-28 23:48:06 +0300 |
commit | cb6e0f1b68ad76402f00968ea6ea65758daa8fbd (patch) | |
tree | bbb13e6d59b0143817e559c9fb8f6a9656fe864e | |
parent | 296e6c04a4c1a01a233c937bd198a31fa849f49c (diff) | |
parent | f1afe0dfee7f97d46f6dad924f75d08956d17620 (diff) | |
download | hercules-cb6e0f1b68ad76402f00968ea6ea65758daa8fbd.tar.gz hercules-cb6e0f1b68ad76402f00968ea6ea65758daa8fbd.tar.bz2 hercules-cb6e0f1b68ad76402f00968ea6ea65758daa8fbd.tar.xz hercules-cb6e0f1b68ad76402f00968ea6ea65758daa8fbd.zip |
Merge pull request #955 from HerculesWS/src-id-constants
Replaced several numeric constants with enums
-rw-r--r-- | src/common/mmo.h | 7 | ||||
-rw-r--r-- | src/map/atcommand.c | 6 | ||||
-rw-r--r-- | src/map/battle.c | 14 | ||||
-rw-r--r-- | src/map/elemental.c | 46 | ||||
-rw-r--r-- | src/map/elemental.h | 22 | ||||
-rw-r--r-- | src/map/homunculus.c | 34 | ||||
-rw-r--r-- | src/map/homunculus.h | 30 | ||||
-rw-r--r-- | src/map/itemdb.c | 4 | ||||
-rw-r--r-- | src/map/itemdb.h | 2 | ||||
-rw-r--r-- | src/map/map.h | 19 | ||||
-rw-r--r-- | src/map/mercenary.c | 30 | ||||
-rw-r--r-- | src/map/mercenary.h | 35 | ||||
-rw-r--r-- | src/map/mob.c | 50 | ||||
-rw-r--r-- | src/map/mob.h | 134 | ||||
-rw-r--r-- | src/map/script.c | 2 | ||||
-rw-r--r-- | src/map/skill.c | 164 | ||||
-rw-r--r-- | src/map/status.c | 12 |
17 files changed, 440 insertions, 171 deletions
diff --git a/src/common/mmo.h b/src/common/mmo.h index 8444a8d67..3c556636c 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -182,9 +182,6 @@ // Base Homun skill. #define HM_SKILLBASE 8001 #define MAX_HOMUNSKILL 43 -#define MAX_HOMUNCULUS_CLASS 52 // [orn] Increased to 60 from 16 to allow new Homun-S. -#define HM_CLASS_BASE 6001 -#define HM_CLASS_MAX (HM_CLASS_BASE+MAX_HOMUNCULUS_CLASS-1) // Mail System #define MAIL_MAX_INBOX 30 @@ -194,15 +191,11 @@ // Mercenary System #define MC_SKILLBASE 8201 #define MAX_MERCSKILL 40 -#define MAX_MERCENARY_CLASS 61 // Elemental System #define MAX_ELEMENTALSKILL 42 #define EL_SKILLBASE 8401 #define MAX_ELESKILLTREE 3 -#define MAX_ELEMENTAL_CLASS 12 -#define EL_CLASS_BASE 2114 -#define EL_CLASS_MAX (EL_CLASS_BASE+MAX_ELEMENTAL_CLASS-1) // The following system marks a different job ID system used by the map server, // which makes a lot more sense than the normal one. [Skotlex] diff --git a/src/map/atcommand.c b/src/map/atcommand.c index d90b4af55..c26daee54 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1992,7 +1992,7 @@ ACMD(monster) for (i = 0; i < number; i++) { int k; map->search_freecell(&sd->bl, 0, &mx, &my, range, range, 0); - k = mob->once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, eventname, size, AI_NONE|(mob_id == MOBID_EMPERIUM?0x200:0x0)); + k = mob->once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, eventname, size, AI_NONE|(mob_id == MOBID_EMPELIUM?0x200:0x0)); count += (k != 0) ? 1 : 0; } @@ -6863,8 +6863,8 @@ ACMD(hommutate) { return false; } - if (!*message) { - homun_id = 6048 + (rnd() % 4); + if (*message == '\0') { + homun_id = HOMID_EIRA + (rnd() % 4); } else { homun_id = atoi(message); } diff --git a/src/map/battle.c b/src/map/battle.c index a040d443b..69d24b299 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3336,7 +3336,7 @@ int64 battle_calc_bg_damage(struct block_list *src, struct block_list *bl, int64 if (bl->type == BL_MOB) { struct mob_data* md = BL_CAST(BL_MOB, bl); - if (flag&BF_SKILL && (md->class_ == MOBID_BLUE_CRYSTAL || md->class_ == MOBID_PINK_CRYSTAL)) + if (flag&BF_SKILL && (md->class_ == MOBID_OBJ_A2 || md->class_ == MOBID_OBJ_B2)) return 0; // Crystal cannot receive skill damage on battlegrounds } @@ -3357,7 +3357,7 @@ int64 battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int64 nullpo_retr(damage, bl); if(md && md->guardian_data) { - if(class_ == MOBID_EMPERIUM && flag&BF_SKILL) { + if (class_ == MOBID_EMPELIUM && flag&BF_SKILL) { //Skill immunity. switch (skill_id) { #ifndef RENEWAL @@ -3373,7 +3373,7 @@ int64 battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int64 if(src->type != BL_MOB) { struct guild *g = src->type == BL_PC ? ((TBL_PC *)src)->guild : guild->search(status->get_guild_id(src)); - if (class_ == MOBID_EMPERIUM && (!g || guild->checkskill(g,GD_APPROVAL) <= 0 )) + if (class_ == MOBID_EMPELIUM && (!g || guild->checkskill(g,GD_APPROVAL) <= 0)) return 0; if (g && battle_config.guild_max_castles && guild->checkcastles(g)>=battle_config.guild_max_castles) @@ -5434,7 +5434,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list wd.damage = wd.div_; // In some cases, right hand no need to have a weapon to increase damage if( flag.lh && (flag.hit || wd.damage2 > 0) ) wd.damage2 = wd.div_; - if( flag.hit && class_ == MOBID_EMPERIUM ) { + if (flag.hit && class_ == MOBID_EMPELIUM) { if(wd.damage2 > 0) { wd.damage2 = battle->attr_fix(src,target,wd.damage2,s_ele_,tstatus->def_ele, tstatus->ele_lv); wd.damage2 = battle->calc_gvg_damage(src,target,wd.damage2,wd.div_,skill_id,skill_lv,wd.flag); @@ -5964,7 +5964,7 @@ int battle_damage_area(struct block_list *bl, va_list ap) { amotion=va_arg(ap,int); dmotion=va_arg(ap,int); damage=va_arg(ap,int); - if( bl->type == BL_MOB && ((TBL_MOB*)bl)->class_ == MOBID_EMPERIUM ) + if (bl->type == BL_MOB && ((TBL_MOB*)bl)->class_ == MOBID_EMPELIUM) return 0; if( bl != src && battle->check_target(src,bl,BCT_ENEMY) > 0 ) { nullpo_ret(src); @@ -6613,7 +6613,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f } break; case BL_MER: - if (t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->class_ == MOBID_EMPERIUM && flag&BCT_ENEMY) + if (t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->class_ == MOBID_EMPELIUM && flag&BCT_ENEMY) return 0; //mercenary may not attack Emperium break; } //end switch actual src @@ -6635,7 +6635,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f return 0; } } - if( map_flag_gvg(m) && !sd->status.guild_id && t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->class_ == MOBID_EMPERIUM ) + if (map_flag_gvg(m) && !sd->status.guild_id && t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->class_ == MOBID_EMPELIUM) return 0; //If you don't belong to a guild, can't target emperium. if( t_bl->type != BL_PC ) state |= BCT_ENEMY; //Natural enemy. diff --git a/src/map/elemental.c b/src/map/elemental.c index 36dee32ba..a6fe94ab2 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -121,28 +121,32 @@ int elemental_create(struct map_session_data *sd, int class_, unsigned int lifet //per individual bonuses switch(db->class_){ - case 2114: - case 2115: - case 2116: //ATK + (Summon Agni Skill Level x 20) / HIT + (Summon Agni Skill Level x 10) + case ELEID_EL_AGNI_S: + case ELEID_EL_AGNI_M: + case ELEID_EL_AGNI_L: + //ATK + (Summon Agni Skill Level x 20) / HIT + (Summon Agni Skill Level x 10) ele.atk += summon_level * 20; ele.atk2 += summon_level * 20; ele.hit += summon_level * 10; break; - case 2117: - case 2118: - case 2119: //MDEF + (Summon Aqua Skill Level x 10) / MATK + (Summon Aqua Skill Level x 20) + case ELEID_EL_AQUA_S: + case ELEID_EL_AQUA_M: + case ELEID_EL_AQUA_L: + //MDEF + (Summon Aqua Skill Level x 10) / MATK + (Summon Aqua Skill Level x 20) ele.mdef += summon_level * 10; ele.matk += summon_level * 20; break; - case 2120: - case 2121: - case 2122: //FLEE + (Summon Ventus Skill Level x 20) / MATK + (Summon Ventus Skill Level x 10) + case ELEID_EL_VENTUS_S: + case ELEID_EL_VENTUS_M: + case ELEID_EL_VENTUS_L: + //FLEE + (Summon Ventus Skill Level x 20) / MATK + (Summon Ventus Skill Level x 10) ele.flee += summon_level * 20; ele.matk += summon_level * 10; break; - case 2123: - case 2124: - case 2125: //DEF + (Summon Tera Skill Level x 25) / ATK + (Summon Tera Skill Level x 5) + case ELEID_EL_TERA_S: + case ELEID_EL_TERA_M: + case ELEID_EL_TERA_L: + //DEF + (Summon Tera Skill Level x 25) / ATK + (Summon Tera Skill Level x 5) ele.def += summon_level * 25; ele.atk += summon_level * 5; ele.atk2 += summon_level * 5; @@ -687,17 +691,17 @@ int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_data *s if( DIFF_TICK(tick,ed->last_spdrain_time) >= 10000 ){// Drain SP every 10 seconds int sp = 5; - switch(ed->vd->class_){ - case 2115: - case 2118: - case 2121: - case 2124: + switch (ed->vd->class_) { + case ELEID_EL_AGNI_M: + case ELEID_EL_AQUA_M: + case ELEID_EL_VENTUS_M: + case ELEID_EL_TERA_M: sp = 8; break; - case 2116: - case 2119: - case 2122: - case 2125: + case ELEID_EL_AGNI_L: + case ELEID_EL_AQUA_L: + case ELEID_EL_VENTUS_L: + case ELEID_EL_TERA_L: sp = 11; break; } diff --git a/src/map/elemental.h b/src/map/elemental.h index 1618c0d15..1a98670e0 100644 --- a/src/map/elemental.h +++ b/src/map/elemental.h @@ -29,6 +29,25 @@ #include <stdarg.h> /** + * Enums + */ +/// Elemental IDs +enum elemental_id { + ELEID_EL_AGNI_S = 2114, ///< EL_AGNI_S / Agni + ELEID_EL_AGNI_M = 2115, ///< EL_AGNI_M / Agni + ELEID_EL_AGNI_L = 2116, ///< EL_AGNI_L / Agni + ELEID_EL_AQUA_S = 2117, ///< EL_AQUA_S / Aqua + ELEID_EL_AQUA_M = 2118, ///< EL_AQUA_M / Aqua + ELEID_EL_AQUA_L = 2119, ///< EL_AQUA_L / Aqua + ELEID_EL_VENTUS_S = 2120, ///< EL_VENTUS_S / Ventus + ELEID_EL_VENTUS_M = 2121, ///< EL_VENTUS_M / Ventus + ELEID_EL_VENTUS_L = 2122, ///< EL_VENTUS_L / Ventus + ELEID_EL_TERA_S = 2123, ///< EL_TERA_S / Tera + ELEID_EL_TERA_M = 2124, ///< EL_TERA_M / Tera + ELEID_EL_TERA_L = 2125, ///< EL_TERA_L / Tera +}; + +/** * Defines **/ #define MIN_ELETHINKTIME 100 @@ -40,6 +59,9 @@ #define EL_SKILLMODE_PASIVE 0x1 #define EL_SKILLMODE_ASSIST 0x2 #define EL_SKILLMODE_AGGRESSIVE 0x4 +#define MAX_ELEMENTAL_CLASS 12 +#define EL_CLASS_BASE ELEID_EL_AGNI_S +#define EL_CLASS_MAX (EL_CLASS_BASE+MAX_ELEMENTAL_CLASS-1) #define elemental_stop_walking(ed, type) (unit->stop_walking(&(ed)->bl, (type))) #define elemental_stop_attack(ed) (unit->stop_attack(&(ed)->bl)) diff --git a/src/map/homunculus.c b/src/map/homunculus.c index 2e74800a3..ac1c4052b 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -73,23 +73,31 @@ struct view_data* homunculus_get_viewdata(int class_) { enum homun_type homunculus_class2type(int class_) { switch(class_) { // Normal Homunculus - case 6001: case 6005: - case 6002: case 6006: - case 6003: case 6007: - case 6004: case 6008: + case HOMID_LIF: + case HOMID_AMISTR: + case HOMID_FILIR: + case HOMID_VANILMIRTH: + case HOMID_LIF2: + case HOMID_AMISTR2: + case HOMID_FILIR2: + case HOMID_VANILMIRTH2: return HT_REG; // Evolved Homunculus - case 6009: case 6013: - case 6010: case 6014: - case 6011: case 6015: - case 6012: case 6016: + case HOMID_LIF_E: + case HOMID_AMISTR_E: + case HOMID_FILIR_E: + case HOMID_VANILMIRTH_E: + case HOMID_LIF2_E: + case HOMID_AMISTR2_E: + case HOMID_FILIR2_E: + case HOMID_VANILMIRTH2_E: return HT_EVO; // Homunculus S - case 6048: - case 6049: - case 6050: - case 6051: - case 6052: + case HOMID_EIRA: + case HOMID_BAYERI: + case HOMID_SERA: + case HOMID_DIETR: + case HOMID_ELEANOR: return HT_S; default: return HT_INVALID; diff --git a/src/map/homunculus.h b/src/map/homunculus.h index 9582c875c..1712c98a9 100644 --- a/src/map/homunculus.h +++ b/src/map/homunculus.h @@ -28,6 +28,36 @@ struct map_session_data; +/// Homunuculus IDs +enum homun_id { + HOMID_LIF = 6001, ///< Lif + HOMID_AMISTR = 6002, ///< Amistr + HOMID_FILIR = 6003, ///< Filir + HOMID_VANILMIRTH = 6004, ///< Vanilmirth + HOMID_LIF2 = 6005, ///< Lif (Alternate) + HOMID_AMISTR2 = 6006, ///< Amistr (Alternate) + HOMID_FILIR2 = 6007, ///< Filir (Alternate) + HOMID_VANILMIRTH2 = 6008, ///< Vanilmirth (Alternate) + HOMID_LIF_E = 6009, ///< Lif (Evolved) + HOMID_AMISTR_E = 6010, ///< Amistr (Evolved) + HOMID_FILIR_E = 6011, ///< Filir (Evolved) + HOMID_VANILMIRTH_E = 6012, ///< Vanilmirth (Evolved) + HOMID_LIF2_E = 6013, ///< Lif (Alternate, Evolved) + HOMID_AMISTR2_E = 6014, ///< Amistr (Alternate, Evolved) + HOMID_FILIR2_E = 6015, ///< Filir (Alternate, Evolved) + HOMID_VANILMIRTH2_E = 6016, ///< Vanilmirth (Alternate, Evolved) + + HOMID_EIRA = 6048, ///< Eira + HOMID_BAYERI = 6049, ///< Bayeri + HOMID_SERA = 6050, ///< Sera + HOMID_DIETR = 6051, ///< Dietr + HOMID_ELEANOR = 6052, ///< Eleanor +}; + +#define MAX_HOMUNCULUS_CLASS 52 // [orn] Increased to 60 from 16 to allow new Homun-S. +#define HM_CLASS_BASE 6001 +#define HM_CLASS_MAX (HM_CLASS_BASE+MAX_HOMUNCULUS_CLASS-1) + #define MAX_HOM_SKILL_REQUIRE 5 #define homdb_checkid(id) ((id) >= HM_CLASS_BASE && (id) <= HM_CLASS_MAX) #define homun_alive(x) ((x) && (x)->homunculus.vaporize == HOM_ST_ACTIVE && (x)->battle_status.hp > 0) diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 54458d248..2894463de 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -2095,9 +2095,9 @@ void itemdb_reload(void) { //Epoque's awesome @reloaditemdb fix - thanks! [Ind] //- Fixes the need of a @reloadmobdb after a @reloaditemdb to re-link monster drop data - for( i = 0; i < MAX_MOB_DB; i++ ) { + for (i = 0; i < MAX_MOB_DB; i++) { struct mob_db *entry; - if( !((i < 1324 || i > 1363) && (i < 1938 || i > 1946)) ) + if ((i >= MOBID_TREASURE_BOX1 && i <= MOBID_TREASURE_BOX40) || (i >= MOBID_TREASURE_BOX41 && i <= MOBID_TREASURE_BOX49)) continue; entry = mob->db(i); for(d = 0; d < MAX_MOB_DROP; d++) { diff --git a/src/map/itemdb.h b/src/map/itemdb.h index f508f5c1d..5ea22b190 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -104,6 +104,8 @@ enum item_itemid { ITEMID_FRAGMENT_OF_CRYSTAL = 7321, ITEMID_SKULL_ = 7420, ITEMID_TOKEN_OF_SIEGFRIED = 7621, + ITEMID_GOLD_KEY77 = 7782, + ITEMID_SILVER_KEY77 = 7783, ITEMID_TRAP_ALLOY = 7940, ITEMID_RED_POUCH_OF_SURPRISE = 12024, ITEMID_BLOODY_DEAD_BRANCH = 12103, diff --git a/src/map/map.h b/src/map/map.h index d31b1c5d3..896c12f23 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -62,25 +62,6 @@ enum E_MAPSERVER_ST { #define block_free_max 1048576 #define BL_LIST_MAX 1048576 - -// Added definitions for WoESE objects. [L0ne_W0lf] -enum MOBID { - MOBID_EMPERIUM = 1288, - MOBID_TREASURE_01 = 1324, - MOBID_TREASURE_40 = 1363, - MOBID_BARRICADE1 = 1905, - MOBID_BARRICADE2, - MOBID_GUARDIAN_STONE1, - MOBID_GUARDIAN_STONE2, - MOBID_FOOD_STORAGE, - MOBID_BLUE_CRYSTAL = 1914, - MOBID_PINK_CRYSTAL, - MOBID_TREASURE_41 = 1938, - MOBID_TREASURE_49 = 1946, - MOBID_SILVERSNIPER = 2042, - MOBID_MAGICDECOY_WIND = 2046, -}; - // For filtering and quick checking. #define MAPID_BASEMASK 0x00ff #define MAPID_UPPERMASK 0x0fff diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 4e3c8508d..fb801a8da 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -127,11 +127,11 @@ int mercenary_get_guild(struct mercenary_data *md) class_ = md->db->class_; - if( class_ >= 6017 && class_ <= 6026 ) + if (class_ >= MERID_MER_ARCHER01 && class_ <= MERID_MER_ARCHER10) return ARCH_MERC_GUILD; - if( class_ >= 6027 && class_ <= 6036 ) + if (class_ >= MERID_MER_LANCER01 && class_ <= MERID_MER_LANCER10) return SPEAR_MERC_GUILD; - if( class_ >= 6037 && class_ <= 6046 ) + if (class_ >= MERID_MER_SWORDMAN01 && class_ <= MERID_MER_SWORDMAN10) return SWORD_MERC_GUILD; return -1; @@ -147,11 +147,11 @@ int mercenary_get_faith(struct mercenary_data *md) class_ = md->db->class_; - if( class_ >= 6017 && class_ <= 6026 ) + if (class_ >= MERID_MER_ARCHER01 && class_ <= MERID_MER_ARCHER10) return sd->status.arch_faith; - if( class_ >= 6027 && class_ <= 6036 ) + if (class_ >= MERID_MER_LANCER01 && class_ <= MERID_MER_LANCER10) return sd->status.spear_faith; - if( class_ >= 6037 && class_ <= 6046 ) + if (class_ >= MERID_MER_SWORDMAN01 && class_ <= MERID_MER_SWORDMAN10) return sd->status.sword_faith; return 0; @@ -167,11 +167,11 @@ int mercenary_set_faith(struct mercenary_data *md, int value) class_ = md->db->class_; - if( class_ >= 6017 && class_ <= 6026 ) + if (class_ >= MERID_MER_ARCHER01 && class_ <= MERID_MER_ARCHER10) faith = &sd->status.arch_faith; - else if( class_ >= 6027 && class_ <= 6036 ) + else if (class_ >= MERID_MER_LANCER01 && class_ <= MERID_MER_LANCER10) faith = &sd->status.spear_faith; - else if( class_ >= 6037 && class_ <= 6046 ) + else if (class_ >= MERID_MER_SWORDMAN01 && class_ <= MERID_MER_SWORDMAN10) faith = &sd->status.sword_faith; else return 0; @@ -193,11 +193,11 @@ int mercenary_get_calls(struct mercenary_data *md) class_ = md->db->class_; - if( class_ >= 6017 && class_ <= 6026 ) + if (class_ >= MERID_MER_ARCHER01 && class_ <= MERID_MER_ARCHER10) return sd->status.arch_calls; - if( class_ >= 6027 && class_ <= 6036 ) + if (class_ >= MERID_MER_LANCER01 && class_ <= MERID_MER_LANCER10) return sd->status.spear_calls; - if( class_ >= 6037 && class_ <= 6046 ) + if (class_ >= MERID_MER_SWORDMAN01 && class_ <= MERID_MER_SWORDMAN10) return sd->status.sword_calls; return 0; @@ -213,11 +213,11 @@ int mercenary_set_calls(struct mercenary_data *md, int value) class_ = md->db->class_; - if( class_ >= 6017 && class_ <= 6026 ) + if (class_ >= MERID_MER_ARCHER01 && class_ <= MERID_MER_ARCHER10) calls = &sd->status.arch_calls; - else if( class_ >= 6027 && class_ <= 6036 ) + else if (class_ >= MERID_MER_LANCER01 && class_ <= MERID_MER_LANCER10) calls = &sd->status.spear_calls; - else if( class_ >= 6037 && class_ <= 6046 ) + else if (class_ >= MERID_MER_SWORDMAN01 && class_ <= MERID_MER_SWORDMAN10) calls = &sd->status.sword_calls; else return 0; diff --git a/src/map/mercenary.h b/src/map/mercenary.h index 05adc1fce..1b3453a84 100644 --- a/src/map/mercenary.h +++ b/src/map/mercenary.h @@ -27,6 +27,7 @@ struct map_session_data; +#define MAX_MERCENARY_CLASS 61 // number of cells that a mercenary can walk to from it's master before being warped #define MAX_MER_DISTANCE 15 @@ -36,6 +37,40 @@ enum { SWORD_MERC_GUILD, }; +/// Mercenary IDs +enum merc_id { + MERID_MER_ARCHER01 = 6017, ///< MER_ARCHER01 / Mina + MERID_MER_ARCHER02 = 6018, ///< MER_ARCHER02 / Dororu + MERID_MER_ARCHER03 = 6019, ///< MER_ARCHER03 / Nami + MERID_MER_ARCHER04 = 6020, ///< MER_ARCHER04 / Elfin + MERID_MER_ARCHER05 = 6021, ///< MER_ARCHER05 / Clara + MERID_MER_ARCHER06 = 6022, ///< MER_ARCHER06 / Dali + MERID_MER_ARCHER07 = 6023, ///< MER_ARCHER07 / Karaya + MERID_MER_ARCHER08 = 6024, ///< MER_ARCHER08 / Hiyori + MERID_MER_ARCHER09 = 6025, ///< MER_ARCHER09 / Kero + MERID_MER_ARCHER10 = 6026, ///< MER_ARCHER10 / Sukye + MERID_MER_LANCER01 = 6027, ///< MER_LANCER01 / Rodin + MERID_MER_LANCER02 = 6028, ///< MER_LANCER02 / Lancer + MERID_MER_LANCER03 = 6029, ///< MER_LANCER03 / Nathan + MERID_MER_LANCER04 = 6030, ///< MER_LANCER04 / Roan + MERID_MER_LANCER05 = 6031, ///< MER_LANCER05 / Orizaro + MERID_MER_LANCER06 = 6032, ///< MER_LANCER06 / Thyla + MERID_MER_LANCER07 = 6033, ///< MER_LANCER07 / Ben + MERID_MER_LANCER08 = 6034, ///< MER_LANCER08 / Pinaka + MERID_MER_LANCER09 = 6035, ///< MER_LANCER09 / Kuhlmann + MERID_MER_LANCER10 = 6036, ///< MER_LANCER10 / Roux + MERID_MER_SWORDMAN01 = 6037, ///< MER_SWORDMAN01 / David + MERID_MER_SWORDMAN02 = 6038, ///< MER_SWORDMAN02 / Ellen + MERID_MER_SWORDMAN03 = 6039, ///< MER_SWORDMAN03 / Luise + MERID_MER_SWORDMAN04 = 6040, ///< MER_SWORDMAN04 / Frank + MERID_MER_SWORDMAN05 = 6041, ///< MER_SWORDMAN05 / Ryan + MERID_MER_SWORDMAN06 = 6042, ///< MER_SWORDMAN06 / Paolo + MERID_MER_SWORDMAN07 = 6043, ///< MER_SWORDMAN07 / Jens + MERID_MER_SWORDMAN08 = 6044, ///< MER_SWORDMAN08 / Thierry + MERID_MER_SWORDMAN09 = 6045, ///< MER_SWORDMAN09 / Steven + MERID_MER_SWORDMAN10 = 6046, ///< MER_SWORDMAN10 / Wayne +}; + struct s_mercenary_db { int class_; char sprite[NAME_LENGTH], name[NAME_LENGTH]; diff --git a/src/map/mob.c b/src/map/mob.c index d8fefa61a..16b5417b9 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -495,7 +495,7 @@ int mob_once_spawn(struct map_session_data* sd, int16 m, int16 x, int16 y, const if (!md) continue; - if ( class_ == MOBID_EMPERIUM && !no_guardian_data ) { + if (class_ == MOBID_EMPELIUM && !no_guardian_data) { struct guild_castle* gc = guild->mapindex2gc(map_id2index(m)); struct guild* g = (gc) ? guild->search(gc->guild_id) : NULL; if( gc ) { @@ -603,7 +603,7 @@ int mob_spawn_guardian_sub(int tid, int64 tick, int id, intptr_t data) { if( g == NULL ) { //Liberate castle, if the guild is not found this is an error! [Skotlex] ShowError("mob_spawn_guardian_sub: Couldn't load guild %d!\n", (int)data); //Not sure this is the best way, but otherwise we'd be invoking this for ALL guardians spawned later on. - if( md->class_ == MOBID_EMPERIUM && md->guardian_data ) { + if (md->class_ == MOBID_EMPELIUM && md->guardian_data) { md->guardian_data->g = NULL; if( md->guardian_data->castle->guild_id ) {//Free castle up. ShowNotice("Clearing ownership of castle %d (%s)\n", md->guardian_data->castle->castle_id, md->guardian_data->castle->castle_name); @@ -2412,7 +2412,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { * so while we discuss, for a small period of time, the list is hardcoded (yes officially only those 2 use it, * thus why we're unsure on how to best place the setting) */ /* temp, will not be hardcoded for long thudu. */ - if( it->nameid == 7782 || it->nameid == 7783 ) /* for when not hardcoded: add a check on mvp bonus drop as well */ + if (it->nameid == ITEMID_GOLD_KEY77 || it->nameid == ITEMID_SILVER_KEY77) /* for when not hardcoded: add a check on mvp bonus drop as well */ clif->item_drop_announce(mvp_sd, it->nameid, md->name); // Announce first, or else ditem will be freed. [Lance] @@ -2572,7 +2572,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { logs->mvpdrop(mvp_sd, md->class_, log_mvp); } - if (type&2 && !sd && md->class_ == MOBID_EMPERIUM && md->guardian_data) { + if (type&2 && !sd && md->class_ == MOBID_EMPELIUM && md->guardian_data) { //Emperium destroyed by script. Discard mvp character. [Skotlex] mvp_sd = NULL; } @@ -2697,9 +2697,10 @@ int mob_guardian_guildchange(struct mob_data *md) if (md->guardian_data->castle->guild_id == 0) { //Castle with no owner? Delete the guardians. - if( md->class_ == MOBID_EMPERIUM ) //But don't delete the emperium, just clear it's guild-data + if (md->class_ == MOBID_EMPELIUM) { + //But don't delete the emperium, just clear it's guild-data md->guardian_data->g = NULL; - else { + } else { if (md->guardian_data->number >= 0 && md->guardian_data->number < MAX_GUARDIANS && md->guardian_data->castle->guardian[md->guardian_data->number].visible) guild->castledatasave(md->guardian_data->castle->castle_id, 10+md->guardian_data->number, 0); unit->free(&md->bl,CLR_OUTSIGHT); //Remove guardian. @@ -3831,7 +3832,7 @@ void mob_read_db_drops_sub(struct mob_db *entry, struct status_data *mstatus, in continue; } type = id->type; - if ((class_ >= 1324 && class_ <= 1363) || (class_ >= 1938 && class_ <= 1946)) { + if ((class_ >= MOBID_TREASURE_BOX1 && class_ <= MOBID_TREASURE_BOX40) || (class_ >= MOBID_TREASURE_BOX41 && class_ <= MOBID_TREASURE_BOX49)) { //Treasure box drop rates [Skotlex] rate_adjust = battle_config.item_rate_treasure; ratemin = battle_config.item_drop_treasure_min; @@ -3872,8 +3873,10 @@ void mob_read_db_drops_sub(struct mob_db *entry, struct status_data *mstatus, in entry->dropitem[idx].p = mob->drop_adjust(value, rate_adjust, ratemin, ratemax); //calculate and store Max available drop chance of the item - if (entry->dropitem[idx].p && (class_ < 1324 || class_ > 1363) && (class_ < 1938 || class_ > 1946)) - { //Skip treasure chests. + if (entry->dropitem[idx].p + && (class_ < MOBID_TREASURE_BOX1 || class_ > MOBID_TREASURE_BOX40) + && (class_ < MOBID_TREASURE_BOX41 || class_ > MOBID_TREASURE_BOX49)) { + //Skip treasure chests. if (id->maxchance == -1 || (id->maxchance < entry->dropitem[idx].p) ) { id->maxchance = entry->dropitem[idx].p; //item has bigger drop chance or sold in shops } @@ -4385,7 +4388,7 @@ int mob_read_randommonster(void) for (i = 0; i < ARRAYLENGTH(mobfile) && i < MAX_RANDOMMONSTER; i++) { FILE *fp; unsigned int count = 0; - mob->db_data[0]->summonper[i] = 1002; // Default fallback value, in case the database does not provide one + mob->db_data[0]->summonper[i] = MOBID_PORING; // Default fallback value, in case the database does not provide one sprintf(line, "%s/%s", map->db_path, mobfile[i]); fp=fopen(line,"r"); if(fp==NULL){ @@ -5009,9 +5012,30 @@ int do_final_mob(void) void mob_defaults(void) { // Defines the Manuk/Splendide/Mora mob groups for the status reductions [Epoque & Frost] - const int mob_manuk[8] = { 1986, 1987, 1988, 1989, 1990, 1997, 1998, 1999 }; - const int mob_splendide[5] = { 1991, 1992, 1993, 1994, 1995 }; - const int mob_mora[5] = { 2137, 2136, 2134, 2133, 2132 }; + const int mob_manuk[8] = { + MOBID_TATACHO, + MOBID_CENTIPEDE, + MOBID_NEPENTHES, + MOBID_HILLSRION, + MOBID_HARDROCK_MOMMOTH, + MOBID_G_TATACHO, + MOBID_G_HILLSRION, + MOBID_CENTIPEDE_LARVA, + }; + const int mob_splendide[5] = { + MOBID_TENDRILRION, + MOBID_CORNUS, + MOBID_NAGA, + MOBID_LUCIOLA_VESPA, + MOBID_PINGUICULA, + }; + const int mob_mora[5] = { + MOBID_POM_SPIDER, + MOBID_ANGRA_MANTIS, + MOBID_PARUS, + MOBID_LITTLE_FATUM, + MOBID_MIMING, + }; mob = &mob_s; diff --git a/src/map/mob.h b/src/map/mob.h index 48b44aab3..5485b2a91 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -268,6 +268,134 @@ enum { MSC_SPAWN, }; +/** + * Mob IDs + */ +enum mob_id { + MOBID_PORING = 1002, ///< PORING / Poring + + MOBID_HORNET = 1004, ///< HORNET / Hornet + + MOBID_RED_PLANT = 1078, ///< RED_PLANT / Red Plant + MOBID_BLUE_PLANT = 1079, ///< BLUE_PLANT / Blue Plant + MOBID_GREEN_PLANT = 1080, ///< GREEN_PLANT / Green Plant + MOBID_YELLOW_PLANT = 1081, ///< YELLOW_PLANT / Yellow Plant + MOBID_WHITE_PLANT = 1082, ///< WHITE_PLANT / White Plant + MOBID_SHINING_PLANT = 1083, ///< SHINING_PLANT / Shining Plant + MOBID_BLACK_MUSHROOM = 1084, ///< BLACK_MUSHROOM / Black Mushroom + MOBID_RED_MUSHROOM = 1085, ///< RED_MUSHROOM / Red Mushroom + + MOBID_MARINE_SPHERE = 1142, ///< MARINE_SPHERE / Marine Sphere + + MOBID_EMPELIUM = 1288, ///< EMPELIUM / Emperium + + MOBID_GIANT_HONET = 1303, ///< GIANT_HONET / Giant Hornet + + MOBID_TREASURE_BOX1 = 1324, ///< TREASURE_BOX1 / Treasure Chest + MOBID_TREASURE_BOX2 = 1325, ///< TREASURE_BOX2 / Treasure Chest + MOBID_TREASURE_BOX3 = 1326, ///< TREASURE_BOX3 / Treasure Chest + MOBID_TREASURE_BOX4 = 1327, ///< TREASURE_BOX4 / Treasure Chest + MOBID_TREASURE_BOX5 = 1328, ///< TREASURE_BOX5 / Treasure Chest + MOBID_TREASURE_BOX6 = 1329, ///< TREASURE_BOX6 / Treasure Chest + MOBID_TREASURE_BOX7 = 1330, ///< TREASURE_BOX7 / Treasure Chest + MOBID_TREASURE_BOX8 = 1331, ///< TREASURE_BOX8 / Treasure Chest + MOBID_TREASURE_BOX9 = 1332, ///< TREASURE_BOX9 / Treasure Chest + MOBID_TREASURE_BOX10 = 1333, ///< TREASURE_BOX10 / Treasure Chest + MOBID_TREASURE_BOX11 = 1334, ///< TREASURE_BOX11 / Treasure Chest + MOBID_TREASURE_BOX12 = 1335, ///< TREASURE_BOX12 / Treasure Chest + MOBID_TREASURE_BOX13 = 1336, ///< TREASURE_BOX13 / Treasure Chest + MOBID_TREASURE_BOX14 = 1337, ///< TREASURE_BOX14 / Treasure Chest + MOBID_TREASURE_BOX15 = 1338, ///< TREASURE_BOX15 / Treasure Chest + MOBID_TREASURE_BOX16 = 1339, ///< TREASURE_BOX16 / Treasure Chest + MOBID_TREASURE_BOX17 = 1340, ///< TREASURE_BOX17 / Treasure Chest + MOBID_TREASURE_BOX18 = 1341, ///< TREASURE_BOX18 / Treasure Chest + MOBID_TREASURE_BOX19 = 1342, ///< TREASURE_BOX19 / Treasure Chest + MOBID_TREASURE_BOX20 = 1343, ///< TREASURE_BOX20 / Treasure Chest + MOBID_TREASURE_BOX21 = 1344, ///< TREASURE_BOX21 / Treasure Chest + MOBID_TREASURE_BOX22 = 1345, ///< TREASURE_BOX22 / Treasure Chest + MOBID_TREASURE_BOX23 = 1346, ///< TREASURE_BOX23 / Treasure Chest + MOBID_TREASURE_BOX24 = 1347, ///< TREASURE_BOX24 / Treasure Chest + MOBID_TREASURE_BOX25 = 1348, ///< TREASURE_BOX25 / Treasure Chest + MOBID_TREASURE_BOX26 = 1349, ///< TREASURE_BOX26 / Treasure Chest + MOBID_TREASURE_BOX27 = 1350, ///< TREASURE_BOX27 / Treasure Chest + MOBID_TREASURE_BOX28 = 1351, ///< TREASURE_BOX28 / Treasure Chest + MOBID_TREASURE_BOX29 = 1352, ///< TREASURE_BOX29 / Treasure Chest + MOBID_TREASURE_BOX30 = 1353, ///< TREASURE_BOX30 / Treasure Chest + MOBID_TREASURE_BOX31 = 1354, ///< TREASURE_BOX31 / Treasure Chest + MOBID_TREASURE_BOX32 = 1355, ///< TREASURE_BOX32 / Treasure Chest + MOBID_TREASURE_BOX33 = 1356, ///< TREASURE_BOX33 / Treasure Chest + MOBID_TREASURE_BOX34 = 1357, ///< TREASURE_BOX34 / Treasure Chest + MOBID_TREASURE_BOX35 = 1358, ///< TREASURE_BOX35 / Treasure Chest + MOBID_TREASURE_BOX36 = 1359, ///< TREASURE_BOX36 / Treasure Chest + MOBID_TREASURE_BOX37 = 1360, ///< TREASURE_BOX37 / Treasure Chest + MOBID_TREASURE_BOX38 = 1361, ///< TREASURE_BOX38 / Treasure Chest + MOBID_TREASURE_BOX39 = 1362, ///< TREASURE_BOX39 / Treasure Chest + MOBID_TREASURE_BOX40 = 1363, ///< TREASURE_BOX40 / Treasure Chest + + MOBID_G_PARASITE = 1555, ///< G_PARASITE / Parasite + MOBID_G_FLORA = 1575, ///< G_FLORA / Flora + MOBID_G_HYDRA = 1579, ///< G_HYDRA / Hydra + MOBID_G_MANDRAGORA = 1589, ///< G_MANDRAGORA / Mandragora + MOBID_G_GEOGRAPHER = 1590, ///< G_GEOGRAPHER / Geographer + + MOBID_BARRICADE = 1905, ///< BARRICADE / Barricade + MOBID_BARRICADE_ = 1906, ///< BARRICADE_ / Barricade + MOBID_S_EMPEL_1 = 1907, ///< S_EMPEL_1 / Guardian Stone + MOBID_S_EMPEL_2 = 1908, ///< S_EMPEL_2 / Guardian Stone + MOBID_OBJ_A = 1909, ///< OBJ_A / Food Storage + MOBID_OBJ_B = 1910, ///< OBJ_B / Food Depot + MOBID_OBJ_NEUTRAL = 1911, ///< OBJ_NEUTRAL / Neutrality Flag + MOBID_OBJ_FLAG_A = 1912, ///< OBJ_FLAG_A / Lion Flag + MOBID_OBJ_FLAG_B = 1913, ///< OBJ_FLAG_B / Eagle Flag + MOBID_OBJ_A2 = 1914, ///< OBJ_A2 / Blue Crystal + MOBID_OBJ_B2 = 1915, ///< OBJ_B2 / Pink Crystal + + MOBID_TREASURE_BOX41 = 1938, ///< TREASURE_BOX41 / Treasure Chest + MOBID_TREASURE_BOX42 = 1939, ///< TREASURE_BOX42 / Treasure Chest + MOBID_TREASURE_BOX43 = 1940, ///< TREASURE_BOX43 / Treasure Chest + MOBID_TREASURE_BOX44 = 1941, ///< TREASURE_BOX44 / Treasure Chest + MOBID_TREASURE_BOX45 = 1942, ///< TREASURE_BOX45 / Treasure Chest + MOBID_TREASURE_BOX46 = 1943, ///< TREASURE_BOX46 / Treasure Chest + MOBID_TREASURE_BOX47 = 1944, ///< TREASURE_BOX47 / Treasure Chest + MOBID_TREASURE_BOX48 = 1945, ///< TREASURE_BOX48 / Treasure Chest + MOBID_TREASURE_BOX49 = 1946, ///< TREASURE_BOX49 / Treasure Chest + + // Manuk + MOBID_TATACHO = 1986, ///< TATACHO / Tatacho + MOBID_CENTIPEDE = 1987, ///< CENTIPEDE / Centipede + MOBID_NEPENTHES = 1988, ///< NEPENTHES / Nepenthes + MOBID_HILLSRION = 1989, ///< HILLSRION / Hillslion + MOBID_HARDROCK_MOMMOTH = 1990, ///< HARDROCK_MOMMOTH / Hardrock Mammoth + + // Splendide + MOBID_TENDRILRION = 1991, ///< TENDRILRION / Tenrillion + MOBID_CORNUS = 1992, ///< CORNUS / Cornus + MOBID_NAGA = 1993, ///< NAGA / Naga + MOBID_LUCIOLA_VESPA = 1994, ///< LUCIOLA_VESPA / Luciola Vespa + MOBID_PINGUICULA = 1995, ///< PINGUICULA / Pinguicola + + // Manuk (continue) + MOBID_G_TATACHO = 1997, ///< G_TATACHO / Tatacho + MOBID_G_HILLSRION = 1998, ///< G_HILLSRION / Hillslion + MOBID_CENTIPEDE_LARVA = 1999, ///< CENTIPEDE_LARVA / Centipede Larva + + MOBID_SILVERSNIPER = 2042, ///< SILVERSNIPER / Silver Sniper + MOBID_MAGICDECOY_FIRE = 2043, ///< MAGICDECOY_FIRE / Magic Decoy + MOBID_MAGICDECOY_WATER = 2044, ///< MAGICDECOY_WATER / Magic Decoy + MOBID_MAGICDECOY_EARTH = 2045, ///< MAGICDECOY_EARTH / Magic Decoy + MOBID_MAGICDECOY_WIND = 2046, ///< MAGICDECOY_WIND / Magic Decoy + + // Mora + MOBID_POM_SPIDER = 2132, ///< POM_SPIDER / Pom Spider + MOBID_ANGRA_MANTIS = 2133, ///< ANGRA_MANTIS / Angra Mantis + MOBID_PARUS = 2134, ///< PARUS / Parus + //... + MOBID_LITTLE_FATUM = 2136, ///< LITTLE_FATUM / Little Fatum + MOBID_MIMING = 2137, ///< MIMING / Miming + + MOBID_KO_KAGE = 2308, ///< KO_KAGE / Zanzou +}; + // The data structures for storing delayed item drops struct item_drop { struct item item_data; @@ -283,9 +411,9 @@ struct item_drop_list { #define mob_stop_walking(md, type) (unit->stop_walking(&(md)->bl, (type))) #define mob_stop_attack(md) (unit->stop_attack(&(md)->bl)) -#define mob_is_battleground(md) (map->list[(md)->bl.m].flag.battleground && ((md)->class_ == MOBID_BARRICADE2 || ((md)->class_ >= MOBID_FOOD_STORAGE && (md)->class_ <= MOBID_PINK_CRYSTAL))) -#define mob_is_gvg(md) (map->list[(md)->bl.m].flag.gvg_castle && ( (md)->class_ == MOBID_EMPERIUM || (md)->class_ == MOBID_BARRICADE1 || (md)->class_ == MOBID_GUARDIAN_STONE1 || (md)->class_ == MOBID_GUARDIAN_STONE2)) -#define mob_is_treasure(md) (((md)->class_ >= MOBID_TREASURE_01 && (md)->class_ <= MOBID_TREASURE_40) || ((md)->class_ >= MOBID_TREASURE_41 && (md)->class_ <= MOBID_TREASURE_49)) +#define mob_is_battleground(md) (map->list[(md)->bl.m].flag.battleground && ((md)->class_ == MOBID_BARRICADE_ || ((md)->class_ >= MOBID_OBJ_A && (md)->class_ <= MOBID_OBJ_B2))) +#define mob_is_gvg(md) (map->list[(md)->bl.m].flag.gvg_castle && ( (md)->class_ == MOBID_EMPELIUM || (md)->class_ == MOBID_BARRICADE || (md)->class_ == MOBID_S_EMPEL_1 || (md)->class_ == MOBID_S_EMPEL_2)) +#define mob_is_treasure(md) (((md)->class_ >= MOBID_TREASURE_BOX1 && (md)->class_ <= MOBID_TREASURE_BOX40) || ((md)->class_ >= MOBID_TREASURE_BOX41 && (md)->class_ <= MOBID_TREASURE_BOX49)) struct mob_interface { // Dynamic mob database, allows saving of memory when there's big gaps in the mob_db [Skotlex] diff --git a/src/map/script.c b/src/map/script.c index b29794ec3..591bca68f 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -12121,7 +12121,7 @@ int buildin_maprespawnguildid_sub_mob(struct block_list *bl,va_list ap) { struct mob_data *md=(struct mob_data *)bl; - if(!md->guardian_data && md->class_ != MOBID_EMPERIUM) + if (md->guardian_data == NULL && md->class_ != MOBID_EMPELIUM) status_kill(bl); return 0; diff --git a/src/map/skill.c b/src/map/skill.c index 72363b9e3..dc3ebe62e 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2088,7 +2088,7 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in switch (target->type) { case BL_MOB: { struct mob_data* md = BL_CAST(BL_MOB, target); - if( md->class_ == MOBID_EMPERIUM ) + if (md->class_ == MOBID_EMPELIUM) return 0; if(src != target && is_boss(target)) // Bosses can't be knocked-back return 0; @@ -3032,7 +3032,7 @@ int skill_check_unit_range2_sub (struct block_list *bl, va_list ap) { if( skill_id == HP_BASILICA && bl->type == BL_PC ) return 0; - if( skill_id == AM_DEMONSTRATION && bl->type == BL_MOB && ((TBL_MOB*)bl)->class_ == MOBID_EMPERIUM ) + if (skill_id == AM_DEMONSTRATION && bl->type == BL_MOB && ((TBL_MOB*)bl)->class_ == MOBID_EMPELIUM) return 0; //Allow casting Bomb/Demonstration Right under emperium [Skotlex] return 1; } @@ -4999,15 +4999,13 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) { break; } - if( ud->skill_id >= SL_SKE && ud->skill_id <= SL_SKA && target->type == BL_MOB ) - { - if( ((TBL_MOB*)target)->class_ == MOBID_EMPERIUM ) + if (ud->skill_id >= SL_SKE && ud->skill_id <= SL_SKA && target->type == BL_MOB) { + if (((TBL_MOB*)target)->class_ == MOBID_EMPELIUM) break; - } - else if (inf && battle->check_target(src, target, inf) <= 0){ + } else if (inf && battle->check_target(src, target, inf) <= 0) { if (sd) clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0); break; - } else if( ud->skill_id == RK_PHANTOMTHRUST && target->type != BL_MOB ) { + } else if (ud->skill_id == RK_PHANTOMTHRUST && target->type != BL_MOB) { if( !map_flag_vs(src->m) && battle->check_target(src,target,BCT_PARTY) <= 0 ) break; // You can use Phantom Thurst on party members in normal maps too. [pakpil] } @@ -5404,7 +5402,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if (skill_id == AB_HIGHNESSHEAL) { heal = heal * (17 + 3 * skill_lv) / 10; } - if (status->isimmune(bl) || (dstmd && (dstmd->class_ == MOBID_EMPERIUM || mob_is_battleground(dstmd)))) + if (status->isimmune(bl) || (dstmd != NULL && (dstmd->class_ == MOBID_EMPELIUM || mob_is_battleground(dstmd)))) heal = 0; if (sd && dstsd && sd->status.partner_id == dstsd->status.char_id && (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.sex == 0) @@ -5650,7 +5648,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); break; } - class_ = skill_id==SA_MONOCELL?1002:mob->get_random_id(4, 1, 0); + class_ = skill_id == SA_MONOCELL ? MOBID_PORING : mob->get_random_id(4, 1, 0); clif->skill_nodamage(src,bl,skill_id,skill_lv,1); mob->class_change(dstmd,class_); if( tsc && dstmd->status.mode&MD_BOSS ) @@ -6652,7 +6650,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); break; } - if( dstmd && dstmd->class_ == MOBID_EMPERIUM ) + if (dstmd && dstmd->class_ == MOBID_EMPELIUM) break; // Cannot be Used on Emperium clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); @@ -6845,7 +6843,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin { int i,sp = 0; int64 hp = 0; - if( dstmd && dstmd->class_ == MOBID_EMPERIUM ) { + if (dstmd && dstmd->class_ == MOBID_EMPELIUM) { map->freeblock_unlock(); return 1; } @@ -7622,7 +7620,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin // Slim Pitcher case CR_SLIMPITCHER: // Updated to block Slim Pitcher from working on barricades and guardian stones. - if (dstmd && (dstmd->class_ == MOBID_EMPERIUM || (dstmd->class_ >= MOBID_BARRICADE1 && dstmd->class_ <= MOBID_GUARDIAN_STONE2))) + if (dstmd != NULL && (dstmd->class_ == MOBID_EMPELIUM || (dstmd->class_ >= MOBID_BARRICADE && dstmd->class_ <= MOBID_S_EMPEL_2))) break; if (script->potion_hp || script->potion_sp) { int hp = script->potion_hp, sp = script->potion_sp; @@ -7702,8 +7700,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin map->freeblock_unlock(); return 0; } - if (rnd() % 100 > skill_lv * 8 || (dstmd && ((dstmd->guardian_data && dstmd->class_ == MOBID_EMPERIUM) || mob_is_battleground(dstmd)))) { - if (sd) + if (rnd() % 100 > skill_lv * 8 || (dstmd && ((dstmd->guardian_data && dstmd->class_ == MOBID_EMPELIUM) || mob_is_battleground(dstmd)))) { + if (sd != NULL) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); map->freeblock_unlock(); @@ -8740,7 +8738,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin { if( bl->type != BL_MOB ) break; md = map->id2md(bl->id); - if( md && md->class_ >= MOBID_SILVERSNIPER && md->class_ <= MOBID_MAGICDECOY_WIND ) + if (md && md->class_ >= MOBID_SILVERSNIPER && md->class_ <= MOBID_MAGICDECOY_WIND) status_kill(bl); clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); } @@ -9425,13 +9423,17 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if( !sd->ed ) break; - switch(sd->ed->db->class_){ - case 2115:case 2124: - case 2118:case 2121: + switch (sd->ed->db->class_) { + case ELEID_EL_AGNI_M: + case ELEID_EL_AQUA_M: + case ELEID_EL_VENTUS_M: + case ELEID_EL_TERA_M: duration = 6000; break; - case 2116:case 2119: - case 2122:case 2125: + case ELEID_EL_AGNI_L: + case ELEID_EL_AQUA_L: + case ELEID_EL_VENTUS_L: + case ELEID_EL_TERA_L: duration = 9000; break; } @@ -9632,7 +9634,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if(sd) { struct mob_data *summon_md; - summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src), 2308, "", SZ_SMALL, AI_NONE); + summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src), MOBID_KO_KAGE, "", SZ_SMALL, AI_NONE); if( summon_md ) { summon_md->master_id = src->id; summon_md->special_state.ai = AI_ZANZOU; @@ -9794,18 +9796,27 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin break; case MH_SUMMON_LEGION: { - int summons[5] = {1004, 1303, 1303, 1994, 1994}; - int qty[5] = {3 , 3 , 4 , 4 , 5}; - struct mob_data *summon_md; + struct { + int mob_id; + int quantity; + } summons[5] = { + { MOBID_HORNET, 3 }, + { MOBID_GIANT_HONET, 3 }, + { MOBID_GIANT_HONET, 4 }, + { MOBID_LUCIOLA_VESPA, 4 }, + { MOBID_LUCIOLA_VESPA, 5 }, + }; int i, dummy = 0; + Assert_retb(skill_lv < ARRAYLENGTH(summons)); - i = map->foreachinmap(skill->check_condition_mob_master_sub, src->m, BL_MOB, src->id, summons[skill_lv-1], skill_id, &dummy); - if(i >= qty[skill_lv-1]) + i = map->foreachinmap(skill->check_condition_mob_master_sub, src->m, BL_MOB, src->id, summons[skill_lv-1].mob_id, skill_id, &dummy); + if(i >= summons[skill_lv-1].quantity) break; - for(i=0; i<qty[skill_lv - 1]; i++){ //easy way - summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src), summons[skill_lv - 1], "", SZ_SMALL, AI_ATTACK); - if (summon_md) { + for (i = 0; i < summons[skill_lv-1].quantity; i++) { + struct mob_data *summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src), + summons[skill_lv-1].mob_id, "", SZ_SMALL, AI_ATTACK); + if (summon_md != NULL) { summon_md->master_id = src->id; if (summon_md->deletetimer != INVALID_TIMER) timer->delete(summon_md->deletetimer, mob->timer_delete); @@ -10522,10 +10533,20 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui case AM_SPHEREMINE: case AM_CANNIBALIZE: { - int summons[5] = { 1589, 1579, 1575, 1555, 1590 }; - //int summons[5] = { 1020, 1068, 1118, 1500, 1368 }; - int class_ = skill_id==AM_SPHEREMINE?1142:summons[skill_lv-1]; struct mob_data *md; + int class_ = 0; + if (skill_id == AM_SPHEREMINE) { + class_ = MOBID_MARINE_SPHERE; + } else { + Assert_retb(skill_lv > 0 && skill_lv <= 5); + switch (skill_lv) { + case 1: class_ = MOBID_G_MANDRAGORA; break; + case 2: class_ = MOBID_G_HYDRA; break; + case 3: class_ = MOBID_G_FLORA; break; + case 4: class_ = MOBID_G_PARASITE; break; + case 5: class_ = MOBID_G_GEOGRAPHER; break; + } + } // Correct info, don't change any of this! [Celest] md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), class_, "", SZ_SMALL, AI_NONE); @@ -10626,7 +10647,8 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui if (rnd()%100 < 50) { clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); } else { - TBL_MOB* md = mob->once_spawn_sub(src, src->m, x, y, "--ja--",(skill_lv < 2 ? 1084+rnd()%2 : 1078+rnd()%6),"", SZ_SMALL, AI_NONE); + int mob_id = skill_lv < 2 ? MOBID_BLACK_MUSHROOM + rnd()%2 : MOBID_RED_PLANT + rnd()%6; + TBL_MOB* md = mob->once_spawn_sub(src, src->m, x, y, "--ja--", mob_id, "", SZ_SMALL, AI_NONE); int i; if (!md) break; if ((i = skill->get_time(skill_id, skill_lv)) > 0) @@ -10771,11 +10793,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 ) @@ -11910,7 +11929,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6 int heal = skill->calc_heal(ss,bl,sg->skill_id,sg->skill_lv,true); struct mob_data *md = BL_CAST(BL_MOB, bl); #ifdef RENEWAL - if (md && md->class_ == MOBID_EMPERIUM) + if (md != NULL && md->class_ == MOBID_EMPELIUM) break; #endif if (md && mob_is_battleground(md)) @@ -12132,7 +12151,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6 int heal; #ifdef RENEWAL struct mob_data *md = BL_CAST(BL_MOB, bl); - if (md && md->class_ == MOBID_EMPERIUM) + if (md && md->class_ == MOBID_EMPELIUM) break; #endif if ((sg->src_id == bl->id && !(tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_BARDDANCER)) @@ -13666,7 +13685,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case SR_CURSEDCIRCLE: if (map_flag_gvg2(sd->bl.m)) { if (map->foreachinrange(mob->count_sub, &sd->bl, skill->get_splash(skill_id, skill_lv), BL_MOB, - MOBID_EMPERIUM, MOBID_GUARDIAN_STONE1, MOBID_GUARDIAN_STONE2)) { + MOBID_EMPELIUM, MOBID_S_EMPEL_1, MOBID_S_EMPEL_2)) { char output[128]; sprintf(output, "You're too close to a stone or emperium to do this skill"); /* TODO official response? or message.conf it */ clif->messagecolor_self(sd->fd, COLOR_RED, output); @@ -14023,10 +14042,22 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, case AM_CANNIBALIZE: case AM_SPHEREMINE: { int c=0; - int summons[5] = { 1589, 1579, 1575, 1555, 1590 }; - //int summons[5] = { 1020, 1068, 1118, 1500, 1368 }; - int maxcount = (skill_id==AM_CANNIBALIZE)? 6-skill_lv : skill->get_maxcount(skill_id,skill_lv); - int mob_class = (skill_id==AM_CANNIBALIZE)? summons[skill_lv-1] :1142; + int maxcount = 0; + int mob_class = 0; + if (skill_id == AM_CANNIBALIZE) { + Assert_retb(skill_lv > 0 && skill_lv <= 5); + maxcount = 6-skill_lv; + switch (skill_lv) { + case 1: mob_class = MOBID_G_MANDRAGORA; break; + case 2: mob_class = MOBID_G_HYDRA; break; + case 3: mob_class = MOBID_G_FLORA; break; + case 4: mob_class = MOBID_G_PARASITE; break; + case 5: mob_class = MOBID_G_GEOGRAPHER; break; + } + } else { + maxcount = skill->get_maxcount(skill_id,skill_lv); + mob_class = MOBID_MARINE_SPHERE; + } if(battle_config.land_skill_limit && maxcount>0 && (battle_config.land_skill_limit&BL_PC)) { i = map->foreachinmap(skill->check_condition_mob_master_sub ,sd->bl.m, BL_MOB, sd->bl.id, mob_class, skill_id, &c); if( c >= maxcount @@ -14043,17 +14074,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; @@ -14063,7 +14092,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, break; case KO_ZANZOU: { int c = 0; - i = map->foreachinmap(skill->check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, 2308, skill_id, &c); + i = map->foreachinmap(skill->check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, MOBID_KO_KAGE, skill_id, &c); if( c >= skill->get_maxcount(skill_id,skill_lv) || c != i) { clif->skill_fail(sd , skill_id, USESKILL_FAIL_LEVEL, 0); return 0; @@ -17588,7 +17617,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; @@ -17608,7 +17637,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 ) { @@ -18532,11 +18574,11 @@ int skill_block_check(struct block_list *bl, sc_type type , uint16 skill_id) { int skill_get_elemental_type( uint16 skill_id , uint16 skill_lv ) { int type = 0; - switch( skill_id ) { - case SO_SUMMON_AGNI: type = 2114; break; - case SO_SUMMON_AQUA: type = 2117; break; - case SO_SUMMON_VENTUS: type = 2120; break; - case SO_SUMMON_TERA: type = 2123; break; + switch (skill_id) { + case SO_SUMMON_AGNI: type = ELEID_EL_AGNI_S; break; + case SO_SUMMON_AQUA: type = ELEID_EL_AQUA_S; break; + case SO_SUMMON_VENTUS: type = ELEID_EL_VENTUS_S; break; + case SO_SUMMON_TERA: type = ELEID_EL_TERA_S; break; } type += skill_lv - 1; diff --git a/src/map/status.c b/src/map/status.c index 32e5760a7..39329d5bb 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2152,7 +2152,7 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) { if (!gc) ShowError("status_calc_mob: No castle set at map %s\n", map->list[md->bl.m].name); else - if(gc->castle_id < 24 || md->class_ == MOBID_EMPERIUM) { + if (gc->castle_id < 24 || md->class_ == MOBID_EMPELIUM) { #ifdef RENEWAL mstatus->max_hp += 50 * gc->defense; mstatus->max_sp += 70 * gc->defense; @@ -2165,7 +2165,7 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) { mstatus->def += (gc->defense+2)/3; mstatus->mdef += (gc->defense+2)/3; } - if(md->class_ != MOBID_EMPERIUM) { + if (md->class_ != MOBID_EMPELIUM) { mstatus->batk += mstatus->batk * 10*guardup_lv/100; mstatus->rhw.atk += mstatus->rhw.atk * 10*guardup_lv/100; mstatus->rhw.atk2 += mstatus->rhw.atk2 * 10*guardup_lv/100; @@ -7095,7 +7095,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t if (bl->type == BL_MOB) { struct mob_data *md = BL_CAST(BL_MOB, bl); - if (md && (md->class_ == MOBID_EMPERIUM || mob_is_battleground(md)) && type != SC_SAFETYWALL && type != SC_PNEUMA) + if (md && (md->class_ == MOBID_EMPELIUM || mob_is_battleground(md)) && type != SC_SAFETYWALL && type != SC_PNEUMA) return 0; //Emperium/BG Monsters can't be afflicted by status changes #if 0 if (md && mob_is_gvg(md) && status->sc2scb_flag(type)&SCB_MAXHP) @@ -9317,7 +9317,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t int max = val1*3; val3 = rnd()%(max-min)+min; val2 = val1; - val1 = 1002; // Monster ID + val1 = MOBID_PORING; } break; case SC_KAGEMUSYA: @@ -9432,8 +9432,8 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t val2 = 30 * val1; break; case SC_MONSTER_TRANSFORM: - if( !mob->db_checkid(val1) ) - val1 = 1002; // default poring + if (!mob->db_checkid(val1)) + val1 = MOBID_PORING; break; case SC_ALL_RIDING: tick = -1; |