Jump to content
  • 0

Display guild master and guild member


Question

Posted (edited)

Hello can anyone help me on how to create a script whereas it would display some guild information like....

Guild Leader and the Guild Members of that Guild... Also the castle they own..... and i want it auto update whenever there is a change of guild members....

Edited by caspa

13 answers to this question

Recommended Posts

Posted (edited)

It's more like a script request.. whatever here for you.

prontera,155,155,5	script	Guild manager	56,{
//- Limit 128 guild names
//- NPC name
.@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
.@m = 0;
.@cast_owned$ = "";
setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
	deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );

// Count guild
// -----------
query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

mes .@npc$;
mes " ";
mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
mes "Select a guild for more informations.";
next;


// Menu display name guild
// -----------------------
query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
				.@guild_id, .@name$, .@master$, .@guild_lv );

.@s = select( implode( .@name$, ":" ) ) -1;

.@c = query_sql( "SELECT `castle_id` FROM `guild_castle` WHERE `guild_id` = '"+ .@guild_id[ .@s ] +"'", .@castle_id );
for( .@i = 0; .@i < .@c; .@i++ )
	.@cast_owned$ = .@cast_owned$ + .castle$[ .@castle_id[ .@i ] ] + ( .@i == .@c -1 ? "" : ", " );

.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
for( .@i = 0; .@i < .@size; .@i++ )
	if( getcharid( 0,.@name_m$[ .@i ] ) )
		.@m++;

mes .@npc$;
mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
	"Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
	"Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
	"Members Online: ^0000FF"+ .@m +"^000000",
	"Castle owned: ^CC00CC"+ ( .@c ? .@cast_owned$ : "None" ) +"^000000";


// Menu members
// ------------
switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
	case 1:
		next;
		break;
	case 2:
		next;
		mes .@npc$;
		mes " ";
		mes "See you soon ^-^";
		close;
	case 3:
		next;
		goto L_list;
}

deletearray .@name_m$, getarraysize( .@name_m$ );
.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

mes .@npc$;
mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
	"- Red: currently ^FF0000offline^000000.",
	"- Green: currently ^00C957online^000000.",
	" ";

for( .@i = 0; .@i < .@size; .@i++ )
	mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
next;
goto L_list;



OnInit:
deletearray .castle$, getarraysize( .castle$ );	//- prevent duplicate
setarray .castle$, "Neuschwanstein",	"Hohenschwangau",	"Nuernberg",	"Wuerzburg",	"Rothenburg",
				"Repherion",		"Eeyolbriggar",		"Yesnelph",		"Bergel",		"Mersetzdeitz",
				"Bright Arbor",		"Scarlet Palace",	"Holy Shadow",	"Sacred Altar",	"Bamboo Grove Hill",
				"Kriemhild",		"Swanhild",			"Fadhgridh",	"Skoegul",		"Gondul",
				"Earth",			"Air",				"Water",		"Fire",			"Himinn",
				"Andlangr",			"Viblainn",			"Hljod",		"Skidbladnir",	"Mardol",
				"Cyr",				"Horn",				"Gefn",			"Bandis";
end;
}

Display :

- Number of guild (total)

- when you select a guild

-- display guild name, guild master, guild lvl, member online and castle owned by the guild

-- display all member name and check if they are online/offline

Works on rAthena only.

Edit including comment of nanakiwurtz

Edited by Capuche
  • Upvote 1
Posted

Thanks Capuche, there's always something I can learn from your scripts!

Btw, isn't it better to put '.@npc$ =' in OnInit label too?

And I think

( .@c ? .@cast_owned$ : "No one" )

will be better to change it to

( .@c ? .@cast_owned$ : "None" )

Posted (edited)

Thanks Capuche, there's always something I can learn from your scripts!

Btw, isn't it better to put '.@npc$ =' in OnInit label too?

And I think

( .@c ? .@cast_owned$ : "No one" )

will be better to change it to

( .@c ? .@cast_owned$ : "None" )

/no1

Error corrected. I don't know if it's better to put .@npc$ in OnInit label but it's just a little set so it doesn't need much ressource in both case.

Edited by Capuche
Posted (edited)

Thanks Capuche, there's always something I can learn from your scripts!

Btw, isn't it better to put '.@npc$ =' in OnInit label too?

And I think

( .@c ? .@cast_owned$ : "No one" )

will be better to change it to

