You can have LastSummonerOf anyone, even dead people. And you can use TriggerOverride/ActionOverride(LastSummonerOf("booba"),TRIGGER/ACTION) to get a minion's master from the script of another creature or an engine script. Giving away a bit of proprietary research here, but what the heck... The summoner of the creature is the target of 67. If you want the simulacra to attack the creature the blow on which a PC had landed, you don't need a script reference to the PC. You make two types of effects for the special attack - a batch of Project Image effects to create your simulacra, these will be targeted at Self, and another, a 67 with the enemy as the target. Pass the 67 through Use EFF File always to block the giveaway puff of smoke (type "shskull" in Resource 2, it's a dud visual). The minion only needs to have a script name for your simulacra to latch on to. To keep minions from hanging around after work, I equip all of mine with a self-destruct mechanism - a Self-targeted delayed Remove Creature effect. Mine vanish in 5 seconds unless the script removes them earlier. You can create a minion like this as a template, call it +MINION.CRE, and it will float on top of the list in Near Infinity. When you need a servant for something, you just copy this guy.
There is a limitation here that the engine perceives only the latest creature with a script name. If you summon another booba, the first one will slip off the hook completely, and there is no way to latch on to it again (same problem as with simulacra, who all have the script name "copy"). Icewind Dale has an action for setting a script name, but the BG series doesn't, which is very big on my wish list, in case some designer is reading this. Script name duplication probably won't be an issue in your case, but what you can put in the scripts of the simulacra instead of a script name is some special definition of the minion, which you can make as exotic as your heart desires. Make the minion, for instance, the BELT General type and add extra details about alignment and so on, if you want. But usually General is enough. There probably won't be too many BELTs hanging around just then. Then you script the simulacra like this:
IF
Detect([BELT])
THEN
RESPONSE #1
AttackOneRound(LastSummonerOf(LastSeenBy))
END
Edited by temnix, 21 February 2018 - 02:44 PM.