Instance for all party members

luizragna

New member
Messages
114
Points
0
Location
In their hearts
Emulator
Hello guys! How can I turn this individual instance into a party instance? (where only the leader can start)

Code:
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;

}
 
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

Code:
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

 
Last edited by a moderator:
Back
Top