leloush 7 Posted December 15, 2013 // Randomize target mineral to mine .@target = rand(getarraysize(.mineral)); // Max range of success .@range = .success[.@target * 2 + 1]; // Check if failed if(rand(1, .@range) != .success[.@target * 2]) { message strcharinfo(0), "Nothing valuable was excavated..."; end; } // Get mineral(s) getitem .mineral[.@target], .amount[.@target]; message strcharinfo(0), "You have successfully mined "+ .amount[.@target] +" "+ getitemname(.mineral[.@target]) +"!"; end; OnWhisperGlobal: // Whisper anything to initialize settings message strcharinfo(0), strnpcinfo(1) +" : 'OnInit' label has been intialized."; OnInit: // Minerals setarray .mineral[0], 25106, 1011, 984, 985; // Phracon, Emveretarcon, Oridecon, Elunium setarray .amount[0], 1, 1, 1, 1; // Amount to mine setarray .coordinate_x,0,300; setarray .coordinate_y,0,300; // Success rate: (x / y)% chance setarray .success[0], 1, 5, // 1/5 (20%) 1, 2, // 1/2 (50%) 4, 5, // 4/5 (80%) 1, 50; // 1/50 (2%) how to work with the success chance ? this is a part of script from http://herc.ws/board/topic/1886-simple-mining/ sry i really can't get on how to work with this format.. thanks Quote Share this post Link to post Share on other sites
0 Triedge 12 Posted December 15, 2013 // Success rate: (x / y)% chance setarray .success[0], 1, 5, // 1/5 (20%) 1, 2, // 1/2 (50%) 4, 5, // 4/5 (80%) 1, 50; // 1/50 (2%) Quote Share this post Link to post Share on other sites
0 leloush 7 Posted December 15, 2013 // Success rate: (x / y)% chance setarray .success[0], 1, 5, // 1/5 (20%) 1, 2, // 1/2 (50%) 4, 5, // 4/5 (80%) 1, 50; // 1/50 (2%) yeah i already knew about this.. but i have hesitation on the format on what item are on the 2% success chance. Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted December 15, 2013 setarray .mineral[0], 25106, 1011, 984, 985; // Phracon, Emveretarcon, Oridecon, Elunium // Success rate: (x / y)% chance setarray .success[0], 1, 5, // 1/5 (20%) -->25106 1, 2, // 1/2 (50%) -->1011 4, 5, // 4/5 (80%) -->984 1, 50; // 1/50 (2%) -->985 1 leloush reacted to this Quote Share this post Link to post Share on other sites
0 leloush 7 Posted December 15, 2013 setarray .mineral[0], 25106, 1011, 984, 985; // Phracon, Emveretarcon, Oridecon, Elunium // Success rate: (x / y)% chance setarray .success[0], 1, 5, // 1/5 (20%) -->25106 1, 2, // 1/2 (50%) -->1011 4, 5, // 4/5 (80%) -->984 1, 50; // 1/50 (2%) -->985 ok thanks .. i think my problem was solve. Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted December 15, 2013 (edited) I don't think the original formula is correct if(rand(1, .@range) != .success[.@target * 2]) should change to if(rand(1, .@range) > .success[.@target * 2]) Edited December 15, 2013 by Angelmelody Quote Share this post Link to post Share on other sites
0 leloush 7 Posted December 16, 2013 (edited) I don't think the original formula is correct if(rand(1, .@range) != .success[.@target * 2]) should change to if(rand(1, .@range) > .success[.@target * 2]) thank you for your concern.. but what are the diff. of this two lines? Edited December 16, 2013 by leloush Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted December 16, 2013 (edited) For example : The success chance of item 984 was setted to 80%, actually the range of if(rand(1, .@range) != .success[.@target * 2]) was total 5 elements(1~5) , The if condition go rand 5 elements not equal to 1 element judged to failure change. So the failure change is 4/5 and success chance is 1/5 not satisfying our setting 80% success chance . Hope you can understand my broken Eng Edited December 17, 2013 by Angelmelody Quote Share this post Link to post Share on other sites
0 leloush 7 Posted December 16, 2013 (edited) For example : The success chance of item 984 ws setted to 80%, actually the range of if(rand(1, .@range) != .success[.@target * 2]) was total 5 elements(1~5) , the if condition go rand 5 elements not equal to 1 elements judged to failure change. So the failure change is 4/5 and success chance is 1/5 not satisfying our setting 80% success chance Hope you can understand my broken Eng yes i did. btw thanks but what if i want to add a prize.. where should i put it Edited December 16, 2013 by leloush Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted December 17, 2013 (edited) For example : The success chance of item 984 ws setted to 80%, actually the range of if(rand(1, .@range) != .success[.@target * 2]) was total 5 elements(1~5) , the if condition go rand 5 elements not equal to 1 elements judged to failure change. So the failure change is 4/5 and success chance is 1/5 not satisfying our setting 80% success chance Hope you can understand my broken Eng yes i did. btw thanks but what if i want to add a prize.. where should i put it For example : The success chance of item 984 ws setted to 80%, actually the range of if(rand(1, .@range) != .success[.@target * 2]) was total 5 elements(1~5) , the if condition go rand 5 elements not equal to 1 elements judged to failure change. So the failure change is 4/5 and success chance is 1/5 not satisfying our setting 80% success chance Hope you can understand my broken Eng yes i did. btw thanks but what if i want to add a prize.. where should i put it Do you mean add new mining reward ? // Minerals setarray .mineral[0], 1010, 1011, 984, 985, 501; // Phracon, Emveretarcon, Oridecon, Elunium setarray .amount[0], 5, 3, 1, 1, 1; // Amount to mine // Success rate: (x / y)% chance setarray .success[0], 1, 5, // 1/5 (20%) 1, 2, // 1/2 (50%) 4, 5, // 4/5 (80%) 1, 50, // 1/50 (2%) 3, 5; // 3/5 (60%) Edited December 17, 2013 by Angelmelody Quote Share this post Link to post Share on other sites
0 leloush 7 Posted December 17, 2013 For example : The success chance of item 984 ws setted to 80%, actually the range of if(rand(1, .@range) != .success[.@target * 2]) was total 5 elements(1~5) , the if condition go rand 5 elements not equal to 1 elements judged to failure change. So the failure change is 4/5 and success chance is 1/5 not satisfying our setting 80% success chance Hope you can understand my broken Eng yes i did. btw thanks but what if i want to add a prize.. where should i put it > For example : The success chance of item 984 ws setted to 80%, actually the range of if(rand(1, .@range) != .success[.@target * 2]) was total 5 elements(1~5) , the if condition go rand 5 elements not equal to 1 elements judged to failure change. So the failure change is 4/5 and success chance is 1/5 not satisfying our setting 80% success chance Hope you can understand my broken Eng yes i did. btw thanks but what if i want to add a prize.. where should i put it Do you mean add new mining reward ? // Minerals setarray .mineral[0], 1010, 1011, 984, 985, 501; // Phracon, Emveretarcon, Oridecon, Elunium setarray .amount[0], 5, 3, 1, 1, 1; // Amount to mine // Success rate: (x / y)% chance setarray .success[0], 1, 5, // 1/5 (20%) 1, 2, // 1/2 (50%) 4, 5, // 4/5 (80%) 1, 50, // 1/50 (2%) 3, 5; // 3/5 (60%) thank you so much angel. but lastly.. if u dont mind.. can u give me an idea of this script.. i want to put an announce to the map after being warped by the npc from outside. example.. ( already in the destination map .. and the npc inside will ( welcome him/her ) ) mellina,63,60,6 script sample 406,{ end; OnInit: waitingroom "waiting room",3,strnpcinfo(3)+"::OnStart",2; end; OnStart: warpwaitingpc "guild_vs2",50,50; announce "The raid team of "+ rid2name( $@warpwaitingpc[0] ) +" was teleported to the Raid Dungeon!",bc_blue|bc_all; enablenpc "insidenpc"; end; } after warped to guild_vs2 announce to map (guild_vs2) welcome this is sample script... etc etc.. thank you in advanced Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted December 17, 2013 you can use mapannounce after warp player to the mining map mapannounce "guild_vs2", "wellcome ".+rid2name( $@warpwaitingpc[0] )+"....blah blah blah...", 0; Quote Share this post Link to post Share on other sites
0 leloush 7 Posted December 17, 2013 (edited) you can use mapannounce after warp player to the mining map mapannounce "guild_vs2", "wellcome ".+rid2name( $@warpwaitingpc[0] )+"....blah blah blah...", 0; good am madam.. i just tried to put this here ( this is the line inside after the waiting room.. so i think i need to put it here.. but it ddnt work. so im wondering on how to deal with this after being warped by the waiting room outside. ) guild_vs2,34,67,0 script Extreme Raid[Lever] 1907,{ message strcharinfo(0), "Pulling the lever..."; progressbar "green", .progress2; specialeffect 234; set .Spawn,rand(100,100); // How many Monster should spawn? set .Map$,.Maps$[rand(getarraysize(.Maps$))]; //------------------ nothing special about the (welcome/introducer)announcer.. but for me it will make sense .. and will make a good story line for this event. that's why i really want to have an announcer before the event start.. Edited December 17, 2013 by leloush Quote Share this post Link to post Share on other sites
how to work with the success chance ? this is a part of script from http://herc.ws/board/topic/1886-simple-mining/
sry i really can't get on how to work with this format..
thanks
Share this post
Link to post
Share on other sites