Jump to content
  • 0

NPC Script that shown a list of a player who have MVP Card


Jesky

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  51
  • Reputation:   3
  • Joined:  11/29/13
  • Last Seen:  

Hi guys, i'm a silent reader in rathena, this is my first post at all.

I'm sorry for my bad english grammar.

 

I want to know if in my server there's already player who have a MVP Card or not.

I can know it from NPC who have a GM Panel.

Option for GM Panel can be like

"delete that item from that player", "announce there's a player who have already that item", and many utility function.

 

It's no matter if the MVP Card is already inserted on an equip, on storage, on cart, or if the character is offline,

the script still can detect it.

 

The NPC will list all of player who have the MVP card also the list of what card he has,

When he get that (in date/month/year clock), how much that card he has.

 

Is there anyone already has a similiar script like my request? or can someone help making this for me?

I'll really appreciate it. Thank you :D

Edited by Jesky
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  51
  • Reputation:   3
  • Joined:  11/29/13
  • Last Seen:  

anyone? :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

this script is possible, but too complex

I just did only a very small part of it

- check the input player in inventory has mvp card or not

and the script already went like this

prontera,155,187,5	script	kjhdfsdksfjh	100,{
	mes "blah";
	next;
	select "search by input player name/ID", "search by card ID";
	if ( @menu == 1 ) {
		switch ( select ( "Char Name", "Account ID", "Char ID" ) ) {
		case 1:
			input .@id$;
			if ( isloggedin( getcharid( 3, .@id$ ) ) ) {
				.@cid = getcharid( 0, .@id$ );
				.@aid = getcharid( 3, .@id$ );
				.@name$ = rid2name( getcharid( 3, .@id$ ) );
			}
			else {
				if ( !query_sql( "select char_id, account_id, name from `char` where name = '"+ escape_sql( .@id$ ) +"'", .@cid, .@aid, .@name$ ) ) {
					mes "There is no such Character Name exist";
					close;
				}
			}	
			break;
		case 2:
			input .@id;
			if ( !( .@nb = query_sql( "select char_id, name, char_num, account_id from `char` where account_id = "+ .@id +" order by char_num asc", .@cid, .@name$, .@gid, .@aid ) ) ) {
				mes "There is no such Account ID";
				close;
			}
			for ( .@i = 0; .@i < .@nb; .@i++ ) {
				mes ( .@gid[.@i] +1 )+". "+ .@cid[.@i] +" "+ .@name$[.@i];
				.@menu$ = .@menu$ +( .@gid[.@i] +1 )+". "+ .@cid[.@i];
			}
			next;
			.@s = select( .@menu$ ) -1;
			.@cid = .@cid[.@s];
			.@aid = .@aid[.@s];
			.@name$ = .@name$[.@s];
			break;
		case 3:
			input .@id;
			if ( !query_sql( "select char_id, account_id, name from `char` where char_id = "+ .@id, .@cid, .@aid, .@name$ ) ) {
				mes "There is no such Character ID exist";
				close;
			}
		}
		mes "The player ^0000FF"+ .@name$ +"^000000 is "+( ( isloggedin(.@aid) )?"^00FF00Online":"^FF0000Offline" )+"^000000";
		if ( isloggedin( .@aid, .@cid ) ) {
			.@origin = getcharid(3);
			attachrid .@aid;
			getinventorylist;
			for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) {
				if ( compare( .mvpcard_compare$, "#"+ @inventorylist_id[.@i] +"#" ) || compare( .mvpcard_compare$, "#"+ @inventorylist_card1[.@i] +"#" ) || compare( .mvpcard_compare$, "#"+ @inventorylist_card2[.@i] +"#" ) || compare( .mvpcard_compare$, "#"+ @inventorylist_card3[.@i] +"#" ) || compare( .mvpcard_compare$, "#"+ @inventorylist_card4[.@i] +"#" ) ) {
					.@itemid[.@c] = @inventorylist_id[.@i];
					.@amount[.@c] = @inventorylist_amount[.@i];
					.@identify[.@c] = @inventorylist_identify[.@i];
					.@refine[.@c] = @inventorylist_refine[.@i];
					.@broken[.@c] = @inventorylist_attribute[.@i];
					.@card1[.@c] = @inventorylist_card1[.@i];
					.@card2[.@c] = @inventorylist_card2[.@i];
					.@card3[.@c] = @inventorylist_card3[.@i];
					.@card4[.@c] = @inventorylist_card4[.@i];
					attachrid .@origin;
					mes @itemname2_info$[0] + callfunc( "getitemname2", .@itemid[.@c], .@identify[.@c], .@refine[.@c], .@broken[.@c], .@card1[.@c], .@card2[.@c], .@card3[.@c], .@card4[.@c] ) +":^000000 "+ .@amount[.@c] +" ea.";
					attachrid .@aid;
					.@c++;
				}
			}
			attachrid .@origin;
		}
		else {
			.@nb = query_sql( "select nameid, amount, identify, refine, attribute, card0, card1, card2, card3 from inventory where "+ .query_sql$ +" and char_id = "+ .@cid, .@itemid, .@amount, .@identify, .@refine, .@broken, .@card0, .@card1, .@card2, .@card3 );
			for ( .@i = 0; .@i < .@nb; .@i++ )
				mes @itemname2_info$[0] + callfunc( "getitemname2", .@itemid[.@i], .@identify[.@i], .@refine[.@i], .@broken[.@i], .@card0[.@i], .@card1[.@i], .@card2[.@i], .@card3[.@i] )+":^000000 "+ .@amount[.@i] +" ea.";
		}
	}
	close;
