Jump to content

Home

Any way to edit force power damage?


dh-vug

Recommended Posts

I'm trying to increase the maximum damage of Force Lightning and Force Storm, but I can't find any game file which determines force power damage/effects. I've tried all the 2da's, but the nearest I got was the casting time in Spells.2da. Is the file somewhere in there, or is it hard-coded into the game?

Link to comment
Share on other sites

I could be wrong here, but I think most of the damage (and other effects) from "spells"/force powers are handled in scripts.

 

If I remember right, they call out to k_sp1_generic.ncs, which compiles with both k_inc_debug (error handling and other junk) and k_inc_force.

 

That include script is where most of the action goes on for force powers.

 

Force storm for example is as follows by default:

 


       /*
       FORCE STORM
       */
       case FORCE_POWER_FORCE_STORM:
       {
           SWFP_HARMFUL = TRUE;
           SWFP_PRIVATE_SAVE_TYPE = SAVING_THROW_WILL;
           int nDamage = GetHitDice(OBJECT_SELF);
           if(nDamage > 10)
           {
               nDamage = 10;
           }
           SWFP_DAMAGE = d6(nDamage);
           SWFP_DAMAGE_TYPE = DAMAGE_TYPE_ELECTRICAL;
           effect eBeam = EffectBeam(2061, OBJECT_SELF, BODY_NODE_HEAD);
           effect eVis = EffectVisualEffect(VFX_PRO_LIGHTNING_L);
           effect eForce;
           effect eDam;
           object oUse = GetFirstObjectInShape(SHAPE_SPHERE, 12.0, GetLocation(oTarget), FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE);
           while(GetIsObjectValid(oUse))
           {
               //Make Immunity Checks
               if(GetIsEnemy(oUse))
               {
                   SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), SWFP_HARMFUL));
                   if(!ResistForce(OBJECT_SELF, oUse))
                   {
                       ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oUse);
                       ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oUse, fLightningDuration);
                       if(!WillSave(oUse, Sp_GetJediDCSave()))
                       {
                           eDam = EffectDamage(SWFP_DAMAGE, SWFP_DAMAGE_TYPE);
                           eForce = EffectDamageForcePoints(SWFP_DAMAGE);
                           ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oUse);
                           ApplyEffectToObject(DURATION_TYPE_INSTANT, eForce, oUse);
                       }
                       else
                       {
                           eDam = EffectDamage(SWFP_DAMAGE/2, SWFP_DAMAGE_TYPE);
                           eForce = EffectDamageForcePoints(SWFP_DAMAGE/2);
                           ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oUse);
                           ApplyEffectToObject(DURATION_TYPE_INSTANT, eForce, oUse);
                       }
                   }
                   else
                   {
                       ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectForceFizzle(), OBJECT_SELF);
                   }
               }
               oUse = GetNextObjectInShape(SHAPE_SPHERE, 12.0, GetLocation(oTarget), FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_PLACEABLE);
           }
       }
       break;

 

If you increase the ammount of damage in the applicable lines above, then save the nss file (in the kotor modification for the NWN toolset thingy) and then re-compile k_sp1_generic.nss and THEN copy the compiled ncs file back over into the override folder, you SHOULD get what you're after. :)

 

-Kitty

Link to comment
Share on other sites

Hmm, doing that made everyone force buffs like speed and Valor have no effect whatsoever.

I used Kotor Tool to extract k_sp1_generic.nss, k_inc_force.nss, and k_inc_debug.nss to Override.

I then opened k_inc_force.nss with Notepad and changed the part which limits Force Storm damage at 10d6 to

 

int nDamage = GetHitDice(OBJECT_SELF);

if(nDamage > 20)

{

nDamage = 20;

}

 

to increase damage to 20-120. Then saved the file, compiled k_sp1_generic.nss, and move it to my Override folder.

This is my first attempt at modifying scripts so I'm pretty certain I did something wrong. :rolleyes:

Link to comment
Share on other sites

Yep. The command line compiler has some bugs (or at least twitchy behavior) that causes it to compile some scripts wrong.

 

I always use the NWN toolset with the Kotor! module. It seems to work a lot better. But the advice above about setting the version on the command line one might do the trick fine too.

 

-Kitty

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...