Jump to content
  • 0

Need help with WoE Supply giver


PandaLovesHamster

Question


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

Hi, I'm using this script for giving out WoE supplies, but the NPC would not talk to me at all. When I click on it, nothing happens, what seems to be the problem?

 

I want to test if it will give the supplies or not.

 

/*-	script	SupplyTrigger	-1,{
OnWed1700:
OnSun1600: 
	enablenpc "WoE Supply";
	end;

OnAgitEnd:
OnAgitEnd2:
	disablenpc "WoE Supply";
	end;
}*/


prontera,164,173,9	script	WoE Supply	78,{
	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$ = getguildname(getelementofarray(getarg(2),getarg(0)));
				return .@name$=="null"?"":.@name$;
			}
		};
	};
	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); };

	if(getgmlevel()>=80 ) {
		mes .Npc_Name$;
		mes "Hello Mr. GM what would you like to do?";
		next;
		switch( select("Add/Remove Guilds:Clear Guild Data:Player Menu:Cancel") ) {
			case 1:
				mes .Npc_Name$;
				mes "Would you like to add or remove a guild?";
				.@a_len = getarraysize($App_Guilds);
				.@format$ = "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s";
				next;
				if( select("Remove:Add") == 1 ) {
					while( .@a != 9999 ) {
						select( sf( .@format$, $App_Guilds, .@a, .@a_len ) );
						switch( @menu ) {
							case 11: .@a = nex( .@a, .@a_len ); break;
							case 12: .@a = bac( .@a ); break;
							case 13: end;
							
							default:
								.@select = .@a+@menu-1;
								mes .Npc_Name$;
								mes "You've selected ^0000FF["+getguildname($App_Guilds[.@select])+"]^000000 guild. Would you like to remove them from the accepted guilds?";
								next;
								if( select("Yes:No") == 1 ) {
									deletearray($App_Guilds[.@select],1);
									mes .Npc_Name$;
									mes "The guild has been removed!";
								}
								close;
						}
					}
				} else {
					mes .Npc_Name$;
					mes "Please input guild name or masters name.";
					next;
					input(.@input$);
					.@len = query_sql( "Select `guild_id` from `guild` where `name` like '%"+escape_sql(.@input$)+"%' or `master` like '%"+escape_sql(.@input$)+"%';",.@guild_id );
					while( .@a != 9999 ) {
						select( sf( .@format$, .@guild_id, .@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;
								.@a_len = getarraysize($App_Guilds);
								for(.@b=0;.@b<.@a_len;.@b++)
									if( $App_Guilds[.@b]==.@guild_id[.@select] ) {
										mes .Npc_Name$;
										mes "You've selected ^0000FF["+getguildname(.@guild_id[.@select])+"]^000000 guild. I'm sorry but that guild has already been added to the accepted list.";
										close;
									}
								mes .Npc_Name$;
								mes "You've selected ^0000FF["+getguildname(.@guild_id[.@select])+"]^000000 guild. Would you like to add them to the accepted guilds?";
								next;
								if( select("Yes:No") == 1 ) {
									.@a_len = getarraysize($App_Guilds);
									if( .@a_len>=128 ) {
										mes .Npc_Name$;
										mes "I'm sorry but the accepted list is full please make some room and try again...";
									} else {
										mes .Npc_Name$;
										mes "The guild was successfully added!";
										$App_Guilds[.@a_len] = .@guild_id[.@select];
									}
								}
								close;
						}
					}
				}
			case 2:
				mes .Npc_Name$;
				mes "Are you sure you want to clear the guild data?!";
				next;
				if( select("Yes!:No!")==1 ) {
					mes .Npc_Name$;
					mes "This is you last chance. Are you surely sure as sure can be?";
					next;
					if( select("Surly!:No, wait... Where am I?!!")==1 )
						deletearray($App_Guilds);
				}
				if( @menu==1 ) {
					mes .Npc_Name$;
					mes "The deed is done...";
				} else {
					mes .Npc_Name$;
					mes "Wow that was a close one... Have a nice day!";
				}
				close;
				
			case 3: break;
			
			case 4:
				mes .Npc_Name$;
				mes "Alright, have a nice day!";
				close;
		}
	}

	mes .Npc_Name$;
	mes "I'm here to give you supplies for WoE!";
	next;
	
	mes .Npc_Name$;
	.@len = getarraysize($App_Guilds);
	for( .@i=0; .@i <= .@len; .@i++ ) {
		if( getcharid(2) == $App_Guilds[.@i] )
			set .@Guild_Check, .@Guild_Check+1;
	}
	if( .@Guild_Check < 1 ) {
		mes "Your guild has not yet been approved, please contact the GMs";
		close;
	}
	if( !getcharid(2) ) {
		mes "Sorry only members of a guild may use this npc.";
		close;	
	}
	if( BaseLevel < 99 || Class > 4022 ) {
		mes "Sorry this is for Lvl 99 Trans Class only";
		close;	
	}
	if( gettimetick(2) < #delay ) {
		mes "Sorry, you can only claim this once every WoE";
		close;
	}
	switch( Class ) {

		case 28: //Soul Linker
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
		case 27: //Star Gladiator
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
		case 26: //Gunslinger
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
		case 4006: //Clown
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
		case 4007: //Gyspy
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
		case 4008: //Paladin
			getitembound2 13534,4,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break; 		
		case 4009: //High Priest
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			getitembound2 717,100,0,0,0,0,0,0,0,1;//bluegem
			getitembound2 523,20,0,0,0,0,0,0,0,1;//holy water
			break;
		case 4010: //High Wizard
			mes "Please choose your role";
			mes "Support : Ganbantien";
			mes "Offensive : SG/MS/LOV (Includes Crystal Fragments)";
			next;
			if( select("Support High Wizard:Offensive High Wizard")==1 )
				//Support High Wizard
				getitembound2 715,50,0,0,0,0,0,0,0,1;//yellowgem
				getitembound2 717,50,0,0,0,0,0,0,0,1;//bluegem
				getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
				getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion 
			else
				//Offensive HWIZ Pack
				getitembound2 7321,100,0,0,0,0,0,0,0,1;//Crystal Fragments
				getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
				getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion 
			break;
		case 4011: //Whitesmith
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
		case 4012: //Sniper
			getitembound2 1065,100,0,0,0,0,0,0,0,1;//traps
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
		case 4013: //Sinx
			mes "Please choose your role.";
			mes "Breaker - 3 Sec Break";
			mes "Killer - Do what you want";
			next;
			if( select("Breaker Sinx:Sonic Blow Sinx")==1)
			getitembound2 678,20,0,0,0,0,0,0,0,1;//poisonbottle
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			getitembound2 12020,20,0,0,0,0,0,0,0,1;//cursedwater
			else
			getitembound2 678,20,0,0,0,0,0,0,0,1;//poisonbottle
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			getitembound2 12114,10,0,0,0,0,0,0,0,1;//fireconv
			getitembound2 12115,10,0,0,0,0,0,0,0,1;//waterconv
			getitembound2 12116,10,0,0,0,0,0,0,0,1;//earthconv
			getitembound2 12117,10,0,0,0,0,0,0,0,1;//windconv
			break;
		case 4016: //Champion
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,4,0,0,0,0,0,0,0,1;//bluepotion
			break;
		case 4017: //Professor
			getitembound2 1025,100,0,0,0,0,0,0,0,1;//cobweb
			getitembound2 715,50,0,0,0,0,0,0,0,1;//yellowgem
			getitembound2 716,50,0,0,0,0,0,0,0,1;//redgem
			getitembound2 717,50,0,0,0,0,0,0,0,1;//bluegem
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
		case 4018: //Stalker
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
		case 4019: //Creator
			mes "Please choose your role.";
			mes "Support : Slim Potion Pitcher";
			mes "Offensive : Acid Demonstration";
			next;
			if( select("Support Creator:Offensive Creator")==1 )
			//Support
			getitembound2 7139,20,0,0,0,0,0,0,0,1;//glisteningcoat
			getitembound2 547,150,0,0,0,0,0,0,0,1;//slimwhitepot
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion 
			else
			//Offensive
			getitembound2 7136,25,0,0,0,0,0,0,0,1;acid bottle
			getitembound2 7135,25,0,0,0,0,0,0,0,1;bottle grenade
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
		case 25: //Ninja
			mes "Please choose your type.";
			mes "Flame : Flame Stone";
			mes "Ice : Ice Stone";
			mes "Wind : Wind Stone";
			mes "Shadow : Shadow Orb";
			next;
		switch( select("Flame:Ice:Wind:Shadow") ) {
			//Flame
			case 1: getitembound2 7521,50,0,0,0,0,0,0,0,1;
				getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
				getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
			//Ice
			case 2: getitembound2 7522,50,0,0,0,0,0,0,0,1;
				getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
				getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion 
			break;
			//Wind
			case 3: getitembound2 7523,50,0,0,0,0,0,0,0,1; 
				getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
				getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			break;
			//Shadow
			case 4: getitembound2 7524,50,0,0,0,0,0,0,0,1;
				getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
				getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			}
			break;
		case 4020: //Lord Knight
			getitembound2 13534,2,0,0,0,0,0,0,0,1;//whitepotion
			getitembound2 13810,2,0,0,0,0,0,0,0,1;//bluepotion
			getitembound2 12114,10,0,0,0,0,0,0,0,1;//fireconv
			getitembound2 12115,10,0,0,0,0,0,0,0,1;//waterconv
			getitembound2 12116,10,0,0,0,0,0,0,0,1;//earthconv
			getitembound2 12117,10,0,0,0,0,0,0,0,1;//windconv
			break;
		//Add more cases for all classes
		default:
			if( !callsub( L_GLSub, .Npc_Name$ ) )
				mes "Sorry this is only for the classes which require items for using skills.";
			close; 
	}
	set #delay, gettimetick(2)+10800;
	callsub( L_GLSub, .Npc_Name$ );
	mes "There you are, goodluck!";
	close;
	
L_GLSub:
	if( getguildmasterid(getcharid(2)) == getcharid(0) ) {
		mes getarg(0);
		mes "Would you like to claim your guild leader package too?";
		next;
		if( select("Yes:No")==1 )
			switch( gettime(4) ) {
				//Treasure Box x 10 - Needs to be discussed
				case 0: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Sunday
				case 1: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Monday
				case 2: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Tuesday
				case 3: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Wednesday
				case 4: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Thursday
				case 5: getitembound2 7444,10,0,0,0,0,0,0,0,1; break; //Friday
				case 6: getitembound2 7444,10,0,0,0,0,0,0,0,1; //Saturday
			}
		return 1;
	}
	return 0;

OnInit:
    set .Npc_Name$, "[^0000FF WoE Supply ^000000]";
    disablenpc "WoE Supply";
    end;
}

I'm sorry if I'm asking too many questions on the same day. I'm just a newbie, sorry.

Edited by PandaRapesHamster
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

Are there any errors in your map server's log when this NPC is loaded?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

It's working now. Thanks!

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