summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-02-18 07:07:25 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-02-18 07:07:25 +0000
commitaa52f1d90449e970bd5972db00ef29f77eaa39d7 (patch)
treea391d053cd9063a34bb090f6839d2233e01aece5
parent797d05f77b8ab4cdfd67fda7aa44126fecc0da21 (diff)
downloadhercules-aa52f1d90449e970bd5972db00ef29f77eaa39d7.tar.gz
hercules-aa52f1d90449e970bd5972db00ef29f77eaa39d7.tar.bz2
hercules-aa52f1d90449e970bd5972db00ef29f77eaa39d7.tar.xz
hercules-aa52f1d90449e970bd5972db00ef29f77eaa39d7.zip
* Added bAddRace2
* Added mob_race2_db.txt * Updated description for backup_txt in char_athena.conf a bit * Added some suggestions by Poki#3 * Use the event names from script_athena.conf to check whenever a player event trigger is being read/set * Removed an unused save/bank.txt git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1131 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-SVN.txt11
-rw-r--r--conf-tmpl/battle_athena.conf4
-rw-r--r--conf-tmpl/char_athena.conf2
-rw-r--r--conf-tmpl/map_athena.conf4
-rw-r--r--db/Changelog.txt2
-rw-r--r--db/const.txt1
-rw-r--r--db/item_db.txt2
-rw-r--r--db/mob_race2_db.txt6
-rw-r--r--doc/item_bonus.txt2
-rw-r--r--save-tmpl/bank.txt0
-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
17 files changed, 124 insertions, 21 deletions
diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt
index 8d5ab72cb..5a3de0f2c 100644
--- a/Changelog-SVN.txt
+++ b/Changelog-SVN.txt
@@ -1,7 +1,18 @@
Date Added
02/18
+ * Added bAddRace2 -- check item_bonus.txt [celest]
+ * Added mob_race2_db.txt -- contains 'main races' of certain monsters [celest]
+ * Updated description for backup_txt in char_athena.conf a bit [celest]
+ * Set read_map_from_cache to 2 (enable compression), and map_cache_file back to
+ saving in /db instead of /save, as suggested by Poki#3 [celest]
+ * Updated description for auto_counter_type, and set plaer_auto_counter_type
+ to 0 by default, as suggested by Poki#3 [celest]
+ * Use the event names from script_athena.conf to check whenever a player event
+ trigger is being read/set [celest]
+ * Removed an unused save/bank.txt [celest]
* Added some new cards effects. (check DB\changelog.txt) [Lupus]
+
02/17
* Now all mobs have 10 drops slots. the last one is used for Cards Drops [Lupus]
Don't forget to update your SQL files (Drop Log: logs.sql and db_tables.sql
diff --git a/conf-tmpl/battle_athena.conf b/conf-tmpl/battle_athena.conf
index 2b5114f95..34e047990 100644
--- a/conf-tmpl/battle_athena.conf
+++ b/conf-tmpl/battle_athena.conf
@@ -466,12 +466,12 @@ save_clothcolor: yes
// 2 = both
undead_detect_type: 2
-// Operational mode of automatic counter.
+// Counter Attack Skill Type
// 0 = 100% critical
// 1 = disregard DEF and HIT+20, CRI*2
// 2 = Same as 0, but can counter skills (?)
// Players
-player_auto_counter_type: 1
+player_auto_counter_type: 0
// Monsters
monster_auto_counter_type: 0
diff --git a/conf-tmpl/char_athena.conf b/conf-tmpl/char_athena.conf
index 97021d816..6b73b3447 100644
--- a/conf-tmpl/char_athena.conf
+++ b/conf-tmpl/char_athena.conf
@@ -84,7 +84,7 @@ char_txt: save/athena.txt
// default is 'no', because backup file take time for nothing. Actually, there is no problem on characters file creation and save.
backup_txt_flag: no
-// Character server flatfile database (backup)
+// Character server flatfile database (backup, TXT only)
backup_txt: save/athena_backup.txt
// Friends list flatfile database
diff --git a/conf-tmpl/map_athena.conf b/conf-tmpl/map_athena.conf
index ad01675d0..405af5d80 100644
--- a/conf-tmpl/map_athena.conf
+++ b/conf-tmpl/map_athena.conf
@@ -57,10 +57,10 @@ map_port: 5121
// It is possible to reduce the map cache to 1MB for 400+ maps with compression
// enabled. If all maps are already loaded in the cache, Athena can boot without
// reading the grf files.
-read_map_from_cache: 1
+read_map_from_cache: 2
//
//Where is the bitmap file stored?
-map_cache_file: save/mapinfo.txt
+map_cache_file: db/mapinfo.txt
// Console Commands
// Allow for console commands to be used on/off
diff --git a/db/Changelog.txt b/db/Changelog.txt
index c757a0adf..73f7b4380 100644
--- a/db/Changelog.txt
+++ b/db/Changelog.txt
@@ -6,6 +6,8 @@
Skill databases == celest working on them i believe.
02/18
+ * Changed Goblin Leader Card to using bAddRace2 -- each player can only save
+ 10 AddDamageClass, so this would save some space for other cards ^^ [celest]
* Started adding new cards effects. Also big thanks to Landarma [Lupus]
02/17
diff --git a/db/const.txt b/db/const.txt
index a2f199c0b..5e3976c86 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -245,6 +245,7 @@ bAddDamageByClass 2020
bSPGainValue 2021
bIgnoreDefMob 2022
bHPLossRate 2023
+bAddRace2 2024
Eff_Stone 0
diff --git a/db/item_db.txt b/db/item_db.txt
index d439a11d9..3a8556870 100644
--- a/db/item_db.txt
+++ b/db/item_db.txt
@@ -1185,7 +1185,7 @@
4152,Galapago_Card,Galapago Card,6,20,0,10,,,,,,,,,,,{},{}
4153,Crab_Card,Crab Card,6,20,0,10,,,,,,,2,,,,{},{ bonus bAtk,5; bonus2 bAddDamageClass,1266,30; bonus2 bAddEle,4,30; if(isequipped(4247,4273)) bonus3 bAddMonsterDropItem,544,5,3000; }
4154,Dumpling_Child_Card,Dumpling Child Card,6,20,0,10,,,,,,,,,,,{},{}
-4155,Goblin_Leader_Card,Goblin Leader Card,6,20,0,10,,,,,,,2,,,,{},{ bonus2 bAddDamageClass,1122,30; bonus2 bAddDamageClass,1123,30; bonus2 bAddDamageClass,1124,30; bonus2 bAddDamageClass,1125,30; bonus2 bAddDamageClass,1126,30; bAddDamageClass,1245,30; bAddDamageClass,1258,30; bAddDamageClass,1280,30; bAddDamageClass,1299,30; bAddDamageClass,1308,30; }
+4155,Goblin_Leader_Card,Goblin Leader Card,6,20,0,10,,,,,,,2,,,,{},{ bonus2 bAddRace2,1,30; }
4156,Goblin_Steamrider_Card,Goblin Steamrider Card,6,20,0,10,,,,,,,2,,,,{},{}
4157,Goblin_Archer_Card,Goblin Archer Card,6,20,0,10,,,,,,,2,,,,{},{}
4158,Sky_Deleter_Card,Sky Deleter Card,6,20,0,10,,,,,,,16,,,,{},{}
diff --git a/db/mob_race2_db.txt b/db/mob_race2_db.txt
new file mode 100644
index 000000000..ebe563d52
--- /dev/null
+++ b/db/mob_race2_db.txt
@@ -0,0 +1,6 @@
+// RACE,Mob ID1,Mob ID2,Mob ID3,...,Mob ID9
+1,1122,1123,1124,1125,1126,1245,1258,1280,1308 // Goblins
+2,1133,1134,1135,1136,1137,1226,1282,1455 // Kobolds
+3,1023,1152,1153,1177,1189,1213,1273 // Orcs
+4,1040,1278,1366,1497 // Golems
+5,1285,1286,1287 // Guardians \ No newline at end of file
diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt
index fedf6b37e..038383d1e 100644
--- a/doc/item_bonus.txt
+++ b/doc/item_bonus.txt
@@ -157,6 +157,8 @@ bonus2 bAddEffWhenHit,n,x; n% chance to cause x state to the enemy when
bonus2 bSkillAtk,n,x; Increase damage of skill n by x%
bonus2 bAddDamageByClass,n,x; When being hit by monster of class n increase
damage taken by x%
+bonus2 bAddRace2,n,x; Increase damage by x% vs. enemies of race n
+ (Check db/mob_race2_db.txt)
bonus3 bHPLossRate,n,x,y; Lose n amount of hp every x amount of time
y:0=Don't show damage 1=Show damage
diff --git a/save-tmpl/bank.txt b/save-tmpl/bank.txt
deleted file mode 100644
index e69de29bb..000000000
--- a/save-tmpl/bank.txt
+++ /dev/null
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);