Jump to content
  • 0

Detect dropped item from monster


Question

Posted

Hello guys,

is there any way how to detect drooped items from monster? For example i can use fucntion

OnNPCKillEvent:

to detect that player killed some monster, but i cannot acces to items data what he dropped. Any advice?

 

Thank you!

4 answers to this question

Recommended Posts

  • 1
Posted
-	script	Item_Drop	-1,{

OnNPCKillEvent:

	.@mob_id = killedrid;
	getmapxy .@m$,.@x,.@y,UNITTYPE_PC;
	getmobdrops .@mob_id;
	.@n = $@MobDrop_count;
	copyarray .@mob_item,$@MobDrop_item,.@n;
	for(;.@i < .@n;.@i++) {
		if(getareadropitem(.@m$,.@x - 15,.@y - 15,.@x + 15,.@y + 15,.@mob_item[.@i]))
			dispbottom "Dropped "+getitemname(.@mob_item[.@i]);
	}
	end;

}

 

  • Upvote 1
  • Like 1
  • 0
Posted

none, currently you cant retrieve the info of item dropped when you killed a monster using the OnNPCKillEvent...

 

you could edit the source to have it store the item info when the monster drop, then retrieve it when it execute the OnNPCKillEvent.

  • 0
Posted

Do you mean edit source and store every killed mob to database + items or store it to some global variable? I was looking for those informations in logs, found something at picklog but it store only items picked from ground (or autolooted to your inv). Is any way how to add to log or I really need to edit source.

Thanks for any advice ?

  • 0
Posted
On 11/10/2018 at 8:15 PM, Montella said:

found something at picklog but it store only items picked from ground (or autolooted to your inv). Is any way how to add to log or I really need to edit source.

if i recall correctly, monster drop are recorded in picklog as well with the monster ID and item ID with the action of drop (D).

 

 

@n0tttt

nice try, didnt realize there exists a script command for getareadropitem. but the script wont work for autoloot.

 

 

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