hello, I am trying to create a fuction, to use in my custom branch to spawn, diferent mvps, with a specific chance for each one, I want to create a version that is more easy to implement, or use with a biger number of MVPs
this is the current script that I made.
function script active_branch {
set .tw,0;
set .@ms,0;
setarray .mob_id[0],1582,1112,1492,1147;
setarray .mob_c[0],80,60,20,10;
for(set .@i,0;.@i<(getarraysize(.mob_c)); set .@i,.@i+1){.tw +=.mob_c[.@i];}
set .rnum, rand(.tw);
debugmes "total weight is: "+.tw;
debugmes .rnum;
freeloop(1);
for(set .@i,0;.@i<(getarraysize(.mob_c)); set .@i,.@i+1){
if(.rnum <=.mob_c[.@i]){
if(.@ms==0){
debugmes .mob_id[.@i];
monster "this",-1,-1,"--ja--",.mob_id[.@i],1,"";.@ms =1;}//}
else
{//debugmes .rnum +"substracted by: "+.mob_c[.@i];.rnum -=.mob_c[.@i];}}
freeloop(0);}
Question
ffman22
hello, I am trying to create a fuction, to use in my custom branch to spawn, diferent mvps, with a specific chance for each one, I want to create a version that is more easy to implement, or use with a biger number of MVPs
this is the current script that I made.
Link to comment
Share on other sites
0 answers to this question
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.