( .@c ? .@cast_owned$ : "None" )

/no1

Error corrected. I don't know if it's better to put .@npc$ in OnInit label but it's just a little set so it doesn't need much ressource in both case.

Sir capuche thank you so much for the script..... now i i was just wondering how to add a single letter that would define the list of name

this is the idea of what i'm trying to do :

[b]mes ""+(.@i + 1)+".  "+( ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00FF00" : "^FF0000" )+ .@name_m$[ .@i ]+" "+(.@name_m$[ .@i ](.@master$[ .@s ]) ? "( L )" : "( M )" )+"";

i want to put letter ( M ) for member and ( L ) for leader at the end of the name..........

Edited by caspa
Posted

It's more like a script request.. whatever here for you.

prontera,155,155,5	script	Guild manager	56,{
//- Limit 128 guild names
//- NPC name
.@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
.@m = 0;
.@cast_owned$ = "";
setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
	deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );

// Count guild
// -----------
query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

mes .@npc$;
mes " ";
mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
mes "Select a guild for more informations.";
next;


// Menu display name guild
// -----------------------
query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
				.@guild_id, .@name$, .@master$, .@guild_lv );

.@s = select( implode( .@name$, ":" ) ) -1;

.@c = query_sql( "SELECT `castle_id` FROM `guild_castle` WHERE `guild_id` = '"+ .@guild_id[ .@s ] +"'", .@castle_id );
for( .@i = 0; .@i < .@c; .@i++ )
	.@cast_owned$ = .@cast_owned$ + .castle$[ .@castle_id[ .@i ] ] + ( .@i == .@c -1 ? "" : ", " );

.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
for( .@i = 0; .@i < .@size; .@i++ )
	if( getcharid( 0,.@name_m$[ .@i ] ) )
		.@m++;

mes .@npc$;
mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
	"Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
	"Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
	"Members Online: ^0000FF"+ .@m +"^000000",
	"Castle owned: ^CC00CC"+ ( .@c ? .@cast_owned$ : "None" ) +"^000000";


// Menu members
// ------------
switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
	case 1:
		next;
		break;
	case 2:
		next;
		mes .@npc$;
		mes " ";
		mes "See you soon ^-^";
		close;
	case 3:
		next;
		goto L_list;
}

deletearray .@name_m$, getarraysize( .@name_m$ );
.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

mes .@npc$;
mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
	"- Red: currently ^FF0000offline^000000.",
	"- Green: currently ^00C957online^000000.",
	" ";

for( .@i = 0; .@i < .@size; .@i++ )
	mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
next;
goto L_list;



OnInit:
deletearray .castle$, getarraysize( .castle$ );	//- prevent duplicate
setarray .castle$, "Neuschwanstein",	"Hohenschwangau",	"Nuernberg",	"Wuerzburg",	"Rothenburg",
				"Repherion",		"Eeyolbriggar",		"Yesnelph",		"Bergel",		"Mersetzdeitz",
				"Bright Arbor",		"Scarlet Palace",	"Holy Shadow",	"Sacred Altar",	"Bamboo Grove Hill",
				"Kriemhild",		"Swanhild",			"Fadhgridh",	"Skoegul",		"Gondul",
				"Earth",			"Air",				"Water",		"Fire",			"Himinn",
				"Andlangr",			"Viblainn",			"Hljod",		"Skidbladnir",	"Mardol",
				"Cyr",				"Horn",				"Gefn",			"Bandis";
end;
}

Display :

- Number of guild (total)

- when you select a guild

-- display guild name, guild master, guild lvl, member online and castle owned by the guild

-- display all member name and check if they are online/offline

Works on rAthena only.

Edit including comment of nanakiwurtz

Capuche!! how do edit this script so that it only reads 1 specific castle!! ( refer to the picture for what i want )

i want to make this script that it only reads the payg_cas03 because that's the castle needed to conquer in order to become the GOTW......

post-3628-0-81699800-1359736658_thumb.jpg

Posted

