summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c20
-rw-r--r--src/map/map.h3
-rw-r--r--src/map/mob.c53
-rw-r--r--src/map/mob.h2
-rw-r--r--src/map/pc.c20
-rw-r--r--src/map/status.c12
-rw-r--r--src/map/status.h1
7 files changed, 96 insertions, 15 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 634b04a70..6b46a357e 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1617,6 +1617,7 @@ static struct Damage battle_calc_pc_weapon_attack(
int damage,damage2,damage3=0,damage4=0,type,div_,blewcount=skill_get_blewcount(skill_num,skill_lv);
int flag,skill,dmg_lv = 0;
int t_mode=0,t_race=0,t_size=1,s_race=7,s_ele=0;
+ int t_race2=0;
struct status_change *sc_data,*t_sc_data;
short *sc_count;
short *option, *opt1, *opt2;
@@ -1644,6 +1645,7 @@ static struct Damage battle_calc_pc_weapon_attack(
option=status_get_option(src); //鷹とかペコとかカートとか
opt1=status_get_opt1(src); //石化、凍結、スタン、睡眠、暗闇
opt2=status_get_opt2(src); //毒、呪い、沈黙、暗闇?
+ t_race2=status_get_race2(target);
if(skill_num != CR_GRANDCROSS) //グランドクロスでないなら
sd->state.attack_type = BF_WEAPON; //攻撃タイプは武器攻撃
@@ -2517,17 +2519,20 @@ static struct Damage battle_calc_pc_weapon_attack(
cardfix=cardfix*(100+sd->addrace[t_race])/100; // 種族によるダメージ修正
cardfix=cardfix*(100+sd->addele[t_ele])/100; // 属性によるダメージ修正
cardfix=cardfix*(100+sd->addsize[t_size])/100; // サイズによるダメージ修正
+ cardfix=cardfix*(100+sd->addrace2[t_race2])/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; // サイズによるダメージ修正(左手による追加あり)
+ cardfix=cardfix*(100+sd->addrace2[t_race2]+sd->addrace2_[t_race2])/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; // サイズによるダメージ修正(弓矢による追加あり)
+ cardfix=cardfix*(100+sd->addrace2[t_race2])/100;
}
if(t_mode & 0x20) { //ボス
if(!sd->state.arrow_atk) { //弓矢攻撃以外なら
@@ -2567,6 +2572,7 @@ static struct Damage battle_calc_pc_weapon_attack(
cardfix=cardfix*(100+sd->addrace_[t_race])/100; // 種族によるダメージ修正左手
cardfix=cardfix*(100+sd->addele_[t_ele])/100; // 属 性によるダメージ修正左手
cardfix=cardfix*(100+sd->addsize_[t_size])/100; // サイズによるダメージ修正左手
+ cardfix=cardfix*(100+sd->addrace2_[t_race2])/100;
if(t_mode & 0x20) //ボス
cardfix=cardfix*(100+sd->addrace_[10])/100; //ボスモンスターに追加ダメージ左手
else
@@ -2580,8 +2586,8 @@ static struct Damage battle_calc_pc_weapon_attack(
}
}
if(!no_cardfix)
-
damage2=damage2*cardfix/100;
+
//カード補正による左手ダメージ増加
//カードによるダメージ増加処理(左手)ここまで
@@ -2629,14 +2635,14 @@ static struct Damage battle_calc_pc_weapon_attack(
}
if(t_sc_data[SC_ASSUMPTIO].timer != -1){ //アスムプティオ
if(!map[target->m].flag.pvp){
- damage=damage/3;
- damage2=damage2/3;
- }else{
- damage=damage/2;
- damage2=damage2/2;
+ damage=damage/3;
+ damage2=damage2/3;
+ }else{
+ damage=damage/2;
+ damage2=damage2/2;
+ }
}
}
- }
//対象にステータス異常がある場合のダメージ減算処理ここまで
if(damage < 0) damage = 0;
diff --git a/src/map/map.h b/src/map/map.h
index d4cd5084e..b8fe82539 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -289,6 +289,7 @@ struct map_session_data {
short ignore_def_mob, ignore_def_mob_;
int hp_loss_tick, hp_loss_rate;
short hp_loss_value, hp_loss_type;
+ int addrace2[6],addrace2_[6];
short spiritball, spiritball_old;
int spirit_timer[MAX_SKILL_LEVEL];
@@ -630,7 +631,7 @@ enum {
SP_CRIT_ATK_RATE, SP_CRITICAL_ADDRACE, SP_NO_REGEN, SP_ADDEFF_WHENHIT, SP_AUTOSPELL_WHENHIT, // 2013-2017
SP_SKILL_ATK, SP_UNSTRIPABLE, SP_ADD_DAMAGE_BY_CLASS, // 2018-2020
- SP_SP_GAIN_VALUE, SP_IGNORE_DEF_MOB, SP_HP_LOSS_RATE // 2021-2023
+ SP_SP_GAIN_VALUE, SP_IGNORE_DEF_MOB, SP_HP_LOSS_RATE, SP_ADDRACE2 // 2021-2023
};
enum {
diff --git a/src/map/mob.c b/src/map/mob.c
index 7d87b1b98..14a9b564b 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -35,7 +35,6 @@
#define MAX_MOB_DB 2000 /* Change this to increase the table size in your mob_db to accomodate
numbers more than 2000 for mobs if you want to (and know what you're doing).
Be sure to note that 4001 to 4047 are for advanced classes. */
-
struct mob_db mob_db[2001];
#define CLASSCHANGE_BOSS_NUM 21
@@ -4318,6 +4317,57 @@ static int mob_readskilldb(void)
}
return 0;
}
+/*==========================================
+ * db/mob_race_db.txt reading
+ *------------------------------------------
+ */
+static int mob_readdb_race(void)
+{
+ FILE *fp;
+ char line[1024];
+ int race,j,k;
+ char *str[20],*p,*np;
+
+ if( (fp=fopen("db/mob_race2_db.txt","r"))==NULL ){
+ printf("can't read db/mob_race2_db.txt\n");
+ return -1;
+ }
+
+ while(fgets(line,1020,fp)){
+ if(line[0]=='/' && line[1]=='/')
+ continue;
+ memset(str,0,sizeof(str));
+
+ for(j=0,p=line;j<12;j++){
+ if((np=strchr(p,','))!=NULL){
+ str[j]=p;
+ *np=0;
+ p=np+1;
+ } else
+ str[j]=p;
+ }
+ if(str[0]==NULL)
+ continue;
+
+ race=atoi(str[0]);
+ if (race < 0 || race >= MAX_MOB_RACE_DB)
+ continue;
+
+ for (j=1; j<20; j++) {
+ if (!str[j])
+ break;
+ k=atoi(str[j]);
+ if (k < 1000 || k > MAX_MOB_DB)
+ continue;
+ mob_db[k].race2 = race;
+ //mob_race_db[race][j] = k;
+ }
+ }
+ fclose(fp);
+ sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","db/mob_race2_db.txt");
+ ShowStatus(tmp_output);
+ return 0;
+}
void mob_reload(void)
{
@@ -4495,6 +4545,7 @@ int do_init_mob(void)
mob_readdb_mobavail();
mob_read_randommonster();
mob_readskilldb();
+ mob_readdb_race();
add_timer_func_list(mob_timer,"mob_timer");
add_timer_func_list(mob_delayspawn,"mob_delayspawn");
diff --git a/src/map/mob.h b/src/map/mob.h
index 103335365..83a07d301 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -3,6 +3,7 @@
#define _MOB_H_
#define MAX_RANDOMMONSTER 3
+#define MAX_MOB_RACE_DB 6
struct mob_skill {
short state;
@@ -26,6 +27,7 @@ struct mob_db {
int str,agi,vit,int_,dex,luk;
int range,range2,range3;
int size,race,element,mode;
+ short race2; // celest
int speed,adelay,amotion,dmotion;
int mexp,mexpper;
struct { int nameid,p; } dropitem[10]; //8 -> 10 Lupus
diff --git a/src/map/pc.c b/src/map/pc.c
index 2bb6ddf5d..cd2d9bb64 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -809,9 +809,9 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
// Automated script events
if (script_config.event_requires_trigger) {
- sd->state.event_death = pc_readglobalreg(sd,"PCDieEvent");
- sd->state.event_kill = pc_readglobalreg(sd,"PCKillEvent");
- sd->state.event_disconnect = pc_readglobalreg(sd,"PCLogoffEvent");
+ sd->state.event_death = pc_readglobalreg(sd, script_config.die_event_name);
+ sd->state.event_kill = pc_readglobalreg(sd, script_config.kill_event_name);
+ sd->state.event_disconnect = pc_readglobalreg(sd, script_config.logout_event_name);
// if script triggers are not required
} else {
sd->state.event_death = 1;
@@ -1839,6 +1839,14 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
sd->hp_loss_rate = val;
}
break;
+ case SP_ADDRACE2:
+ if (type2 > 0 && type2 < MAX_MOB_RACE_DB)
+ break;
+ if(sd->state.lr_flag != 2)
+ sd->addrace2[type2] += val;
+ else
+ sd->addrace2_[type2] += val;
+ break;
default:
if(battle_config.error_log)
@@ -5560,11 +5568,11 @@ int pc_setglobalreg(struct map_session_data *sd,char *reg,int val)
if(strcmp(reg,"PC_DIE_COUNTER") == 0 && sd->die_counter != val){
sd->die_counter = val;
status_calc_pc(sd,0);
- } else if(strcmp(reg,"PCDieEvent") == 0){
+ } else if(strcmp(reg,script_config.die_event_name) == 0){
sd->state.event_death = val;
- } else if(strcmp(reg,"PCKillEvent") == 0){
+ } else if(strcmp(reg,script_config.kill_event_name) == 0){
sd->state.event_kill = val;
- } else if(strcmp(reg,"PCLogoutEvent") == 0){
+ } else if(strcmp(reg,script_config.logout_event_name) == 0){
sd->state.event_disconnect = val;
}
diff --git a/src/map/status.c b/src/map/status.c
index 6c2300dca..74a7bd320 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -510,6 +510,8 @@ int status_calc_pc(struct map_session_data* sd,int first)
sd->sp_gain_value = 0;
sd->ignore_def_mob = sd->ignore_def_mob_ = 0;
sd->hp_loss_rate = sd->hp_loss_value = sd->hp_loss_type = 0;
+ memset(sd->addrace2,0,sizeof(sd->addrace2));
+ memset(sd->addrace2_,0,sizeof(sd->addrace2_));
if(!sd->disguiseflag && sd->disguise) {
sd->disguise=0;
@@ -2812,6 +2814,16 @@ int status_get_mexp(struct block_list *bl)
else
return 0;
}
+int status_get_race2(struct block_list *bl)
+{
+ nullpo_retr(0, bl);
+ if(bl->type == BL_MOB && (struct mob_data *)bl)
+ return mob_db[((struct mob_data *)bl)->class_].race2;
+ else if(bl->type==BL_PET && (struct pet_data *)bl)
+ return mob_db[((struct pet_data *)bl)->class_].race2;
+ else
+ return 0;
+}
// StatusChange系の所得
struct status_change *status_get_sc_data(struct block_list *bl)
diff --git a/src/map/status.h b/src/map/status.h
index dbb4ec21c..9bda514b7 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -240,6 +240,7 @@ int status_get_race(struct block_list *bl);
int status_get_size(struct block_list *bl);
int status_get_mode(struct block_list *bl);
int status_get_mexp(struct block_list *bl);
+int status_get_race2(struct block_list *bl);
struct status_change *status_get_sc_data(struct block_list *bl);
short *status_get_sc_count(struct block_list *bl);