OnInit:
	query_sql "select dropcardid from mob_db where mexp != 0 and dropcardper = 1", .mvpcard;
	.mvpcard_size = getarraysize( .mvpcard );
	.mvpcard_compare$ = "#";
	for ( .@i = 1; .@i < .mvpcard_size; .@i++ ) {
		.@nameid$ = .@nameid$ +","+ .mvpcard[.@i];
		.@card0$ = .@card0$ +","+ .mvpcard[.@i];
		.@card1$ = .@card1$ +","+ .mvpcard[.@i];
		.@card2$ = .@card2$ +","+ .mvpcard[.@i];
		.@card3$ = .@card3$ +","+ .mvpcard[.@i];
		.mvpcard_compare$ = .mvpcard_compare$ + .mvpcard[.@i] +"#";
	}
	for ( .@i = 0; .@i < .mvpcard_size; .@i++ ) {
	}
	.query_sql$ = "( nameid in ("+ .mvpcard + .@nameid$ +") or card0 in ("+ .mvpcard + .@card0$ +") or card1 in ("+ .mvpcard + .@card1$ +") or card2 in ("+ .mvpcard + .@card2$ +") or card3 in ("+ .mvpcard + .@card3$ +") )";
	end;
}
so good luck finding someone who has the patience to make for ya ...

me get out of here :ph34r:

 

me prefer write event script, not utility script

edit ... fixed some typo

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  51
  • Reputation:   3
  • Joined:  11/29/13
  • Last Seen:  

this script is possible, but too complex

I just did only a very small part of it

- check the input player in inventory has mvp card or not

and the script already went like this

