summaryrefslogtreecommitdiff
path: root/src/map/mob.c
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 /src/map/mob.c
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
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c53
1 files changed, 52 insertions, 1 deletions
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");