Jump to content
  • 0

Question

Posted

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++;
    }

 


 

2 answers to this question

Recommended Posts

  • 1
Posted

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.

  • 0
Posted

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;
}

 

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...