Jump to content
  • 0

@monster random at list mob


Question

Posted

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!

3 answers to this question

Recommended Posts

  • 0
Posted
-	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;
}

 

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

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...