PDA

View Full Version : Force Power Script Problem


Wogi
07-06-2010, 06:39 PM
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