Jump to content
  • 0

Question

4 answers to this question

Recommended Posts

Posted

Try :

 

-    script    Sample    -1,{
    OnInit:
        set .item_id,7227;
        set .amount,10;
        monster "prontera",0,0,"Poringer",1002,1,strnpcinfo(0)+"::OnKill";
        end;
        
    OnKill:
        for (set .@i,0; .@i < .amount; set .@i,.@i+1) {
            do {
                set .@x, rand(1,500);
                set .@y, rand(1,500);
            } while (!checkcell("prontera",.@x,.@y,cell_chkpass));
            makeitem .item_id,1,"prontera",.@x,.@y;
        }
        end;
}
Posted

I don't know how to get the monstres position besides patskies script but you could use the players position

OnNPCKillEvent:
	if(killedrid == <monster id>) {
		attachrid(killerrid);
		if(getmapxy(@mapname$,@mapx,@mapy,0,"""+strcharinfo(0)+"")!=0) end;
		set @mapx,@mapx+rand(-15,15);
		if(@mapx < 0) set @mapx,0;
		set @mapy,@mapy+rand(-15,15);
		if(@mapy < 0) set @mapy,0;
		makeitem "<item name>",<amount>,""+@mapname$+"",@mapx,@mapy;
	}
end; 

(not tested)

 

 

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