Jump to content
  • 0

(Npc)Drop in an npc event


sran

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  56
  • Reputation:   0
  • Joined:  11/19/12
  • Last Seen:  

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
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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;

 

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  56
  • Reputation:   0
  • Joined:  11/19/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  56
  • Reputation:   0
  • Joined:  11/19/12
  • Last Seen:  

Thank You sir emistry

Link to comment
Share on other sites

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.

×
×
  • Create New...