Author Topic: EffectDamage - Player isn't treated as damage dealer  (Read 318 times)

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
EffectDamage - Player isn't treated as damage dealer
« on: March 31, 2012, 04:13:19 am »


               I'm calling this from a unique power cast by the player. On the creatures death, no loot drops. It acts as though the player isn't the damage dealer. How can solve this?



  eEffect = EffectDamage(d2(), DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL);
  ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, GetItemActivatedTarget());


               
               

               
            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
EffectDamage - Player isn't treated as damage dealer
« Reply #1 on: March 31, 2012, 04:48:10 am »


               Make sure you have the player creating the damage effect.  Perhaps in special function...

void DoDamage(object oTarget, int nDamage, int nDamageType, int nDamagePower)
{
effect eDamage = EffectDamage(nDamage, nDamageType, nDamagePower);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
}

void main()
{
object oPC = GetItemActivator();
object oTarget = GetItemActivatedTarget();
AssignCommand(oPC, DoDamage(oTarget, d2(), DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL));
}
               
               

               
            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
EffectDamage - Player isn't treated as damage dealer
« Reply #2 on: March 31, 2012, 05:18:00 am »


               

The Amethyst Dragon wrote...

Make sure you have the player creating the damage effect. Perhaps in special function...

void DoDamage(object oTarget, int nDamage, int nDamageType, int nDamagePower)
{
effect eDamage = EffectDamage(nDamage, nDamageType, nDamagePower);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
}

void main()
{
object oPC = GetItemActivator();
object oTarget = GetItemActivatedTarget();
AssignCommand(oPC, DoDamage(oTarget, d2(), DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL));
}




Ooh it looks like that worked. I'm so glad these forums are still alive. Thank you kindly!