Jump to content
  • 0
Sign in to follow this  
glemor123

gpack npc problem

Question

invek,135,164,5	script	Guild Package	734,{	.@req_online = 11; // how many players need to online to claim. Default: 11	.@req_lv = 255; // minimum level of .@online players that has to be. Default: MAX_LEVEL in mmo.h	mes "^FF0000The Guild Level must be level 50^000000";	mes "";		mes "^FF0000You must have 11 players online^000000 in your guild including the guild master";		mes "";		mes "^FF0000All you the player in the guild must be level 255^000000";		mes "";		mes "^00FF00Bound items^0000FF that gained cannot be ";		mes "traded it to other account,sold,";		mes "nor dropped";		next;		mes "The Guild Master Will Receive The Following";		mes " ^FF0000 1x Ghostring Card ^000000";		mes " ^FF0000 1x Moonlight Card ^000000";		mes " ^FF0000 4x Turtle General Card ^000000";		mes " ^FF0000 1x Thara Frog Card ^000000";		mes " ^FF0000 1x Orc hero Card ^000000";		mes " ^FF0000 1x Evil Snake Lord Card ^000000";		mes " ^FF0000 1x Raydric Card ^000000";		mes " ^FF0000 1x General Egnigem Cenia Card ^000000";		mes " ^FF0000 1x Hollow Mask(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Helm(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Armor(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Mantue(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Shoes(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Shield(BOUND) ^000000";		mes " ^FF0000 1000x Super Fish Slice(BOUND) ^000000";		mes " ^FF0000 10x Emergency Level 3 Scroll(BOUND) ^000000";		mes "^00FF00 1x Wing of Choice ^000000";		mes " ^FF0000 Arch demon wing OR Deviling Wing OR Angeling Wing(BOUND) ^000000";		mes "^00FF00 Random Items(BOUND) ^000000";		mes " ^FF0000 1x Earth Headprotector ^000000";		mes " ^FF0000 1x Fire Headprotector ^000000";		mes " ^FF0000 1x Lightning Headprotector ^000000";		mes " ^FF0000 1x Sound Headprotector ^000000";		mes " ^FF0000 1x Water Headprotector ^000000";		next;		mes "The Guild Member Will Receive The Following";		mes " ^FF0000 1x Ghostring Card ^000000";		mes " ^FF0000 1x Moonlight Card ^000000";		mes " ^FF0000 4x Turtle General Card ^000000";		mes " ^FF0000 1x Thara Frog Card ^000000";		mes " ^FF0000 1x Orc hero Card ^000000";		mes " ^FF0000 1x Evil Snake Lord Card ^000000";		mes " ^FF0000 1x Raydric Card ^000000";		mes " ^FF0000 1x General Egnigem Cenia Card ^000000";		mes " ^FF0000 1x Hollow Mask(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Helm(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Armor(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Mantue(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Shoes(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Shield(BOUND) ^000000";		mes " ^FF0000 500x Super Fish Slice(BOUND) ^000000";		mes "^00FF00 1x Wing of Choice ^000000";		mes " ^FF0000 Arch demon wing OR Deviling Wing OR Angeling Wing(BOUND) ^000000";		mes "^00FF00 Random Items(BOUND) ^000000";		mes " ^FF0000 1x Earth Headprotector ^000000";		mes " ^FF0000 1x Fire Headprotector ^000000";		mes " ^FF0000 1x Lightning Headprotector ^000000";		mes " ^FF0000 1x Sound Headprotector ^000000";		mes " ^FF0000 1x Water Headprotector ^000000";		next;	if ( !getcharid(2) ) {		mes "You must have a guild";		close;	}	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) {		mes "You cannot request the Guild Package,";		mes "only the guild master can request for the package";		close;	}	query_sql "SELECT guild_lv FROM guild WHERE guild_id = "+getcharid(2), .@guild_lv;	if ( .@guild_lv != 50 ) {		mes "You're guild level must be level 50";		close;	}	getguildmember getcharid(2), 1;	getguildmember getcharid(2), 2;	for ( .@i = 0; .@i < $@guildmembercount; .@i++ )		if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) )			.@online++;	if ( .@online < .@req_online ) {		mes "Your guild must have "+ .@req_online +" guild members online including the guild master";		close;	}	.@origin = getcharid(3);	for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) {		if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) {			attachrid $@guildmemberaid[.@i];			if ( BaseLevel < .@req_lv ) {				.@deny_name$[.@c] = strcharinfo(0);				.@c++;			}		}	}	attachrid .@origin;	if ( .@c ) {		mes "There are "+ .@c +" member does not meet the level requirement";		mes "All members must be level 255";		mes implode( .@deny_name$, "," );		close;	}	for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) {		if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) {			attachrid $@guildmemberaid[.@i];			if ( #guild_package_claimeddd ) {				.@deny_name$[.@c] = strcharinfo(0);				.@c++;			}		}	}	attachrid .@origin;	if ( .@c ) {		mes "There are "+ .@c +" members already claimed this package within their account";		mes implode( .@deny_name$, "," );		close;	}	if ( query_sql( "select account_id as aaa, ( select last_ip from login where account_id = aaa ) as last_ip from guild_member where guild_id = "+ getcharid(2) +" group by last_ip", .@aid, .@ip$ ) < .@req_online ) {		mes "same ip detected";		.@nb = query_sql( "select name, account_id as aaa, ( select last_ip from login where account_id = aaa ) as last_ip from guild_member where guild_id = "+ getcharid(2), .@name$, .@aid, .@ip$ );		for ( .@i = 0; .@i < .@nb; .@i++ )			mes (.@i +1)+". "+ .@name$[.@i] +" ("+ .@ip$ +")";		next;	}	mes "pass";	for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) {		if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) {			attachrid $@guildmemberaid[.@i];			if ( getguildmasterid( getcharid(2) ) != $@guildmembercid[.@i] ){				getitem 4047,1;				getitem 4058,1;				getitem 4143,1;				getitem 4330,1;				getitem 4133,1;				getitem 4352,1;				getitem 4131,1;				getitem 4305,4;				getitembound  30021,1,1;				getitembound 30032,1,1;				getitembound 30033, 1,1;				getitembound 30034, 1,1;				getitembound 30035, 1,1;				getitembound 30036, 1,1;				getitembound 14524, 500,1;				getitembound callfunc( "F_Rand", 30082, 30083, 30084, 30085, 30086, 30087 ), 1,1;			}else if ( getguildmasterid( getcharid(2) ) == $@guildmembercid[.@i] ){				getitem 4047, 1;				getitem 4058, 1;				getitem 4143, 1;				getitem 4330, 1;				getitem 4133, 1;				getitem 4352, 1;				getitem 4131,1;				getitem 4305,4;				getitembound  30021, 1,1;				getitembound 30032, 1,1;				getitembound 30033, 1,1;				getitembound 30034, 1,1;				getitembound 30035, 1,1;				getitembound 30036, 1,1;				getitembound 14524, 1000,1;				getitembound 12970, 10,1;				getitembound callfunc( "F_Rand", 30082, 30083, 30084, 30085,  30086, 30087 ), 1,1;}if( getguildmasterid( getcharid(2) ) != $@guildmembercid[.@i] ||  getguildmasterid( getcharid(2) ) == $@guildmembercid[.@i]){switch( select( "Arch demon wing:Deviling Wing:Angeling Wing" ) ) {		case 1: //getitem <item id>,<amount>				getitembound 30027,1,1;skilleffect 361,0; sc_start SC_ASSUMPTIO,360000,5;skilleffect 34,0; sc_start SC_BLESSING,360000,10;skilleffect 29,0; sc_start SC_INCREASEAGI,360000,10;				break;		case 2: //getitem <item id>,<amount>				getitembound 30028,1,1;skilleffect 361,0; sc_start SC_ASSUMPTIO,360000,5;skilleffect 34,0; sc_start SC_BLESSING,360000,10;skilleffect 29,0; sc_start SC_INCREASEAGI,360000,10;				break;		case 3: //getitem <item id>,<amount>				getitembound 30030,1,1;skilleffect 361,0; sc_start SC_ASSUMPTIO,360000,5;skilleffect 34,0; sc_start SC_BLESSING,360000,10;skilleffect 29,0; sc_start SC_INCREASEAGI,360000,10;				break;		default: break;	}}			#guild_package_claimeddd = 1;		}	}	attachrid .@origin;	close;}

 

All the members must be given gpack. but out of 11 players. 2 players was only given.

I think thr switch( select( function is the problem.

 

Because after obtaining the freebies. each player including the guild master will choose there own choice of wing

Edited by glemor123

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Okay, well looking at your script I see you used the command addrid. Are you using rAthena or Hercules as your emulator?

If your using rAthena, than you should be able to go back to the regular switch(select) option instead of doevent. But also while replacing your for(loop) and using addrid as Emistry suggested.

 

If you're using Hercules as your emulator, then I'll have to look around for another solution.

 

 

Edit: Okay, since you said *doevent, didn't work. Then I think the only option left, without src modifications is a timer using this command: addtimer <ticks>,"NPC::OnLabel";

This should allow you to give each player their own timer, which upon activation you can prompt them with the menu. Can also just put the timer to 1 tick, to make it appear practically instantly.

Edited by GmOcean

Share this post


Link to post
Share on other sites
  • 0

I don't believe that to be your issue, I'll take a good look at it later.

Edit:

Okay, after looking at your script, I couldn't find anything fundamentally wrong. And it doesn't seem to be the switch(select); since these do work within loops.

Edited by GmOcean

Share this post


Link to post
Share on other sites
  • 0

u

 

I don't believe that to be your issue, I'll take a good look at it later.

Edit:

Okay, after looking at your script, I couldn't find anything fundamentally wrong. And it doesn't seem to be the switch(select); since these do work within loops.

I updated my thread. the problem is a menu popup first to the GM to choose the wing that the GM wants after choosing the wing. A menu pops up to 1 member then choose a wing after choosing a menu will popup to another player.

 

what I want to be solve is that the menu will appear to all the players including the GM in a guild at once. not one at a time

Share this post


Link to post
Share on other sites
  • 0

try change

	for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) {		if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) {			attachrid $@guildmemberaid[.@i];

to

addrid( 3,getcharid(2) );

Share this post


Link to post
Share on other sites
  • 0

@ Emistry - Hercules, doesn't have addrid by default.

 

But there is another option. Use this command: doevent "<NPC object name>::<event label>";

Since the command will hold off execution until the original script is done, you can loop through everyone making them call the event, and when it's done. Have that label prompt them with the menu options.

Share this post


Link to post
Share on other sites
  • 0
invek,135,164,5	script	Guild Package	734,{	.@req_online = 4; // how many players need to online to claim. Default: 11	.@req_lv = 255; // minimum level of .@online players that has to be. Default: MAX_LEVEL in mmo.h	mes "^FF0000The Guild Level must be level 50^000000";	mes "";		mes "^FF0000You must have 11 players online^000000 in your guild including the guild master";		mes "";		mes "^FF0000All you the player in the guild must be level 255^000000";		mes "";		mes "^00FF00Bound items^0000FF that gained cannot be ";		mes "traded it to other account,sold,";		mes "nor dropped";		next;		mes "The Guild Master Will Receive The Following";		mes " ^FF0000 1x Ghostring Card ^000000";		mes " ^FF0000 1x Moonlight Card ^000000";		mes " ^FF0000 4x Turtle General Card ^000000";		mes " ^FF0000 1x Thara Frog Card ^000000";		mes " ^FF0000 1x Orc hero Card ^000000";		mes " ^FF0000 1x Evil Snake Lord Card ^000000";		mes " ^FF0000 1x Raydric Card ^000000";		mes " ^FF0000 1x General Egnigem Cenia Card ^000000";		mes " ^FF0000 1x Hollow Mask(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Helm(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Armor(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Mantue(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Shoes(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Shield(BOUND) ^000000";		mes " ^FF0000 1000x Super Fish Slice(BOUND) ^000000";		mes " ^FF0000 10x Emergency Level 3 Scroll(BOUND) ^000000";		mes "^00FF00 1x Wing of Choice ^000000";		mes " ^FF0000 Arch demon wing OR Deviling Wing OR Angeling Wing(BOUND) ^000000";		mes "^00FF00 Random Items(BOUND) ^000000";		mes " ^FF0000 1x Earth Headprotector ^000000";		mes " ^FF0000 1x Fire Headprotector ^000000";		mes " ^FF0000 1x Lightning Headprotector ^000000";		mes " ^FF0000 1x Sound Headprotector ^000000";		mes " ^FF0000 1x Water Headprotector ^000000";		next;		mes "The Guild Member Will Receive The Following";		mes " ^FF0000 1x Ghostring Card ^000000";		mes " ^FF0000 1x Moonlight Card ^000000";		mes " ^FF0000 4x Turtle General Card ^000000";		mes " ^FF0000 1x Thara Frog Card ^000000";		mes " ^FF0000 1x Orc hero Card ^000000";		mes " ^FF0000 1x Evil Snake Lord Card ^000000";		mes " ^FF0000 1x Raydric Card ^000000";		mes " ^FF0000 1x General Egnigem Cenia Card ^000000";		mes " ^FF0000 1x Hollow Mask(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Helm(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Armor(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Mantue(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Shoes(BOUND) ^000000";		mes " ^FF0000 1x Silver Valkyrie Shield(BOUND) ^000000";		mes " ^FF0000 500x Super Fish Slice(BOUND) ^000000";		mes "^00FF00 1x Wing of Choice ^000000";		mes " ^FF0000 Arch demon wing OR Deviling Wing OR Angeling Wing(BOUND) ^000000";		mes "^00FF00 Random Items(BOUND) ^000000";		mes " ^FF0000 1x Earth Headprotector ^000000";		mes " ^FF0000 1x Fire Headprotector ^000000";		mes " ^FF0000 1x Lightning Headprotector ^000000";		mes " ^FF0000 1x Sound Headprotector ^000000";		mes " ^FF0000 1x Water Headprotector ^000000";		next;	if ( !getcharid(2) ) {		mes "You must have a guild";		close;	}	if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) {		mes "You cannot request the Guild Package,";		mes "only the guild master can request for the package";		close;	}	query_sql "SELECT guild_lv FROM guild WHERE guild_id = "+getcharid(2), .@guild_lv;	if ( .@guild_lv != 50 ) {		mes "You're guild level must be level 50";		close;	}	getguildmember getcharid(2), 1;	getguildmember getcharid(2), 2;	for ( .@i = 0; .@i < $@guildmembercount; .@i++ )		if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) )			.@online++;	if ( .@online < .@req_online ) {		mes "Your guild must have "+ .@req_online +" guild members online including the guild master";		close;	}	.@origin = getcharid(3);	for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) {		if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) {			attachrid $@guildmemberaid[.@i];			if ( BaseLevel < .@req_lv ) {				.@deny_name$[.@c] = strcharinfo(0);				.@c++;			}		}	}	attachrid .@origin;	if ( .@c ) {		mes "There are "+ .@c +" member does not meet the level requirement";		mes "All members must be level 255";		mes implode( .@deny_name$, "," );		close;	}	for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) {		if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) {			attachrid $@guildmemberaid[.@i];			if ( #guild_package_claimeddd1211111 ) {				.@deny_name$[.@c] = strcharinfo(0);				.@c++;			}		}	}	attachrid .@origin;	if ( .@c ) {		mes "There are "+ .@c +" members already claimed this package within their account";		mes implode( .@deny_name$, "," );		close;	}	if ( query_sql( "select account_id as aaa, ( select last_ip from login where account_id = aaa ) as last_ip from guild_member where guild_id = "+ getcharid(2) +" group by last_ip", .@aid, .@ip$ ) < .@req_online ) {		mes "same ip detected";		.@nb = query_sql( "select name, account_id as aaa, ( select last_ip from login where account_id = aaa ) as last_ip from guild_member where guild_id = "+ getcharid(2), .@name$, .@aid, .@ip$ );		for ( .@i = 0; .@i < .@nb; .@i++ )			mes (.@i +1)+". "+ .@name$[.@i] +" ("+ .@ip$ +")";		next;	}	mes "pass";	for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) {		if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) {			attachrid $@guildmemberaid[.@i];			if ( getguildmasterid( getcharid(2) ) != $@guildmembercid[.@i] ){				getitem 4047,1;				getitem 4058,1;				getitem 4143,1;				getitem 4330,1;				getitem 4133,1;				getitem 4352,1;				getitem 4131,1;				getitem 4305,4;				getitembound  30021,1,1;				getitembound 30032,1,1;				getitembound 30033, 1,1;				getitembound 30034, 1,1;				getitembound 30035, 1,1;				getitembound 30036, 1,1;				getitembound 14524, 500,1;				getitembound callfunc( "F_Rand", 30082, 30083, 30084, 30085, 30086, 30087 ), 1,1;			}else if ( getguildmasterid( getcharid(2) ) == $@guildmembercid[.@i] ){				getitem 4047, 1;				getitem 4058, 1;				getitem 4143, 1;				getitem 4330, 1;				getitem 4133, 1;				getitem 4352, 1;				getitem 4131,1;				getitem 4305,4;				getitembound  30021, 1,1;				getitembound 30032, 1,1;				getitembound 30033, 1,1;				getitembound 30034, 1,1;				getitembound 30035, 1,1;				getitembound 30036, 1,1;				getitembound 14524, 1000,1;				getitembound 12970, 10,1;				getitembound callfunc( "F_Rand", 30082, 30083, 30084, 30085,  30086, 30087 ), 1,1;}if( getguildmasterid( getcharid(2) ) != $@guildmembercid[.@i] ||  getguildmasterid( getcharid(2) ) == $@guildmembercid[.@i]){doevent "validation_sys::OnValidate";}			#guild_package_claimeddd1211111 = 1;		}	}	attachrid .@origin;	close;}

 

-	script	validation_sys	-1,{OnValidate:	switch( select( "Arch demon wing:Deviling Wing:Angeling Wing" ) ) {		case 1: //getitem <item id>,<amount>				getitembound 30027,1,1;skilleffect 361,0; sc_start SC_ASSUMPTIO,360000,5;skilleffect 34,0; sc_start SC_BLESSING,360000,10;skilleffect 29,0; sc_start SC_INCREASEAGI,360000,10;				break;		case 2: //getitem <item id>,<amount>				getitembound 30028,1,1;skilleffect 361,0; sc_start SC_ASSUMPTIO,360000,5;skilleffect 34,0; sc_start SC_BLESSING,360000,10;skilleffect 29,0; sc_start SC_INCREASEAGI,360000,10;				break;		case 3: //getitem <item id>,<amount>				getitembound 30030,1,1;skilleffect 361,0; sc_start SC_ASSUMPTIO,360000,5;skilleffect 34,0; sc_start SC_BLESSING,360000,10;skilleffect 29,0; sc_start SC_INCREASEAGI,360000,10;				break;		default: break;	}	close;}

I tried your suggestion GMOcean.but doesn't work

Edited by glemor123

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.