Jump to content
  • 0

Custom Rewards NPC


c2greentea

Question


  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  173
  • Reputation:   0
  • Joined:  06/07/14
  • Last Seen:  

I need an NPC accessible by group lvl 10 and above. The GM can choose max of 3 items from the list of item IDs available, input certain amount for each item IDs, and type the exact name of the player. After that, the items input by the GM will be received by the player.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

I just made it this way:

 

http://upaste.me/r/4c9b142899108c3d7

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Here's a script that does pretty much that: http://pastebin.com/raw.php?i=wTG07rbs

It's really old and not too well-written, but just throwing it out there.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

Here's a script that does pretty much that: http://pastebin.com/raw.php?i=wTG07rbs

It's really old and not too well-written, but just throwing it out there.

well, yours is much better.

 

Edit:

//Script by Normynator v1.1
//v1.1 -- Log

-	script	Gamemaster	-1,{

OnWhisperGlobal:
	if(getgmlevel() >= 10){
		if (@whispervar0$ == "Start"){
			//-------------------------------------------------------------
			//------------------$$Config$$---------------------------------
			//
				setarray .@in$[0], "Yggdrasil Berry","Yggdrasil Seed","Apple","White Potion"; //Available Items.
				set .@choose, 4;															//How many can be choosen.
			
			//-------------------------------------------------------------
			mes "Hello.";
			mes "Items or Log?";
			switch(select("Items:Log:Leave")){
			case 1:
				mes "List of Available Items: ";
				callfunc "List", .@in$;
				next;
				mes "You can choose "+.@choose+" items.";
				mes "How many do you need?";
				input .@count;
				if(.@count > .@choose){ next; mes "Max "+.@choose+"!!"; close;
				}else
				for(.@i = .@count; .@i < .@choose; .@i++){
					set .@item$[.@i], "empty";
					dispbottom "empty @" + .@i;
				}
				next;
				mes "Which items do you want?";
				mes "How many do you want?";
				mes "List of Available Items: ";
				callfunc "List", .@in$;
				for(.@i = 0; .@i < .@count; .@i++){
					set .@cheat, 0;
					input .@item$[.@i];
					input .@amount[.@i];
					for(.@a = 0; .@a < getarraysize(.@in$); .@a++){
						//dispbottom "a";
						//dispbottom .@item$[.@i];
						if(.@item$[.@i] == .@in$[.@a]){
							set .@cheat, 1;
						}
					}
					if(.@cheat == 0){
						next;
						mes "Error!";
						close;
					}
					//dispbottom .@cheat;
				}
				next;
				mes "Whats the name of the player?";
				input .@name$;
				next;
				mes "Your Input:";
				for(.@i = 0; .@i < .@count; .@i++){
					mes .@amount[.@i] + " " + .@item$[.@i];
				}
				mes "Name: " + .@name$;
				mes "";
				mes "Is your input correct?";
				if(select("Yes:No") -1) end;
				next;
				
				set .logdate[.z], gettimestr("%Y",21) +gettimestr("%m",21) + gettimestr("%d",21);
				set .loggm$[.z], strcharinfo(0);
				set .logplayer$[.z], .@name$;
				set .@size,getarraysize(.logitem$);
				for(.@i = 0; .@i < .@choose;.@i++){
					set .logamount[.@size + .@i], .@amount[.@i];
					set .logitem$[.@size + .@i], .@item$[.@i];
				}
				.z++;
				set .@account, getcharid(3, .@name$);
				if(isloggedin(.@account) == 0){
					mes "Player is offline";
				}else 
				mes "Player is online and got the Item(s)";
				for(.@i = 0; .@i < .@count; .@i++){
					getitem .@item$[.@i], .@amount[.@i], .@account;
				}
				close;
			case 2:
				next;
				mes "Log";
				set .@n, 1;
				set .@c, 0;
				for(.@i = 0; .@i < getarraysize(.logdate);.@i++){
					mes .@n + ". -- " + .logdate[.@i];
					mes "  Player: " + .logplayer$[.@i];
					mes "       GM: " + .loggm$[.@i];
					for(.@a = 0; .@a < .@choose;.@a++){
						if(.logitem$[.@c] != "empty"){
						mes "     Item: " + .logamount[.@c] + "x " + .logitem$[.@c];  //L: "+ .@c + "|" + .@a + "|" + .@i + "|" + .logitem$[.@c];
						}
						.@c++;
					}
					.@n++;
				}
				close;
			case 3:
				next;
				mes "Bye ~";
				close;
			}
		}
	}
}
function	script	List	{
	for(.@i = 0; .@i < getarraysize(getarg(0)); .@i++){
		mes  getelementofarray(getarg(0), .@i);
	}
	return;
}

I added a Log System

Edited by Normynator
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...