Jump to content

Home

altering light side/ dark side bonuses


souder

Recommended Posts

I want to change the LS/DS bonuses for being totally dark or light to a smooth scale. This way you get partial bonuses for being partially light or dark. that way players can be in the grey area and be cheated out of the bonuses.

However i cant seem to find the files that manage this, if someone can help me out, i'd really appreciate it.

 

Thanx

Link to comment
Share on other sites

I want to change the LS/DS bonuses for being totally dark or light to a smooth scale. This way you get partial bonuses for being partially light or dark. that way players can be in the grey area and be cheated out of the bonuses.

However i cant seem to find the files that manage this, if someone can help me out, i'd really appreciate it.

 

Thanx

I think it may be in a .2da file. Ah... Use the KotOR Tool, and look in the .2da files. I will bet you can find something close to this.
Link to comment
Share on other sites

As said, Light/Darkside Mastery is handled internally by the Alignment system, which is hardcoded in the game engine. There is no mechanism for changing what bonuses are given, or changing when they appear.

 

The best you could do as a workaround would probably be to have a script checking the GoodEvilValue of the player/party members and apply different effects to them depending on what the value is. But it's a rather clumsy and far from perfect solution.

Link to comment
Share on other sites

Thanx, the script thing is prolly my only option if the actual mastery bonus code is hard coded. BTW if someone can tell me how to get a script to trigger when the main character dies, it would help me a lot. I made an arm band with Atton's SPIRIT feat on it and got it working for the NPC's, by adding the attonspirit script to their OnDeath field, but i dont know how to add it to the main character.

Link to comment
Share on other sites

BTW if someone can tell me how to get a script to trigger when the main character dies, it would help me a lot. I made an arm band with Atton's SPIRIT feat on it and got it working for the NPC's, by adding the attonspirit script to their OnDeath field, but i dont know how to add it to the main character.

 

As far as I can tell the Player Character does not have an OnDeath AI script assigned to it.

 

There is a module script event, "OnPlayerDeath" (Mod_OnPlrDeath field in a GFF Editor) which should fire when the player dies, though in the case of KotOR I am unsure if it fires when the main character dies or when the entire party goes down. In either case, using it would be highly unpractical since it has to be set in the module.ifo file for every single module in the game independently.

 

The best workaround I can think of would be to modify the combat AI for your other party members to work as a monitor for the main character's health. Thus, if the main character dies, the AI of your party members notice and revive her again. While this would only work when you have other members in the party, that isn't a problem for the "Spirit" feats since they are only supposed to work if there are other party members still standing anyway.

 

A function like this, if called from either the CombatRound-script of the party members, or from GN_DetermineCombatRound(), would probably work:

 

void ST_CheckRevivePlayer() { 
   // Only make party members do this.
   if (!IsObjectPartyMember(OBJECT_SELF))
       return;

   object oTarget = GetFirstPC();

   // Abort if the main character could not be located yet.     
   if(!GetIsObjectValid(oTarget))
       return;

   // The main character shouldn't run this on themselves...
   if (oTarget == OBJECT_SELF)
       return;    

   // If I'm dead myself, no point doing this...
   if ((GetCurrentHitPoints(OBJECT_SELF) < 1) || GetIsDead(OBJECT_SELF))
       return;

   // If the main character isn't dead, no point continuing...
   if ((GetCurrentHitPoints(oTarget) > 0) && !GetIsDead(oTarget))
       return;

   // Only proceed if the main character has one of the feats...
   if (   !GetHasFeat(FEAT_SPIRIT, oTarget) 
       && !GetHasFeat(FEAT_FIGHTING_SPIRIT, oTarget) 
       && !GetHasFeat(FEAT_HEROIC_RESOLVE, oTarget)) 
   {
       return;
   }

   // Check to see if any other party member is still alive.
   int bPartyNotDead = FALSE;
   int nIdx = 0;
   object oParty = GetPartyMemberByIndex(nIdx);
   while (GetIsObjectValid(oParty)) {
       if ((GetCurrentHitPoints(oParty) > 0) 
           && !GetIsDead(oParty)
           && GetIsInCombat(oParty, TRUE)) 
       {
           bPartyNotDead = TRUE;
           break;
       }
       oParty = GetPartyMemberByIndex(++nIdx);
   }

   // Someone was alive, attempt to revive the main character.
   if (bPartyNotDead) {
       if (GetCurrentHitPoints(oTarget) < 1) {
           int nHPPercent = 0;
           if( GetHasFeat(FEAT_HEROIC_RESOLVE, oTarget) )
               nHPPercent = 30;
           else if( GetHasFeat(FEAT_FIGHTING_SPIRIT, oTarget) )
               nHPPercent = 20;
           else if( GetHasFeat(FEAT_SPIRIT, oTarget) )
               nHPPercent = 10;

           ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(nHPPercent), oTarget);
           AssignCommand(oTarget, ClearAllActions());
       }

       // Kickstart combat AI again if not player controlled...
       if (!GetIsPartyLeader(oTarget))
           DelayCommand(4.0, ExecuteScript("k_ai_master", oTarget, 2003));
   }
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...