mes ""+(.@i + 1)+".  "+( ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00FF00" : "^FF0000" )+ .@name_m$[ .@i ]+" "+(.@name_m$[ .@i ](.@master$[ .@s ]) ? "( L )" : "( M )" )+"";

i want to put letter ( M ) for member and ( L ) for leader at the end of the name..........

Just put == in

(.@name_m$[ .@i ](.@master$[ .@s ]) ? "( L )" : "( M )" )

mes (.@i + 1)+".  "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00FF00" : "^FF0000" ) + .@name_m$[ .@i ] +" "+ ( .@name_m$[ .@i ] == .@master$[ .@s ] ? "( L )" : "" ) +"^000000";

@xmaniacx

I don't understand well your request.

If you only want payg_cas03 castle... well something like this ?

prontera,155,155,5    script    Guild manager    56,{
//- Limit 128 guild names
//- NPC name
   .@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
   if( .@m ) {
       .@m = 0;
       .@cast_owned$ = "";
       setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
       for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
           deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );
   }

// Count guild
// -----------
   query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

   mes .@npc$;
   mes " ";
   mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
   mes "Select a guild for more informations.";
   next;


// Menu display name guild
// -----------------------
   query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
                   .@guild_id, .@name$, .@master$, .@guild_lv );

   .@s = select( implode( .@name$, ":" ) ) -1;

   .@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
   for( .@i = 0; .@i < .@size; .@i++ )
       if( getcharid( 0,.@name_m$[ .@i ] ) )
           .@m++;

   mes .@npc$;
   mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
       "Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
       "Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
       "Members Online: ^0000FF"+ .@m +"^000000",
       "Castle owned: ^CC00CC"+ ( getcastledata( "payg_cas03",1 ) == .@guild_id[ .@s ] ? getcastlename( "payg_cas03" ) : "None" ) +"^000000";


// Menu members
// ------------
   switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
       case 1:
           next;
           break;
       case 2:
           next;
           mes .@npc$;
           mes " ";
           mes "See you soon ^-^";
           close;
       case 3:
           next;
           goto L_list;
   }

   deletearray .@name_m$, getarraysize( .@name_m$ );
   .@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

   mes .@npc$;
   mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
       "- Red: currently ^FF0000offline^000000.",
       "- Green: currently ^00C957online^000000.",
       " ";

   for( .@i = 0; .@i < .@size; .@i++ )
       mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
   next;
   goto L_list;
}

Posted (edited)

mes ""+(.@i + 1)+".  "+( ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00FF00" : "^FF0000" )+ .@name_m$[ .@i ]+" "+(.@name_m$[ .@i ](.@master$[ .@s ]) ? "( L )" : "( M )" )+"";

i want to put letter ( M ) for member and ( L ) for leader at the end of the name..........

Just put == in

(.@name_m$[ .@i ](.@master$[ .@s ]) ? "( L )" : "( M )" )

mes (.@i + 1)+".  "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00FF00" : "^FF0000" ) + .@name_m$[ .@i ] +" "+ ( .@name_m$[ .@i ] == .@master$[ .@s ] ? "( L )" : "" ) +"^000000";

@xmaniacx

I don't understand well your request.

If you only want payg_cas03 castle... well something like this ?

prontera,155,155,5	script	Guild manager	56,{
//- Limit 128 guild names
//- NPC name
.@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
if( .@m ) {
	.@m = 0;
	.@cast_owned$ = "";
	setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
	for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
		deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );
}

// Count guild
// -----------
query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

mes .@npc$;
mes " ";
mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
mes "Select a guild for more informations.";
next;


// Menu display name guild
// -----------------------
query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
				.@guild_id, .@name$, .@master$, .@guild_lv );

.@s = select( implode( .@name$, ":" ) ) -1;

.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
for( .@i = 0; .@i < .@size; .@i++ )
	if( getcharid( 0,.@name_m$[ .@i ] ) )
		.@m++;

mes .@npc$;
mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
	"Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
	"Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
	"Members Online: ^0000FF"+ .@m +"^000000",
	"Castle owned: ^CC00CC"+ ( getcastledata( "payg_cas03",1 ) == .@guild_id[ .@s ] ? getcastlename( "payg_cas03" ) : "None" ) +"^000000";


// Menu members
// ------------
switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
	case 1:
		next;
		break;
	case 2:
		next;
		mes .@npc$;
		mes " ";
		mes "See you soon ^-^";
		close;
	case 3:
		next;
		goto L_list;
}

deletearray .@name_m$, getarraysize( .@name_m$ );
.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

mes .@npc$;
mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
	"- Red: currently ^FF0000offline^000000.",
	"- Green: currently ^00C957online^000000.",
	" ";

