Ok, there are two possibilities:
1) the player uses an item on the scene (*not* on any interactive object within the scene). By default that makes the character to walk to that point. IMHO you should keep this behavior, because it's more comfortable for the player.
2) the player uses the item on some interactive object (including other items). In that case a "default-use" event is triggered in the actor (the default scripts handle this).
So all you need to do is to edit the script attached to your actor and add the following handler:
on "default-use"
{
switch(Random(1, 5))
{
case 1: actor.PlayAnim("bad_use_1.sprite"); break;
case 2: actor.PlayAnim("bad_use_2.sprite"); break;
// etc.
}
}
In case of using the right combination, you can either incorporate the animation directly into the code which handles this combination or (if you want to play the animation everytime) you'd have to modify the standard game.script.
There is the following piece of code in game.script in the "LeftClick" handler:
else if(Game.SelectedItem != null && Game.SelectedItem!=ActObj)
{
var Item = Game.SelectedItem;
if(ActObj.CanHandleEvent(Item.Name)) ActObj.ApplyEvent(Item.Name);
else if(Item.CanHandleEvent("default-use")) Item.ApplyEvent("default-use");
else if(ActObj.CanHandleEvent("default-use")) ActObj.ApplyEvent("default-use");
else actor.Talk("I can't use these things together.");
}
You'd have to change it to something like:
else if(Game.SelectedItem != null && Game.SelectedItem!=ActObj)
{
var Item = Game.SelectedItem;
if(ActObj.CanHandleEvent(Item.Name))
{
// *******
// add some special code when the combination is possible
actor.PlayAnim("whatever.sprite");
// *******
ActObj.ApplyEvent(Item.Name);
}
else if(Item.CanHandleEvent("default-use")) Item.ApplyEvent("default-use");
else if(ActObj.CanHandleEvent("default-use")) ActObj.ApplyEvent("default-use");
else actor.Talk("I can't use these things together.");
}