Jump to content
  • 0

(Npc)Drop in an npc event


Question

Posted (edited)
Hello, I saw several npc that have done here in the forum and I came to this, but I don't know how to do this. I would like to kill the poring in certain cells 10 white potions for example, thanks

poring.txt

Edited by sran

4 answers to this question

Recommended Posts

  • 0
Posted
OnKill:
	if (playerattached()) {
		getmapxy(.@map$, .@x, .@y, BL_PC);
		for (.@i = 0; .@i < 10; .@i++)
			makeitem 7539, 1, .@map$, .@x + rand(-3,3), .@y + rand(-3,3);
	}
	end;

 

  • 0
Posted
-	script	chicken	-1,{
    OnKill:
		if (playerattached()) {
			if ( rand( 156 ) <= 158 ) {
				.@item_id = F_Rand( 7539 );
				getitem .@item_id,1;
			}
		}
        sleep 1 * 60 * 1000;
    OnInit:
        monster "prontera",156,157,"Poring",1002,1,strnpcinfo(1)+"::OnKill";
        end;		
}

or you can also try a better approach

prontera,156,157,0,0	monster	Poring	1002,1,60000,0,"poring_event::OnKill";

-	script	poring_event	-1,{
    OnKill:
		if (playerattached()) {
			if ( rand(156) <= 158 ) {
				.@item_id = F_Rand( 7539 );
				getitem .@item_id,1;
			}
		}
		end;
}

the rate checking seem useless tho, no idea what you are planning to do with that.

  • 0
Posted
Hello, Mr. emistry, what I want the npc to do is that when the poring is killed, say so in 5 seconds 10 poring coins will fall in prontera near where the poring came out, thanks

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