for( .@i = 0; .@i < .@size; .@i++ )
	mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
next;
goto L_list;
}

Well what i'm basically trying to say is that.......... in my server every, sunday at 9:00P.M - 10:00PM the castle payg_cas03 is active and whoever conquer this one will be the GOTW...... now what i want is that, whenever the WoE finishes and a certain guild conquer this castle..... like for example the maniac guild owns the Castle..... it would display the information of the guild (guildleader/nameofguild/guildmembers) on the flag........ so that when newbie people view the flag.... it would give them the information on what guild to target during the WoE session...... hope u get what i'm trying to say........

Edited by xmaniacx
Posted

Like that ?

prontera,155,155,5    script    Guild manager    56,{
//- Limit 128 guild names
//- NPC name
   .@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
   if( .@m ) {
       .@m = 0;
       .@cast_owned$ = "";
       setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
       for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
           deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );
   }

// Count guild
// -----------
   query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

   mes .@npc$;
   mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
   mes "^FF0000GOTW Information^000000",
       "Castle : "+ getcastlename( "payg_cas03" ),
       "Owned by Guild : "+getguildname( getcastledata( "payg_cas03",1 ) ),
       "^FF0000WANTED !^000000 Guild Leader : "+ getguildmaster( getcastledata( "payg_cas03",1 ) );
   next;


// Menu display name guild
// -----------------------
   query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
                   .@guild_id, .@name$, .@master$, .@guild_lv );

   .@s = select( implode( .@name$, ":" ) ) -1;

   .@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
   for( .@i = 0; .@i < .@size; .@i++ )
       if( getcharid( 0,.@name_m$[ .@i ] ) )
           .@m++;

   mes .@npc$;
   mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
       "Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
       "Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
       "Members Online: ^0000FF"+ .@m +"^000000",
       "Castle owned: ^CC00CC"+ ( getcastledata( "payg_cas03",1 ) == .@guild_id[ .@s ] ? getcastlename( "payg_cas03" ) : "None" ) +"^000000";


// Menu members
// ------------
   switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
       case 1:
           next;
           break;
       case 2:
           next;
           mes .@npc$;
           mes " ";
           mes "See you soon ^-^";
           close;
       case 3:
           next;
           goto L_list;
   }

   deletearray .@name_m$, getarraysize( .@name_m$ );
   .@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

   mes .@npc$;
   mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
       "- Red: currently ^FF0000offline^000000.",
       "- Green: currently ^00C957online^000000.",
       " ";

   for( .@i = 0; .@i < .@size; .@i++ )
       mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
   next;
   goto L_list;
}

Posted (edited)

Like that ?

prontera,155,155,5	script	Guild manager	56,{
//- Limit 128 guild names
//- NPC name
.@npc$ = "[ Guild manager ]";
//--------------------------------------

L_list:
// Delete variables
// ----------------
if( .@m ) {
	.@m = 0;
	.@cast_owned$ = "";
	setarray .@var$, ".@guild_id", ".@name$", ".@master$", ".@guild_lv", ".@connect_member", ".@max_member", ".@name_m$", ".@castle_id";
	for( .@i = 0; .@i < getarraysize( .@var$ ); .@i++ )
		deletearray getd( .@var$[ .@i ] ), getarraysize( getd( .@var$[ .@i ] ) );
}

// Count guild
// -----------
query_sql( "SELECT COUNT(`guild_id`) FROM `guild`", .@count );

mes .@npc$;
mes "Total: ^FF0000"+ .@count +"^000000 guild"+ ( .@count -1 ? "s." : "." );
mes "^FF0000GOTW Information^000000",
	"Castle : "+ getcastlename( "payg_cas03" ),
	"Owned by Guild : "+getguildname( getcastledata( "payg_cas03",1 ) ),
	"^FF0000WANTED !^000000 Guild Leader : "+ getguildmaster( getcastledata( "payg_cas03",1 ) );
next;


// Menu display name guild
// -----------------------
query_sql( "SELECT `guild_id`, `name`, `master`, `guild_lv` FROM `guild` ORDER BY `guild_id` ASC limit 128",
				.@guild_id, .@name$, .@master$, .@guild_lv );

.@s = select( implode( .@name$, ":" ) ) -1;

.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );
for( .@i = 0; .@i < .@size; .@i++ )
	if( getcharid( 0,.@name_m$[ .@i ] ) )
		.@m++;

