about mining success chance

leloush

New member
Messages
269
Points
0
Location
in front of my laptop =)
Emulator
    // 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

 
Code:
// 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%) 
 
setarray .mineral[0], 25106, 1011, 984, 985; // Phracon, Emveretarcon, Oridecon, Elunium

Code:
// 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
 
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.

 
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])

 
Last edited by a moderator:
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
default_tongue.png


 
Last edited by a moderator:
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
default_tongue.png
yes i did. 
default_tongue.png
btw thanks

but what if i want to add a prize.. where should i put it

 
Last edited by a moderator:
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
default_tongue.png
yes i did. 
default_tongue.png
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
default_tongue.png
yes i did. 
default_tongue.png
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%)
 
Last edited by a moderator:
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
default_tongue.png
yes i did. 
default_tongue.png
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
default_tongue.png
yes i did. 
default_tongue.png
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. 
default_thx.gif


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


 
you can use  mapannounce after warp player to the  mining map

mapannounce "guild_vs2", "wellcome ".+rid2name( $@warpwaitingpc[0] )+"....blah blah blah...", 0;

 
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..
 
Last edited by a moderator:
Back
Top