domez86 Posted October 12, 2019 Posted October 12, 2019 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! Quote
0 Emistry Posted October 12, 2019 Posted October 12, 2019 - 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; } Quote
0 domez86 Posted October 12, 2019 Author Posted October 12, 2019 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... Quote
0 Skorm Posted October 20, 2019 Posted October 20, 2019 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. Quote
Question
domez86
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.