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;
.@select$ = implode(.map_name$, ":");
.@i = select( .@select$ ) - 1;
mes "How many MvPs would you like to spawn on map "+ .map_name$[.@i] +"?";
next;
input .@mob_nbr;
mes "So you have choosen to spawn "+ .@mob_nbr +" on "+ .map_name$[.@i] +" is this correct?";
if(select("Yes:No") == 2) end;
.@rand = rand(1,getarraysize(.size_mob)/2)*2;
monster .map_name$[.@i],0,0,"--ja--",.mob_id[.@rand+1],.@mob_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;
}
Question
DR4LUC0N
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; .@select$ = implode(.map_name$, ":"); .@i = select( .@select$ ) - 1; mes "How many MvPs would you like to spawn on map "+ .map_name$[.@i] +"?"; next; input .@mob_nbr; mes "So you have choosen to spawn "+ .@mob_nbr +" on "+ .map_name$[.@i] +" is this correct?"; if(select("Yes:No") == 2) end; .@rand = rand(1,getarraysize(.size_mob)/2)*2; monster .map_name$[.@i],0,0,"--ja--",.mob_id[.@rand+1],.@mob_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
1 answer 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.