Jump to content

Home

Problem with scripting a Force power.


Emperor Devon

Recommended Posts

For some reason, I cannot get my Force power script to work. I could not find any errors. Here's my script:

 

// FP Force Drain

 

int FORCE_POWER_Drain = 282

 

#include "k_inc_force"

 

void main()

{

SWFP_HARMFUL = TRUE;

SWFP_DAMAGE = Sp_CalcDamage( oTarget, 0, 0, (GetHitDice(OBJECT_SELF)*2);

 

SWFP_DAMAGE_TYPE = DAMAGE_TYPE_DARK_SIDE

 

eLink1 = EffectAbilityDecrease(ABILITY_STRENGTH, 15);

 

effect eFlame = EffectFlame()

effect eDamage = EffectDamage(SWFP_DAMAGE, SWFP_DAMAGE_TYPE);

 

int nResist = Sp_BlockingChecks(oTarget, eChoke, eDamage, eInvalid);

int nSaves;

SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), SWFP_HARMFUL));

if(nResist == 0)

{

nSaves = Sp_MySavingThrows(oTarget);

if(nResist == 0)

{

ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_BEAM_DRAIN_LIFE), oTarget);

ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_BEAM_FLAME_SPRAY), oTarget);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFlame, oTarget, 3.5);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDrain, oTarget, 3.5);

 

float fDuration = Sp_CalcDuration( 3.5."" );

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, oTarget, fDuration);

int nIdx = 1

float fDelay;

SP_InteractiveDamage(eDamage, 7, oTarget);

}

}

 

}

 

Thanks for any help.

Link to comment
Share on other sites

I'm not exactly sure about what you want the FP to do so I tried to improvise, but here is my version:

#include "k_inc_force"

// int FORCE_POWER_Drain = 282    not needed

void main()
{
object oTarget = GetSpellTargetObject();
object oSelf = OBJECT_SELF;

effect eLink1 = EffectAbilityIncrease(ABILITY_STRENGTH, 15);
// effect eFlame = EffectFlame();    There is no 'EffectFlame()'
effect eChoke = EffectChoke();    // Declared 'eChoke'

int nDamage = Sp_CalcDamage(oTarget, 1, GetHitDice(oTarget), 0);    // here...
effect eDamage = EffectDamage(nDamage, DAMAGE_TYPE_DARK_SIDE);    // and lastly, here

effect eDrain = EffectHeal(nDamage);    // Declared the drain effect here...
effect eInvalid;    // Declared eInvalid

int nResist = Sp_BlockingChecks(oTarget, eChoke, eInvalid, eDamage);
// int nSaves;    Unused integer

if (nResist == 0)
{
	ApplyEffectToObject(1, EffectBeam(VFX_BEAM_DRAIN_LIFE, oSelf, 3, 0), oTarget, 1.0f);    // Changed VFX_BEAM effects to 'EffectBeam()'
	ApplyEffectToObject(1, EffectBeam(VFX_BEAM_FLAME_SPRAY, oSelf, 3, 0), oTarget, 1.0f);   // Here as well
	ApplyEffectToObject(1, eChoke, oTarget, 1.0f);
	ApplyEffectToObject(0, eDamage, oTarget);
	ApplyEffectToObject(0, eDrain, oSelf);
}
ApplyEffectToObject(1, eLink1, oTarget, Sp_CalcDuration(3.5f));    // This applies the strength decrease to the target no matter what
}

It compiles at any rate...

Link to comment
Share on other sites

For some reason, I cannot get my Force power script to work. I could not find any errors. Here's my script:

(snip)

int FORCE_POWER_Drain = 282

 

I could find a few errors at a quick glance of yoru script. :) To begin, you are missing a semicolon at the end of the above line.

 

SWFP_DAMAGE = Sp_CalcDamage( oTarget, 0, 0, (GetHitDice(OBJECT_SELF)*2);

 

You have 3 opening paranthesises on this line, but only 2 closing paranthesises. Further, oTarget has not been declared anywhere.

 

SWFP_DAMAGE_TYPE = DAMAGE_TYPE_DARK_SIDE

 

Missing semicolon at the end of this line as well.

 

 

effect eFlame = EffectFlame()

 

There is no effect constructor function called EffectFlame() in the scripting language, and you are missing a semicolon at the end of the line.

 

int nResist = Sp_BlockingChecks(oTarget, eChoke, eDamage, eInvalid);

 

You are checking for immunity to a variable called eChoke here, which has never been declared in the script you posted.

 

if(nResist == 0)

{

nSaves = Sp_MySavingThrows(oTarget);

if(nResist == 0)

{

 

You are checking for resistances twice, but never account for the fact if the target actually made their saving throw. I assume the second (nResist == 0) is meant to be (nSaves == 0).

 

ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_BEAM_DRAIN_LIFE), oTarget);

ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_BEAM_FLAME_SPRAY), oTarget);

 

Beams are not applied as visual effects directly, but are made by using the EffectBeam() effect constructor, where you specify the VFX_BEAM_* type as a parameter instead.

 

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDrain, oTarget, 3.5);

 

The eDrain variable you try to apply to the target has not been declared anywhere in the script.

 

float fDuration = Sp_CalcDuration( 3.5."" );

 

The Sp_CalcDuration() function takes a floating point (decimal) value as a parameter. You have one extra period and an empty string constant ("") supplied as parameter as well, making the parameter invalid.

 

int nIdx = 1

float fDelay;

SP_InteractiveDamage(eDamage, 7, oTarget);

 

The nIdx and fDelay variables are declared but never used for anything (which technically isn't an error, just rather pointless and unnessecary :) ), but you miss a semicolon after nIdx at any rate. Further, there is no function called SP_InteractiveDamage(). I assume you meant to use the SP_InterativeDamage()(sic) function found in k_inc_force. :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...