Jump to content

Home

Force Power Script Problem


Wogi

Recommended Posts

Im making a new force power based off the two handed lightning force power from The Force Unleashed. I got everything to work but one thing. The problem is when I use it, it damages the PC like an enemy.

 

This is the script I used:

#include "k_inc_force"
void main()
{
SWFP_DAMAGE_TYPE = DAMAGE_TYPE_ELECTRICAL; 

object oCaster = OBJECT_SELF;
object oTarget = GetSpellTargetObject();
//object oUse = GetFirstObjectInShape(SHAPE_SPHERE, 12.0, GetLocation(oTarget), FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE);
object oUse = GetFirstObjectInShape(SHAPE_SPHERE, 12.0, GetLocation(oTarget), FALSE, OBJECT_TYPE_CREATURE);
   while (GetIsObjectValid(oUse)) {
       if (!GetIsDead(oUse))

SWFP_DAMAGE = GetMaxHitPoints(oCaster)/2;

   effect eBeam = EffectBeam(2038, oCaster, BODY_NODE_HAND_LEFT);

   effect eBeamr = EffectBeam(2038, oCaster, BODY_NODE_HAND_RIGHT);

   effect eVFX = EffectVisualEffect(2038);

effect eDamage = EffectDamage(SWFP_DAMAGE, SWFP_DAMAGE_TYPE);

ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oUse);

ApplyEffectToObject(1, eBeam, oUse, 2.0f);

ApplyEffectToObject(1, eBeamr, oUse, 2.0f);

ApplyEffectToObject(1, eVFX, oUse, 2.0f);

//object oUse = GetFirstObjectInShape(SHAPE_SPHERE, 12.0, GetLocation(oTarget), FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE);
oUse = GetNextObjectInShape(SHAPE_SPHERE, 12.0, GetLocation(oTarget), FALSE, OBJECT_TYPE_CREATURE);
}

 

Any ideas on stopping the power from damaging the PC while still hitting multiple targets?

 

Thanks.

~Wogi

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...