Jump to content

Home

Editing Force Powers damage


Sneeper

Recommended Posts

Could someone tell me if it's possible to edit the damage of Force Powers, particulary the Lightning, Drain life and Choke. If possible could someone explain me how to do this or direct me to a guide?

 

Thanks in advance.

Link to comment
Share on other sites

After looking at Spells.2da, I can see no way to edit them. Of course, I could be wrong. Anyone care to elaborate?

 

The impactscript column in spells.2da determines what script will run when a force power is activated. These scripts determine what a force power actual does (damage, status effects etc). All the standard force powers in the game use the same impact script (k_sp1_generic.ncs) which then checks which force power/spell was activated and do things accordingly.

 

If you just want to tweak things for your own game and aren't concerned about mod compatibility you can just modify this script directly. The k_sp1_generic script only runs a single custom function, which you can find in the k_inc_force include file (scripts.bif). After changing the include file you need to recompile k_sp1_generic. (You can't compile include files)

 

It's generally easier to ensure compatibility if you change the impact script of the powers you modify to a custom one, and then copy/paste the relevant bits from k_inc_force over there, and then do your changes to that script. That way your changes are kept separate and you won't have to mess with a standard script. It does require you to know a bit about scripting though.

Link to comment
Share on other sites

It just takes a little practice. Just to spur you on, here is a script that will put a serious hurtin' on it's target. It uses all the the drain life effects, then adds paralysis, a green glow, and virulent poisoning. I copied the Drain Life code from k_inc_force, and tinkered with it a little.

 

All you have to do is:

 

Get all the modding tools.

Learn how to compile the script,

Make an icon,

Add a line to the spells.2da file.

Add two lines to dialog.tlk (name and description)

 

It is easier than it sounds, and you'll find youself making a passle of custom force powers in no time! You can read through the tutorals to get the specific details. Here is a good one:

 

http://www.lucasforums.com/showthread.php?s=&threadid=130898

 

For K1:

 

#include "k_inc_force" 

void main() 
{ 

  effect eInvalid;
  object oSource = OBJECT_SELF;
  object oTarget = GetSpellTargetObject();
  SWFP_HARMFUL = TRUE;
           SWFP_PRIVATE_SAVE_TYPE = SAVING_THROW_FORT;
           int nDam = GetHitDice(OBJECT_SELF);
           int nDamTest = GetHitDice(OBJECT_SELF);
           if(nDamTest > 10)
           {
               nDamTest = 10;
           }
           SWFP_DAMAGE = d4(nDamTest);
           SWFP_DAMAGE_TYPE= DAMAGE_TYPE_DARK_SIDE;
           SWFP_DAMAGE_VFX = VFX_PRO_DRAIN;
           //Set up the drain effect link for the target
           effect eBeam = EffectBeam(VFX_BEAM_DRAIN_LIFE, OBJECT_SELF, BODY_NODE_HAND);
           effect eVFX = EffectVisualEffect(SWFP_DAMAGE_VFX);
           effect eVFX1 = EffectVisualEffect(2044, 0);
           //Set up the link to Heal the user by the same amount.
           effect eHeal;
           effect eDamage = EffectDamage(SWFP_DAMAGE, DAMAGE_TYPE_DARK_SIDE);

           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oTarget, fLightningDuration);
           ApplyEffectToObject(1, EffectPoison(POISON_ABILITY_SCORE_VIRULENT), oTarget, 30.0);
           DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget));
           DelayCommand(0.3, ApplyEffectToObject(1, eVFX1, oTarget, 20.0));
           DelayCommand(0.3, ApplyEffectToObject(1, EffectParalyze(), oTarget, 20.0));
           int nResist = Sp_BlockingChecks(oTarget, eDamage, eInvalid, eInvalid);  

           SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), SWFP_HARMFUL));
           if(GetRacialType(oTarget) != RACIAL_TYPE_DROID)
           {
               if(nResist == 0)
               {
                   int nSaves = Sp_MySavingThrows(oTarget);
                   if(nSaves > 0)
                   {
                       SWFP_DAMAGE /= 2;
                   }
                   eDamage = EffectDamage(SWFP_DAMAGE,  DAMAGE_TYPE_DARK_SIDE);
                   if(GetCurrentHitPoints(OBJECT_SELF) < GetMaxHitPoints(OBJECT_SELF) && SWFP_DAMAGE > 0)
                   {
                       eHeal = EffectHeal(SWFP_DAMAGE);
                       ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, OBJECT_SELF);
                   }
                   ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
               }
               else
               {
                   ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectForceFizzle(), OBJECT_SELF);
               }
           }
} 

 

Edit: Removed the eLink stuff from the script.

 

Now, to address your original question some more. The eDamage effect controls the amount of damage the spell does. A simpler way to script damage would be:

 

effect eDamage = EffectDamage(50);

//causes 50 hp damage

ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...