1st post.
Not sure were this should go, I'm guessing a moderator will give me a heads up and correct the situation.
So I decided to go a little crazy and through all TSL buffs, including all powers from each tree in a mega force power.
My problem is it seems to work randomly (sort of). I'll try to be a bit more specific.
Perugus II:
When I'm solo, no party members, i got it All, all three speed mastery's, valor mastery's, resists, ...inspire followers, the deal. In the journal > messages > effects it looked somewhat like this:
Speed Burst
Knight Speed
Speed Mastery
Force Aura
Force Shield
Force Armor
Force Mind
Knight Mind
Mind Mastery
Resist Force
Force Immunity
Resist Cold Heat Energy
Resist Poison Disease Sonic
Master Energy Resistance
Force Barrier
Improved Force Barrier
Master Force Barrier
Battle Meditation Pc
Improved Battle Meditation Pc
Master Battle Meditation Pc
Force Body
Improved Force Body
Master Force Body
Inspire Followers I
Inspire Followers II
Inspire Followers II
Inspire Followers IV
Inspire Followers V
Inspire Followers VI
Force Sight
When I'm in a party however I don't seem to get that result.
Now the idea is to go through all specific powers, apply each of them to all non enemy creatures in a specific radius.
something like:
I'm not sure if the game engine is not able to handle it, or my logic is flawed. I'm betting on the latter :)
Full version, a little extensive I fear:
I appreciate your time. Thank you very much.
Not sure were this should go, I'm guessing a moderator will give me a heads up and correct the situation.
So I decided to go a little crazy and through all TSL buffs, including all powers from each tree in a mega force power.
My problem is it seems to work randomly (sort of). I'll try to be a bit more specific.
Perugus II:
When I'm solo, no party members, i got it All, all three speed mastery's, valor mastery's, resists, ...inspire followers, the deal. In the journal > messages > effects it looked somewhat like this:
Speed Burst
Knight Speed
Speed Mastery
Force Aura
Force Shield
Force Armor
Force Mind
Knight Mind
Mind Mastery
Resist Force
Force Immunity
Resist Cold Heat Energy
Resist Poison Disease Sonic
Master Energy Resistance
Force Barrier
Improved Force Barrier
Master Force Barrier
Battle Meditation Pc
Improved Battle Meditation Pc
Master Battle Meditation Pc
Force Body
Improved Force Body
Master Force Body
Inspire Followers I
Inspire Followers II
Inspire Followers II
Inspire Followers IV
Inspire Followers V
Inspire Followers VI
Force Sight
When I'm in a party however I don't seem to get that result.
Now the idea is to go through all specific powers, apply each of them to all non enemy creatures in a specific radius.
something like:
Code:
void main () {
// variables
// (...)
for ( ; nSpell < 282; nSpell++ ) {
oCreature = GetFirstObjectInShape ( SHAPE_SPHERE, fRange, GetLocation ( OBJECT_SELF ), FALSE, OBJECT_TYPE_CREATURE );
while ( GetIsObjectValid ( oCreature ) ) {
if ( !GetIsEnemy ( oCreature ) ) {
switch ( nSpell ) {
(...)
}
}
oCreature = GetNextObjectInShape ( SHAPE_SPHERE, fRange, GetLocation ( OBJECT_SELF ), FALSE, OBJECT_TYPE_CREATURE );
}
}
}
Full version, a little extensive I fear:
Show spoiler
Code:
#include "k_inc_force"
void main () {
effect eLink1, eLink2;
effect eInvalid;
object oCreature;
int nSpell = 0;
SWFP_SHAPE = SHAPE_SPHERE;
float fDuration = Sp_CalcDuration ( 360.0f );
float fRange = Sp_CalcRange ( 30.0f );
for ( ; nSpell < 282; nSpell++ ) {
oCreature = GetFirstObjectInShape ( SHAPE_SPHERE, fRange, GetLocation ( OBJECT_SELF ), FALSE, OBJECT_TYPE_CREATURE );
while ( GetIsObjectValid ( oCreature ) ) {
// if ( GetIsFriend ( oCreature ) || IsObjectPartyMember ( oCreature ) ) {
if ( !GetIsEnemy ( oCreature ) ) {
switch ( nSpell ) {
/*
HEAL
*/
case FORCE_POWER_CURE: {
SWFP_HARMFUL = FALSE;
// The Regeneration Consular Forms increase the relevance of
// the Wisdom and Charisma modifiers.
int nMultiplier = 1;
// Form/Stance re-design.
int nHeal = ( ( GetAbilityModifier ( ABILITY_WISDOM ) + GetAbilityModifier ( ABILITY_CHARISMA ) ) * nMultiplier ) + 5 + GetHitDice ( OBJECT_SELF );
effect eVis = EffectVisualEffect ( VFX_IMP_CURE );
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, FALSE ) );
ApplyEffectToObject ( DURATION_TYPE_INSTANT, eVis, oCreature );
ApplyEffectToObject ( DURATION_TYPE_INSTANT, EffectHeal ( nHeal ), oCreature );
}
break;
/*
FORCE ARMOR
*/
case FORCE_POWER_FORCE_ARMOR: {
// float fDuration = Sp_CalcDuration ( 20.0 );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
eLink1 = EffectACIncrease ( 6, AC_DODGE_BONUS );
eLink1 = EffectLinkEffects ( eLink1, EffectSavingThrowIncrease ( SAVING_THROW_ALL, 6 ) );
eLink1 = SetEffectIcon ( eLink1, 7 );
eLink2 = EffectVisualEffect ( VFX_PRO_FORCE_ARMOR );
eLink2 = EffectLinkEffects ( eLink2, EffectVisualEffect ( VFX_PRO_FORCE_SHIELD ) );
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eLink2, 3.0 );
}
}
break;
/*
FORCE AURA
*/
case FORCE_POWER_FORCE_AURA: {
// float fDuration = Sp_CalcDuration ( 20.0 );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
eLink1 = EffectACIncrease ( 2, AC_DODGE_BONUS );
eLink1 = EffectLinkEffects ( eLink1, EffectSavingThrowIncrease ( SAVING_THROW_ALL, 2 ) );
eLink1 = SetEffectIcon ( eLink1, 8 );
eLink2 = EffectVisualEffect ( VFX_PRO_FORCE_AURA );
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eLink2, 3.0 );
}
}
break;
/*
FORCE IMMUNITY
*/
case FORCE_POWER_FORCE_IMMUNITY: {
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// float fDuration = Sp_CalcDuration ( 60.0 );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
int nSR = 15 + GetHitDice ( OBJECT_SELF );
eLink1 = EffectForceResistanceIncrease ( nSR );
eLink1 = SetEffectIcon ( eLink1, 9 );
eLink2 = EffectVisualEffect ( VFX_PRO_RESIST_FORCE );
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eLink2, 1.0 );
}
}
break;
/*
FORCE VALOR
*/
case FORCE_POWER_FORCE_MIND: {
SWFP_HARMFUL = FALSE;
eLink1 = EffectSavingThrowIncrease ( SAVING_THROW_FORT,2 );
eLink1 = EffectLinkEffects ( eLink1, EffectSavingThrowIncrease ( SAVING_THROW_REFLEX, 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectSavingThrowIncrease ( SAVING_THROW_WILL, 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_CHARISMA, 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_CONSTITUTION, 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_DEXTERITY, 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_INTELLIGENCE, 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_STRENGTH, 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_WISDOM, 2 ) );
eLink2 = EffectVisualEffect ( VFX_IMP_MIND_FORCE );
eLink1 = SetEffectIcon ( eLink1, 10 );
// float fDuration = Sp_CalcDuration ( 20.0 );
// if ( GetIsObjectValid ( oCreature ) && IsObjectPartyMemberIsObjectPartyMember ( oCreature ) ) {
if ( GetIsObjectValid ( oCreature ) ) {
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, SWFP_HARMFUL ) );
Sp_ApplyForcePowerEffects ( fDuration, eLink1, oCreature );
Sp_ApplyForcePowerEffects ( 0.0, eLink2, oCreature );
}
}
}
break;
/*
FORCE SHIELD
*/
case FORCE_POWER_FORCE_SHIELD: {
// float fDuration = Sp_CalcDuration ( 20.0 );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
eLink1 = EffectACIncrease ( 4, AC_DODGE_BONUS );
eLink1 = EffectLinkEffects ( eLink1, EffectSavingThrowIncrease ( SAVING_THROW_ALL, 4 ) );
eLink1 = SetEffectIcon ( eLink1, 12 );
eLink2 = EffectVisualEffect ( VFX_PRO_FORCE_SHIELD );
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eLink2, 3.0 );
}
}
break;
/*
IMPROVED HEAL
*/
case FORCE_POWER_HEAL: {
SWFP_HARMFUL = FALSE;
int nMultiplier = 1;
// Form/Stance re-design.
// Balance change
int nHeal = ( ( GetAbilityModifier ( ABILITY_WISDOM ) + GetAbilityModifier ( ABILITY_CHARISMA ) ) * nMultiplier ) + 15 + GetHitDice ( OBJECT_SELF );
effect eVis = EffectVisualEffect ( VFX_IMP_HEAL );
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, SWFP_HARMFUL ) );
Sp_RemoveSpecificEffect ( EFFECT_TYPE_POISON, oCreature );
ApplyEffectToObject ( DURATION_TYPE_INSTANT, eVis, oCreature );
ApplyEffectToObject ( DURATION_TYPE_INSTANT, EffectHeal ( nHeal ), oCreature );
}
break;
/*
MASTER HEAL
*/
// Same as Improved Heal with addition 5 VP and Stun removal.
case FORCE_POWER_MASTER_HEAL: {
SWFP_HARMFUL = FALSE;
int nMultiplier = 1;
// Form/Stance re-design.
// Balance Change
int nHeal = ( ( GetAbilityModifier ( ABILITY_WISDOM ) + GetAbilityModifier ( ABILITY_CHARISMA ) ) * nMultiplier ) + 15 + 2*GetHitDice ( OBJECT_SELF );
effect eVis = EffectVisualEffect ( VFX_IMP_HEAL );
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, SWFP_HARMFUL ) );
Sp_RemoveSpecificEffect ( EFFECT_TYPE_STUNNED, oCreature );
Sp_RemoveSpecificEffect ( EFFECT_TYPE_POISON, oCreature );
ApplyEffectToObject ( DURATION_TYPE_INSTANT, eVis, oCreature );
ApplyEffectToObject ( DURATION_TYPE_INSTANT, EffectHeal ( nHeal ), oCreature );
}
break;
/*
KNIGHT VALOR
*/
case FORCE_POWER_KNIGHT_MIND: {
SWFP_HARMFUL = FALSE;
eLink1 = EffectSavingThrowIncrease ( SAVING_THROW_ALL,3 );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_CHARISMA, 3 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_CONSTITUTION, 3 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_DEXTERITY, 3 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_INTELLIGENCE, 3 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_STRENGTH, 3 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_WISDOM, 3 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectImmunity ( IMMUNITY_TYPE_POISON ) );
eLink1 = SetEffectIcon ( eLink1, 19 );
eLink2 = EffectVisualEffect ( 1033 );
// float fDuration = Sp_CalcDuration ( 20.0 );
// if ( GetIsObjectValid ( oCreature ) && IsObjectPartyMember ( oCreature ) ) {
if ( GetIsObjectValid ( oCreature ) ) {
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, SWFP_HARMFUL ) );
Sp_ApplyForcePowerEffects ( fDuration, eLink1, oCreature );
Sp_ApplyForcePowerEffects ( 0.0, eLink2, oCreature );
}
}
}
break;
/*
KNIGHT SPEED
*/
case FORCE_POWER_KNIGHT_SPEED: {
// float fDuration = Sp_CalcDuration ( 36.0 );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
eLink1 = EffectMovementSpeedIncrease ( 99 );
eLink1 = EffectLinkEffects ( eLink1, EffectACIncrease ( 4 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectModifyAttacks ( 1 ) );
eLink1 = SetEffectIcon ( eLink1, 20 );
if ( OBJECT_SELF == GetPartyMemberByIndex ( 0 ) ) {
eLink1 = EffectLinkEffects ( eLink1, EffectVisualEffect ( VFX_DUR_SPEED ) );
}
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eInvalid, 0.0 );
}
}
break;
/*
MASTER VALOR
*/
case FORCE_POWER_MIND_MASTERY: {
SWFP_HARMFUL = FALSE;
eLink1 = EffectSavingThrowIncrease ( SAVING_THROW_ALL,5 );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_CHARISMA, 5 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_CONSTITUTION, 5 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_DEXTERITY, 5 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_INTELLIGENCE, 5 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_STRENGTH, 5 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectAbilityIncrease ( ABILITY_WISDOM, 5 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectImmunity ( IMMUNITY_TYPE_POISON ) );
eLink1 = SetEffectIcon ( eLink1, 21 );
eLink2 = EffectVisualEffect ( VFX_IMP_MIND_MASTERY );
// float fDuration = Sp_CalcDuration ( 20.0 );
// if ( GetIsObjectValid ( oCreature ) && IsObjectPartyMember ( oCreature ) ) {
if ( GetIsObjectValid ( oCreature ) ) {
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, SWFP_HARMFUL ) );
Sp_ApplyForcePowerEffects ( fDuration, eLink1, oCreature );
Sp_ApplyForcePowerEffects ( 0.0, eLink2, oCreature );
}
}
}
break;
/*
IMPROVED ENERGY RESISTANCE
*/
case FORCE_POWER_RESIST_COLD_HEAT_ENERGY: {
SWFP_HARMFUL = FALSE;
eLink1 = EffectDamageResistance ( DAMAGE_TYPE_COLD, 12 );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_FIRE, 12 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_SONIC, 12 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_BLASTER, 12 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_ELECTRICAL, 12 ) );
eLink1 = SetEffectIcon ( eLink1, 24 );
eLink2 = EffectVisualEffect ( VFX_PRO_RESIST_ELEMENTS );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
// float fDuration = Sp_CalcDuration ( 120.0 );
ApplyEffectToObject ( DURATION_TYPE_TEMPORARY, eLink1, oCreature, fDuration );
ApplyEffectToObject ( DURATION_TYPE_TEMPORARY, eLink2, oCreature, 1.0 );
}
}
break;
/*
MASTER ENERGY RESISTANCE
*/
case FORCE_POWER_MASTER_ENERGY_RESISTANCE: {
SWFP_HARMFUL = FALSE;
eLink1 = EffectDamageResistance ( DAMAGE_TYPE_COLD, 20 );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_FIRE, 20 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_SONIC, 20 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_BLASTER, 20 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_ELECTRICAL, 20 ) );
eLink1 = SetEffectIcon ( eLink1, 104 );
eLink2 = EffectVisualEffect ( VFX_PRO_RESIST_ELEMENTS );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
// float fDuration = Sp_CalcDuration ( 120.0 );
ApplyEffectToObject ( DURATION_TYPE_TEMPORARY, eLink1, oCreature, fDuration );
ApplyEffectToObject ( DURATION_TYPE_TEMPORARY, eLink2, oCreature, 1.0 );
}
}
break;
/*
RESIST FORCE 1
*/
case FORCE_POWER_RESIST_FORCE: {
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
int nSR = 10 + GetHitDice ( OBJECT_SELF );
eLink1 = EffectForceResistanceIncrease ( nSR );
eLink1 = SetEffectIcon ( eLink1, 25 );
eLink2 = EffectVisualEffect ( VFX_PRO_RESIST_FORCE );
// float fDuration = Sp_CalcDuration ( 60.0 );
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eLink2, 1.0 );
}
}
break;
/*
RESIST ENERGY
*/
case FORCE_POWER_RESIST_POISON_DISEASE_SONIC: {
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
eLink1 = EffectDamageResistance ( DAMAGE_TYPE_COLD, 6 );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_FIRE, 6 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_SONIC, 6 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_ELECTRICAL, 6 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_BLASTER, 6 ) );
eLink1 = SetEffectIcon ( eLink1, 26 );
eLink2 = EffectVisualEffect ( VFX_PRO_RESIST_ELEMENTS );
// float fDuration = Sp_CalcDuration ( 120.0 );
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eLink2, 1.0 );
}
}
break;
/*
BURST OF SPEED
*/
case FORCE_POWER_SPEED_BURST: {
// float fDuration = Sp_CalcDuration ( 36.0 );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
eLink1 = EffectMovementSpeedIncrease ( 99 );
eLink1 = EffectLinkEffects ( eLink1, EffectACIncrease ( 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectVisualEffect ( VFX_DUR_KNIGHTS_SPEED ) );
eLink1 = SetEffectIcon ( eLink1, 2 );
if ( OBJECT_SELF == GetPartyMemberByIndex ( 0 ) ) {
eLink1 = EffectLinkEffects ( eLink1, EffectVisualEffect ( VFX_DUR_SPEED ) );
}
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eInvalid, 0.0 );
}
}
break;
/*
MASTER SPEED
*/
case FORCE_POWER_SPEED_MASTERY: {
// float fDuration = Sp_CalcDuration ( 36.0 );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
eLink1 = EffectMovementSpeedIncrease ( 99 );
eLink1 = EffectLinkEffects ( eLink1, EffectACIncrease ( 4 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectModifyAttacks ( 2 ) );
eLink1 = SetEffectIcon ( eLink1, 22 );
if ( OBJECT_SELF == GetPartyMemberByIndex ( 0 ) ) {
eLink1 = EffectLinkEffects ( eLink1, EffectVisualEffect ( VFX_DUR_SPEED ) );
}
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eInvalid, 0.0 );
}
}
break;
/*
FORCESIGHT
*/
case FORCE_POWER_FORCE_SIGHT: {
// float fDuration = Sp_CalcDuration ( 20.0 );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, EffectForceSight (), fDuration, eInvalid, 0.0 );
}
}
break;
/*
FORCE BARRIER
*/
case FORCE_POWER_FORCE_BARRIER: {
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
eLink1 = EffectDamageResistance ( DAMAGE_TYPE_BLUDGEONING, 4 );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_PIERCING, 4 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_SLASHING, 4 ) );
eLink1 = SetEffectIcon ( eLink1, 64 );
eLink2 = EffectVisualEffect ( VFX_PRO_FORCE_ARMOR );
eLink2 = EffectLinkEffects ( eLink2, EffectVisualEffect ( VFX_PRO_FORCE_SHIELD ) );
// float fDuration = Sp_CalcDuration ( 30.0 );
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eLink2, 3.0 );
}
}
break;
/*
IMPROVED FORCE BARRIER
*/
case FORCE_POWER_IMPROVED_FORCE_BARRIER: {
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
eLink1 = EffectDamageResistance ( DAMAGE_TYPE_BLUDGEONING, 8 );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_PIERCING, 8 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_SLASHING, 8 ) );
eLink1 = SetEffectIcon ( eLink1, 65 );
eLink2 = EffectVisualEffect ( VFX_PRO_FORCE_ARMOR );
eLink2 = EffectLinkEffects ( eLink2, EffectVisualEffect ( VFX_PRO_FORCE_SHIELD ) );
// float fDuration = Sp_CalcDuration ( 45.0 );
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eLink2, 3.0 );
}
}
break;
/*
MASTER FORCE BARRIER
*/
case FORCE_POWER_MASTER_FORCE_BARRIER: {
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
eLink1 = EffectDamageResistance ( DAMAGE_TYPE_BLUDGEONING, 15 );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_PIERCING, 15 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageResistance ( DAMAGE_TYPE_SLASHING, 15 ) );
eLink1 = SetEffectIcon ( eLink1, 66 );
eLink2 = EffectVisualEffect ( VFX_PRO_FORCE_ARMOR );
eLink2 = EffectLinkEffects ( eLink2, EffectVisualEffect ( VFX_PRO_FORCE_SHIELD ) );
// float fDuration = Sp_CalcDuration ( 60.0 );
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eLink2, 3.0 );
}
}
break;
/*
BATTLE MEDITATION
*/
case FORCE_POWER_BATTLE_MEDITATION_PC: {
SWFP_HARMFUL = FALSE;
// Bonuses
eLink1 = EffectDamageIncrease ( 2, DAMAGE_TYPE_UNIVERSAL );
eLink1 = EffectLinkEffects ( eLink1, EffectAttackIncrease ( 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectSavingThrowIncrease ( SAVING_THROW_WILL, 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectVPRegenModifier ( 50 ) );
eLink1 = SetEffectIcon ( eLink1, 67 );
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, SWFP_HARMFUL ) );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
ApplyEffectToObject ( DURATION_TYPE_INSTANT, EffectVisualEffect ( 9000 ), oCreature );
ApplyEffectToObject ( DURATION_TYPE_TEMPORARY, eLink1, oCreature, fDuration );
}
}
break;
/*
IMPROVED BATTLE MEDITATION
*/
case FORCE_POWER_IMPROVED_BATTLE_MEDITATION_PC: {
SWFP_HARMFUL = FALSE;
// Bonuses
eLink1 = EffectDamageIncrease ( 2 );
eLink1 = EffectLinkEffects ( eLink1, EffectAttackIncrease ( 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectSavingThrowIncrease ( SAVING_THROW_WILL, 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectVPRegenModifier ( 50 ) );
eLink1 = SetEffectIcon ( eLink1, 68 );
// float fDuration = Sp_CalcDuration ( 20.0 );
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, SWFP_HARMFUL ) );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
ApplyEffectToObject ( DURATION_TYPE_INSTANT, EffectVisualEffect ( 9001 ), oCreature );
ApplyEffectToObject ( DURATION_TYPE_TEMPORARY, eLink1, oCreature, fDuration );
}
SWFP_HARMFUL = TRUE;
SWFP_PRIVATE_SAVE_TYPE = SAVING_THROW_WILL;
SWFP_SHAPE = SHAPE_SPHERE;
// Penalties
eLink1 = EffectDamageDecrease ( 2 );
eLink1 = EffectLinkEffects ( eLink1, EffectAttackDecrease ( 2 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectSavingThrowDecrease ( SAVING_THROW_WILL, 2 ) );
eLink1 = SetEffectIcon ( eLink1, 68 );
// Iterate over all targets of the detrimental effects and
// apply them.
/*
object oCreature = GetFirstObjectInShape ( SHAPE_SPHERE, fRange, GetLocation ( OBJECT_SELF ), FALSE, OBJECT_TYPE_CREATURE );
while ( GetIsObjectValid ( oCreature ) ) {
// This power targets hostile creatures only.
if ( GetIsObjectValid ( oCreature ) &&
GetIsEnemy ( oCreature ) &&
GetRacialType ( oCreature ) != RACIAL_TYPE_DROID ) {
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, SWFP_HARMFUL ) );
// Make Immunity Checks
int nResist = Sp_BlockingChecks ( oCreature, eLink1, eInvalid, eInvalid );
if ( nResist == 0 ) {
int nSaves = Sp_MySavingThrows ( oCreature );
if ( nSaves == 0 ) {
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
ApplyEffectToObject ( DURATION_TYPE_INSTANT, EffectVisualEffect ( 9003 ), oCreature );
ApplyEffectToObject ( DURATION_TYPE_TEMPORARY, eLink1, oCreature, fDuration );
}
}
}
}
oCreature = GetNextObjectInShape ( SHAPE_SPHERE, fRange, GetLocation ( OBJECT_SELF ), FALSE, OBJECT_TYPE_CREATURE );
}
*/
}
break;
/*
MASTER BATTLE MEDITATION
*/
case FORCE_POWER_MASTER_BATTLE_MEDITATION_PC: {
SWFP_HARMFUL = FALSE;
// Bonuses
eLink1 = EffectDamageIncrease ( 4 );
eLink1 = EffectLinkEffects ( eLink1, EffectAttackIncrease ( 4 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectSavingThrowIncrease ( SAVING_THROW_WILL, 4 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectVPRegenModifier ( 50 ) );
eLink1 = SetEffectIcon ( eLink1, 69 );
// float fDuration = Sp_CalcDuration ( 20.0 );
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, SWFP_HARMFUL ) );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
ApplyEffectToObject ( DURATION_TYPE_INSTANT, EffectVisualEffect ( 9002 ), oCreature );
ApplyEffectToObject ( DURATION_TYPE_TEMPORARY, eLink1, oCreature, fDuration );
}
SWFP_HARMFUL = TRUE;
SWFP_PRIVATE_SAVE_TYPE = SAVING_THROW_WILL;
SWFP_SHAPE = SHAPE_SPHERE;
// Penalties
eLink1 = EffectDamageDecrease ( 4 );
eLink1 = EffectLinkEffects ( eLink1, EffectAttackDecrease ( 4 ) );
eLink1 = EffectLinkEffects ( eLink1, EffectSavingThrowDecrease ( SAVING_THROW_WILL, 4 ) );
eLink1 = SetEffectIcon ( eLink1, 69 );
/*
object oCreature = GetFirstObjectInShape ( SHAPE_SPHERE, fRange, GetLocation ( OBJECT_SELF ), FALSE, OBJECT_TYPE_CREATURE );
while ( GetIsObjectValid ( oCreature ) ) {
// This power targets hostile creatures only.
if ( GetIsObjectValid ( oCreature ) &&
GetIsEnemy ( oCreature ) &&
GetRacialType ( oCreature ) != RACIAL_TYPE_DROID ) {
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, SWFP_HARMFUL ) );
// Make Immunity Checks
int nResist = Sp_BlockingChecks ( oCreature, eLink1, eInvalid, eInvalid );
if ( nResist == 0 ) {
int nSaves = Sp_MySavingThrows ( oCreature );
if ( nSaves == 0 ) {
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
ApplyEffectToObject ( DURATION_TYPE_INSTANT, EffectVisualEffect ( 9004 ), oCreature );
ApplyEffectToObject ( DURATION_TYPE_TEMPORARY, eLink1, oCreature, fDuration );
}
}
}
}
oCreature = GetNextObjectInShape ( SHAPE_SPHERE, fRange, GetLocation ( OBJECT_SELF ), FALSE, OBJECT_TYPE_CREATURE );
}
*/
}
break;
case FORCE_POWER_FORCE_BODY:
case FORCE_POWER_IMPROVED_FORCE_BODY:
case FORCE_POWER_MASTER_FORCE_BODY: {
int nFX = 0;
if ( nSpell == FORCE_POWER_FORCE_BODY ) {
nFX = 9011;
}
else if ( nSpell == FORCE_POWER_IMPROVED_FORCE_BODY ) {
nFX = 9012;
}
else if ( nSpell == FORCE_POWER_MASTER_FORCE_BODY ) {
nFX = 9013;
}
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
SWFP_HARMFUL = FALSE;
int nValue = nSpell - FORCE_POWER_FORCE_BODY;
eLink1 = EffectForceBody ( nValue );
eLink1 = SetEffectIcon ( eLink1, 76 + nValue );
// float fDuration = Sp_CalcDuration ( 30.0 );
Sp_ApplyEffects ( FALSE, oCreature, 0.0, 1, eLink1, fDuration, eInvalid, 0.0 );
ApplyEffectToObject ( DURATION_TYPE_INSTANT, EffectVisualEffect ( nFX ), oCreature );
}
}
break;
case FORCE_POWER_INSPIRE_FOLLOWERS_I:
case FORCE_POWER_INSPIRE_FOLLOWERS_II:
case FORCE_POWER_INSPIRE_FOLLOWERS_III:
case FORCE_POWER_INSPIRE_FOLLOWERS_IV:
case FORCE_POWER_INSPIRE_FOLLOWERS_V:
case FORCE_POWER_INSPIRE_FOLLOWERS_VI: {
SWFP_HARMFUL = FALSE;
// float fDuration = Sp_CalcDuration ( 45.0 );
// Calculate the size of the bonus based on the power used.
// It goes from 1 to 6.
int nBonus = nSpell - FORCE_POWER_INSPIRE_FOLLOWERS_I + 1;
// Bonuses
eLink1 = EffectAttackIncrease ( nBonus );
eLink1 = EffectLinkEffects ( eLink1, EffectDamageIncrease ( nBonus ) );
eLink1 = EffectLinkEffects ( eLink1, EffectSavingThrowIncrease ( SAVING_THROW_WILL, nBonus ) );
eLink1 = SetEffectIcon ( eLink1, 85 + nBonus - 1 );
SignalEvent ( oCreature, EventSpellCastAt ( OBJECT_SELF, nSpell, SWFP_HARMFUL ) );
// Remove any lower level or equal versions of this power.
Sp_RemoveRelatedPowers ( oCreature, nSpell );
// Do not apply the effects of this power if a more powerful
// version is already attached to the target.
if ( !Sp_BetterRelatedPowerExists ( oCreature, nSpell ) ) {
ApplyEffectToObject ( DURATION_TYPE_TEMPORARY, eLink1, oCreature, fDuration );
}
}
break;
}
}
oCreature = GetNextObjectInShape ( SHAPE_SPHERE, fRange, GetLocation ( OBJECT_SELF ), FALSE, OBJECT_TYPE_CREATURE );
}
}
}
I appreciate your time. Thank you very much.