Rivers Posted December 5, 2020 Share Posted December 5, 2020 good day, I'm looking for a simple Invasion script that will spawn, either a set or random amount, of a specific monster set. I'm looking to use this for Seasonal Invasions, like Christmas mobs for Christmas season invasions. Quote Link to comment Share on other sites More sharing options...
1 crazyarashi Posted December 6, 2020 Share Posted December 6, 2020 (edited) - script invasion -1,{ OnInit: setarray .map$,"prontera","izlude"; function add_set; function create_set; create_set(); end; OnMinute00: function start_set; start_set(); end; OnMobDead: if(!mobcount(.current_map$,strnpcinfo(0) + "::OnMobDead")){ OnTimer900000: function end_set; end_set(); } end; //= Add your new set here. function create_set { //= add_set("Mob ID:Mob Amount{:Min amount:Max amount},....."); If min/max amount is added mob amount will be ignored. add_set("1001:50,1002:20:70:100"); add_set("1005:50:10:20,1001:20"); } function add_set { .set$[getarraysize(.set$)] = getarg(0); return; } function start_set { .current_map$ = .map$[rand(getarraysize(.map$))]; killmonster .current_map$,strnpcinfo(0) + "::OnMobDead"; explode([email protected]$,.set$[rand(getarraysize(.set$))],","); for([email protected] = 0; [email protected] < getarraysize([email protected]$); [email protected]++){ explode([email protected]$,[email protected]$[[email protected]],":"); if(getarraysize([email protected]$) > 2){ if(atoi([email protected]$[3]) == 0) [email protected] = atoi([email protected]$[1]); else [email protected] = rand(atoi([email protected]$[2]),atoi([email protected]$[3])); } else [email protected] = atoi([email protected]$[1]); monster .current_map$,0,0,"--ja--",atoi([email protected]$[0]),[email protected],strnpcinfo(0) + "::OnMobDead"; deletearray [email protected]$[0],getarraysize([email protected]$); } announce "Invasion : Invasion has started in " + .current_map$ + ".",bc_blue; initnpctimer; end; } function end_set { announce "Invasion : All monster has been killed.",bc_blue; killmonster .current_map$,strnpcinfo(0) + "::OnMobDead"; end; } } Edited December 6, 2020 by crazyarashi Quote Link to comment Share on other sites More sharing options...
0 Rivers Posted December 6, 2020 Author Share Posted December 6, 2020 Thanks so very much. This works more the way I am looking for. You're the best! Quote Link to comment Share on other sites More sharing options...
good day,
I'm looking for a simple Invasion script that will spawn, either a set or random amount, of a specific monster set. I'm looking to use this for Seasonal Invasions, like Christmas mobs for Christmas season invasions.
Link to comment
Share on other sites