xBeer Posted February 19 Posted February 19 ive a question about wheter it is possible for an "event" when killing a mob to trigger a bindatcmd command, example: Quote monster "prontera",0,0,"Quest Poring",1002,10,"NPCNAME::OnPoringKilled"; mes "[Summon Man]"; mes "Now go and kill all the Porings I summoned."; close; OnPoringKilled: bindatcmd "Droprain", strnpcinfo(0) +"::OnDrop"; } end; getmapxy(.@map$, .@x, .@y, BL_PC); close2; .@i = 0; while (.@i < .@amount) { do { .@dx = rand(-14, 14); .@dy = rand(-14, 14); } while (!checkcell(.@map$, .@x + .@dx, .@y + .@dy, cell_chkpass)); makeitem .@itemid, 1, .@map$, .@x + .@dx, .@y + .@dy; .@i++; } Quote
1 sader1992 Posted February 20 Posted February 20 I smell a bot, however i will answer the question for future reference for others. bindatcmd apply a command to all the server , triggering the script command by one player and expecting to give the command to that player only , will not work. as for the event ondrop , it's the one that should been in the monster script command not an event to another event that redirect to the drop event. Quote
0 xBeer Posted February 21 Author Posted February 21 Problem solve. Thx Sader Quote - script Item_Shower -1,{ OnInit: bindatcmd "Mobevent", strnpcinfo(0) +"::OnCommandEvent",99,99;//Only the GM can use the command using 99,99 if you want players too use 0,0 setarray .AllowedItems[0], 501, 502, 603, 1201; // List of Items end; OnCommandEvent: getmapxy(.@map$, .@x, .@y); mes "[Item Shower]"; mes "Invocare un Mob especial en este mapa."; next; input .@mobid; monster .@map$, .@x, .@y, "--Mob Especial--", .@mobid, 1, strnpcinfo(0) + "::OnMobDeath"; mes "¡Mob invocado!"; end; OnMobDeath: .@gid = killedgid; getunitdata(.@gid,.@temp); .@map$ = mapid2name(.@temp[UMOB_MAPID]); .@rains = rand(2,4); for (.@i = 0; .@i < .@rains; .@i++) { .@itemid = .AllowedItems[rand(getarraysize(.AllowedItems))]; makeitem .@itemid, 1, .@map$, (.@temp[UMOB_X]-5) + rand(10), (.@temp[UMOB_Y]-5) + rand(10); } announce "Ha caido una lluvia de items en " + .@map$ + "!", bc_all; end; } Quote
Question
xBeer
ive a question about wheter it is possible for an "event" when killing a mob to trigger a bindatcmd command, example:
2 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.