Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

[TSL] Dark/Light Mastery

Page: 1 of 1
 Soulforged
12-03-2006, 12:32 PM
#1
Wich script or file controls the causes and effects of both masteries? I want to erase or reduce them. Is it even possible? Thanks.
 stoffe
12-03-2006, 2:11 PM
#2
Wich script or file controls the causes and effects of both masteries? I want to erase or reduce them. Is it even possible? Thanks.

As far as I know those effects are not scripted but applied internally in the game engine whenever a character's alignment value is either 0 or 100.
 DarthCyclopsRLZ
12-03-2006, 3:19 PM
#3
Mmm.

Would it be possible to script an additional bonus?

I'm thinking of the AdjustCreatureAtrributes, GetClassByPosition and GetGoodEvilValue which would allow to make sure character gets bonuses.

Proverbial catch (well, for this semi-experienced modder) is to enforce those and make sure character doesn't get bonuses more than once (aka every 2 bloody seconds).

Am somewhat comfortable using heartbeat checks, but those work best for feats/powers/classes since you can easily make checks (ie. !GetFeatAcquired).

As to checking for a *scripted* attribute bonus... no idea what the line would be to make a check for a *return* value. Sorry, lol.

***

Of course, you could create a *FP* (regular one or used via armband/stim), thus making it 100 times easier to replace/grant effects and make checks (will be a LOT of those, lol), but I got the impression you wanted to change/remove the mastery bonuses.

With this you could remove the old bonuses via AbilityDecrease and grant new ones.

*Very* *VERY* ugly, I know, but it should work if you make the proper Classes and GoodEvilValue checks. Of course, there's no way you can force anyone to do this, but oh well...

***

But then again, considering how all classes get pretty roxor bonuses except for the the Sith Lord (sentinel on some level, I guess), one could just take the *extremely* lazy way out and give the SithLord a +3 wiz/charisma or whatever upon getting prestige class by modding the a_pc_jedi file.
 Soulforged
12-03-2006, 5:17 PM
#4
As far as I know those effects are not scripted but applied internally in the game engine whenever a character's alignment value is either 0 or 100.
I thought as much. But could it be possible to counter those effects with an script wich checked for the same values and gave the exact same quantity to the attributes and FP but in negative?

Also: Is it possible to adjust the effects of the already existing Force Powers editing the k_inc_force.nss?
 DarthCyclopsRLZ
12-03-2006, 6:48 PM
#5
I thought as much. But could it be possible to counter those effects with an script wich checked for the same values and gave the exact same quantity to the attributes and FP but in negative?

Also: Is it possible to adjust the effects of the already existing Force Powers editing the k_inc_force.nss?

Mmm.

Am about to go out for a jog and then catch a second screening of Casino Royale (Darth Bond PWNZ!!!!), so I'll explain it as fast as I can.

Answering questions in reverse order.

2 - Yes, you can edit k_inc_force.nss. DON'T. Modify the impactscripts collumns in spells.2da instead. Copy/paste what you need and make custom scripts. The only somewhat problematic one is the Droid tree and the effect on mines if you go for a custom include file.

1 - Been working on a bunch of feats-enforcing armbands, so converting it to class checks wasn't much of a stretch. Whipped this up in the last 10-15 minutes, so it's pretty rough.

Didn't bother changing most of the bonuses/penalties, but all classes checks are made for a LS character and the ones I could test work fine. Easiest way to deal with DS would be to change classes values and make a new script. Suppose both sides can be put in same script, but, seriously, I'm *not* in the mood to deal with the semi-headache right now. ;)

The odd 666 duration value is just to remind that armband will have to be used upon entering every zone. Put an insane duration value or DURATION_TYPE_PERMANENT.

Just have an armband/stim use this script (mod the itemcreate files to build on bench or something) and there ya go.

Ugly, but it works. Oh, and some of the commands come from something Stoffe scripted a while back. Kuddos to her.



//DC CLASS TRY

void ST_RemoveOldEffects(object oTarget, int iSpellId);
void DC_EnforceGoodEvil(object oTarget, int iSpellId, float fTimer);


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

effect eBonus;

float fDuration = 666.0;

int iGood = GetGoodEvilValue(OBJECT_SELF);

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




if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDIGUARDIAN)
&& (GetClassByPosition(2, OBJECT_SELF) == CLASS_TYPE_JEDIWEAPONMASTER)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_STRENGTH, 6);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_CONSTITUTION, 6));
}



else if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDIGUARDIAN)
&& (GetClassByPosition(2, OBJECT_SELF) == CLASS_TYPE_JEDIWATCHMAN)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_DEXTERITY, 6);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_INTELLIGENCE, 6));
}



