• 0
Sign in to follow this  
Followers 0
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

  • 0

Posted (edited)

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 ( [email protected] = 0; [email protected] < .total; [email protected] ) {
		if ( getmapusers( .id[[email protected]] +"Test" ) == -1 ) {
			deletearray .id[[email protected]], 1;
			[email protected];
			--.total;
		}
	}
	mes "Total Instances -> "+ .total;
	for ( [email protected] = 0; [email protected] < .total; [email protected] )
		[email protected]$ += "["+ .id[[email protected]] +"] has "+ getmapusers( .id[[email protected]] +"Test" ) +" players:";
	[email protected] = select( [email protected]$ +"continue" ) -1;
	if ( [email protected] < .total ) {
		warp .id[[email protected]] +"Test", 49,49;
		end;
	}
	if ( ( [email protected] = instance_create( "test_bg", 0, IOT_NONE ) ) < 0 ) {
		announce "Fail to create instanced.", bc_all;
		end;
	}
	if ( !getstrlen( instance_attachmap( "guild_vs2", [email protected], true, [email protected] +"Test" ) ) ) {
		announce "Fail to create instanced battleground.", bc_all;
		end;
	}
	instance_set_timeout 86400, 0, [email protected];
	instance_init [email protected];
	warp [email protected] +"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";
	[email protected] = getvariableofnpc( .total, "Test Instance" );
	while ( getvariableofnpc( .id[[email protected]], "Test Instance" ) != instance_id() && [email protected] < [email protected] ) { [email protected]; }
	deletearray getvariableofnpc( .id[[email protected]], "Test Instance" ), 1;
	set getvariableofnpc( .total, "Test Instance" ), [email protected] -1;
	instance_destroy;
	end;
OnInstanceInit:
	instance_set_respawn has_instance("guild_vs2"), 0,0;
	[email protected] = getvariableofnpc( .total, "Test Instance" );
	set getvariableofnpc( .id[[email protected]], "Test Instance" ), instance_id();
	set getvariableofnpc( .total, "Test Instance" ), [email protected] +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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0