Jump to content
  • 0
Sign in to follow this  
Kuroyama

Castle Guild Member Limit

Question

Does anyone know how to limit guild members entering a castle during woe? For example my guild cap is 76 but i only want 25 or 30 members can enter a castle during woe. I did try this https://upaste.me/raw/691b80 script, but its kicking all of the members on Ecall. Please help me find any other way to refine this script to make them stay for alteast 25 members and not allowing to enter the castle for excess members.

Share this post


Link to post
Share on other sites

14 answers to this question

Recommended Posts

  • 0

oh ok, you are partially right when it kick excess guild members

but it isn't the way you claimed that it count from other guild members

 

upon close inspection, @astralprojection script has 2 problems which is

1. if the player has multiple characters from the same account join the same guild, it count multiple times instead of 1, it doesn't extend the isloggedin into [email protected] check

2. it checks as long as the guild member enter ANY CASTLE map, not that particular castle map

 

try this one

https://gist.github.com/AnnieRuru/339e268a8be5370fa7ae1aa2f856ca28

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, astralprojection said:

maybe limit your guild capacity?

I already implement 72 guild cap, whenever I tried to lowered it down. It cause major bugs and errors. That's why, I choose script as an alternative to avoid that major error.

Share this post


Link to post
Share on other sites
  • 0

-	script	woelimit	HIDDEN_NPC,{
end;

OnPCLoadMapEvent:
	.@rid = playerattached();
	if ( !compare(strcharinfo(PC_MAP), "g_cas") || !agitcheck() ) end;
	getguildmember getcharid(CHAR_ID_GUILD), 1;
	getguildmember getcharid(CHAR_ID_GUILD), 2;
	.@count = 0;
	for ( .@i = 0; .@i < [email protected]; .@i++ ) {
		if (attachrid([email protected]aid[.@i])) {
			if( compare(strcharinfo(PC_MAP), "g_cas") ) .@count++;
		}
	}
	if ( .@rid )
      		attachrid(.@rid);
	else
        	detachrid;

	if(.@count > .max){
		message strcharinfo(0), "WARNING: Max of "+.max+" members can simultaneously join the WOE.";
		warp "SavePoint",0,0;
	}
	end;

OnInit:
	.max = 25;
	end;
}

try this

Share this post


Link to post
Share on other sites
  • 0
-	script	Guild Limiter	-1,{
	
	// This part ejects players when they are in the map 
	OnPCLoadMapEvent:
	if( getcharid(2) == $App_Guilds[[email protected]] ){
	.count = 0;
	[email protected] = getcharid(3);
	getmapguildusers( [email protected]$, getcharid(2));
	if ( strcharinfo(3) == [email protected]$ )
		.count++;
	if ( [email protected] ) end;
	if ( .count ) > 3 { // 5 means only 5 players per guild allowed in a map.
		message strcharinfo(0), "Your guild members are over the limit";
		sleep2 2000;
		warp "SavePoint", 0,0;
	}
	}
	end;
OnInit:
	setarray [email protected]$, "guild_vs1", "arug_cas01", "arug_cas02", "arug_cas03", "arug_cas04", "arug_cas05", "schg_cas01", "schg_cas02", "schg_cas03", "schg_cas04", "schg_cas05";
	[email protected] = getarraysize( [email protected]$ );
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		setmapflag [email protected]$[[email protected]], mf_loadevent;
		setd "."+ [email protected]$[[email protected]], 1;
	}
	end;
}

Currently modifying this, it takes no error but it doesn't work.

Just now, astralprojection said:

- script woelimit HIDDEN_NPC,{ end; OnPCLoadMapEvent: [email protected] = playerattached(); if ( !compare(strcharinfo(PC_MAP), "g_cas") || !agitcheck() ) end; getguildmember getcharid(CHAR_ID_GUILD), 1; getguildmember getcharid(CHAR_ID_GUILD), 2; [email protected] = 0; for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) { if (attachrid([email protected][[email protected]])) { if( compare(strcharinfo(PC_MAP), "g_cas") ) [email protected]++; } } if ( [email protected] ) attachrid([email protected]); else detachrid; if([email protected] > .max){ message strcharinfo(0), "WARNING: Max of "+.max+" members can simultaneously join the WOE."; warp "SavePoint",0,0; } end; OnInit: .max = 25; end; }

-	script	woelimit	HIDDEN_NPC,{
end;

OnPCLoadMapEvent:
	.@rid = playerattached();
	if ( !compare(strcharinfo(PC_MAP), "g_cas") || !agitcheck() ) end;
	getguildmember getcharid(CHAR_ID_GUILD), 1;
	getguildmember getcharid(CHAR_ID_GUILD), 2;
	.@count = 0;
	for ( .@i = 0; .@i < [email protected]; .@i++ ) {
		if (attachrid([email protected][.@i])) {
			if( compare(strcharinfo(PC_MAP), "g_cas") ) .@count++;
		}
	}
	if ( .@rid )
      		attachrid(.@rid);
	else
        	detachrid;

	if(.@count > .max){
		message strcharinfo(0), "WARNING: Max of "+.max+" members can simultaneously join the WOE.";
		warp "SavePoint",0,0;
	}
	end;

OnInit:
	.max = 25;
	end;
}

try this

Oh thanks, wait let me try this.

It works @astralprojection! I repeat it works perfectly!  Thank you so much! :sob:

Share this post


Link to post
Share on other sites
  • 0
