Jump to content
  • 0

Item Drop When Carry An Item


Dolphin86

Question


  • Group:  Members
  • Topic Count:  255
  • Topics Per Day:  0.06
  • Content Count:  706
  • Reputation:   16
  • Joined:  01/07/12
  • Last Seen:  

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

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  298
  • Reputation:   47
  • Joined:  03/30/13
  • Last Seen:  

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;

 

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