Jump to content
  • 0
lelouchxv

Raceto 99 NPC

Question

How can i fix this guys? any help would be appreciated! 

///////////////////////////////////////////////////////
//  ___________               _____.__                
//  \__    ___/__.__.________/ ____\__| ____    ____  
//    |    | <   |  |\_  __ \   __\|  |/    \  / ___\ 
//    |    |  \___  | |  | \/|  |  |  |   |  \/ /_/  >
//    |____|  / ____| |__|   |__|  |__|___|  /\___  / 
//            \/       Scripts             \//_____/  
//
//=====================================================
// Name: Race to Max Level
//
// Description:
// This NPC allows for Game Masters to set a reward to
// be given to the first player of each 2nd class that
// reaches maximum level (base and class).
//=====================================================
///////////////////////////////////////////////////////
prontera,147,180,5	script	Race to Max Level	58,{
	set [email protected]_level, 99; // GM level required to set the reward
	set [email protected], 99;
	set [email protected], 70;
	set [email protected], 510;
	setarray [email protected][0], Job_Lord_Knight, Job_Creator, Job_Assassin_Cross, Job_Clown, Job_Whitesmith, Job_Paladin, Job_Gypsy, Job_Sniper, Job_Champion, Job_High_Priest, Job_Stalker, Job_Professor, Job_High_Wizard;
	
	Begin:
	clear;
	mes "[ ^0099ccRace to Max Level^000000 ]";
	mes "Hello, " + ((getgmlevel() >= [email protected]_level) ? "master! What do you want to do today?" : "are you here for your reward?");
	switch(select(((getgmlevel() >= [email protected]_level) ? "Set Reward:Restart Race" : ":") + ":YES!:...Reward?:Who was rewarded?:Cancel")) {
		case 1:
			goto SetReward;
		case 2:
			goto RestartRace;
		case 3:
			goto GetReward;
		case 4:
			goto ExplainRace;
		case 5:
			goto ShowRewarded;
		default:
			end;
	}
	
	SetReward:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		if ($reward == 0)
			set $reward, [email protected];
		mes "The reward is " + getitemname($reward) + " (ID: " + $reward + ").";
		mes "Do you want to change it?";
		if (select("Yes:No") == 1) {
			clear;
			mes "[ ^0099ccRace to Max Level^000000 ]";
			mes "Please enter the new reward item ID.";
			input [email protected];			
			clear;
			mes "[ ^0099ccRace to Max Level^000000 ]";
			mes "Set " + getitemname([email protected]) + " as the reward?";
			if(select("Yes:No") == 1) {
				set $reward, [email protected];
			}
		}
		goto Begin;
	
	RestartRace:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		mes "Are you sure you want to restart the race?";
		if (select("Yes:No") == 1) {
			for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++) {
				set $rewarded$[[email protected][[email protected]]], "";
			}
			announce "The Race to Max Level has begun! Claim a reward once you reach " + [email protected] + " base and " + [email protected] + " class!", bc_all;
		}
		goto Begin;
	
	GetReward:
		mes "Let's see... " + strcharinfo(0) + ", huh?";
		
		set [email protected], 0;
		for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++) {
			if (Class == [email protected][[email protected]]) {
				set [email protected], 1;
				if (BaseLevel < [email protected] || JobLevel < [email protected]) {
					mes "I'm sorry, but you still need to level a bit more.";
				} else if ($rewarded$[Class] == strcharinfo(0)) {
					mes "You have already claimed your reward.";
				} else if ($rewarded$[Class] != "") {
					mes "Too late!";
					mes "The reward for " + jobname(Class) + " was already claimed by " + $rewarded$[Class] + ".";
				} else goto GiveReward;
			}
		}
		if ([email protected] == 0)
			mes "You need to change your job.";
		close;
	
	GiveReward:
		set $rewarded$[Class], strcharinfo(0);
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		mes "Congratulations! You were the first " + jobname(Class) + " to reach " + [email protected] + " base and " + [email protected] + " class!";
		getitem $reward, 1;
		announce strcharinfo(0) + " (" + jobname(Class) + ") reached Max. Level and received " + getitemname($reward) + "!", bc_all;
		close;
	
	ExplainRace:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		mes "Yes! When you reach the maximum level for your class, talk to me and you'll be rewarded with a special item.";
		next;
		goto Begin;
		
	ShowRewarded:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++) {
			mes jobname([email protected][[email protected]]) + ": " + (($rewarded$[[email protected][[email protected]]] != "") ? $rewarded$[[email protected][[email protected]]] : "^ff0000Nobody^000000");
		}
		next;
		goto Begin;
}

 

map.jpeg

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

clear(); should only be called if there are any mes(); (aka npc dialog) displayed

  • Love 1

Share this post


Link to post
Share on other sites
  • 0
