Jump to content
  • 0

Sign item for GM


none

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   1
  • Joined:  11/14/11
  • Last Seen:  

Hi,

I search to make a NPC how allow to remove @item of Gamemaster.
So my NPC make item only for npc, but i wish that this item was sign by the name of the GM.

 

What is the function ?
How to sign item (stuff) and sign item (consumable) ?

 

Thx a lot.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 1

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

You can use getitem2 to do this... Here's a small example I came up with.

-	script	at_signed_item	-1,{
	function sf {
		function s;
		.@a = getarg(2);
		.@len = getarg(3);
		return (
			sprintf( getarg(0),
				s(.@a, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
				s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
				s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), 
				s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), 
				s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1))
			)
			+(( .@a+1 < .@len )?":Next":":")
			+(( .@a-11 > 0 )?":Back":":")
			+":Cancel"
		);
		function s {
			if( getarg(0) >= getarg(1) ) return "";
			else {
				.@name$ = getelementofarray( getarg(2), getarg(0) );
				return .@name$=="null"?"":"Character [^0054ff"+.@name$+"^000000]";
			}
		};
	};
	function nex { return((getarg(0)+10)<getarg(1)?getarg(0)+10:getarg(1)-(getarg(1)%10)); };
	function bac { return((getarg(0)-10)>=0?getarg(0)-10:0); };
	
OnCreate:
	//@signeditem <item_id>{ "<Signed Name>"{ <amount>{ <refine>{ <VVV Strong>{ <element>{ "Receiving Player"}}}}};
	
	switch( .@atcmd_numparameters ) {
		default: dispbottom "Error: Too many parameters sent! ( @signeditem <item_id>{ <Signed Name>{ <amount>{ <refine>{ <VVV Strong>{ <element>{ Receiving Player}}}}}} ) "; end;
		case 7: .@player = getcharid( 3, .@atcmd_parameters$[6] ); if( !.@player ) { dispbottom "Error: Player not found! ( Maybe they aren't online! )"; end; }
		case 6: .@element = atoi( .@atcmd_parameters$[5] ); if( .@element > 4 ) { dispbottom "Error: Element not found! ( 1 - Ice, 2 - Earth, 3 - Fire, 4 - Wind )"; end; }
		case 5:	.@strong = atoi( .@atcmd_parameters$[4] );
		case 4: .@refine = atoi( .@atcmd_parameters$[3] );
		case 3: .@amount = atoi( .@atcmd_parameters$[2] );
		case 2: .@signature$ = .@atcmd_parameters$[1];
		case 1: .@item = atoi( .@atcmd_parameters$ );
	}
	
	.@len = query_sql( "SELECT `char_id`,`name` FROM `char` WHERE `name` LIKE '%"+.@signature$+"%' LIMIT 127;", .@cid, .@c_name$ );
	
	if( .@len > 1 ) {
		mes "[ Signed @item ]";
		mes "There was more than one result. Please select the correct name.";
		.@format$ = "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s";
		next;
		while( 1 ) {
			select( sf( .@format$, .@c_name$, .@a, .@len ) );
			switch( @menu ) {
				case 11: .@a = nex( .@a, .@len ); break;
				case 12: .@a = bac( .@a ); break;
				case 13: end;
				
				default:
					.@select = .@a+@menu-1;
					mes "[ Signed @item ]";
					mes "You've selected ^0000FF["+.@c_name$[.@select]+"]^000000, is this correct?";
					next;
					if( select("Yes:No") == 1 )
						callsub Sub_NamedItem, .@item, .@cid[.@select], .@amount, .@refine, .@strong, .@element, .@player;
					close;
			}
		}
	} else if( .@len )
		callsub Sub_NamedItem, .@item, .@cid, .@amount, .@refine, .@strong, .@element, .@player;
	dispbottom "Error: Signature could not be identified! ( Maybe that player doesn't exist! )";
	end;
	
Sub_NamedItem:
	.@cid = getarg(1);
	.@card3 = .@cid & 65535;
	.@card4 = .@cid >> 16;
	.@item = !getarg(0,501)?501:getarg(0);
	.@amount = !getarg(2,1)?1:getarg(2);
	.@refine = getarg(3,0);
	.@equip = getiteminfo( .@item, 5 );
	if( .@equip == 0 || .@equip == 32768 )
		.@card1 = 254;
	else {
		.@sc = getarg(4,0);
		.@ele = getarg(5,0);
		.@card1 = 255;
		.@card2 = .@ele+((.@sc*5)<<8);
	}
	if( .@player )
		getitem2 .@item, .@amount, 1, .@refine, 0, .@card1, .@card2, .@card3, .@card4, .@player;
	else
		getitem2 .@item, .@amount, 1, .@refine, 0, .@card1, .@card2, .@card3, .@card4;
	dispbottom "Item"+((.@amount>1)?"s":"")+" Created!";
	end;
	
OnInit: bindatcmd "signeditem", "at_signed_item::OnCreate", 99, 99;
	
}

Usage: @signeditem <item_id>{ "<Signed Name>"{ <amount>{ <refine>{ <VVV Strong>{ <element>{ "Receiving Player"}}}}};

 

Example: @signeditem 1599 Lovely 1 10 3 >> +10 Very Very Very Strong Lovely's Fire Angra Manyu x1

 

Alternately the command can be used to search for players by letter or displaying the first 127 results directly from the database if nothing is provided.

  • MVP 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  34
  • Reputation:   1
  • Joined:  12/17/11
  • Last Seen:  

What do you actually mean?

If you want to change @ commands, you may change at conf/atcommand_athena.conf

Or you just want a simple Item Signer NPC, you may find it at npc/custom/item_signer.txt

I'm wrong?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   1
  • Joined:  11/14/11
  • Last Seen:  

hi,

i wish make NPC that sign all item it give (stuff or heal item or else).
This NPC replace the command @item.

thx

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   1
  • Joined:  11/14/11
  • Last Seen:  

Bump,

I can use getnameditem, but use it ?

I wish: game master use this NPC: input name of player

the NPC give sign item to player.

 

But with getnameitem no possible to give amount and player name

 

>is possible : getnameditem(<item id>,"<name to inscribe>","AMOUNT ?", "TO PLAYER NAME?");

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   1
  • Joined:  11/14/11
  • Last Seen:  

hi,

Nobody know how to imput amount for getnameditem command ??

thx.

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...