Jump to content
  • 0

Leveling room


mrlongshen

Question


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

I want to request an npc, that have a menu for leveling room.

1~10 (poring, poporing, picky)

10~20 (some hard mons)

20~30 (other hard mons)

and etc until 150

 

the npc will warp on the same map, but different mobs.

if got some rare map why not share ? 

hehe :P

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

I want to request an npc, that have a menu for leveling room.

1~10 (poring, poporing, picky)

10~20 (some hard mons)

20~30 (other hard mons)

and etc until 150

 

the npc will warp on the same map, but different mobs.

if got some rare map why not share ? 

hehe :P

I'll probably be updating it a little... but this is a Dynamic Leveling based system thingy... No need to hard code mob spawns...

The script is a little heavy on the server side because -.- and this is the really lame part... Killedrid isn't set with monster spawned events... IKR WTF.

Also if you run into one of the rooms and do @killmonster they won't spawn back untill you reloadscripts just saying right now don't do it... I had a whole system worked out for getting the correct information but yeah... I need a way to single out the event and get the mobid... That can't happen with OnNPCKillEvent. Anyways here it is... Only works with rAthena SQL Based servers that have there mod_dbs SQL side.

prontera,160,158,2	script	Training Room	100,{
	select(.menu$);
	warp getd(".room"+(@menu-1)+"$[1]"),0,0;
	end;

OnNPCKillEvent:
//OnMobDeath:
	for(set .@p,0;getarraysize(getd(".room"+.@p+"$"));set(.@p,.@p+1))
		if( playerattached() ) {
			if( getd(".room"+.@p+"$[1]") == strcharinfo(3) ) {
				monster strcharinfo(3),0,0,"--ja--",killedrid,1/*,"Training Room::OnMobDeath"*/;
				break;
			}
		}
	end;
	
Oninit:
//Configuration
//	              #   Room Name                                ,  Map         ,  MobLvlRngLow ,  MobLvlRngHigh,  #SpawnMobs,  Mobs Limit(MAX 128),   Optional Search String    ;
	setarray .room0$, "Novice Room %s~%s (<mob>,<mob>...)"     ,  "06guild_01",  "0"          ,  "10"         ,  "20"      ,  "128"              ,   "`iName` LIKE '%Por%'"    ; // Would make a novice poring room.
	setarray .room1$, "Beginner Room %s~%s (<mob>,<mob>...)"   ,  "06guild_02",  "11"         ,  "20"         ,  "5"       ,  "128"              ,   ""                        ;
	setarray .room2$, "Adept Room %s~%s (<mob>,<mob>...)"      ,  "06guild_03",  "21"         ,  "30"         ,  "5"       ,  "128"              ,   ""                        ;
	setarray .room3$, "Advanced Room %s~%s (<mob>,<mob>...)"   ,  "06guild_04",  "31"         ,  "40"         ,  "5"       ,  "128"              ,   ""                        ;
	setarray .room4$, "Experts Room %s~%s (<mob>,<mob>...)"    ,  "06guild_05",  "41"         ,  "50"         ,  "5"       ,  "128"              ,   ""                        ;
	setarray .room5$, "Veterans Room %s~%s (<mob>,<mob>...)"   ,  "06guild_06",  "51"         ,  "60"         ,  "6"       ,  "128"              ,   ""                        ;
	setarray .room6$, "MVP Room %s~%s (<mob>,<mob>...)"        ,  "06guild_07",  "61"         ,  "70"         ,  "7"       ,  "128"              ,   ""                        ;
	setarray .room7$, "Like a Boss Room %s~%s (<mob>,<mob>...)",  "06guild_08",  "71"         ,  "80"         ,  "8"       ,  "128"              ,   ""                        ;
	
	
	set .srch$, "<mob>"; //String searched and replaced with mob name in the Room Name Feild.
	set .mvps, 0; //Mvps Summoned or not? 0=Off 1=On
//End

	for(set(.@a,0);getarraysize(getd(".room"+.@a+"$"));set(.@a,.@a+1)) {
		set .rmn$, ".room"+.@a+"$";
		set .nam$, ".name"+.@a+"$";
		set .mid$, ".id"+.@a;
		
		set .rrm$, getd(.rmn$+"[0]");
		set .map$, getd(.rmn$+"[1]");
		set .lrl$, getd(.rmn$+"[2]");
		set .lrh$, getd(.rmn$+"[3]");
		set .nsms, atoi(getd(.rmn$+"[4]"));
		set .mlim, atoi(getd(.rmn$+"[5]"));
		set .ops$, getd(.rmn$+"[6]");
		
		set .length, countstr(getd(.rmn$+"[0]"), .srch$);
		set .lengt, countstr(getd(.rmn$+"[0]"), "%s");
		if(.lengt>1) set .mes$[.@a], sprintf(.rrm$,.lrl$,.lrh$);
		
		set .len, query_sql("SELECT `ID`,`iName` FROM `mob_db` WHERE `LV` > "+.lrl$+" AND `LV` < "+.lrh$+" "+((.ops$!="")?"AND "+.ops$+" ":"")+((!.mvps)?"AND `MEXP` <= 0 ":"")+"ORDER BY RAND() LIMIT "+((.mlim>128)?128:.mlim )+";",.id,.name$);
		set .lens, getarraysize(.name$);
		
		copyarray getd(.nam$+"[0]"), .name$, .lens;
		copyarray getd(.mid$+"[0]"), .id, .lens;
		deletearray .name$;
		deletearray .id;
		
		while(.@i++<=.length )
		if(.@i<=.lens) set .mes$[.@a], replacestr(.mes$[.@a], .srch$, getd(.nam$+"["+(.@i-1)+"]"), 1, 1);
		set .@i,0;
		
		for(set(.@h,0);.@h<.lens;set(.@h,.@h+1)) {
			monster .map$,0,0,"--ja--",getd(.mid$+"["+.@h+"]"),.nsms/*,"Training Room::OnMobDeath"*/;
		}
	}
	
	set .menu$, implode(.mes$,":");
}
If you have any questions feel free to ask. BTW this will spawn any monster in your mob_db if they are the right level... so if you have errored mobs that you don't want to spawn I suggest you add a condition in the search for it... Other then that this thing saves loads of time. Edited by Skorm
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