///////////////////////////////////////////////////////
//  ___________               _____.__                
//  \__    ___/__.__.________/ ____\__| ____    ____  
//    |    | <   |  |\_  __ \   __\|  |/    \  / ___\ 
//    |    |  \___  | |  | \/|  |  |  |   |  \/ /_/  >
//    |____|  / ____| |__|   |__|  |__|___|  /\___  / 
//            \/       Scripts             \//_____/  
//
//=====================================================
// Name: Race to Max Level
//
// Description:
// This NPC allows for Game Masters to set a reward to
// be given to the first player of each 2nd class that
// reaches maximum level (base and class).
//=====================================================
///////////////////////////////////////////////////////
prontera,147,180,5	script	Race to Max Level	58,{
	set [email protected]_level, 99; // GM level required to set the reward
	set [email protected], 99;
	set [email protected], 70;
	set [email protected], 510;
	setarray [email protected][0], Job_Lord_Knight, Job_Creator, Job_Assassin_Cross, Job_Clown, Job_Whitesmith, Job_Paladin, Job_Gypsy, Job_Sniper, Job_Champion, Job_High_Priest, Job_Stalker, Job_Professor, Job_High_Wizard;
	
	Begin:
	clear;
	mes "[ ^0099ccRace to Max Level^000000 ]";
	mes "Hello, " + ((getgmlevel() >= [email protected]_level) ? "master! What do you want to do today?" : "are you here for your reward?");
	switch(select(((getgmlevel() >= [email protected]_level) ? "Set Reward:Restart Race" : ":") + ":YES!:...Reward?:Who was rewarded?:Cancel")) {
		case 1:
			goto SetReward;
		case 2:
			goto RestartRace;
		case 3:
			goto GetReward;
		case 4:
			goto ExplainRace;
		case 5:
			goto ShowRewarded;
		default:
			end;
	}
	
	SetReward:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		if ($reward == 0)
			set $reward, [email protected];
		mes "The reward is " + getitemname($reward) + " (ID: " + $reward + ").";
		mes "Do you want to change it?";
		if (select("Yes:No") == 1) {
			clear;
			mes "[ ^0099ccRace to Max Level^000000 ]";
			mes "Please enter the new reward item ID.";
			input [email protected];			
			clear;
			mes "[ ^0099ccRace to Max Level^000000 ]";
			mes "Set " + getitemname([email protected]) + " as the reward?";
			if(select("Yes:No") == 1) {
				set $reward, [email protected];
			}
		}
		goto Begin;
	
	RestartRace:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		mes "Are you sure you want to restart the race?";
		if (select("Yes:No") == 1) {
			for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++) {
				set $rewarded$[[email protected][[email protected]]], "";
			}
			announce "The Race to Max Level has begun! Claim a reward once you reach " + [email protected] + " base and " + [email protected] + " class!", bc_all;
		}
		goto Begin;
	
	GetReward:
		mes "Let's see... " + strcharinfo(0) + ", huh?";
		
		set [email protected], 0;
		for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++) {
			if (Class == [email protected][[email protected]]) {
				set [email protected], 1;
				if (BaseLevel < [email protected] || JobLevel < [email protected]) {
					mes "I'm sorry, but you still need to level a bit more.";
				} else if ($rewarded$[Class] == strcharinfo(0)) {
					mes "You have already claimed your reward.";
				} else if ($rewarded$[Class] != "") {
					mes "Too late!";
					mes "The reward for " + jobname(Class) + " was already claimed by " + $rewarded$[Class] + ".";
				} else goto GiveReward;
			}
		}
		if ([email protected] == 0)
			mes "You need to change your job.";
		close;
	
	GiveReward:
		set $rewarded$[Class], strcharinfo(0);
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		mes "Congratulations! You were the first " + jobname(Class) + " to reach " + [email protected] + " base and " + [email protected] + " class!";
		getitem $reward, 1;
		announce strcharinfo(0) + " (" + jobname(Class) + ") reached Max. Level and received " + getitemname($reward) + "!", bc_all;
		end;
	
	ExplainRace:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		mes "Yes! When you reach the maximum level for your class, talk to me and you'll be rewarded with a special item.";
		next;
		goto Begin;
		
	ShowRewarded:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++) {
			mes jobname([email protected][[email protected]]) + ": " + (($rewarded$[[email protected][[email protected]]] != "") ? $rewarded$[[email protected][[email protected]]] : "^ff0000Nobody^000000");
		}
		next;
		goto Begin;
}

 

Share this post


Link to post
Share on other sites
  • 0
