summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog.txt3
-rw-r--r--src/map/npc.c16
2 files changed, 14 insertions, 5 deletions
diff --git a/Changelog.txt b/Changelog.txt
index 0385070f2..842c6a91b 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,5 +1,8 @@
Date Added
11/15
+ * Added spawning of monsters at specific level by adding ,# after the spawn name. [Valaris]
+ mobs_level_up option should be on when using this.
+ (Example: {ama_dun01.gat,0,0,0,0 monster Shinobi,99 1401,1,0,0,0} to spawn a level 99 shinobi.)
* Added addtoskill script command for (levels can stack on top of existing levels). [Valaris]
Use same usage as skill script command.
* Added -ffast-math argument to makefile to increase performance, thanks to kashy. [Valaris]
diff --git a/src/map/npc.c b/src/map/npc.c
index 65974aee8..d2fc58205 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1886,9 +1886,10 @@ static int npc_parse_function(char *w1,char *w2,char *w3,char *w4,char *first_li
*/
int npc_parse_mob(char *w1,char *w2,char *w3,char *w4)
{
- int m,x,y,xs,ys,class,num,delay1,delay2;
+ int m,x,y,xs,ys,class,num,delay1,delay2,level;
int i;
char mapname[24];
+ char mobname[24];
char eventname[24]="";
struct mob_data *md;
@@ -1916,10 +1917,15 @@ int npc_parse_mob(char *w1,char *w2,char *w3,char *w4)
md->bl.m=m;
md->bl.x=x;
md->bl.y=y;
- if(strcmp(w3,"--en--")==0)
- memcpy(md->name,mob_db[class].name,24);
- else if(strcmp(w3,"--ja--")==0)
- memcpy(md->name,mob_db[class].jname,24);
+
+ if(sscanf(w3,"%[^,],%d",mobname,&level) > 1) {
+ if(strcmp(mobname,"--en--")==0)
+ memcpy(md->name,mob_db[class].name,24);
+ else if(strcmp(mobname,"--ja--")==0)
+ memcpy(md->name,mob_db[class].jname,24);
+ md->level=level;
+ }
+
else
memcpy(md->name,w3,24);