@monster that spawns random location

iZeal

New member
Messages
158
Points
0
Emulator
Is it possible to have an @monster that spawns the monster on a random location on a Map like: @monster2 argiope prontera then it will spawn on different location of the map.. is it possible?

 
- script OnInit -1,{end;OnInit: bindatcmd "monster2", "AtCommands::OnMonster2", <GM Level>, 99;end;}- script AtCommands -1,{end;OnMonster2: if(getarraysize(.@atcmd_parameters$) == 1) { set .@mobid,.@atcmd_parameters$[0]; monster ""+strcharinfo(3)+"",0,0,""+strmobinfo(1, .@mobid)+"",.@mobid,1; } else if(getarraysize(.@atcmd_parameters$) == 2) { set .@mobid,.@atcmd_parameters$[0]; set .@map$,.@atcmd_parameters$[1]; monster ""+.@map$+"",0,0,""+strmobinfo(1, .@mobid)+"",.@mobid,1; } else if(getarraysize(.@atcmd_parameters$) == 3) { set .@mobid,.@atcmd_parameters$[0]; set .@amount,.@atcmd_parameters$[1]; if(!.@amount) set .@amount,1; set .@map$,.@atcmd_parameters$[2]; monster ""+.@map$+"",0,0,""+strmobinfo(1, .@mobid)+"",.@mobid,.@amount; } else { message strcharinfo(0), "Wrong command format. Possible formats:"; message strcharinfo(0), " - @monster2 <Mob ID> <amount> <map>"; message strcharinfo(0), " - @monster2 <Mob ID> <map>"; message strcharinfo(0), " - @monster2 <Mob ID>"; message strcharinfo(0), "@monster2 failed."; }end;} 

 It could basically work like that, but I'm not good of a coder and I don't know how to check if a monster ID or a map is valid. There will be a console message when someone enters invalid values I assume. Don't forget to change gm level if you use it

 
Last edited by a moderator:
I will try this Thank you
default_biggrin.png


 
Back
Top