Jump to content
  • 0
Sign in to follow this  
iZeal

@monster that spawns random location

Question

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?

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
-	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

Edited by Sunzuki

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.