Jump to content
  • 0
Sign in to follow this  
luizragna

Instance for all party members

Question

Hello guys! How can I turn this individual instance into a party instance? (where only the leader can start)

job_wiz,119,109,4	script	Guia Solo	8_F_GIRL,{

	if ( has_instance2("dungeon") >= 0 ) {
//		dispbottom has_instance2("dungeon") +" destroy";
		instance_destroy has_instance2("dungeon");
	}
	if ( ( .@ins = instance_create( ""+strnpcinfo(NPC_NAME)+"", getcharid(CHAR_ID_ACCOUNT), IOT_CHAR ) ) < 0 ) {
		mes "error : "+ .@ins;
		close;
	}
	if ( !getstrlen( instance_attachmap( "dungeon", .@ins, true, ( getcharid(CHAR_ID_ACCOUNT) )+"INST" ) ) ) {
		mes "error : 5";
		instance_destroy .@ins;
		close;
	}
	instance_set_timeout 3600, 15, .@ins;
	instance_init .@ins;
	warp has_instance("dungeon"), 69,47;
	end;

}

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

change IOT_CHAR into IOT_PARTY
and *warp into *warpparty ?
also add *instance_check_party when applicable ...

and the first 2 lines in that script was made like an event thing ...  to prevent the player stay in the map
if you want the player to stay in the map like quest script, then add src4instance mapflag and *instance_set_respawn

Spoiler

prontera,155,180,0	script	Test Instance	1_F_MARIA,{
	for ( .@i = 0; .@i < .total; ++.@i ) {
		if ( getmapusers( .id[.@i] +"Test" ) == -1 ) {
			deletearray .id[.@i], 1;
			--.@i;
			--.total;
		}
	}
	mes "Total Instances -> "+ .total;
	for ( .@i = 0; .@i < .total; ++.@i )
		.@menu$ += "["+ .id[.@i] +"] has "+ getmapusers( .id[.@i] +"Test" ) +" players:";
	.@s = select( .@menu$ +"continue" ) -1;
	if ( .@s < .total ) {
		warp .id[.@s] +"Test", 49,49;
		end;
	}
	if ( ( .@ins = instance_create( "test_bg", 0, IOT_NONE ) ) < 0 ) {
		announce "Fail to create instanced.", bc_all;
		end;
	}
	if ( !getstrlen( instance_attachmap( "guild_vs2", .@ins, true, .@ins +"Test" ) ) ) {
		announce "Fail to create instanced battleground.", bc_all;
		end;
	}
	instance_set_timeout 86400, 0, .@ins;
	instance_init .@ins;
	warp .@ins +"Test", 49,49;
	end;
}
guild_vs2	mapflag	src4instance
guild_vs2,49,49,5	script	test dialog	1_F_MARIA,{
	mes strnpcinfo(NPC_MAP);
	select "Destroy";
	.@total = getvariableofnpc( .total, "Test Instance" );
	while ( getvariableofnpc( .id[.@i], "Test Instance" ) != instance_id() && .@i < .@total ) { ++.@i; }
	deletearray getvariableofnpc( .id[.@i], "Test Instance" ), 1;
	set getvariableofnpc( .total, "Test Instance" ), .@total -1;
	instance_destroy;
	end;
OnInstanceInit:
	instance_set_respawn has_instance("guild_vs2"), 0,0;
	.@total = getvariableofnpc( .total, "Test Instance" );
	set getvariableofnpc( .id[.@total], "Test Instance" ), instance_id();
	set getvariableofnpc( .total, "Test Instance" ), .@total +1;
	end;
}

just put it here since there are no examples how to use *instance_set_respawn

 

Edited by AnnieRuru

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.