» Thu Jun 21, 2012 5:19 pm
Yeah. No easy way.
What I actually needed to do is detect when the player is bartering. I'm using this method:
When OnItemAdded () is triggered, I count the number of times Gold is increased and the number of times an inventory item is added.
Whan OnItemRemoved () is triggered, I count the number of times Gold is removed and the number of times an inventory item is removed.
Because bartering happens outside gamemode (i.e. in "menumode"), when OnUpdate () is next triggered, I check if transactions occured with this:
(gold added AND item removed) || (gold removed AND item added)
If no trasaction happend, I clear all the variables - allowing for dropping stuff, looting, quest rewards, etc... to be ignored.
It's not perfect, but it's better than trying to guess if those events happen while the player is conversing with a merchant.
And it seems to work with what I need it for.