So I have this script that I've been working on, but the problem is, it only spawns 1 of the monsters, trying to get random monsters off the list with the % based chance to spawn. If possible I'd like to keep the array mob_ID,%chance, if not it's okay, would much rather a functioning script over functionality.
ba_chess,20,20,6 script MvP Shower Helper 10023,{
if(getgmlevel() >= 90){
mes "Hello"+ strcharinfo(0) +", welcome to the MvP Shower NPC.";
mes "Please select a map you'd like to spawn MvPs on.";
next;
[email protected]$ = implode(.map_name$, ":");
[email protected] = select( [email protected]$ ) - 1;
mes "How many MvPs would you like to spawn on map "+ .map_name$[[email protected]] +"?";
next;
input [email protected]_nbr;
mes "So you have choosen to spawn "+ [email protected]_nbr +" on "+ .map_name$[[email protected]] +" is this correct?";
if(select("Yes:No") == 2) end;
[email protected] = rand(1,getarraysize(.size_mob)/2)*2;
monster .map_name$[[email protected]],0,0,"--ja--",.mob_id[[email protected]+1],[email protected]_nbr;
}
OnInit:
setarray .map_name$,"ba_chess","veil","prontera","fair_izlude","ba_bath";
setarray .mob_id[1],1857,5,1002,10,1031,2,1113,15,1613,33,1836,60;
.size_mob = getarraysize( .mob_id );
end;
}
So I have this script that I've been working on, but the problem is, it only spawns 1 of the monsters, trying to get random monsters off the list with the % based chance to spawn. If possible I'd like to keep the array mob_ID,%chance, if not it's okay, would much rather a functioning script over functionality.
ba_chess,20,20,6 script MvP Shower Helper 10023,{ if(getgmlevel() >= 90){ mes "Hello"+ strcharinfo(0) +", welcome to the MvP Shower NPC."; mes "Please select a map you'd like to spawn MvPs on."; next; [email protected]$ = implode(.map_name$, ":"); [email protected] = select( [email protected]$ ) - 1; mes "How many MvPs would you like to spawn on map "+ .map_name$[[email protected]] +"?"; next; input [email protected]_nbr; mes "So you have choosen to spawn "+ [email protected]_nbr +" on "+ .map_name$[[email protected]] +" is this correct?"; if(select("Yes:No") == 2) end; [email protected] = rand(1,getarraysize(.size_mob)/2)*2; monster .map_name$[[email protected]],0,0,"--ja--",.mob_id[[email protected]+1],[email protected]_nbr; } OnInit: setarray .map_name$,"ba_chess","veil","prontera","fair_izlude","ba_bath"; setarray .mob_id[1],1857,5,1002,10,1031,2,1113,15,1613,33,1836,60; .size_mob = getarraysize( .mob_id ); end; }I appreciate any help given.
Edited by DR4LUC0NLink to comment
Share on other sites