prontera,155,181,5	script	Sample	757,{
set .@i,select( implode( .room_name$,":" ) ) - 1;
warp .map$[.@i],0,0;
end;

OnInit:
setarray .room_name$,
	"1 ~ 10 ( Mob1 )",
	"11 ~ 20 ( Mob2 )",
	"21 ~ 30 ( Mob3 )";
	"31 ~ 40 ( Mob4 )";
	"41 ~ 50 ( Mob5 )";
	"51 ~ 60 ( Mob6 )";
	"61 ~ 70 ( Mob7 )";
	"71 ~ 80 ( Mob8 )";
setarray .map$,
	"06guild_01",
	"06guild_02",
	"06guild_03",
	"06guild_04",
	"06guild_05",
	"06guild_06",
	"06guild_07",
	"06guild_08";
end;
}

read this to add monster

Permanent_Monster_Spawn

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

this is cool bro. but the monster so many. its would be hard. hahaa.btw it nice i like it. hehehehehe

i will try to adjust the mob max. the mob will be respawn right ? 

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

this is cool bro. but the monster so many. its would be hard. hahaa.btw it nice i like it. hehehehehe

i will try to adjust the mob max.

 

Mobs Limit(MAX 128) is the amount of mobs selected from the database lowering it to 5 would spawn 5 different types of monsters from the level range.

#SpawnMobs is the number of times that type of monster will be spawned.

So it's #SpawnMobs times Mobs Limit(MAX 128).

 

If you were to lower #SpawnMobs down to 1 you would get 128 different random monsters from your database depending on the search results. I hope you understand.

 

 

the mob will be respawn right ? 

 

Yes the mobs do re-spawn when you attack it with a skill or weapon, but commands like @killmonster don't attach the character to the monster when it's killed. If you use GM commands they will not re-spawn.

Edited by Skorm
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

yes i understand. thx bro :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...