Author Topic: No exp for kill  (Read 324 times)

Legacy_Surek

  • Full Member
  • ***
  • Posts: 169
  • Karma: +0/-0
No exp for kill
« on: June 19, 2014, 05:38:18 pm »


               

I recently noticed this on my PW while testing; I have a number of Items that use a unique power script to cause damage. However, if these items are used to kill a creature, I am having trouble capturing the Item Possessor as the real Killer in order to give proper experience rewards any help with this would be appreciated.


               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
No exp for kill
« Reply #1 on: June 19, 2014, 06:49:17 pm »


               

The scripts are run by the module.  In order to have the player take credit the effects used for killing (damage, death) must be created by the PC.  This can be done through AssignCommand() if the effect is fully declared only within this command.  Otherwise create a function that handles damage and death and AssignCommand it.



               
               

               
            

Legacy_Surek

  • Full Member
  • ***
  • Posts: 169
  • Karma: +0/-0
No exp for kill
« Reply #2 on: June 20, 2014, 07:20:34 am »


               

I'm still not sure what you mean by that.


Here is the script i'm using. Did you mean something like this?


 


 


void main()

{

object oPC;

 

if ((GetObjectType(GetItemActivatedTarget())!=OBJECT_TYPE_CREATURE)

){

 

SendMessageToPC(GetItemActivator(), "Improper use of item!");

return;}

 

oPC = GetItemActivator();

 

 

 

object oTarget;

oTarget = GetItemActivatedTarget();

effect eBeam = EffectBeam(VFX_BEAM_FIRE,oPC,BODY_NODE_HAND,FALSE);

effect eDMG = EffectDamage(3 ,DAMAGE_TYPE_FIRE);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oTarget,1.0);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(474),oTarget,3.0);

AssignCommand(oPC,ApplyEffectToObject(DURATION_TYPE_INSTANT,eDMG,oTarget,0.0));

 

}


               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
No exp for kill
« Reply #3 on: June 20, 2014, 07:46:15 am »


               


 


I'm still not sure what you mean by that.


Here is the script i'm using. Did you mean something like this?


 


 


void main()

{

object oPC;

 

if ((GetObjectType(GetItemActivatedTarget())!=OBJECT_TYPE_CREATURE)

){

 

SendMessageToPC(GetItemActivator(), "Improper use of item!");

return;}

 

oPC = GetItemActivator();

 

 

 

object oTarget;

oTarget = GetItemActivatedTarget();

effect eBeam = EffectBeam(VFX_BEAM_FIRE,oPC,BODY_NODE_HAND,FALSE);

effect eDMG = EffectDamage(3 ,DAMAGE_TYPE_FIRE);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oTarget,1.0);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(474),oTarget,3.0);

AssignCommand(oPC,ApplyEffectToObject(DURATION_TYPE_INSTANT,eDMG,oTarget,0.0));

 

}

 




 


 


That still has the damaging effect being created by the module.  The module is the object that is running the script.   So you need the Damaging effect to be created after it is assigned to the PC.   


 


 


object oTarget;

oTarget = GetItemActivatedTarget();

effect eBeam = EffectBeam(VFX_BEAM_FIRE,oPC,BODY_NODE_HAND,FALSE);

effect eDMG = EffectDamage(3 ,DAMAGE_TYPE_FIRE);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oTarget,1.0);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(474),oTarget,3.0);

AssignCommand(oPC,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(3 ,DAMAGE_TYPE_FIRE),oTarget,0.0));