AssignCommand not crediting assignee with damage
Bluesorc
Member Posts: 3
When passing an EffectDamage through an AssignCommand function to give "credit" for the damage in the combat log to some object other than the caller, it doesn't seem to work.
For example, I have the following code in the OnUsed script of a placeable in a test area:
The expectation is that I should see in the combat log that the PC using the object gets dealt 1 point of damage, twice. The first instance should be credited to the placeable, the second time should be credited to the PC. Here is what happens:
...Both effects are credited to the combat dummy.
Can anyone point me in the right direction? I had been led to believe that AssignCommand could be used in this manner. Am I incorrect?
For example, I have the following code in the OnUsed script of a placeable in a test area:
effect eDam=EffectDamage(1);
object oArm=GetFirstPC();
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDam,oArm);
AssignCommand(oArm,ApplyEffectToObject(DURATION_TYPE_INSTANT,eDam,oArm));
The expectation is that I should see in the combat log that the PC using the object gets dealt 1 point of damage, twice. The first instance should be credited to the placeable, the second time should be credited to the PC. Here is what happens:
...Both effects are credited to the combat dummy.
Can anyone point me in the right direction? I had been led to believe that AssignCommand could be used in this manner. Am I incorrect?
0
Comments
void DealDamage(object oTarget) { effect eDamage = EffectDamage(1); ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget); } void main() { object oPlayer = GetLastUsedBy(); DealDamage(oPlayer); AssignCommand(oPlayer, DealDamage(oPlayer)); }