Jump to content
  • 0

@monster random at list mob


domez86

Question


  • Group:  Members
  • Topic Count:  85
  • Topics Per Day:  0.02
  • Content Count:  207
  • Reputation:   0
  • Joined:  06/11/13
  • Last Seen:  

hi!

i would need a npc that evokes a random mob from a predefined list.
I tried many scripts like:

atcommand "@monster rand (1001,1002,1003)";

npc does not give errors but I always get "@monster failed" when I click...

help me pls? txn!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

-	script	Sample	FAKE_NPC,{
	OnInit: 
		bindatcmd("monster", strnpcinfo(3)+"::OnAtcommand");
		end;
		
	OnAtcommand:
		.@mob_id = F_Rand(1001, 1002, 1003); // mob id.
		.@amount = atoi(.@atcmd_parameters$[0]);
		if (.@amount <= 0)
			.@amount = 1;
		getmapxy(.@map$, .@x, .@y, BL_PC);
		monster(.@map$, .@x + rand(-2,2),  .@y + rand(-2,2), "--ja--", .@mob_id, .@amount);
		end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  85
  • Topics Per Day:  0.02
  • Content Count:  207
  • Reputation:   0
  • Joined:  06/11/13
  • Last Seen:  

35 minutes ago, Emistry said:

-	script	Sample	FAKE_NPC,{
	OnInit: 
		bindatcmd("monster", strnpcinfo(3)+"::OnAtcommand");
		end;
		
	OnAtcommand:
		.@mob_id = F_Rand(1001, 1002, 1003); // mob id.
		.@amount = atoi(.@atcmd_parameters$[0]);
		if (.@amount <= 0)
			.@amount = 1;
		getmapxy(.@map$, .@x, .@y, BL_PC);
		monster(.@map$, .@x + rand(-2,2),  .@y + rand(-2,2), "--ja--", .@mob_id, .@amount);
		end;
}

 

not work, when click, not error script but not work...

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

On 10/12/2019 at 7:01 AM, domez86 said:

not work, when click, not error script but not work...

It's bound to @monster command... Just do @monster 3 will summon 3 of a random mob id from that list.

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...