^^
What Shadooow said.
If you need to have another creature/object as the creator of an effect, you need to 'delegate' part of your scripted actions to that object.
Eg:
In order to execute a script on player1, to instruct player2 to inflict damage on player 3
void DoDamageAgainst(int iAmount, int iType, int iPower, object oTarget)
{
effect eDamage = EffectDamage(iType,iAmount,iPower);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oTarget);
}
void main()
{
object oPlayer2 = // code to get player 2
object oPlayer3 = // code to get player 3
//We ask player 2 to create the damage effect, then apply directly to player 3
AssignCommand(oPlayer2,DoDamageAgainst(50,DAMAGE_TYPE_FIRE,DAMAGE_POWER_ENERGY,oPlayer3);
}
Note:
In nwnx_funcs for windows - maybe in linux too, you can modify the effect creator without having to assign/delegate actions to other creatures.
Allowing for more linear scripting.