summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/battle.c14
-rw-r--r--src/map/map.h19
-rw-r--r--src/map/mob.c11
-rw-r--r--src/map/mob.h82
-rw-r--r--src/map/script.c2
-rw-r--r--src/map/skill.c34
-rw-r--r--src/map/status.c6
8 files changed, 113 insertions, 57 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index d90b4af55..9ba3994d1 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;
}
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/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/mob.c b/src/map/mob.c
index d8fefa61a..5950758a0 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);
@@ -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.
diff --git a/src/map/mob.h b/src/map/mob.h
index 48b44aab3..342d24985 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -268,6 +268,82 @@ enum {
MSC_SPAWN,
};
+/**
+ * Mob IDs
+ */
+enum mob_id {
+ MOBID_EMPELIUM = 1288, ///< EMPELIUM / Emperium
+
+ 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_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
+
+ 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
+};
+
// The data structures for storing delayed item drops
struct item_drop {
struct item item_data;
@@ -283,9 +359,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..68cd272f9 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)
@@ -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);
}
@@ -11910,7 +11908,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 +12130,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 +13664,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);
diff --git a/src/map/status.c b/src/map/status.c
index 32e5760a7..b80f04046 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)