On 9/16/2020 at 11:29 AM, astralprojection said:

- script woelimit HIDDEN_NPC,{ end; OnPCLoadMapEvent: [email protected] = playerattached(); if ( !compare(strcharinfo(PC_MAP), "g_cas") || !agitcheck() ) end; getguildmember getcharid(CHAR_ID_GUILD), 1; getguildmember getcharid(CHAR_ID_GUILD), 2; [email protected] = 0; for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) { if (attachrid([email protected][[email protected]])) { if( compare(strcharinfo(PC_MAP), "g_cas") ) [email protected]++; } } if ( [email protected] ) attachrid([email protected]); else detachrid; if([email protected] > .max){ message strcharinfo(0), "WARNING: Max of "+.max+" members can simultaneously join the WOE."; warp "SavePoint",0,0; } end; OnInit: .max = 25; end; }


-	script	woelimit	HIDDEN_NPC,{
end;

OnPCLoadMapEvent:
	.@rid = playerattached();
	if ( !compare(strcharinfo(PC_MAP), "g_cas") || !agitcheck() ) end;
	getguildmember getcharid(CHAR_ID_GUILD), 1;
	getguildmember getcharid(CHAR_ID_GUILD), 2;
	.@count = 0;
	for ( .@i = 0; .@i < [email protected]; .@i++ ) {
		if (attachrid([email protected][.@i])) {
			if( compare(strcharinfo(PC_MAP), "g_cas") ) .@count++;
		}
	}
	if ( .@rid )
      		attachrid(.@rid);
	else
        	detachrid;

	if(.@count > .max){
		message strcharinfo(0), "WARNING: Max of "+.max+" members can simultaneously join the WOE.";
		warp "SavePoint",0,0;
	}
	end;

OnInit:
	.max = 25;
	end;
}

try this

Hello sir @astralprojection, just a little update here. So I'd use this on live server and the result is good but it affects overall counts of the guild inside the map, not just "per" guild.

For example: so I set the max cap to 30, guild 1 enter the castle and they already have 17 players there and guild 2 was entering too with 15 members. The script was counting the overall guildmember cap inside the castle, not per member of the separate guilds so even though the guild 1 and guild 2 aren't 30 members inside, the script will kick the excess.

Edited by Kuroyama
Additional Info

Share this post


Link to post
Share on other sites
  • 0

https://upaste.me/691b80

emistry's script should work though ...

 

-	script	Sample	FAKE_NPC,{
OnPCLoadMapEvent:
	.@map$ = strcharinfo(PC_MAP);
	.@guild_id = getcharid(CHAR_ID_GUILD);

	if (getmapflag(.@map$, MF_GVG_CASTLE) && .@guild_id) {
		if (getmapguildusers( .@map$,.@guild_id ) > 2){
			mes "Max Guild Member can stay on this map exceed.";
			close2;
			warp "prontera",155,181;
		}
	}
	end;
}

aldeg_cas01	mapflag	gvg_castle
aldeg_cas01	mapflag	loadevent

 

now astralprojection's script

.... also works when set .max, 2; ...

 

... I have no idea why doesn't work for you,

- I open 6 client, 3 client join guild A, other 3 client join guild B

- guild A only can only enter 2 guild members, guild B also only can enter 2 guild members, always 1 getting kick

 

if it doesn't work this way, then what is the behavior you want ?

Share this post


Link to post
Share on other sites
  • 0
10 hours ago, AnnieRuru said:

https://upaste.me/691b80

emistry's script should work though ...

 

- script Sample FAKE_NPC,{ OnPCLoadMapEvent: [email protected]$ = strcharinfo(PC_MAP); [email protected]_id = getcharid(CHAR_ID_GUILD); if (getmapflag([email protected]$, MF_GVG_CASTLE) && [email protected]_id) { if (getmapguildusers( [email protected]$,[email protected]_id ) > 2){ mes "Max Guild Member can stay on this map exceed."; close2; warp "prontera",155,181; } } end; } aldeg_cas01 mapflag gvg_castle aldeg_cas01 mapflag loadevent

-	script	Sample	FAKE_NPC,{
OnPCLoadMapEvent:
	.@map$ = strcharinfo(PC_MAP);
	.@guild_id = getcharid(CHAR_ID_GUILD);

	if (getmapflag(.@map$, MF_GVG_CASTLE) && .@guild_id) {
		if (getmapguildusers( .@map$,.@guild_id ) > 2){
			mes "Max Guild Member can stay on this map exceed.";
			close2;
			warp "prontera",155,181;
		}
	}
	end;
}

aldeg_cas01	mapflag	gvg_castle
aldeg_cas01	mapflag	loadevent

 

now astralprojection's script

.... also works when set .max, 2; ...

 

... I have no idea why doesn't work for you,

- I open 6 client, 3 client join guild A, other 3 client join guild B

- guild A only can only enter 2 guild members, guild B also only can enter 2 guild members, always 1 getting kick

 

if it doesn't work this way, then what is the behavior you want ?

I already tried this, and it's affecting (kicking) all the guild members when you Ecall them. Once recalled, all the members are affected by limit and they will be warped out even you set the limit to large number.

 

 

Sir @astralprojection script works and exclude the ecall issue, but the problem is the script is counting the overall guildmember cap inside the castle/koe map, not per member of the separate guilds so even though the guild A and guild B aren't 3 (or 30) members inside, the script will kick the excess as long as its reach the limit inside the map. It counts all the guild members inside the map.

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.