prontera,155,187,5	script	kjhdfsdksfjh	100,{
	mes "blah";
	next;
	select "search by input player name/ID", "search by card ID";
	if ( @menu == 1 ) {
		switch ( select ( "Char Name", "Account ID", "Char ID" ) ) {
		case 1:
			input .@id$;
			if ( isloggedin( getcharid( 3, .@id$ ) ) ) {
				.@cid = getcharid( 0, .@id$ );
				.@aid = getcharid( 3, .@id$ );
				.@name$ = rid2name( getcharid( 3, .@id$ ) );
			}
			else {
				if ( !query_sql( "select char_id, account_id, name from `char` where name = '"+ escape_sql( .@id$ ) +"'", .@cid, .@aid, .@name$ ) ) {
					mes "There is no such Character Name exist";
					close;
				}
			}	
			break;
		case 2:
			input .@id;
			if ( !( .@nb = query_sql( "select char_id, name, char_num, account_id from `char` where account_id = "+ .@id +" order by char_num asc", .@cid, .@name$, .@gid, .@aid ) ) ) {
				mes "There is no such Account ID";
				close;
			}
			for ( .@i = 0; .@i < .@nb; .@i++ ) {
				mes ( .@gid[.@i] +1 )+". "+ .@cid[.@i] +" "+ .@name$[.@i];
				.@menu$ = .@menu$ +( .@gid[.@i] +1 )+". "+ .@cid[.@i];
			}
			next;
			.@s = select( .@menu$ ) -1;
			.@cid = .@cid[.@s];
			.@aid = .@aid[.@s];
			.@name$ = .@name$[.@s];
			break;
		case 3:
			input .@id;
			if ( !query_sql( "select char_id, account_id, name from `char` where char_id = "+ .@id, .@cid, .@aid, .@name$ ) ) {
				mes "There is no such Character ID exist";
				close;
			}
		}
		mes "The player ^0000FF"+ .@name$ +"^000000 is "+( ( isloggedin(.@aid) )?"^00FF00Online":"^FF0000Offline" )+"^000000";
		if ( isloggedin( .@aid, .@cid ) ) {
			.@origin = getcharid(3);
			attachrid .@aid;
			getinventorylist;
			for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) {
				if ( compare( .mvpcard_compare$, "#"+ @inventorylist_id[.@i] +"#" ) || compare( .mvpcard_compare$, "#"+ @inventorylist_card1[.@i] +"#" ) || compare( .mvpcard_compare$, "#"+ @inventorylist_card2[.@i] +"#" ) || compare( .mvpcard_compare$, "#"+ @inventorylist_card3[.@i] +"#" ) || compare( .mvpcard_compare$, "#"+ @inventorylist_card4[.@i] +"#" ) ) {
					.@itemid[.@c] = @inventorylist_id[.@i];
					.@amount[.@c] = @inventorylist_amount[.@i];
					.@identify[.@c] = @inventorylist_identify[.@i];
					.@refine[.@c] = @inventorylist_refine[.@i];
					.@broken[.@c] = @inventorylist_attribute[.@i];
					.@card1[.@c] = @inventorylist_card1[.@i];
					.@card2[.@c] = @inventorylist_card2[.@i];
					.@card3[.@c] = @inventorylist_card3[.@i];
					.@card4[.@c] = @inventorylist_card4[.@i];
					attachrid .@origin;
					mes @itemname2_info$[0] + callfunc( "getitemname2", .@itemid[.@c], .@identify[.@c], .@refine[.@c], .@broken[.@c], .@card1[.@c], .@card2[.@c], .@card3[.@c], .@card4[.@c] ) +":^000000 "+ .@amount[.@c] +" ea.";
					attachrid .@aid;
					.@c++;
				}
			}
			attachrid .@origin;
		}
		else {
			.@nb = query_sql( "select nameid, amount, identify, refine, attribute, card0, card1, card2, card3 from inventory where "+ .query_sql$ +" and char_id = "+ .@cid, .@itemid, .@amount, .@identify, .@refine, .@broken, .@card0, .@card1, .@card2, .@card3 );
			for ( .@i = 0; .@i < .@nb; .@i++ )
				mes @itemname2_info$[0] + callfunc( "getitemname2", .@itemid[.@i], .@identify[.@i], .@refine[.@i], .@broken[.@i], .@card0[.@i], .@card1[.@i], .@card2[.@i], .@card3[.@i] )+":^000000 "+ .@amount[.@i] +" ea.";
		}
	}
	close;
OnInit:
	query_sql "select dropcardid from mob_db where mexp != 0 and dropcardper = 1", .mvpcard;
	.mvpcard_size = getarraysize( .mvpcard );
	.mvpcard_compare$ = "#";
	for ( .@i = 1; .@i < .mvpcard_size; .@i++ ) {
		.@nameid$ = .@nameid$ +","+ .mvpcard[.@i];
		.@card0$ = .@card0$ +","+ .mvpcard[.@i];
		.@card1$ = .@card1$ +","+ .mvpcard[.@i];
		.@card2$ = .@card2$ +","+ .mvpcard[.@i];
		.@card3$ = .@card3$ +","+ .mvpcard[.@i];
		.mvpcard_compare$ = .mvpcard_compare$ + .mvpcard[.@i] +"#";
	}
	for ( .@i = 0; .@i < .mvpcard_size; .@i++ ) {
	}
	.query_sql$ = "( nameid in ("+ .mvpcard + .@nameid$ +") or card0 in ("+ .mvpcard + .@card0$ +") or card1 in ("+ .mvpcard + .@card1$ +") or card2 in ("+ .mvpcard + .@card2$ +") or card3 in ("+ .mvpcard + .@card3$ +") )";
	end;
}
so good luck finding someone who has the patience to make for ya ...

me get out of here :ph34r:

 

me prefer write event script, not utility script

edit ... fixed some typo

 

Wow, thank you so much for the script Annie. :D

 

I had try it and it's not work like what i want, but i really appreciate what you did, thank you so much Annie.

Can i get permission to modify your script? i hope from your script i can get the script i want :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

of course, that's the purpose of script request section, anyone can contribute and share

... the actual reason I'm doing 1/2 ass script like this is because I wanna tell you how time-consuming the script going to be =/

EDIT: actually if you can request to do only parts of it, I might consider do little by little

since everything there is possible to do ... I just not in the mood to write this kind of long long script atm

Edited by AnnieRuru
Link to comment
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.   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.

×
×
  • Create New...