Jump to content

Upgrading Challenge Event


Recommended Posts


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  182
  • Reputation:   22
  • Joined:  12/30/12
  • Last Seen:  

Hi! Just want to share something for the community! I've been helped a lot by others and by know, I am able to make my own scripts.

 

This is an Upgrading Challenge script, which is based on the Philippine ROs official event.

 

Basically, you need to upgrade a specific headgear and you can exchange it for a reward depending on the rate of refinement.

I've added an optional headgear reward in arrayed form which can be disabled if commented out.

 

Default headgear needed to be upgraded is the Ph.D Hat.

 

Changelogs

//= 1.0    Initial Script [boom]
//= 1.1 Used functions instead of labels
//= 1.2 Item rewarding and deletion of catalyst have been grouped (Player abuse)
//= 2.0 Used arrays for better item ID passing.
//= 2.1 Update NPC Name
//= 2.2 Deleted the Labels, used arrays instead [Euphy]

 

 

Please comment if there are bugs of any kind and if there are other suggestions, so I can update the script. Don't forget to say thanks! XD /ok

event_uchallenge.txt

Edited by Boom
  • Upvote 1
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:  

There's no need to duplicate the labels "NINE", "EIGHT", and "SEVEN" (or use labels at all):

		mes "You can trade PH.D hats with the following quantity and refinement";
		next;

		set .@refine, 6 + select("5x +7 Ph.D Hats","4x +8 Ph.D Hats","3x +9 Ph.D Hats");
		setarray .@amount[7],5,4,3; // required number of hats

		if(countitem2(5012,1,.@refine,0,0,0,0,0) >= .@amount[.@refine]){
			mes .npcname$;
			mes "Thank you for bringing them! I have some super cool rewards for you!";
			next;
			mes .npcname$;
			mes "Which of the following headgear would you like to have?";
			next;
			for( set .@i,0; .@i < getarraysize(@HGLists); set .@i,.@i + 1 )
			set .@Menu$,.@Menu$ + getitemname(@HGLists[.@i])+ ":";

			set .@ChosenHG, select( .@Menu$ );
			set .@HG, .@ChosenHG - 1 ;
			set .@refine, 9;
			callfunc("uchallengehg", @HGLists[.@HG], .@refine); end;

		}
		mes .npcname$;
		mes "Sorry, but you haven't brought the complete set of PH.D Hats";
		close;
Also, not sure why you have @HGLists as a character array when everything else is scope.

Otherwise, nice job, keep scripting! c:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  182
  • Reputation:   22
  • Joined:  12/30/12
  • Last Seen:  

Hi Euphy! Thanks, I sure will continue on sharing scripts that I'll make. The comment you gave made the script more short. I don't usually dig in more to arrays because I usually mess it up. XD

 

Also, not sure why you have @HGLists as a character array when everything else is scope.

 

I didn't quite get this? Hmm.. Did i made a wrong type of array?

 

 

Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  182
  • Reputation:   22
  • Joined:  12/30/12
  • Last Seen:  

Updated the script. Cleaned some lines /no1

Edited by Boom
Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  213
  • Reputation:   109
  • Joined:  05/21/12
  • Last Seen:  

Posted · Hidden by Euphy, July 1, 2013 - No reason given
Hidden by Euphy, July 1, 2013 - No reason given

There's no need to duplicate the labels "NINE", "EIGHT", and "SEVEN" (or use labels at all):

		mes "You can trade PH.D hats with the following quantity and refinement";
		next;

		set .@refine, 6 + select("5x +7 Ph.D Hats","4x +8 Ph.D Hats","3x +9 Ph.D Hats");
		setarray .@amount[7],5,4,3; // required number of hats

		if(countitem2(5012,1,.@refine,0,0,0,0,0) >= .@amount[.@refine]){
			mes .npcname$;
			mes "Thank you for bringing them! I have some super cool rewards for you!";
			next;
			mes .npcname$;
			mes "Which of the following headgear would you like to have?";
			next;
			for( set .@i,0; .@i < getarraysize(@HGLists); set .@i,.@i + 1 )
			set .@Menu$,.@Menu$ + getitemname(@HGLists[.@i])+ ":";

			set .@ChosenHG, select( .@Menu$ );
			set .@HG, .@ChosenHG - 1 ;
			set .@refine, 9;
			callfunc("uchallengehg", @HGLists[.@HG], .@refine); end;

		}
		mes .npcname$;
		mes "Sorry, but you haven't brought the complete set of PH.D Hats";
		close;
Also, not sure why you have @HGLists as a character array when everything else is scope.

Otherwise, nice job, keep scripting! c:

Delete this post please. Didn't want to grave-dig.
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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