mes .@npc$;
mes "Guild name: ^FF0000"+ .@name$[ .@s ] +"^000000",
	"Master name: ^FFCC00"+ .@master$[ .@s ] +"^000000",
	"Guild lvl: ^FF00CC"+ .@guild_lv[ .@s ] +"^000000",
	"Members Online: ^0000FF"+ .@m +"^000000",
	"Castle owned: ^CC00CC"+ ( getcastledata( "payg_cas03",1 ) == .@guild_id[ .@s ] ? getcastlename( "payg_cas03" ) : "None" ) +"^000000";


// Menu members
// ------------
switch( select( "~ ^777777Informations members^000000", "~ ^777777Cancel^000000", "~ ^777777Choose another guild^000000" ) ) {
	case 1:
		next;
		break;
	case 2:
		next;
		mes .@npc$;
		mes " ";
		mes "See you soon ^-^";
		close;
	case 3:
		next;
		goto L_list;
}

deletearray .@name_m$, getarraysize( .@name_m$ );
.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ .@guild_id[ .@s ] +"' ORDER BY `position` ASC", .@name_m$ );

mes .@npc$;
mes "Members of ^0000FF"+ .@name$[ .@s ] +"^000000 guild.",
	"- Red: currently ^FF0000offline^000000.",
	"- Green: currently ^00C957online^000000.",
	" ";

for( .@i = 0; .@i < .@size; .@i++ )
	mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
next;
goto L_list;
}

Boss capu it's about nearly what i want i'd say 80%...........

I've check the script and there is a little bit too much information LOL.............

What i'd like is that when a player click's the flag.......

it would display something like this

mes [ GOTW Information ]";

mes "Castle : payg_cas03/Holy Shadow";

mes "Status : (null/unoccopied) <-- if not owned yet || occupied <-- if occupied";

mes "GM Leader : (none) <--- if not owned yet || guild leader name <-- if owned by a guild";

mes "GM Member : (none) <--- if not owned yet || list of guild member's name who owned the castle";

next;

menu "Enter Castle" "Cancel"

if enter caslte -->>

it would check the character if she/he is a part of the guild that owned the castle...

then if the castle has not been conquered it yet......

It would say "no guild has conquered this castle yet..... ";

something like this............

also i would still like it to have a green and red color if they're online or offline

Edited by xmaniacx
Posted (edited)

@xmaniacx

It was a request far await from the topic... the topic is a little confused now. Post a new in script request next time.

prontera,155,155,5	script	GOTW Infos	56,{
//- NPC name
.@npc$ = "[ ^FF0000GOTW Informations^000000 ]";
//--------------------------------------

if( getcastledata( "payg_cas03",1 ) )
	.@size = query_sql( "SELECT `name` FROM `guild_member` WHERE `guild_id`= '"+ getcastledata( "payg_cas03",1 ) +"' ORDER BY `position` ASC", .@name_m$ );

mes .@npc$;
mes "Castle : payg_cas03/"+ getcastlename( "payg_cas03" ),
	"Owned by Guild : "+ ( getcastledata( "payg_cas03",1 ) ? getguildname( getcastledata( "payg_cas03",1 ) ) : "none" ),
	"GM Leader : "+ ( getcastledata( "payg_cas03",1 ) ? ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + getguildmaster( getcastledata( "payg_cas03",1 ) ) +"^000000" : "none" ),
	"Members ^00C957online^000000 / ^FF0000offline^000000 : "+ ( .@size ? "" : "none" );
for( .@i = 0; .@i < .@size; .@i++ )
	mes "-> "+ ( getcharid( 0,.@name_m$[ .@i ] ) ? "^00C957" : "^FF0000" ) + .@name_m$[ .@i ] +"^000000";
next;

// Menu members
// ------------
if( select( "~ ^777777Enter castle^000000", "~ ^777777Cancel^000000" ) -1 ) {
	mes .@npc$;
	mes " ";
	mes "See you soon ^-^";
	close;
}
.@d = getcastledata( "payg_cas03",1 );
mes .@npc$;
if( !.@d ) {
	mes "No guild has conquered this castle yet !";
	close;
}
else if( .@d == getcharid(2) ) {
	mes "You are a member of the guild's castle !";
	close;
}
mes "I can't do nothing for you.";
close;

}

@caspa

It's done ? ^-^'

Edited by Capuche

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...