else if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDIGUARDIAN)
&& (GetClassByPosition(2, OBJECT_SELF) == CLASS_TYPE_JEDIMASTER)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_WISDOM, 6);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_CHARISMA, 6));
}



else if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDISENTINEL)
&& (GetClassByPosition(2, OBJECT_SELF) == CLASS_TYPE_JEDIWEAPONMASTER)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_STRENGTH, 6);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_CONSTITUTION, 6));
}


else if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDISENTINEL)
&& (GetClassByPosition(2, OBJECT_SELF) == CLASS_TYPE_JEDIWATCHMAN)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_DEXTERITY, 6);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_INTELLIGENCE, 6));
}


else if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDISENTINEL)
&& (GetClassByPosition(2, OBJECT_SELF) == CLASS_TYPE_JEDIMASTER)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_WISDOM, 6);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_CHARISMA, 6));
}


else if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDICONSULAR)
&& (GetClassByPosition(2, OBJECT_SELF) == CLASS_TYPE_JEDIWEAPONMASTER)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_STRENGTH, 6);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_CONSTITUTION, 6));
}


else if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDICONSULAR)
&& (GetClassByPosition(2, OBJECT_SELF) == CLASS_TYPE_JEDIWATCHMAN)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_DEXTERITY, 6);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_INTELLIGENCE, 6));
}


else if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDICONSULAR)
&& (GetClassByPosition(2, OBJECT_SELF) == CLASS_TYPE_JEDIMASTER)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_WISDOM, 6);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_CHARISMA, 6));
}



else if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDIGUARDIAN)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_STRENGTH, 3);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_CONSTITUTION, 3));
}


else if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDISENTINEL)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_STRENGTH, 3);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_CONSTITUTION, 3));
}


else if ((GetClassByPosition(1, OBJECT_SELF) == CLASS_TYPE_JEDICONSULAR)
&& (iGood = 100)) {
eBonus = EffectAbilityDecrease(ABILITY_STRENGTH, 3);
eBonus = EffectLinkEffects(eBonus, EffectAbilityIncrease(ABILITY_CONSTITUTION, 3));
}



if (GetIsEffectValid(eBonus)) {
// ST: If the ability is already active, remove existing effects
// before re-applying new ones.
ST_RemoveOldEffects(oTarget, GetSpellId());

// ST: Apply the effect
effect eVis = EffectVisualEffect(9013);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonus, oTarget, fDuration);

// DC: cancel effect if player loses mastery
DC_EnforceGoodEvil(oTarget, GetSpellId(), fDuration);
}
}






void DC_EnforceGoodEvil(object oTarget, int iSpellId, float fTimer) {

int iGood = GetGoodEvilValue(OBJECT_SELF);

if (GetIsObjectValid(oTarget) && GetHasSpellEffect(iSpellId, oTarget)) {
if ((iGood < 100))

{
ST_RemoveOldEffects(oTarget, iSpellId);
return;
}

if (fTimer > 0.0) {
DelayCommand(1.0, DC_EnforceGoodEvil(oTarget, iSpellId, fTimer - 1.0));
}
}
}



void ST_RemoveOldEffects(object oTarget, int iSpellId) {
if (GetHasSpellEffect(iSpellId, oTarget)) {
effect eEff = GetFirstEffect(oTarget);

while (GetIsEffectValid(eEff)) {
if( GetEffectSpellId(eEff) == iSpellId) {
RemoveEffect(oTarget, eEff);
}
eEff = GetNextEffect(oTarget);
}
}
}


Oh well. Have fun with this.

Cheers,

DC
 Soulforged
12-03-2006, 8:44 PM
#6
2 - Yes, you can edit k_inc_force.nss. DON'T. Modify the impactscripts collumns in spells.2da instead. Copy/paste what you need and make custom scripts. The only somewhat problematic one is the Droid tree and the effect on mines if you go for a custom include file.Thanks, but does that means that I can edit the k_inc_force.nss then put it into the override folder and the values would have been changed or instead nothing happens or worse it provoques a crash?
 DarthCyclopsRLZ
12-03-2006, 11:49 PM
#7
1 - Off-topic, but I am reiterating that Casino Royale rocks. God bless quiet sunday nights at the theater with no kids. :D

2 - As for the question, no, it's not gonna crash unless you REALLY mess up some of the FPs (like removing area effect lines, lol).

I was merely giving advice. K_inc_force is pretty much a mess of a file. If you want to do customizing that goes beyond (*cough* recommended *cough*) fixing damage and bonuses, you're MUCH better off with custom scripts.

Seriously, short of the Interative damage and RemoveRelatedPowers features, there's not much going on for that file...

Oh, and I *might* recheck that script in the morning before heading off and try to add the DS values.

Cheers,

DC
Page: 1 of 1