Jump to content
  • 0

Custom Instance Help


SpiritD

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  75
  • Reputation:   7
  • Joined:  08/10/17
  • Last Seen:  

Hye guys, can someone tell me what's wrong with this script? The person who wrote it hasn't replied in a couple of days.

//instance entrance
prontera,153,31,2	script	Knight Tord#prtfild08Tord	418,{
	mes "[ Knight Tord ]";
	mes "Operations are going smoothly.";
	switch(select("Thank you, sir.:Sir, may I join the operation?")){
	case 1:
		close;
	case 2:
		next;
		mes "[ Knight Tord ]";
		mes "===================";
		mes "Level 10-15 - South Prontera.";
		mes "===================";
		mes "Are you sure?";
		switch(select("Not sure.:Yes, I am ready!")){
		case 1:
			close;
		case 2:
			.@isntname$ = "prt_fild08";
			switch(select("Solo:Party:Guild")){
				case 1: .@mode$ = "IM_CHAR"; break;
				case 2: .@mode$ = "IM_PARTY"; break;
				case 3: .@mode$ = "IM_GUILD"; break;
			}
			switch(instance_create(.@isntname$, .@mode$)) {
				case -1: mes "^FF0000-1 Invalid Type^000000.";
				case -2: mes "^FF0000-2 Char/Party/Guild not exist^000000.";
				case -3: instance_enter(.@isntname$); close;
				case -4: mes "^FF0000-4 No Free Instances. MAX_INSTANCE?!^000000.";
				default: break;
			}
			switch(instance_enter(.@isntname$)){
			case 3:
				mes "An unknown error has occurred.";
				debugmes strcharinfo(0) + " / " + instance_id() + " / FAIL CODE 3";
				close;
			case 2:
				mes "Instance for " + .@isntname$ + " does not exist.";
				mes "Instance has been destroyed by the Party Leader, or because of the time limit.";
				debugmes strcharinfo(0) + " / " + instance_id() + " / FAIL CODE 2";
				close;
			case 1:
				mes "Looking for a party on a single char only instance..";
				debugmes strcharinfo(0) + " / " + instance_id() + " / FAIL CODE 1";
				close;
			case 0:
				end;
			}
		}
	}
}
//monster spawn
function	script	monster_spawn	{
	switch(getarg(0)){
		case 1:
			instance_announce instance_id(),"50 Monsters spawned. Defeat them all to proceed.",0;
			monster instance_mapname("prt_fild08"),169,366,"Poring",3000,1,instance_npcname("monster_death")+"::OnMobKill";
			monster instance_mapname("prt_fild08"),171,365,"Poring",3000,1,instance_npcname("monster_death")+"::OnMobKill";
			viewpoint 1,169,366,1,0xFFA7CB;
			viewpoint 1,171,365,1,0xFFA7CB;
			break;
		case 2:
			instance_announce instance_id(),"All 50 monsters killed! [Mastering] appeared!",0;
			viewpoint 1,171,365,1,0xFF1B78;
			monster instance_mapname("prt_fild08"),175,363,"Mastering [Boss]",1090,1,instance_npcname("monster_death")+"::OnBossKill";
			break;
	}
	end;
}
//instance
prt_fild08,172,373,2	script	Knight Tord#prtfld08Tord1	418,{
	if('start > 1)
		end;
	mes "start?";
	menu "Yes",-;
	close2;
	'start = 1; //instance variable
	monster_spawn('start);
	end;
}
prt_fild08,1,1,-1	script	monster_death	-1,{
OnMobKill:
	if(mobcount(instance_mapname("prt_fild08")) < 1){ //counts how many mobs are left, if 0 mobs remain, moves to next round
		'start++;
		monster_spawn('start);
		end;
	}
OnBossKill:
	instance_announce instance_id(),"Cogratulations",0;
	getitem 501,1;
	instance_destroy(instance_id());
	end;
}

https://pastebin.com/SR5fR8f2

When you chcoose "solo" or any other options the map server will crash. Does this have to be added to instance_db as well?

21269742_10159255537785293_454069618_n.png

Edited by SpiritD
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  666
  • Reputation:   674
  • Joined:  11/12/12
  • Last Seen:  

As the error mentions, the function (mobcount) doesn't have enough argument: *mobcount("<map name>","<event label>"). Refer to: https://github.com/rathena/rathena/blob/d770de8015afd31be89e1b125a8c3615a0453f88/doc/script_commands.txt#L5974 for more info.

mobcount(instance_mapname("prt_fild08"), instance_npcname("monster_death")+"::OnMobKill")

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  75
  • Reputation:   7
  • Joined:  08/10/17
  • Last Seen:  

1 hour ago, Tokei said:

As the error mentions, the function (mobcount) doesn't have enough argument: *mobcount("<map name>","<event label>"). Refer to: https://github.com/rathena/rathena/blob/d770de8015afd31be89e1b125a8c3615a0453f88/doc/script_commands.txt#L5974 for more info.

 

Thank you. I have fixed the NPC error but there must be another error in the logic somewhere. When I choose "solo" (or any other option) the map-server crashes. What gives? (ps- I went ahead and defined the instance in the instance_db.txt)

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...