Jump to content
  • 0

Item Drop When Carry An Item


Question

Posted (edited)

Can someone show me an example of script, that which when player carry an item let say a dagger in his inventory ( Not Equipped ) and when ever the player kill any monster in any map, player will get a specific item with 100% success like a meat ? all the player need to do is just carry that dagger around in his inventory

need 2 items drop, eg = meat and bone 

i found this script created by @sader1992LINK but it does not have item requirement

Script :

Spoiler
-	script	monsterdrop	-1,{
OnNPCKillEvent:
	if(rand(100) <= 9){//9%
		getitem(502,1);//item id is the 502
	}
end;
}

 

 

Edited by Dolphin86

2 answers to this question

Recommended Posts

  • 0
Posted (edited)
-	script	MOB_DROP	FAKE_NPC,{
	OnNPCKillEvent:
		if(countitem(.required_item) < 1) end;

		for(.@i = 0; .@i < getarraysize(.item_drops); .@i += 2)
			getitem(.item_drops[.@i], .item_drops[.@i + 1]);
	end;

	OnInit:
		.required_item = 13038;
		setarray(.item_drops, 517, 1, 932, 1);
}

 

Edited by Winterfox
  • 0
Posted

You can check docs for example

 

Quote

mes "[Quest Person]";
    if (countitem(512) < 1) {  // 512 is the item ID for Apple, found in item_db
        mes "Can you please bring me an apple?";
        close;
    }
    mes "Oh, you brought an Apple!";
    mes "I didn't want it, I just wanted to see one.";
    close;

 

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