Boom Posted May 7, 2013 Group: Members Topic Count: 21 Topics Per Day: 0.00 Content Count: 182 Reputation: 22 Joined: 12/30/12 Last Seen: February 20, 2017 Share Posted May 7, 2013 (edited) 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 event_uchallenge.txt Edited October 20, 2013 by Boom 1 Quote Link to comment Share on other sites More sharing options...
Euphy Posted May 7, 2013 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted May 7, 2013 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: Quote Link to comment Share on other sites More sharing options...
Boom Posted May 7, 2013 Group: Members Topic Count: 21 Topics Per Day: 0.00 Content Count: 182 Reputation: 22 Joined: 12/30/12 Last Seen: February 20, 2017 Author Share Posted May 7, 2013 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? Quote Link to comment Share on other sites More sharing options...
Boom Posted May 31, 2013 Group: Members Topic Count: 21 Topics Per Day: 0.00 Content Count: 182 Reputation: 22 Joined: 12/30/12 Last Seen: February 20, 2017 Author Share Posted May 31, 2013 (edited) Updated the script. Cleaned some lines Edited October 20, 2013 by Boom Quote Link to comment Share on other sites More sharing options...
Cookie Posted July 1, 2013 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 213 Reputation: 109 Joined: 05/21/12 Last Seen: December 27, 2014 Share Posted July 1, 2013 · 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
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.