Jump to content
  • 0

Detect dropped item from monster


Montella

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  07/05/13
  • Last Seen:  

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!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

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

  • 0

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

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  07/05/13
  • Last Seen:  

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 ?

Link to comment
Share on other sites

  • 0

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

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.

 

 

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