summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/atcommand.cpp2
-rw-r--r--src/map/battle.cpp296
-rw-r--r--src/map/battle.hpp2
-rw-r--r--src/map/magic-stmt.cpp12
-rw-r--r--src/map/map.hpp23
-rw-r--r--src/map/map.t.hpp68
-rw-r--r--src/map/mob.cpp156
-rw-r--r--src/map/mob.hpp3
-rw-r--r--src/map/npc.cpp4
-rw-r--r--src/map/pc.cpp212
-rw-r--r--src/map/skill.cpp49
-rw-r--r--src/map/skill.t.hpp6
12 files changed, 190 insertions, 643 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index 21b4234..0f6bb1f 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -6428,7 +6428,7 @@ int atcommand_summon(const int, struct map_session_data *sd,
{
md->master_id = sd->bl.id;
md->state.special_mob_ai = 1;
- md->mode = mob_db[md->mob_class].mode | 0x04;
+ md->mode = mob_db[md->mob_class].mode | MobMode::AGGRESSIVE;
md->deletetimer = add_timer(tick + 60000, mob_timer_delete, id, 0);
clif_misceffect(&md->bl, 344);
}
diff --git a/src/map/battle.cpp b/src/map/battle.cpp
index 53ac896..9d51486 100644
--- a/src/map/battle.cpp
+++ b/src/map/battle.cpp
@@ -1208,36 +1208,6 @@ int battle_get_attack_element(struct block_list *bl)
return ret;
}
-static
-int battle_get_attack_element2(struct block_list *bl)
-{
- nullpo_ret(bl);
- if (bl->type == BL_PC && (struct map_session_data *) bl)
- {
- int ret = ((struct map_session_data *) bl)->atk_ele_;
- eptr<struct status_change, StatusChange> sc_data =
- ((struct map_session_data *) bl)->sc_data;
-
- if (sc_data)
- {
- if (sc_data[SC_FROSTWEAPON].timer != -1) // フロストウェポン
- ret = 1;
- if (sc_data[SC_SEISMICWEAPON].timer != -1) // サイズミックウェポン
- ret = 2;
- if (sc_data[SC_FLAMELAUNCHER].timer != -1) // フレームランチャー
- ret = 3;
- if (sc_data[SC_LIGHTNINGLOADER].timer != -1) // ライトニングローダー
- ret = 4;
- if (sc_data[SC_ENCPOISON].timer != -1) // エンチャントポイズン
- ret = 5;
- if (sc_data[SC_ASPERSIO].timer != -1) // アスペルシオ
- ret = 6;
- }
- return ret;
- }
- return 0;
-}
-
int battle_get_party_id(struct block_list *bl)
{
nullpo_ret(bl);
@@ -1267,25 +1237,13 @@ int battle_get_race(struct block_list *bl)
return 0;
}
-static
-int battle_get_size(struct block_list *bl)
-{
- nullpo_retr(1, bl);
- if (bl->type == BL_MOB && (struct mob_data *) bl)
- return mob_db[((struct mob_data *) bl)->mob_class].size;
- else if (bl->type == BL_PC && (struct map_session_data *) bl)
- return 1;
- else
- return 1;
-}
-
-int battle_get_mode(struct block_list *bl)
+MobMode battle_get_mode(struct block_list *bl)
{
- nullpo_retr(0x01, bl);
+ nullpo_retr(MobMode::CAN_MOVE, bl);
if (bl->type == BL_MOB && (struct mob_data *) bl)
return mob_db[((struct mob_data *) bl)->mob_class].mode;
- else
- return 0x01; // とりあえず動くということで1
+ // とりあえず動くということで1
+ return MobMode::CAN_MOVE;
}
int battle_get_mexp(struct block_list *bl)
@@ -1760,7 +1718,6 @@ struct Damage battle_calc_mob_weapon_attack(struct block_list *src,
BF flag;
int ac_flag = 0;
ATK dmg_lv = ATK::ZERO;
- int t_mode = 0, s_race = 0, s_ele = 0;
eptr<struct status_change, StatusChange> sc_data, t_sc_data;
//return前の処理があるので情報出力部のみ変更
@@ -1771,8 +1728,6 @@ struct Damage battle_calc_mob_weapon_attack(struct block_list *src,
return wd;
}
- s_race = battle_get_race(src);
- s_ele = battle_get_attack_element(src);
sc_data = battle_get_sc_data(src);
// ターゲット
@@ -1780,7 +1735,7 @@ struct Damage battle_calc_mob_weapon_attack(struct block_list *src,
tsd = (struct map_session_data *) target;
else if (target->type == BL_MOB)
tmd = (struct mob_data *) target;
- t_mode = battle_get_mode(target);
+ MobMode t_mode = battle_get_mode(target);
t_sc_data = battle_get_sc_data(target);
flag = BF_SHORT | BF_WEAPON | BF_NORMAL; // 攻撃の種類の設定
@@ -1889,10 +1844,6 @@ struct Damage battle_calc_mob_weapon_attack(struct block_list *src,
if (skill_num != SkillID::ZERO && skill_num != SkillID::NEGATIVE)
{
- int i;
- if ((i = skill_get_pl(skill_num)) > 0)
- s_ele = i;
-
flag = (flag & ~BF_SKILLMASK) | BF_SKILL;
switch (skill_num)
{
@@ -2031,21 +1982,7 @@ struct Damage battle_calc_mob_weapon_attack(struct block_list *src,
if (tsd)
{
- int cardfix = 100, i;
- cardfix = cardfix * (100 - tsd->subele[s_ele]) / 100; // 属 性によるダメージ耐性
- cardfix = cardfix * (100 - tsd->subrace[s_race]) / 100; // 種族によるダメージ耐性
- if (mob_db[md->mob_class].mode & 0x20)
- cardfix = cardfix * (100 - tsd->subrace[10]) / 100;
- else
- cardfix = cardfix * (100 - tsd->subrace[11]) / 100;
- for (i = 0; i < tsd->add_def_class_count; i++)
- {
- if (tsd->add_def_classid[i] == md->mob_class)
- {
- cardfix = cardfix * (100 - tsd->add_def_classrate[i]) / 100;
- break;
- }
- }
+ int cardfix = 100;
if (bool(flag & BF_LONG))
cardfix = cardfix * (100 - tsd->long_attack_def_rate) / 100;
if (bool(flag & BF_SHORT))
@@ -2096,7 +2033,7 @@ struct Damage battle_calc_mob_weapon_attack(struct block_list *src,
}
// if(def1 >= 1000000 && damage > 0)
- if (t_mode & 0x40 && damage > 0)
+ if (bool(t_mode & MobMode::PLANT) && damage > 0)
damage = 1;
if (tsd && tsd->special_state.no_weapon_damage)
@@ -2156,12 +2093,12 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
skill_get_blewcount(skill_num, skill_lv);
BF flag;
ATK dmg_lv = ATK::ZERO;
- int t_mode = 0, t_race = 0, t_size = 1, s_race = 7, s_ele = 0;
+ int t_race = 0;
eptr<struct status_change, StatusChange> sc_data, t_sc_data;
- int atkmax_ = 0, atkmin_ = 0, s_ele_; //二刀流用
+ int atkmax_ = 0, atkmin_ = 0; //二刀流用
int watk, watk_, cardfix, t_ele;
bool da = false;
- int t_class, ac_flag = 0;
+ int ac_flag = 0;
int idef_flag = 0, idef_flag_ = 0;
int target_distance;
@@ -2174,9 +2111,6 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
}
// アタッカー
- s_race = battle_get_race(src); //種族
- s_ele = battle_get_attack_element(src); //属性
- s_ele_ = battle_get_attack_element2(src); //左手属性
sc_data = battle_get_sc_data(src); //ステータス異常
sd->state.attack_type = BF_WEAPON; //攻撃タイプは武器攻撃
@@ -2188,8 +2122,7 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
tmd = (struct mob_data *) target; //tmdに代入(tsdはNULL)
t_race = battle_get_race(target); //対象の種族
t_ele = battle_get_elem_type(target); //対象の属性
- t_size = battle_get_size(target); //対象のサイズ
- t_mode = battle_get_mode(target); //対象のMode
+ MobMode t_mode = battle_get_mode(target); //対象のMode
t_sc_data = battle_get_sc_data(target); //対象のステータス異常
flag = BF_SHORT | BF_WEAPON | BF_NORMAL; // 攻撃の種類の設定
@@ -2270,8 +2203,6 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
{ //武器が弓矢の場合
atkmin = watk * ((atkmin < watk) ? atkmin : watk) / 100; //弓用最低ATK計算
flag = (flag & ~BF_RANGEMASK) | BF_LONG; //遠距離攻撃フラグを有効
- if (sd->arrow_ele > 0) //属性矢なら属性を矢の属性に変更
- s_ele = sd->arrow_ele;
sd->state.arrow_atk = 1; //arrow_atk有効化
}
@@ -2388,7 +2319,7 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
damage2 = (damage2 * (def1 + def2)) / 100;
idef_flag_ = 1;
}
- if (t_mode & 0x20)
+ if (bool(t_mode & MobMode::BOSS))
{
if (!idef_flag && sd->def_ratio_atk_race & (1 << 10))
{
@@ -2444,10 +2375,6 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
if (skill_num != SkillID::ZERO && skill_num != SkillID::NEGATIVE)
{
- int i;
- if ((i = skill_get_pl(skill_num)) > 0)
- s_ele = s_ele_ = i;
-
flag = (flag & ~BF_SKILLMASK) | BF_SKILL;
switch (skill_num)
{
@@ -2553,7 +2480,7 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
if (sd->ignore_def_ele_ & (1 << t_ele)
|| sd->ignore_def_race_ & (1 << t_race))
idef_flag_ = 1;
- if (t_mode & 0x20)
+ if (bool(t_mode & MobMode::BOSS))
{
if (sd->ignore_def_race & (1 << 10))
idef_flag = 1;
@@ -2649,111 +2576,9 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
dmg_lv = ATK_DEF;
}
-//スキルによるダメージ補正ここまで
-
-//カードによるダメージ追加処理ここから
- cardfix = 100;
- if (!sd->state.arrow_atk)
- { //弓矢以外
- if (!battle_config.left_cardfix_to_right)
- { //左手カード補正設定無し
- cardfix = cardfix * (100 + sd->addrace[t_race]) / 100; // 種族によるダメージ修正
- cardfix = cardfix * (100 + sd->addele[t_ele]) / 100; // 属性によるダメージ修正
- cardfix = cardfix * (100 + sd->addsize[t_size]) / 100; // サイズによるダメージ修正
- }
- else
- {
- cardfix = cardfix * (100 + sd->addrace[t_race] + sd->addrace_[t_race]) / 100; // 種族によるダメージ修正(左手による追加あり)
- cardfix = cardfix * (100 + sd->addele[t_ele] + sd->addele_[t_ele]) / 100; // 属性によるダメージ修正(左手による追加あり)
- cardfix = cardfix * (100 + sd->addsize[t_size] + sd->addsize_[t_size]) / 100; // サイズによるダメージ修正(左手による追加あり)
- }
- }
- else
- { //弓矢
- cardfix = cardfix * (100 + sd->addrace[t_race] + sd->arrow_addrace[t_race]) / 100; // 種族によるダメージ修正(弓矢による追加あり)
- cardfix = cardfix * (100 + sd->addele[t_ele] + sd->arrow_addele[t_ele]) / 100; // 属性によるダメージ修正(弓矢による追加あり)
- cardfix = cardfix * (100 + sd->addsize[t_size] + sd->arrow_addsize[t_size]) / 100; // サイズによるダメージ修正(弓矢による追加あり)
- }
- if (t_mode & 0x20)
- { //ボス
- if (!sd->state.arrow_atk)
- { //弓矢攻撃以外なら
- if (!battle_config.left_cardfix_to_right) //左手カード補正設定無し
- cardfix = cardfix * (100 + sd->addrace[10]) / 100; //ボスモンスターに追加ダメージ
- else //左手カード補正設定あり
- cardfix = cardfix * (100 + sd->addrace[10] + sd->addrace_[10]) / 100; //ボスモンスターに追加ダメージ(左手による追加あり)
- }
- else //弓矢攻撃
- cardfix = cardfix * (100 + sd->addrace[10] + sd->arrow_addrace[10]) / 100; //ボスモンスターに追加ダメージ(弓矢による追加あり)
- }
- else
- { //ボスじゃない
- if (!sd->state.arrow_atk)
- { //弓矢攻撃以外
- if (!battle_config.left_cardfix_to_right) //左手カード補正設定無し
- cardfix = cardfix * (100 + sd->addrace[11]) / 100; //ボス以外モンスターに追加ダメージ
- else //左手カード補正設定あり
- cardfix = cardfix * (100 + sd->addrace[11] + sd->addrace_[11]) / 100; //ボス以外モンスターに追加ダメージ(左手による追加あり)
- }
- else
- cardfix = cardfix * (100 + sd->addrace[11] + sd->arrow_addrace[11]) / 100; //ボス以外モンスターに追加ダメージ(弓矢による追加あり)
- }
- //特定Class用補正処理(少女の日記→ボンゴン用?)
- t_class = battle_get_class(target);
- for (int i = 0; i < sd->add_damage_class_count; i++)
- {
- if (sd->add_damage_classid[i] == t_class)
- {
- cardfix = cardfix * (100 + sd->add_damage_classrate[i]) / 100;
- break;
- }
- }
- damage = damage * cardfix / 100; //カード補正によるダメージ増加
-//カードによるダメージ増加処理ここまで
-
-//カードによるダメージ追加処理(左手)ここから
- cardfix = 100;
- if (!battle_config.left_cardfix_to_right)
- { //左手カード補正設定無し
- cardfix = cardfix * (100 + sd->addrace_[t_race]) / 100; // 種族によるダメージ修正左手
- cardfix = cardfix * (100 + sd->addele_[t_ele]) / 100; // 属 性によるダメージ修正左手
- cardfix = cardfix * (100 + sd->addsize_[t_size]) / 100; // サイズによるダメージ修正左手
- if (t_mode & 0x20) //ボス
- cardfix = cardfix * (100 + sd->addrace_[10]) / 100; //ボスモンスターに追加ダメージ左手
- else
- cardfix = cardfix * (100 + sd->addrace_[11]) / 100; //ボス以外モンスターに追加ダメージ左手
- }
- //特定Class用補正処理左手(少女の日記→ボンゴン用?)
- for (int i = 0; i < sd->add_damage_class_count_; i++)
- {
- if (sd->add_damage_classid_[i] == t_class)
- {
- cardfix = cardfix * (100 + sd->add_damage_classrate_[i]) / 100;
- break;
- }
- }
- damage2 = damage2 * cardfix / 100; //カード補正による左手ダメージ増加
-//カードによるダメージ増加処理(左手)ここまで
-
-//カードによるダメージ減衰処理ここから
if (tsd)
{ //対象がPCの場合
cardfix = 100;
- cardfix = cardfix * (100 - tsd->subrace[s_race]) / 100; // 種族によるダメージ耐性
- cardfix = cardfix * (100 - tsd->subele[s_ele]) / 100; // 属性によるダメージ耐性
- if (battle_get_mode(src) & 0x20)
- cardfix = cardfix * (100 - tsd->subrace[10]) / 100; //ボスからの攻撃はダメージ減少
- else
- cardfix = cardfix * (100 - tsd->subrace[11]) / 100; //ボス以外からの攻撃はダメージ減少
- //特定Class用補正処理左手(少女の日記→ボンゴン用?)
- for (int i = 0; i < tsd->add_def_class_count; i++)
- {
- if (tsd->add_def_classid[i] == 0)
- {
- cardfix = cardfix * (100 - tsd->add_def_classrate[i]) / 100;
- break;
- }
- }
if (bool(flag & BF_LONG))
cardfix = cardfix * (100 - tsd->long_attack_def_rate) / 100; //遠距離攻撃はダメージ減少(ホルンCとか)
if (bool(flag & BF_SHORT))
@@ -2874,7 +2699,7 @@ struct Damage battle_calc_pc_weapon_attack(struct block_list *src,
}
//MobのModeに頑強フラグが立っているときの処理
- if (t_mode & 0x40)
+ if (bool(t_mode & MobMode::PLANT))
{
if (damage > 0)
damage = 1;
@@ -3031,8 +2856,7 @@ struct Damage battle_calc_magic_attack(struct block_list *bl,
skill_get_blewcount(skill_num, skill_lv), rdamage = 0;
struct Damage md;
int normalmagic_flag = 1;
- int ele = 0, race = 7, t_ele = 0, t_race = 7, t_mode =
- 0, cardfix, t_class, i;
+ int t_ele = 0, t_race = 7, cardfix;
struct map_session_data *sd = NULL, *tsd = NULL;
//return前の処理があるので情報出力部のみ変更
@@ -3045,11 +2869,9 @@ struct Damage battle_calc_magic_attack(struct block_list *bl,
matk1 = battle_get_matk1(bl);
matk2 = battle_get_matk2(bl);
- ele = skill_get_pl(skill_num);
- race = battle_get_race(bl);
t_ele = battle_get_elem_type(target);
t_race = battle_get_race(target);
- t_mode = battle_get_mode(target);
+ MobMode t_mode = battle_get_mode(target);
#define MATK_FIX( a,b ) { matk1=matk1*(a)/(b); matk2=matk2*(a)/(b); }
@@ -3089,7 +2911,7 @@ struct Damage battle_calc_magic_attack(struct block_list *bl,
if (sd->ignore_mdef_ele & (1 << t_ele)
|| sd->ignore_mdef_race & (1 << t_race))
imdef_flag = 1;
- if (t_mode & 0x20)
+ if (bool(t_mode & MobMode::BOSS))
{
if (sd->ignore_mdef_race & (1 << 10))
imdef_flag = 1;
@@ -3118,47 +2940,9 @@ struct Damage battle_calc_magic_attack(struct block_list *bl,
damage = 1;
}
- if (sd)
- {
- cardfix = 100;
- cardfix = cardfix * (100 + sd->magic_addrace[t_race]) / 100;
- cardfix = cardfix * (100 + sd->magic_addele[t_ele]) / 100;
- if (t_mode & 0x20)
- cardfix = cardfix * (100 + sd->magic_addrace[10]) / 100;
- else
- cardfix = cardfix * (100 + sd->magic_addrace[11]) / 100;
- t_class = battle_get_class(target);
- for (i = 0; i < sd->add_magic_damage_class_count; i++)
- {
- if (sd->add_magic_damage_classid[i] == t_class)
- {
- cardfix =
- cardfix * (100 + sd->add_magic_damage_classrate[i]) / 100;
- break;
- }
- }
- damage = damage * cardfix / 100;
- }
-
if (tsd)
{
- int s_class = battle_get_class(bl);
cardfix = 100;
- cardfix = cardfix * (100 - tsd->subele[ele]) / 100; // 属 性によるダメージ耐性
- cardfix = cardfix * (100 - tsd->subrace[race]) / 100; // 種族によるダメージ耐性
- cardfix = cardfix * (100 - tsd->magic_subrace[race]) / 100;
- if (battle_get_mode(bl) & 0x20)
- cardfix = cardfix * (100 - tsd->magic_subrace[10]) / 100;
- else
- cardfix = cardfix * (100 - tsd->magic_subrace[11]) / 100;
- for (i = 0; i < tsd->add_mdef_class_count; i++)
- {
- if (tsd->add_mdef_classid[i] == s_class)
- {
- cardfix = cardfix * (100 - tsd->add_mdef_classrate[i]) / 100;
- break;
- }
- }
cardfix = cardfix * (100 - tsd->magic_def_rate) / 100;
damage = damage * cardfix / 100;
}
@@ -3171,7 +2955,7 @@ struct Damage battle_calc_magic_attack(struct block_list *bl,
damage *= div_;
// if(mdef1 >= 1000000 && damage > 0)
- if (t_mode & 0x40 && damage > 0)
+ if (bool(t_mode & MobMode::PLANT) && damage > 0)
damage = 1;
if (tsd && tsd->special_state.no_magic_damage)
@@ -3220,7 +3004,7 @@ struct Damage battle_calc_misc_attack(struct block_list *bl,
struct block_list *target,
SkillID skill_num, int skill_lv, int)
{
- int ele, race, cardfix;
+ int cardfix;
struct map_session_data *sd = NULL, *tsd = NULL;
int damage = 0, div_ = 1, blewcount =
skill_get_blewcount(skill_num, skill_lv);
@@ -3281,9 +3065,6 @@ struct Damage battle_calc_misc_attack(struct block_list *bl,
break;
}
- ele = skill_get_pl(skill_num);
- race = battle_get_race(bl);
-
if (damagefix)
{
if (damage < 1 && skill_num != NPC_DARKBREATH)
@@ -3292,8 +3073,6 @@ struct Damage battle_calc_misc_attack(struct block_list *bl,
if (tsd)
{
cardfix = 100;
- cardfix = cardfix * (100 - tsd->subele[ele]) / 100; // 属性によるダメージ耐性
- cardfix = cardfix * (100 - tsd->subrace[race]) / 100; // 種族によるダメージ耐性
cardfix = cardfix * (100 - tsd->misc_def_rate) / 100;
damage = damage * cardfix / 100;
}
@@ -3502,8 +3281,7 @@ ATK battle_weapon_attack(struct block_list *src, struct block_list *target,
(target->type ==
BL_PC) ? ((struct map_session_data *) target)->
status.char_id : target->id,
- (target->type ==
- BL_PC) ? 0 : ((struct mob_data *) target)->mob_class,
+ battle_get_class(target),
wd.damage + wd.damage2, weapon);
}
@@ -3513,11 +3291,10 @@ ATK battle_weapon_attack(struct block_list *src, struct block_list *target,
MAP_LOG("PC%d %d:%d,%d WPNINJURY %s%d %d FOR %d",
sd2->status.char_id, target->m, target->x, target->y,
(src->type == BL_PC) ? "PC" : "MOB",
- (src->type ==
- BL_PC) ? ((struct map_session_data *) src)->
- status.char_id : src->id,
- (src->type ==
- BL_PC) ? 0 : ((struct mob_data *) src)->mob_class,
+ (src->type == BL_PC)
+ ? ((struct map_session_data *) src)->status.char_id
+ : src->id,
+ battle_get_class(src),
wd.damage + wd.damage2);
}
@@ -3530,31 +3307,6 @@ ATK battle_weapon_attack(struct block_list *src, struct block_list *target,
if (wd.damage > 0 || wd.damage2 > 0)
{
skill_additional_effect(src, target, SkillID::ZERO, 0, BF_WEAPON, tick);
- if (sd)
- {
- if (sd->weapon_coma_ele[ele] > 0
- && MRAND(10000) < sd->weapon_coma_ele[ele])
- battle_damage(src, target,
- battle_get_max_hp(target), 1);
- if (sd->weapon_coma_race[race] > 0
- && MRAND(10000) < sd->weapon_coma_race[race])
- battle_damage(src, target,
- battle_get_max_hp(target), 1);
- if (battle_get_mode(target) & 0x20)
- {
- if (sd->weapon_coma_race[10] > 0
- && MRAND(10000) < sd->weapon_coma_race[10])
- battle_damage(src, target,
- battle_get_max_hp(target), 1);
- }
- else
- {
- if (sd->weapon_coma_race[11] > 0
- && MRAND(10000) < sd->weapon_coma_race[11])
- battle_damage(src, target,
- battle_get_max_hp(target), 1);
- }
- }
}
}
if (sd)
diff --git a/src/map/battle.hpp b/src/map/battle.hpp
index 8e2335b..04ca656 100644
--- a/src/map/battle.hpp
+++ b/src/map/battle.hpp
@@ -68,7 +68,7 @@ int battle_get_element(struct block_list *bl);
#define battle_get_elem_type(bl) (battle_get_element(bl)%10)
int battle_get_party_id(struct block_list *bl);
int battle_get_race(struct block_list *bl);
-int battle_get_mode(struct block_list *bl);
+MobMode battle_get_mode(struct block_list *bl);
int battle_get_mexp(struct block_list *bl);
int battle_get_stat(SP stat_id, struct block_list *bl);
diff --git a/src/map/magic-stmt.cpp b/src/map/magic-stmt.cpp
index d93c44c..b89b3c4 100644
--- a/src/map/magic-stmt.cpp
+++ b/src/map/magic-stmt.cpp
@@ -483,7 +483,7 @@ int op_banish(env_t *, int, val_t *args)
{
struct mob_data *mob = (struct mob_data *) subject;
- if (mob->mode & MOB_MODE_SUMMONED)
+ if (bool(mob->mode & MOB_MODE_SUMMONED))
mob_catch_delete(mob, 3);
}
@@ -623,7 +623,7 @@ int op_aggravate(env_t *, int, val_t *args)
mob_target(other, victim, battle_get_range(victim));
if (AGGRAVATION_MODE_MAKES_AGGRESSIVE(mode))
- other->mode = 0x85 | (other->mode & MOB_SENSIBLE_MASK); /* war */
+ other->mode = MobMode::war | (other->mode & MOB_SENSIBLE_MASK);
if (AGGRAVATION_MODE_ATTACKS_CASTER(mode))
{
@@ -676,15 +676,15 @@ int op_spawn(env_t *, int, val_t *args)
case MONSTER_ATTITUDE_SERVANT:
mob->state.special_mob_ai = 1;
- mob->mode |= 0x04;
+ mob->mode |= MobMode::AGGRESSIVE;
break;
case MONSTER_ATTITUDE_FRIENDLY:
- mob->mode = 0x80 | (mob->mode & 1);
+ mob->mode = MobMode::CAN_ATTACK | (mob->mode & MobMode::CAN_MOVE);
break;
case MONSTER_ATTITUDE_HOSTILE:
- mob->mode = 0x84 | (mob->mode & 1);
+ mob->mode = MobMode::CAN_ATTACK | MobMode::AGGRESSIVE | (mob->mode & MobMode::CAN_MOVE);
if (owner)
{
mob->target_id = owner->bl.id;
@@ -693,7 +693,7 @@ int op_spawn(env_t *, int, val_t *args)
break;
case MONSTER_ATTITUDE_FROZEN:
- mob->mode = 0;
+ mob->mode = MobMode::ZERO;
break;
}
diff --git a/src/map/map.hpp b/src/map/map.hpp
index 0f89743..20423ba 100644
--- a/src/map/map.hpp
+++ b/src/map/map.hpp
@@ -302,13 +302,11 @@ struct map_session_data
int def, def2, mdef, mdef2, critical, matk1, matk2;
int atk_ele, def_ele, star, overrefine;
int castrate, hprate, sprate, dsprate;
- int addele[10], addrace[12], addsize[3], subele[10], subrace[12];
earray<int, BadSC, BadSC::COUNT> addeff, addeff2, reseff;
- int watk_, watk_2, addele_[10], addrace_[12], addsize_[3]; //二刀流のために追加
+ int watk_, watk_2;
int atk_ele_, star_, overrefine_; //二刀流のために追加
int base_atk, atk_rate;
int arrow_atk, arrow_ele, arrow_cri, arrow_hit, arrow_range;
- int arrow_addele[10], arrow_addrace[12], arrow_addsize[3];
earray<int, BadSC, BadSC::COUNT> arrow_addeff, arrow_addeff2;
int nhealhp, nhealsp, nshealhp, nshealsp, nsshealhp, nsshealsp;
int aspd_rate, speed_rate, hprecov_rate, sprecov_rate, critical_def,
@@ -318,21 +316,11 @@ struct map_session_data
int matk_rate, ignore_def_ele, ignore_def_race, ignore_def_ele_,
ignore_def_race_;
int ignore_mdef_ele, ignore_mdef_race;
- int magic_addele[10], magic_addrace[12], magic_subrace[12];
int perfect_hit, get_zeny_num;
int critical_rate, hit_rate, flee_rate, flee2_rate, def_rate, def2_rate,
mdef_rate, mdef2_rate;
int def_ratio_atk_ele, def_ratio_atk_ele_, def_ratio_atk_race,
def_ratio_atk_race_;
- int add_damage_class_count, add_damage_class_count_,
- add_magic_damage_class_count;
- short add_damage_classid[10], add_damage_classid_[10],
- add_magic_damage_classid[10];
- int add_damage_classrate[10], add_damage_classrate_[10],
- add_magic_damage_classrate[10];
- short add_def_class_count, add_mdef_class_count;
- short add_def_classid[10], add_mdef_classid[10];
- int add_def_classrate[10], add_mdef_classrate[10];
short monster_drop_item_count;
short monster_drop_itemid[10];
int monster_drop_race[10], monster_drop_itemrate[10];
@@ -344,7 +332,6 @@ struct map_session_data
short hp_drain_rate, hp_drain_per, sp_drain_rate, sp_drain_per;
short hp_drain_rate_, hp_drain_per_, sp_drain_rate_, sp_drain_per_;
int short_weapon_damage_return, long_weapon_damage_return;
- int weapon_coma_ele[10], weapon_coma_race[12];
short break_weapon_rate, break_armor_rate;
short add_steal_rate;
@@ -471,11 +458,6 @@ struct npc_data
short arenaflag;
};
-#define MOB_MODE_SUMMONED 0x1000
-#define MOB_MODE_TURNS_AGAINST_BAD_MASTER 0x2000
-
-#define MOB_SENSIBLE_MASK 0xf000 // fate: mob mode flags that I actually understand
-
#define MOB_XP_BONUS_BASE 1024
#define MOB_XP_BONUS_SHIFT 10
@@ -483,7 +465,8 @@ struct mob_data
{
struct block_list bl;
short n;
- short base_class, mob_class, dir, mode;
+ short mob_class, dir;
+ MobMode mode;
short m, x0, y0, xs, ys;
char name[24];
int spawndelay1, spawndelay2;
diff --git a/src/map/map.t.hpp b/src/map/map.t.hpp
index 4110f05..1745ba3 100644
--- a/src/map/map.t.hpp
+++ b/src/map/map.t.hpp
@@ -306,16 +306,7 @@ enum class SP : uint16_t
#define SP_MAXSPRATE SP::MAXSPRATE
SPRATE = 1006,
#define SP_SPRATE SP::SPRATE
- ADDELE = 1007,
-#define SP_ADDELE SP::ADDELE
- ADDRACE = 1008,
-#define SP_ADDRACE SP::ADDRACE
- ADDSIZE = 1009,
-#define SP_ADDSIZE SP::ADDSIZE
- SUBELE = 1010,
-#define SP_SUBELE SP::SUBELE
- SUBRACE = 1011,
-#define SP_SUBRACE SP::SUBRACE
+
ADDEFF = 1012,
#define SP_ADDEFF SP::ADDEFF
RESEFF = 1013,
@@ -362,12 +353,7 @@ enum class SP : uint16_t
#define SP_IGNORE_MDEF_ELE SP::IGNORE_MDEF_ELE
IGNORE_MDEF_RACE = 1034,
#define SP_IGNORE_MDEF_RACE SP::IGNORE_MDEF_RACE
- MAGIC_ADDELE = 1035,
-#define SP_MAGIC_ADDELE SP::MAGIC_ADDELE
- MAGIC_ADDRACE = 1036,
-#define SP_MAGIC_ADDRACE SP::MAGIC_ADDRACE
- MAGIC_SUBRACE = 1037,
-#define SP_MAGIC_SUBRACE SP::MAGIC_SUBRACE
+
PERFECT_HIT_RATE = 1038,
#define SP_PERFECT_HIT_RATE SP::PERFECT_HIT_RATE
PERFECT_HIT_ADD_RATE = 1039,
@@ -378,14 +364,7 @@ enum class SP : uint16_t
#define SP_GET_ZENY_NUM SP::GET_ZENY_NUM
ADD_GET_ZENY_NUM = 1042,
#define SP_ADD_GET_ZENY_NUM SP::ADD_GET_ZENY_NUM
- ADD_DAMAGE_CLASS = 1043,
-#define SP_ADD_DAMAGE_CLASS SP::ADD_DAMAGE_CLASS
- ADD_MAGIC_DAMAGE_CLASS = 1044,
-#define SP_ADD_MAGIC_DAMAGE_CLASS SP::ADD_MAGIC_DAMAGE_CLASS
- ADD_DEF_CLASS = 1045,
-#define SP_ADD_DEF_CLASS SP::ADD_DEF_CLASS
- ADD_MDEF_CLASS = 1046,
-#define SP_ADD_MDEF_CLASS SP::ADD_MDEF_CLASS
+
ADD_MONSTER_DROP_ITEM = 1047,
#define SP_ADD_MONSTER_DROP_ITEM SP::ADD_MONSTER_DROP_ITEM
DEF_RATIO_ATK_ELE = 1048,
@@ -422,10 +401,7 @@ enum class SP : uint16_t
#define SP_SHORT_WEAPON_DAMAGE_RETURN SP::SHORT_WEAPON_DAMAGE_RETURN
LONG_WEAPON_DAMAGE_RETURN = 1064,
#define SP_LONG_WEAPON_DAMAGE_RETURN SP::LONG_WEAPON_DAMAGE_RETURN
- WEAPON_COMA_ELE = 1065,
-#define SP_WEAPON_COMA_ELE SP::WEAPON_COMA_ELE
- WEAPON_COMA_RACE = 1066,
-#define SP_WEAPON_COMA_RACE SP::WEAPON_COMA_RACE
+
ADDEFF2 = 1067,
#define SP_ADDEFF2 SP::ADDEFF2
BREAK_WEAPON_RATE = 1068,
@@ -606,4 +582,40 @@ enum class ItemType : uint8_t
_11 = 11, // in eA, delayed use (special script)
};
+namespace e
+{
+enum class MobMode : uint16_t
+{
+ ZERO = 0x0000,
+
+ CAN_MOVE = 0x0001,
+ LOOTER = 0x0002,
+ AGGRESSIVE = 0x0004,
+ ASSIST = 0x0008,
+
+ CAST_SENSOR = 0x0010,
+ BOSS = 0x0020,
+ // sometimes also called "robust"
+ PLANT = 0x0040,
+ CAN_ATTACK = 0x0080,
+
+ DETECTOR = 0x0100,
+ CHANGE_TARGET = 0x0200,
+
+ war = CAN_MOVE | AGGRESSIVE | CAN_ATTACK,
+
+ SUMMONED = 0x1000,
+#define MOB_MODE_SUMMONED MobMode::SUMMONED
+ TURNS_AGAINST_BAD_MASTER = 0x2000,
+#define MOB_MODE_TURNS_AGAINST_BAD_MASTER MobMode::TURNS_AGAINST_BAD_MASTER
+
+ // mob mode flags that Fate actually understood
+ SENSIBLE_MASK = 0xf000,
+#define MOB_SENSIBLE_MASK MobMode::SENSIBLE_MASK
+};
+
+ENUM_BITWISE_OPERATORS(MobMode)
+}
+using e::MobMode;
+
#endif // MAP_T_HPP
diff --git a/src/map/mob.cpp b/src/map/mob.cpp
index 4b68cd9..46bb71e 100644
--- a/src/map/mob.cpp
+++ b/src/map/mob.cpp
@@ -103,7 +103,7 @@ int mob_spawn_dataset(struct mob_data *md, const char *mobname, int mob_class)
md->bl.prev = NULL;
md->bl.next = NULL;
md->n = 0;
- md->base_class = md->mob_class = mob_class;
+ md->mob_class = mob_class;
md->bl.id = npc_get_new_npc_id();
memset(&md->state, 0, sizeof(md->state));
@@ -282,9 +282,13 @@ int mob_gen_exp(struct mob_db *mob)
mob->attrs[ATTR::LUK]) * (1872.0 / mob->adelay) / 4;
double dodge_factor =
pow(mob->lv + mob->attrs[ATTR::AGI] + mob->attrs[ATTR::LUK] / 2.0, 4.0 / 3.0);
+ // TODO s/persuit/pursuit/g sometime when I'm not worried about diffs
double persuit_factor =
- (3 + mob->range) * (mob->mode % 2) * 1000 / mob->speed;
- double aggression_factor = (mob->mode & 4) == 4 ? 10.0 / 9.0 : 1.0;
+ (3 + mob->range) * bool(mob->mode & MobMode::CAN_MOVE) * 1000 / mob->speed;
+ double aggression_factor =
+ bool(mob->mode & MobMode::AGGRESSIVE)
+ ? 10.0 / 9.0
+ : 1.0;
int xp =
(int) floor(effective_hp *
pow(sqrt(attack_factor) + sqrt(dodge_factor) +
@@ -410,7 +414,7 @@ int mob_once_spawn(struct map_session_data *sd, const char *mapname,
for (count = 0; count < amount; count++)
{
md = (struct mob_data *) calloc(1, sizeof(struct mob_data));
- if (mob_db[mob_class].mode & 0x02)
+ if (bool(mob_db[mob_class].mode & MobMode::LOOTER))
md->lootitem =
(struct item *) calloc(LOOTITEM_SIZE, sizeof(struct item));
else
@@ -421,7 +425,8 @@ int mob_once_spawn(struct map_session_data *sd, const char *mapname,
md->bl.x = x;
md->bl.y = y;
if (r < 0 && battle_config.dead_branch_active == 1)
- md->mode = 0x1 + 0x4 + 0x80; //移動してアクティブで反撃する
+ //移動してアクティブで反撃する
+ md->mode = MobMode::war;
md->m = m;
md->x0 = x;
md->y0 = y;
@@ -548,6 +553,7 @@ int mob_spawn_guardian(struct map_session_data *sd, const char *mapname,
return (amount > 0) ? md->bl.id : 0;
}
+// TODO: deprecate these
int mob_get_sex(int mob_class)
{
return mob_db[mob_class].sex;
@@ -751,7 +757,8 @@ int mob_check_attack(struct mob_data *md)
struct map_session_data *tsd = NULL;
struct mob_data *tmd = NULL;
- int mode, race, range;
+ MobMode mode;
+ int race, range;
nullpo_ret(md);
@@ -802,22 +809,23 @@ int mob_check_attack(struct mob_data *md)
}
}
- if (!md->mode)
+ if (md->mode == MobMode::ZERO)
mode = mob_db[md->mob_class].mode;
else
mode = md->mode;
race = mob_db[md->mob_class].race;
- if (!(mode & 0x80))
+ if (!bool(mode & MobMode::CAN_ATTACK))
{
md->target_id = 0;
md->state.attackable = false;
return 0;
}
- if (tsd && !(mode & 0x20) && (tsd->sc_data[SC_TRICKDEAD].timer != -1 ||
- ((pc_ishiding(tsd)
- || tsd->state.gangsterparadise)
- && race != 4 && race != 6)))
+ if (tsd
+ && !bool(mode & MobMode::BOSS)
+ && (tsd->sc_data[SC_TRICKDEAD].timer != -1
+ || ((pc_ishiding(tsd) || tsd->state.gangsterparadise)
+ && race != 4 && race != 6)))
{
md->target_id = 0;
md->state.attackable = false;
@@ -825,7 +833,7 @@ int mob_check_attack(struct mob_data *md)
}
range = mob_db[md->mob_class].range;
- if (mode & 1)
+ if (bool(mode & MobMode::CAN_MOVE))
range++;
if (distance(md->bl.x, md->bl.y, tbl->x, tbl->y) > range)
return 0;
@@ -1179,8 +1187,6 @@ int mob_spawn(int id)
skill_unit_out_all(&md->bl, gettick(), 1);
map_delblock(&md->bl);
}
- else
- md->mob_class = md->base_class;
md->bl.m = md->m;
{
@@ -1420,7 +1426,8 @@ int mob_target(struct mob_data *md, struct block_list *bl, int dist)
{
struct map_session_data *sd;
eptr<struct status_change, StatusChange> sc_data;
- int mode, race;
+ MobMode mode;
+ int race;
nullpo_ret(md);
nullpo_ret(bl);
@@ -1429,7 +1436,7 @@ int mob_target(struct mob_data *md, struct block_list *bl, int dist)
Option *option = battle_get_option(bl);
race = mob_db[md->mob_class].race;
- if (!md->mode)
+ if (md->mode == MobMode::ZERO)
{
mode = mob_db[md->mob_class].mode;
}
@@ -1437,18 +1444,18 @@ int mob_target(struct mob_data *md, struct block_list *bl, int dist)
{
mode = md->mode;
}
- if (!(mode & 0x80))
+ if (!bool(mode & MobMode::CAN_ATTACK))
{
md->target_id = 0;
return 0;
}
// Nothing will be carried out if there is no mind of changing TAGE by TAGE ending.
if ((md->target_id > 0 && md->state.attackable)
- && (!(mode & 0x04) || MRAND(100) > 25))
+ && (!bool(mode & MobMode::AGGRESSIVE) || MRAND(100) > 25))
return 0;
// Coercion is exerted if it is MVPMOB.
- if (mode & 0x20
+ if (bool(mode & MobMode::BOSS)
|| (sc_data && sc_data[SC_TRICKDEAD].timer == -1
&& ((option != NULL && !bool(*option & (Option::CLOAK | Option::HIDE2)))
|| race == 4
@@ -1459,7 +1466,7 @@ int mob_target(struct mob_data *md, struct block_list *bl, int dist)
nullpo_ret(sd = (struct map_session_data *) bl);
if (sd->invincible_timer != -1 || pc_isinvisible(sd))
return 0;
- if (!(mode & 0x20) && race != 4 && race != 6
+ if (!bool(mode & MobMode::BOSS) && race != 4 && race != 6
&& sd->state.gangsterparadise)
return 0;
}
@@ -1486,7 +1493,8 @@ void mob_ai_sub_hard_activesearch(struct block_list *bl,
{
struct map_session_data *tsd = NULL;
struct mob_data *tmd = NULL;
- int mode, race, dist;
+ MobMode mode;
+ int race, dist;
nullpo_retv(bl);
nullpo_retv(smd);
@@ -1503,13 +1511,13 @@ void mob_ai_sub_hard_activesearch(struct block_list *bl,
if (battle_check_target(&smd->bl, bl, BCT_ENEMY) == 0)
return;
- if (!smd->mode)
+ if (smd->mode == MobMode::ZERO)
mode = mob_db[smd->mob_class].mode;
else
mode = smd->mode;
// アクティブでターゲット射程内にいるなら、ロックする
- if (mode & 0x04)
+ if (bool(mode & MobMode::AGGRESSIVE))
{
race = mob_db[smd->mob_class].race;
//対象がPCの場合
@@ -1521,10 +1529,11 @@ void mob_ai_sub_hard_activesearch(struct block_list *bl,
(dist =
distance(smd->bl.x, smd->bl.y, tsd->bl.x, tsd->bl.y)) < 9)
{
- if (mode & 0x20 ||
- (tsd->sc_data[SC_TRICKDEAD].timer == -1 &&
- ((!pc_ishiding(tsd) && !tsd->state.gangsterparadise)
- || race == 4 || race == 6)))
+ if (bool(mode & MobMode::BOSS)
+ || (tsd->sc_data[SC_TRICKDEAD].timer == -1
+ && ((!pc_ishiding(tsd)
+ && !tsd->state.gangsterparadise)
+ || race == 4 || race == 6)))
{ // 妨害がないか判定
if (mob_can_reach(smd, bl, 12) && // 到達可能性判定
MRAND(1000) < 1000 / (++(*pcc)))
@@ -1559,11 +1568,12 @@ void mob_ai_sub_hard_activesearch(struct block_list *bl,
static
void mob_ai_sub_hard_lootsearch(struct block_list *bl, struct mob_data *md, int *itc)
{
- int mode, dist;
+ MobMode mode;
+ int dist;
nullpo_retv(bl);
- if (!md->mode)
+ if (md->mode == MobMode::ZERO)
{
mode = mob_db[md->mob_class].mode;
}
@@ -1572,7 +1582,7 @@ void mob_ai_sub_hard_lootsearch(struct block_list *bl, struct mob_data *md, int
mode = md->mode;
}
- if (!md->target_id && mode & 0x02)
+ if (!md->target_id && bool(mode & MobMode::LOOTER))
{
if (!md->lootitem
|| (battle_config.monster_loot_type == 1
@@ -1606,23 +1616,16 @@ void mob_ai_sub_hard_linksearch(struct block_list *bl, struct mob_data *md, stru
nullpo_retv(md);
nullpo_retv(target);
- // same family free in a range at a link monster -- it will be made to lock if MOB is
-/* if ((md->target_id > 0 && md->state.attackable) && mob_db[md->mob_class].mode&0x08){
- if ( tmd->mob_class==md->mob_class && (!tmd->target_id || !md->state.attackable) && tmd->bl.m == md->bl.m){
- if ( mob_can_reach(tmd,target,12) ){ // Reachability judging
- tmd->target_id=md->target_id;
- tmd->state.attackable = true;
- tmd->min_chase=13;
- }
- }
- }*/
- if (md->attacked_id > 0 && mob_db[md->mob_class].mode & 0x08)
+ if (md->attacked_id > 0
+ && bool(mob_db[md->mob_class].mode & MobMode::ASSIST))
{
- if (tmd->mob_class == md->mob_class && tmd->bl.m == md->bl.m
+ if (tmd->mob_class == md->mob_class
+ && tmd->bl.m == md->bl.m
&& (!tmd->target_id || !md->state.attackable))
{
if (mob_can_reach(tmd, target, 12))
- { // Reachability judging
+ {
+ // Reachability judging
tmd->target_id = md->attacked_id;
tmd->state.attackable = true;
tmd->min_chase = 13;
@@ -1640,7 +1643,8 @@ int mob_ai_sub_hard_slavemob(struct mob_data *md, unsigned int tick)
{
struct mob_data *mmd = NULL;
struct block_list *bl;
- int mode, race, old_dist;
+ MobMode mode;
+ int race, old_dist;
nullpo_ret(md);
@@ -1742,7 +1746,7 @@ int mob_ai_sub_hard_slavemob(struct mob_data *md, unsigned int tick)
{
race = mob_db[md->mob_class].race;
- if (mode & 0x20 ||
+ if (bool(mode & MobMode::BOSS) ||
(sd->sc_data[SC_TRICKDEAD].timer == -1 &&
((!pc_ishiding(sd) && !sd->state.gangsterparadise)
|| race == 4 || race == 6)))
@@ -1863,7 +1867,8 @@ void mob_ai_sub_hard(struct block_list *bl, unsigned int tick)
struct flooritem_data *fitem;
int i, dx, dy, ret, dist;
int attack_type = 0;
- int mode, race;
+ MobMode mode;
+ int race;
nullpo_retv(bl);
md = (struct mob_data *) bl;
@@ -1879,7 +1884,7 @@ void mob_ai_sub_hard(struct block_list *bl, unsigned int tick)
return;
}
- if (!md->mode)
+ if (md->mode == MobMode::ZERO)
mode = mob_db[md->mob_class].mode;
else
mode = md->mode;
@@ -1891,10 +1896,10 @@ void mob_ai_sub_hard(struct block_list *bl, unsigned int tick)
|| md->state.state == MS_DELAY)
return;
- if (!(mode & 0x80) && md->target_id > 0)
+ if (!bool(mode & MobMode::CAN_ATTACK) && md->target_id > 0)
md->target_id = 0;
- if (md->attacked_id > 0 && mode & 0x08)
+ if (md->attacked_id > 0 && bool(mode & MobMode::ASSIST))
{ // Link monster
struct map_session_data *asd = map_id2sd(md->attacked_id);
if (asd)
@@ -1909,9 +1914,9 @@ void mob_ai_sub_hard(struct block_list *bl, unsigned int tick)
}
// It checks to see it was attacked first (if active, it is target change at 25% of probability).
- if (mode > 0 && md->attacked_id > 0
+ if (mode != MobMode::ZERO && md->attacked_id > 0
&& (!md->target_id || !md->state.attackable
- || (mode & 0x04 && MRAND(100) < 25)))
+ || (bool(mode & MobMode::AGGRESSIVE) && MRAND(100) < 25)))
{
struct block_list *abl = map_id2bl(md->attacked_id);
struct map_session_data *asd = NULL;
@@ -1945,7 +1950,7 @@ void mob_ai_sub_hard(struct block_list *bl, unsigned int tick)
// アクティヴモンスターの策敵 (?? of a bitter taste TIVU monster)
if ((!md->target_id || !md->state.attackable)
- && mode & 0x04 && !md->state.master_check
+ && bool(mode & MobMode::AGGRESSIVE) && !md->state.master_check
&& battle_config.monster_active_enable == 1)
{
i = 0;
@@ -1965,7 +1970,9 @@ void mob_ai_sub_hard(struct block_list *bl, unsigned int tick)
}
// The item search of a route monster
- if (!md->target_id && mode & 0x02 && !md->state.master_check)
+ if (!md->target_id
+ && bool(mode & MobMode::LOOTER)
+ && !md->state.master_check)
{
i = 0;
map_foreachinarea(std::bind(mob_ai_sub_hard_lootsearch, ph::_1, md, &i),
@@ -1989,7 +1996,7 @@ void mob_ai_sub_hard(struct block_list *bl, unsigned int tick)
distance(md->bl.x, md->bl.y, tbl->x,
tbl->y)) >= md->min_chase)
mob_unlocktarget(md, tick); // 別マップか、視界外
- else if (tsd && !(mode & 0x20)
+ else if (tsd && !bool(mode & MobMode::BOSS)
&& (tsd->sc_data[SC_TRICKDEAD].timer != -1
||
((pc_ishiding(tsd)
@@ -1999,7 +2006,7 @@ void mob_ai_sub_hard(struct block_list *bl, unsigned int tick)
else if (!battle_check_range(&md->bl, tbl, mob_db[md->mob_class].range))
{
// 攻撃範囲外なので移動
- if (!(mode & 1))
+ if (!bool(mode & MobMode::CAN_MOVE))
{ // 移動しないモード
mob_unlocktarget(md, tick);
return;
@@ -2103,7 +2110,7 @@ void mob_ai_sub_hard(struct block_list *bl, unsigned int tick)
}
else if (dist)
{
- if (!(mode & 1))
+ if (!bool(mode & MobMode::CAN_MOVE))
{ // 移動しないモード
mob_unlocktarget(md, tick);
return;
@@ -2173,9 +2180,10 @@ void mob_ai_sub_hard(struct block_list *bl, unsigned int tick)
return;
// 歩行処理
- if (mode & 1 && mob_can_move(md) && // 移動可能MOB&動ける状態にある
- (md->master_id == 0 || md->state.special_mob_ai
- || md->master_dist > 10))
+ if (bool(mode & MobMode::CAN_MOVE)
+ && mob_can_move(md)
+ && (md->master_id == 0 || md->state.special_mob_ai
+ || md->master_dist > 10))
{ //取り巻きMOBじゃない
if (DIFF_TICK(md->next_walktime, tick) > +7000 &&
@@ -2248,8 +2256,9 @@ void mob_ai_sub_lazy(db_key_t, db_val_t data, unsigned int tick)
return;
}
- if (DIFF_TICK(md->next_walktime, tick) < 0 &&
- (mob_db[md->mob_class].mode & 1) && mob_can_move(md))
+ if (DIFF_TICK(md->next_walktime, tick) < 0
+ && bool(mob_db[md->mob_class].mode & MobMode::CAN_MOVE)
+ && mob_can_move(md))
{
if (map[md->bl.m].users > 0)
@@ -2263,7 +2272,7 @@ void mob_ai_sub_lazy(db_key_t, db_val_t data, unsigned int tick)
// MOB which is not not the summons MOB but BOSS, either sometimes reboils.
else if (MRAND(1000) < MOB_LAZYWARPPERC && md->x0 <= 0
&& md->master_id != 0 && mob_db[md->mob_class].mexp <= 0
- && !(mob_db[md->mob_class].mode & 0x20))
+ && !bool(mob_db[md->mob_class].mode & MobMode::BOSS))
mob_spawn(md->bl.id);
}
@@ -2274,7 +2283,7 @@ void mob_ai_sub_lazy(db_key_t, db_val_t data, unsigned int tick)
// MOB which is not BOSS which is not Summons MOB, either -- a case -- sometimes -- leaping
if (MRAND(1000) < MOB_LAZYWARPPERC && md->x0 <= 0
&& md->master_id != 0 && mob_db[md->mob_class].mexp <= 0
- && !(mob_db[md->mob_class].mode & 0x20))
+ && !bool(mob_db[md->mob_class].mode & MobMode::BOSS))
mob_warp(md, -1, -1, -1, -1);
}
@@ -2491,11 +2500,11 @@ int mob_damage(struct block_list *src, struct mob_data *md, int damage,
nullpo_ret(md); //srcはNULLで呼ばれる場合もあるので、他でチェック
if (src && src->id == md->master_id
- && md->mode & MOB_MODE_TURNS_AGAINST_BAD_MASTER)
+ && bool(md->mode & MOB_MODE_TURNS_AGAINST_BAD_MASTER))
{
/* If the master hits a monster, have the monster turn against him */
md->master_id = 0;
- md->mode = 0x85; /* Regular war mode */
+ md->mode = MobMode::war; /* Regular war mode */
md->target_id = src->id;
md->attacked_id = src->id;
}
@@ -2635,7 +2644,7 @@ int mob_damage(struct block_list *src, struct mob_data *md, int damage,
if ((skillidx =
mob_skillid2skillidx(md->mob_class, NPC_SELFDESTRUCTION2)) >= 0)
{
- md->mode |= 0x1;
+ md->mode |= MobMode::CAN_MOVE;
md->next_walktime = tick;
mobskill_use_id(md, &md->bl, skillidx); //自爆詠唱開始
md->state.special_mob_ai++;
@@ -2826,9 +2835,9 @@ int mob_damage(struct block_list *src, struct mob_data *md, int damage,
if (sd->monster_drop_itemid[i] <= 0)
continue;
if (sd->monster_drop_race[i] & (1 << race) ||
- (mob_db[md->mob_class].mode & 0x20
+ (bool(mob_db[md->mob_class].mode & MobMode::BOSS)
&& sd->monster_drop_race[i] & 1 << 10)
- || (!(mob_db[md->mob_class].mode & 0x20)
+ || (!bool(mob_db[md->mob_class].mode & MobMode::BOSS)
&& sd->monster_drop_race[i] & 1 << 11))
{
if (sd->monster_drop_itemrate[i] <= MRAND(10000))
@@ -3026,7 +3035,8 @@ int mob_class_change(struct mob_data *md, int *value)
md->skillid = SkillID();
md->skilllv = 0;
- if (md->lootitem == NULL && mob_db[mob_class].mode & 0x02)
+ if (md->lootitem == NULL
+ && bool(mob_db[mob_class].mode & MobMode::LOOTER))
md->lootitem = (struct item *)
calloc(LOOTITEM_SIZE, sizeof(struct item));
@@ -3231,7 +3241,7 @@ int mob_summonslave(struct mob_data *md2, int *value, int amount, int flag)
{
int x = 0, y = 0, c = 0, i = 0;
md = (struct mob_data *) calloc(1, sizeof(struct mob_data));
- if (mob_db[mob_class].mode & 0x02)
+ if (bool(mob_db[mob_class].mode & MobMode::LOOTER))
md->lootitem = (struct item *)
calloc(LOOTITEM_SIZE, sizeof(struct item));
else
@@ -4012,7 +4022,7 @@ int mob_makedummymobdb(int mob_class)
mob_db[mob_class].size = 0;
mob_db[mob_class].race = 0;
mob_db[mob_class].element = 0;
- mob_db[mob_class].mode = 0;
+ mob_db[mob_class].mode = MobMode::ZERO;
mob_db[mob_class].speed = 300;
mob_db[mob_class].adelay = 1000;
mob_db[mob_class].amotion = 500;
@@ -4133,7 +4143,7 @@ int mob_readdb(void)
mob_db[mob_class].size = atoi(str[21]);
mob_db[mob_class].race = atoi(str[22]);
mob_db[mob_class].element = atoi(str[23]);
- mob_db[mob_class].mode = atoi(str[24]);
+ mob_db[mob_class].mode = static_cast<MobMode>(atoi(str[24]));
mob_db[mob_class].speed = atoi(str[25]);
mob_db[mob_class].adelay = atoi(str[26]);
mob_db[mob_class].amotion = atoi(str[27]);
diff --git a/src/map/mob.hpp b/src/map/mob.hpp
index b8b1128..357c4fa 100644
--- a/src/map/mob.hpp
+++ b/src/map/mob.hpp
@@ -37,7 +37,8 @@ struct mob_db
int def, mdef;
earray<int, ATTR, ATTR::COUNT> attrs;
int range, range2, range3;
- int size, race, element, mode;
+ int size, race, element;
+ MobMode mode;
int speed, adelay, amotion, dmotion;
int mexp, mexpper;
int mutations_nr, mutation_power;
diff --git a/src/map/npc.cpp b/src/map/npc.cpp
index 876b0fd..1d10855 100644
--- a/src/map/npc.cpp
+++ b/src/map/npc.cpp
@@ -1719,7 +1719,7 @@ int npc_parse_mob(const char *w1, const char *, const char *w3, const char *w4)
memcpy(md->name, w3, 24);
md->n = i;
- md->base_class = md->mob_class = mob_class;
+ md->mob_class = mob_class;
md->bl.id = npc_get_new_npc_id();
md->m = m;
md->x0 = x;
@@ -1734,7 +1734,7 @@ int npc_parse_mob(const char *w1, const char *, const char *w3, const char *w4)
md->target_id = 0;
md->attacked_id = 0;
- if (mob_db[mob_class].mode & 0x02)
+ if (bool(mob_db[mob_class].mode & MobMode::LOOTER))
md->lootitem =
(struct item *) calloc(LOOTITEM_SIZE, sizeof(struct item));
else
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index 931db47..c25392a 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -1265,14 +1265,6 @@ int pc_calcstatus(struct map_session_data *sd, int first)
sd->arrow_range = 0;
sd->nhealhp = sd->nhealsp = sd->nshealhp = sd->nshealsp = sd->nsshealhp =
sd->nsshealsp = 0;
- memset(sd->addele, 0, sizeof(sd->addele));
- memset(sd->addrace, 0, sizeof(sd->addrace));
- memset(sd->addsize, 0, sizeof(sd->addsize));
- memset(sd->addele_, 0, sizeof(sd->addele_));
- memset(sd->addrace_, 0, sizeof(sd->addrace_));
- memset(sd->addsize_, 0, sizeof(sd->addsize_));
- memset(sd->subele, 0, sizeof(sd->subele));
- memset(sd->subrace, 0, sizeof(sd->subrace));
for (int& ire : sd->addeff)
ire = 0;
for (int& ire : sd->addeff2)
@@ -1280,8 +1272,6 @@ int pc_calcstatus(struct map_session_data *sd, int first)
for (int& ire : sd->reseff)
ire = 0;
memset(&sd->special_state, 0, sizeof(sd->special_state));
- memset(sd->weapon_coma_ele, 0, sizeof(sd->weapon_coma_ele));
- memset(sd->weapon_coma_race, 0, sizeof(sd->weapon_coma_race));
sd->watk_ = 0; //二刀流用(仮)
sd->watk_2 = 0;
@@ -1302,32 +1292,17 @@ int pc_calcstatus(struct map_session_data *sd, int first)
sd->ignore_mdef_ele = sd->ignore_mdef_race = 0;
sd->arrow_cri = 0;
sd->magic_def_rate = sd->misc_def_rate = 0;
- memset(sd->arrow_addele, 0, sizeof(sd->arrow_addele));
- memset(sd->arrow_addrace, 0, sizeof(sd->arrow_addrace));
- memset(sd->arrow_addsize, 0, sizeof(sd->arrow_addsize));
for (int& ire : sd->arrow_addeff)
ire = 0;
for (int& ire : sd->arrow_addeff2)
ire = 0;
- memset(sd->magic_addele, 0, sizeof(sd->magic_addele));
- memset(sd->magic_addrace, 0, sizeof(sd->magic_addrace));
- memset(sd->magic_subrace, 0, sizeof(sd->magic_subrace));
sd->perfect_hit = 0;
sd->critical_rate = sd->hit_rate = sd->flee_rate = sd->flee2_rate = 100;
sd->def_rate = sd->def2_rate = sd->mdef_rate = sd->mdef2_rate = 100;
sd->def_ratio_atk_ele = sd->def_ratio_atk_ele_ = 0;
sd->def_ratio_atk_race = sd->def_ratio_atk_race_ = 0;
sd->get_zeny_num = 0;
- sd->add_damage_class_count = sd->add_damage_class_count_ =
- sd->add_magic_damage_class_count = 0;
- sd->add_def_class_count = sd->add_mdef_class_count = 0;
sd->monster_drop_item_count = 0;
- memset(sd->add_damage_classrate, 0, sizeof(sd->add_damage_classrate));
- memset(sd->add_damage_classrate_, 0, sizeof(sd->add_damage_classrate_));
- memset(sd->add_magic_damage_classrate, 0,
- sizeof(sd->add_magic_damage_classrate));
- memset(sd->add_def_classrate, 0, sizeof(sd->add_def_classrate));
- memset(sd->add_mdef_classrate, 0, sizeof(sd->add_mdef_classrate));
memset(sd->monster_drop_race, 0, sizeof(sd->monster_drop_race));
memset(sd->monster_drop_itemrate, 0, sizeof(sd->monster_drop_itemrate));
sd->speed_add_rate = sd->aspd_add_rate = 100;
@@ -2016,25 +1991,6 @@ int pc_calcstatus(struct map_session_data *sd, int first)
if (sd->sc_data[SC_CONCENTRATION].timer != -1) //コンセントレーション
sd->hit += (10 * (sd->sc_data[SC_CONCENTRATION].val1));
- // 耐性
- if (sd->sc_data[SC_SIEGFRIED].timer != -1)
- { // 不死身のジークフリード
- sd->subele[1] += sd->sc_data[SC_SIEGFRIED].val2; // 水
- sd->subele[2] += sd->sc_data[SC_SIEGFRIED].val2; // 水
- sd->subele[3] += sd->sc_data[SC_SIEGFRIED].val2; // 水
- sd->subele[4] += sd->sc_data[SC_SIEGFRIED].val2; // 水
- sd->subele[5] += sd->sc_data[SC_SIEGFRIED].val2; // 水
- sd->subele[6] += sd->sc_data[SC_SIEGFRIED].val2; // 水
- sd->subele[7] += sd->sc_data[SC_SIEGFRIED].val2; // 水
- sd->subele[8] += sd->sc_data[SC_SIEGFRIED].val2; // 水
- sd->subele[9] += sd->sc_data[SC_SIEGFRIED].val2; // 水
- }
- if (sd->sc_data[SC_PROVIDENCE].timer != -1)
- { // プロヴィデンス
- sd->subele[6] += sd->sc_data[SC_PROVIDENCE].val2; // 対 聖属性
- sd->subrace[6] += sd->sc_data[SC_PROVIDENCE].val2; // 対 悪魔
- }
-
// その他
if (sd->sc_data[SC_APPLEIDUN].timer != -1)
{ // イドゥンの林檎
@@ -2609,44 +2565,10 @@ int pc_bonus(struct map_session_data *sd, SP type, int val)
*/
int pc_bonus2(struct map_session_data *sd, SP type, int type2, int val)
{
- int i;
-
nullpo_ret(sd);
switch (type)
{
- case SP_ADDELE:
- if (!sd->state.lr_flag)
- sd->addele[type2] += val;
- else if (sd->state.lr_flag == 1)
- sd->addele_[type2] += val;
- else if (sd->state.lr_flag == 2)
- sd->arrow_addele[type2] += val;
- break;
- case SP_ADDRACE:
- if (!sd->state.lr_flag)
- sd->addrace[type2] += val;
- else if (sd->state.lr_flag == 1)
- sd->addrace_[type2] += val;
- else if (sd->state.lr_flag == 2)
- sd->arrow_addrace[type2] += val;
- break;
- case SP_ADDSIZE:
- if (!sd->state.lr_flag)
- sd->addsize[type2] += val;
- else if (sd->state.lr_flag == 1)
- sd->addsize_[type2] += val;
- else if (sd->state.lr_flag == 2)
- sd->arrow_addsize[type2] += val;
- break;
- case SP_SUBELE:
- if (sd->state.lr_flag != 2)
- sd->subele[type2] += val;
- break;
- case SP_SUBRACE:
- if (sd->state.lr_flag != 2)
- sd->subrace[type2] += val;
- break;
case SP_ADDEFF:
if (sd->state.lr_flag != 2)
sd->addeff[BadSC(type2)] += val;
@@ -2663,122 +2585,6 @@ int pc_bonus2(struct map_session_data *sd, SP type, int type2, int val)
if (sd->state.lr_flag != 2)
sd->reseff[BadSC(type2)] += val;
break;
- case SP_MAGIC_ADDELE:
- if (sd->state.lr_flag != 2)
- sd->magic_addele[type2] += val;
- break;
- case SP_MAGIC_ADDRACE:
- if (sd->state.lr_flag != 2)
- sd->magic_addrace[type2] += val;
- break;
- case SP_MAGIC_SUBRACE:
- if (sd->state.lr_flag != 2)
- sd->magic_subrace[type2] += val;
- break;
- case SP_ADD_DAMAGE_CLASS:
- if (!sd->state.lr_flag)
- {
- for (i = 0; i < sd->add_damage_class_count; i++)
- {
- if (sd->add_damage_classid[i] == type2)
- {
- sd->add_damage_classrate[i] += val;
- break;
- }
- }
- if (i >= sd->add_damage_class_count
- && sd->add_damage_class_count < 10)
- {
- sd->add_damage_classid[sd->add_damage_class_count] =
- type2;
- sd->add_damage_classrate[sd->add_damage_class_count] +=
- val;
- sd->add_damage_class_count++;
- }
- }
- else if (sd->state.lr_flag == 1)
- {
- for (i = 0; i < sd->add_damage_class_count_; i++)
- {
- if (sd->add_damage_classid_[i] == type2)
- {
- sd->add_damage_classrate_[i] += val;
- break;
- }
- }
- if (i >= sd->add_damage_class_count_
- && sd->add_damage_class_count_ < 10)
- {
- sd->add_damage_classid_[sd->add_damage_class_count_] =
- type2;
- sd->add_damage_classrate_[sd->add_damage_class_count_] +=
- val;
- sd->add_damage_class_count_++;
- }
- }
- break;
- case SP_ADD_MAGIC_DAMAGE_CLASS:
- if (sd->state.lr_flag != 2)
- {
- for (i = 0; i < sd->add_magic_damage_class_count; i++)
- {
- if (sd->add_magic_damage_classid[i] == type2)
- {
- sd->add_magic_damage_classrate[i] += val;
- break;
- }
- }
- if (i >= sd->add_magic_damage_class_count
- && sd->add_magic_damage_class_count < 10)
- {
- sd->add_magic_damage_classid
- [sd->add_magic_damage_class_count] = type2;
- sd->add_magic_damage_classrate
- [sd->add_magic_damage_class_count] += val;
- sd->add_magic_damage_class_count++;
- }
- }
- break;
- case SP_ADD_DEF_CLASS:
- if (sd->state.lr_flag != 2)
- {
- for (i = 0; i < sd->add_def_class_count; i++)
- {
- if (sd->add_def_classid[i] == type2)
- {
- sd->add_def_classrate[i] += val;
- break;
- }
- }
- if (i >= sd->add_def_class_count
- && sd->add_def_class_count < 10)
- {
- sd->add_def_classid[sd->add_def_class_count] = type2;
- sd->add_def_classrate[sd->add_def_class_count] += val;
- sd->add_def_class_count++;
- }
- }
- break;
- case SP_ADD_MDEF_CLASS:
- if (sd->state.lr_flag != 2)
- {
- for (i = 0; i < sd->add_mdef_class_count; i++)
- {
- if (sd->add_mdef_classid[i] == type2)
- {
- sd->add_mdef_classrate[i] += val;
- break;
- }
- }
- if (i >= sd->add_mdef_class_count
- && sd->add_mdef_class_count < 10)
- {
- sd->add_mdef_classid[sd->add_mdef_class_count] = type2;
- sd->add_mdef_classrate[sd->add_mdef_class_count] += val;
- sd->add_mdef_class_count++;
- }
- }
- break;
case SP_HP_DRAIN_RATE:
if (!sd->state.lr_flag)
{
@@ -2803,14 +2609,6 @@ int pc_bonus2(struct map_session_data *sd, SP type, int type2, int val)
sd->sp_drain_per_ += val;
}
break;
- case SP_WEAPON_COMA_ELE:
- if (sd->state.lr_flag != 2)
- sd->weapon_coma_ele[type2] += val;
- break;
- case SP_WEAPON_COMA_RACE:
- if (sd->state.lr_flag != 2)
- sd->weapon_coma_race[type2] += val;
- break;
case SP_RANDOM_ATTACK_INCREASE: // [Valaris]
if (sd->state.lr_flag != 2)
{
@@ -3420,11 +3218,11 @@ int pc_steal_item(struct map_session_data *sd, struct block_list *bl)
int i, skill, rate, itemid, count;
struct mob_data *md;
md = (struct mob_data *) bl;
- if (!md->state.steal_flag && mob_db[md->mob_class].mexp <= 0 &&
- !(mob_db[md->mob_class].mode & 0x20) &&
- md->sc_data[SC_STONE].timer == -1 &&
- md->sc_data[SC_FREEZE].timer == -1 &&
- (!(md->mob_class > 1324 && md->mob_class < 1364))) // prevent stealing from treasure boxes [Valaris]
+ if (!md->state.steal_flag
+ && mob_db[md->mob_class].mexp <= 0
+ && !bool(mob_db[md->mob_class].mode & MobMode::BOSS)
+ && md->sc_data[SC_STONE].timer == -1
+ && md->sc_data[SC_FREEZE].timer == -1)
{
skill = sd->paramc[ATTR::DEX] - mob_db[md->mob_class].attrs[ATTR::DEX] + 10;
diff --git a/src/map/skill.cpp b/src/map/skill.cpp
index bab0db2..68ceaff 100644
--- a/src/map/skill.cpp
+++ b/src/map/skill.cpp
@@ -311,7 +311,7 @@ earray<StatusChange, SkillID, MAX_SKILL_DB> SkillStatusChangeTable //=
StatusChange::NEGATIVE1,
StatusChange::NEGATIVE1,
SC_DEVOTION,
- SC_PROVIDENCE,
+ StatusChange::NEGATIVE1,
SC_DEFENDER,
SC_SPEARSQUICKEN,
StatusChange::NEGATIVE1,
@@ -374,7 +374,7 @@ earray<StatusChange, SkillID, MAX_SKILL_DB> SkillStatusChangeTable //=
SC_NIBELUNGEN,
SC_ROKISWEIL,
SC_INTOABYSS,
- SC_SIEGFRIED,
+ StatusChange::NEGATIVE1,
StatusChange::NEGATIVE1,
StatusChange::NEGATIVE1,
StatusChange::NEGATIVE1,
@@ -1732,8 +1732,6 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl,
return 1;
if (dstsd && pc_isdead(dstsd))
return 1;
- if (battle_get_class(bl) == 1288)
- return 1;
map_freeblock_lock();
switch (skillid)
@@ -2314,11 +2312,12 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl,
int sec = skill_get_time2(sg->skill_id,
sg->skill_lv) -
(double) battle_get_agi(bl) * 0.1;
- if (battle_get_mode(bl) & 0x20)
+ if (bool(battle_get_mode(bl) & MobMode::BOSS))
sec = sec / 5;
battle_stopwalking(bl, 1);
- skill_status_change_start(bl, SC_ANKLE, sg->skill_lv, 0, 0,
- 0, sec, 0);
+ skill_status_change_start(bl, SC_ANKLE,
+ sg->skill_lv, 0, 0, 0,
+ sec, 0);
if (moveblock)
map_delblock(bl);
@@ -3296,7 +3295,8 @@ int skill_use_id(struct map_session_data *sd, int target_id,
/* 詠唱反応モンスター */
if (bl->type == BL_MOB && (md = (struct mob_data *) bl)
- && mob_db[md->mob_class].mode & 0x10 && md->state.state != MS_ATTACK
+ && bool(mob_db[md->mob_class].mode & MobMode::CAST_SENSOR)
+ && md->state.state != MS_ATTACK
&& sd->invincible_timer == -1)
{
md->target_id = sd->bl.id;
@@ -3787,7 +3787,6 @@ int skill_status_change_end(struct block_list *bl, StatusChange type, int tid)
case SC_GLORIA: /* グロリア */
case SC_LOUD: /* ラウドボイス */
case SC_QUAGMIRE: /* クァグマイア */
- case SC_PROVIDENCE: /* プロヴィデンス */
case SC_SPEARSQUICKEN: /* スピアクイッケン */
case SC_VOLCANO:
case SC_DELUGE:
@@ -3795,7 +3794,6 @@ int skill_status_change_end(struct block_list *bl, StatusChange type, int tid)
case SC_ETERNALCHAOS: /* エターナルカオス */
case SC_DRUMBATTLE: /* 戦太鼓の響き */
case SC_NIBELUNGEN: /* ニーベルングの指輪 */
- case SC_SIEGFRIED: /* 不死身のジークフリード */
case SC_WHISTLE: /* 口笛 */
case SC_ASSNCROS: /* 夕陽のアサシンクロス */
case SC_HUMMING: /* ハミング */
@@ -4477,7 +4475,7 @@ int skill_status_effect(struct block_list *bl, StatusChange type,
Opt2 *opt2;
Opt3 *opt3;
int opt_flag = 0, calc_flag = 0;
- int race, mode, elem, undead_flag;
+ int race, elem, undead_flag;
SP updateflag = SP::ZERO;
int scdef = 0;
@@ -4494,7 +4492,7 @@ int skill_status_effect(struct block_list *bl, StatusChange type,
nullpo_ret(opt3 = battle_get_opt3(bl));
race = battle_get_race(bl);
- mode = battle_get_mode(bl);
+ MobMode mode = battle_get_mode(bl);
elem = battle_get_elem_type(bl);
undead_flag = battle_check_undead(race, elem);
@@ -4565,13 +4563,17 @@ int skill_status_effect(struct block_list *bl, StatusChange type,
&& sc_data[type].val2 && !val2)
return 0;
- if (mode & 0x20 && (type == SC_STONE || type == SC_FREEZE ||
- type == SC_STAN || type == SC_SLEEP
- || type == SC_SILENCE || type == SC_QUAGMIRE
- || type == SC_DECREASEAGI || type == SC_SIGNUMCRUCIS
- || type == SC_PROVOKE || (type == SC_BLESSING
- && (undead_flag
- || race == 6)))
+ if (bool(mode & MobMode::BOSS)
+ && (type == SC_STONE
+ || type == SC_FREEZE
+ || type == SC_STAN
+ || type == SC_SLEEP
+ || type == SC_SILENCE
+ || type == SC_QUAGMIRE
+ || type == SC_DECREASEAGI
+ || type == SC_SIGNUMCRUCIS
+ || type == SC_PROVOKE
+ || (type == SC_BLESSING && (undead_flag || race == 6)))
&& !(flag & 1))
{
/* ボスには効かない(ただしカードによる効果は適用される) */
@@ -4755,10 +4757,6 @@ int skill_status_effect(struct block_list *bl, StatusChange type,
case SC_DEVOTION: /* ディボーション */
calc_flag = 1;
break;
- case SC_PROVIDENCE: /* プロヴィデンス */
- calc_flag = 1;
- val2 = val1 * 5;
- break;
case SC_REFLECTSHIELD:
val2 = 10 + val1 * 3;
break;
@@ -4828,11 +4826,6 @@ int skill_status_effect(struct block_list *bl, StatusChange type,
break;
case SC_INTOABYSS: /* 深淵の中に */
break;
- case SC_SIEGFRIED: /* 不死身のジークフリード */
- calc_flag = 1;
- val2 = 40 + val1 * 5;
- val3 = val1 * 10;
- break;
case SC_DISSONANCE: /* 不協和音 */
val2 = 10;
break;
diff --git a/src/map/skill.t.hpp b/src/map/skill.t.hpp
index 0b8b8e1..0bdee8f 100644
--- a/src/map/skill.t.hpp
+++ b/src/map/skill.t.hpp
@@ -131,8 +131,7 @@ enum class StatusChange : uint16_t
#define SC_REFLECTSHIELD StatusChange::SC_REFLECTSHIELD
SC_DEVOTION = 60,
#define SC_DEVOTION StatusChange::SC_DEVOTION
- SC_PROVIDENCE = 61,
-#define SC_PROVIDENCE StatusChange::SC_PROVIDENCE
+
SC_DEFENDER = 62,
#define SC_DEFENDER StatusChange::SC_DEFENDER
@@ -264,8 +263,7 @@ enum class StatusChange : uint16_t
#define SC_ROKISWEIL StatusChange::SC_ROKISWEIL
SC_INTOABYSS = 166,
#define SC_INTOABYSS StatusChange::SC_INTOABYSS
- SC_SIEGFRIED = 167,
-#define SC_SIEGFRIED StatusChange::SC_SIEGFRIED
+
SC_DISSONANCE = 168,
#define SC_DISSONANCE StatusChange::SC_DISSONANCE
SC_WHISTLE = 169,