On 4/4/2021 at 3:13 PM, cook1e said:
///////////////////////////////////////////////////////
//  ___________               _____.__                
//  \__    ___/__.__.________/ ____\__| ____    ____  
//    |    | <   |  |\_  __ \   __\|  |/    \  / ___\ 
//    |    |  \___  | |  | \/|  |  |  |   |  \/ /_/  >
//    |____|  / ____| |__|   |__|  |__|___|  /\___  / 
//            \/       Scripts             \//_____/  
//
//=====================================================
// Name: Race to Max Level
//
// Description:
// This NPC allows for Game Masters to set a reward to
// be given to the first player of each 2nd class that
// reaches maximum level (base and class).
//=====================================================
///////////////////////////////////////////////////////
prontera,147,180,5	script	Race to Max Level	58,{
	set [email protected]_level, 99; // GM level required to set the reward
	set [email protected], 99;
	set [email protected], 70;
	set [email protected], 510;
	setarray [email protected][0], Job_Lord_Knight, Job_Creator, Job_Assassin_Cross, Job_Clown, Job_Whitesmith, Job_Paladin, Job_Gypsy, Job_Sniper, Job_Champion, Job_High_Priest, Job_Stalker, Job_Professor, Job_High_Wizard;
	
	Begin:
	clear;
	mes "[ ^0099ccRace to Max Level^000000 ]";
	mes "Hello, " + ((getgmlevel() >= [email protected]_level) ? "master! What do you want to do today?" : "are you here for your reward?");
	switch(select(((getgmlevel() >= [email protected]_level) ? "Set Reward:Restart Race" : ":") + ":YES!:...Reward?:Who was rewarded?:Cancel")) {
		case 1:
			goto SetReward;
		case 2:
			goto RestartRace;
		case 3:
			goto GetReward;
		case 4:
			goto ExplainRace;
		case 5:
			goto ShowRewarded;
		default:
			end;
	}
	
	SetReward:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		if ($reward == 0)
			set $reward, [email protected];
		mes "The reward is " + getitemname($reward) + " (ID: " + $reward + ").";
		mes "Do you want to change it?";
		if (select("Yes:No") == 1) {
			clear;
			mes "[ ^0099ccRace to Max Level^000000 ]";
			mes "Please enter the new reward item ID.";
			input [email protected];			
			clear;
			mes "[ ^0099ccRace to Max Level^000000 ]";
			mes "Set " + getitemname([email protected]) + " as the reward?";
			if(select("Yes:No") == 1) {
				set $reward, [email protected];
			}
		}
		goto Begin;
	
	RestartRace:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		mes "Are you sure you want to restart the race?";
		if (select("Yes:No") == 1) {
			for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++) {
				set $rewarded$[[email protected][[email protected]]], "";
			}
			announce "The Race to Max Level has begun! Claim a reward once you reach " + [email protected] + " base and " + [email protected] + " class!", bc_all;
		}
		goto Begin;
	
	GetReward:
		mes "Let's see... " + strcharinfo(0) + ", huh?";
		
		set [email protected], 0;
		for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++) {
			if (Class == [email protected][[email protected]]) {
				set [email protected], 1;
				if (BaseLevel < [email protected] || JobLevel < [email protected]) {
					mes "I'm sorry, but you still need to level a bit more.";
				} else if ($rewarded$[Class] == strcharinfo(0)) {
					mes "You have already claimed your reward.";
				} else if ($rewarded$[Class] != "") {
					mes "Too late!";
					mes "The reward for " + jobname(Class) + " was already claimed by " + $rewarded$[Class] + ".";
				} else goto GiveReward;
			}
		}
		if ([email protected] == 0)
			mes "You need to change your job.";
		close;
	
	GiveReward:
		set $rewarded$[Class], strcharinfo(0);
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		mes "Congratulations! You were the first " + jobname(Class) + " to reach " + [email protected] + " base and " + [email protected] + " class!";
		getitem $reward, 1;
		announce strcharinfo(0) + " (" + jobname(Class) + ") reached Max. Level and received " + getitemname($reward) + "!", bc_all;
		end;
	
	ExplainRace:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		mes "Yes! When you reach the maximum level for your class, talk to me and you'll be rewarded with a special item.";
		next;
		goto Begin;
		
	ShowRewarded:
		clear;
		mes "[ ^0099ccRace to Max Level^000000 ]";
		for ([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++) {
			mes jobname([email protected][[email protected]]) + ": " + (($rewarded$[[email protected][[email protected]]] != "") ? $rewarded$[[email protected][[email protected]]] : "^ff0000Nobody^000000");
		}
		next;
		goto Begin;
}

 

still the same bro

stillthesame.jpg

 

On 4/5/2021 at 1:52 AM, Emistry said:

clear(); should only be called if there are any mes(); (aka npc dialog) displayed

Thankyou master! it worked i remove all clear ();

Share this post


Link to post
Share on other sites
  • 0

@Emistry

is it possible to have specific reward for each job ? 

Share this post


Link to post
Share on other sites
  • 0
On 4/6/2021 at 12:08 AM, rmon said:

@Emistry

is it possible to have specific reward for each job ? 

if (Class == Job_Swordman) {
	getitem 512, 1;
}
else if (Class = Job_Archer) {
	getitem 512, 1;
}
else (Class == XXXX) {
	// rewards...
}

add all classes and correspond rewards ... and make your own topic next time.

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.