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.

[KotOR]Wookiee Rage and other Special Abilities

Page: 1 of 1
 jinger
03-05-2008, 11:01 AM
#1
I'm giving Zaalbar his special ability and I thought I'd ask a little about them special spells. Am I right to assume there's no way to use that Special Ability utc field? If so, I've been thinking to let the whole thing be scripted and used by wookiees automatically with a subrace check, as opposed to a magic wand (stim) which would be usable by wookiees alone, say once every two minutes, and that would sadly show on the item panel. What do you think?
 jinger
03-05-2008, 8:14 PM
#2
Done. I put this in GN_DetermineCombatRound.int EnterWookieeRage()
{
if( (GetSubRace(OBJECT_SELF) == SUBRACE_WOOKIE) &&
(GetHPRatio() <= 0.4) && (Random(100) < 25) &&
GetHasSpell(SPECIAL_ABILITY_RAGE) && !GetHasSpellEffect(SPECIAL_ABILITY_RAGE) )
{
ClearAllActions();
ActionUseTalentOnObject(TalentSpell(SPECIAL_ABILIT Y_RAGE), OBJECT_SELF);
return TRUE;
}
return FALSE;
}I have found that even if you can't select them, the spells you give a non-jedi creature are recognized by the game nonetheless, and can be used via script. So I made special abilities kind of instinctual, like a reflex. Though I don't think this sucks too much, other ideas are always welcome :)
 Q
03-05-2008, 8:57 PM
#3
This is a good idea. I'll be sure to give it a try when you release it.
 Darth Payne
03-05-2008, 9:17 PM
#4
I agree, might make me want to use Zaalbar more.
 jinger
03-06-2008, 2:47 PM
#5
Zaalbar's rage actually sucks, I blended that with Hanharr's and gave him: +4Str, +2VP per Lev, +2Will&Fort, -4AC, immunity to paralysis, and one extra attack.
int AssumePsychicStance()
{
if( (GetStandardFaction(OBJECT_SELF) == STANDARD_FACTION_FRIENDLY_1) &&
GetHasSpell(SPECIAL_ABILITY_PSYCHIC_STANCE) &&
(GetGlobalNumber("CONFUSION_CURRENT") < GetHitDice(OBJECT_SELF)/2) )
{
int nFoes, nAllies;
location loc = GetLocation(OBJECT_SELF);
object oCreature = GetFirstObjectInShape(SHAPE_SPHERE, 8.0, loc, TRUE, OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oCreature))
{
if( (GetRacialType(oCreature) != RACIAL_TYPE_DROID) && !GetIsDead(oCreature) )
{
if(GetIsEnemy(oCreature)) ++nFoes;
else if(GetIsFriend(oCreature)) ++nAllies;
}
oCreature = GetNextObjectInShape(SHAPE_SPHERE, 8.0, loc, TRUE, OBJECT_TYPE_CREATURE);
}
if(nFoes < 2) return FALSE;
nFoes-=nAllies;
if(nFoes < 1) nFoes = 1;
if(GetHPRatio()/IntToFloat(nFoes) <= 0.2) //1 at full health versus 5 or more
{
ClearAllActions();
ActionUseTalentOnObject(TalentSpell(SPECIAL_ABILIT Y_PSYCHIC_STANCE),OBJECT_SELF);
return TRUE;
}
}
return FALSE;
}Here's Psychic Static, any bugs you can think of? This triggers the special ability whenever Jolee is outnumbered in a range of 8 meters, which is the power's area of effect. It won't be used in combat with Revan and Bastila, applying confusion to a party member would mean to get them out of the party, then join them back later; that'd be trouble, I guess. case SPECIAL_ABILITY_PSYCHIC_STANCE:
{
SWFP_HARMFUL = TRUE;
float fDuration = IntToFloat(6*GetHitDice(oTarget));
int nCurrent = GetGlobalNumber("CONFUSION_CURRENT");
int nRemaining = GetHitDice(oTarget)/2-nCurrent;
int nCnt;
location loc = GetLocation(oTarget);
object oCreature = GetFirstObjectInShape(SHAPE_SPHERE, 8.0, loc, TRUE, OBJECT_TYPE_CREATURE);
while( (nCnt < nRemaining) && GetIsObjectValid(oCreature) )
{
if(GetIsEnemy(oCreature) && (GetRacialType(oCreature) != RACIAL_TYPE_DROID) && !GetIsDead(oCreature) )
{
SignalEvent(oCreature, EventSpellCastAt(oTarget, GetSpellId(), SWFP_HARMFUL));
int nRoll = Random(100);
if(nRoll < 80)
{
++nCnt;
int nFaction = GetStandardFaction(oCreature);
DelayCommand(fDuration,ChangeToStandardFaction(oCr eature,nFaction));
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(8003), oCreature);
if(nRoll < 40)
{
ChangeToStandardFaction(oCreature, STANDARD_FACTION_FRIENDLY_1);
AssignCommand(oCreature, ClearAllActions());
AssignCommand(oCreature, GN_DetermineCombatRound());
}
else
{
ChangeToStandardFaction(oCreature, STANDARD_FACTION_NEUTRAL);
AssignCommand(oCreature, ClearAllActions());
FaceObjectAwayFromObject(oCreature, oTarget);
}
}
}
oCreature = GetNextObjectInShape(SHAPE_SPHERE, 8.0, loc, TRUE, OBJECT_TYPE_CREATURE);
}
SetGlobalNumber("CONFUSION_CURRENT",nCurrent+nCnt);
DelayCommand(fDuration,UpdateGlobalNumber("CONFUSION_CURRENT",-nCnt));
}The Psychic Static effect doesn't seem to work, I had to rewrite the spell. According to the description of the spell: 40% chance the organic turns friendly, 40% neutral, 20% stays hostile. I limited the number of targets you can keep under the spell with a global number, that is, one each two levels, to a maximum of ten… yeah maybe that's too many.

Due to lack of TSL-like visual effects, I don't think I can make Battle Meditation. Body Fuel (Force Body) would have been easy to make, but the description says it's Bastila's, that's too many special abilities in one person. I'd hand it over to Juhani, since she has more vitality points to speak of, being a guardian, but then again she too has her own special power already. So I guess that's it, there ain't laigreks or storm beasts in K1, no monster abilities. Still now every npc who was said to have a talent actually uses it.

EDIT: Psychic Static still needs work. Should you save the game and reload, or change area, it would screw the whole thing up, I need some other way to create the faction modifier effect. Since local numbers don't seem to work, I've been thinking how and where to store the original faction number, so that it may be used to turn creatures back to normal. I could create an invisible placeable to control the area with heartbeats, set a number on each creature to keep track of time and original faction and so forth. Creature XP? Item cost? What else has a number you can set?

"Help! Please! Over here! Under the wreckage!"

Edit2: Works fine with the placeable. Now whenever Jolee enters an area the global is set to 0 and any creature under the spell, say from a battle before, is disenchanted. When you cast the spell, on the targets is stored a WORD with their original faction and a counter, and an invisible placeable is created that updates the counters at each heartbeat. When a counter is 0 the creature turns back to normal and the global is updated. The placeable self-destructs as soon as it runs out of creatures to check. I used creature XP to store the numbers. Better ideas?
 jinger
03-10-2008, 2:50 AM
#6
I still had a lot of trouble with Psychic Static, but I managed to get it working by other means. I used shouts, specifically I used listen pattern numbers to keep track of the original faction and the heartbeats of an invisible placeable to shout a string which those under the spell are set to listen for. That's quite efficient, I thought I'd share the solution.//This is from k_inc_generic, I wrote this to trigger the ability in the body of GN_DetermineCombatRound.
//With 25% chance, Jolee activates Psychic Static if he is outnumbered in a range of 8 meters.
//The action is not worth the round if he can't affect at least two creatures. Maximum is six.
//Makes sure never to use it against the player.
int AssumePsychicStance()
{
if( GetHasSpell(SPECIAL_ABILITY_PSYCHIC_STANCE) && (Random(100) < 25) &&
GetIsFriend(GetFirstPC()) && (GetGlobalNumber("CONFUSION_CURRENT") < 5) )
{
int nFoes, nAllies;
location loc = GetLocation(OBJECT_SELF);
object oCreature = GetFirstObjectInShape(SHAPE_SPHERE, 8.0, loc, TRUE, OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oCreature))
{
if( (GetRacialType(oCreature) != RACIAL_TYPE_DROID) && !GetIsDead(oCreature) )
{
if(GetIsEnemy(oCreature)) ++nFoes;
else if(GetIsFriend(oCreature)) ++nAllies;
}
oCreature = GetNextObjectInShape(SHAPE_SPHERE, 8.0, loc, TRUE, OBJECT_TYPE_CREATURE);
}
if(nFoes < 2) return FALSE;
nFoes-=nAllies;
if(nFoes < 1) nFoes = 1;
if(GetHPRatio()/IntToFloat(nFoes) <= 0.2) //1 versus 5 at full health
{
ClearAllActions();
ActionUseTalentOnObject(TalentSpell(SPECIAL_ABILIT Y_PSYCHIC_STANCE),OBJECT_SELF);
return TRUE;
}
}
return FALSE;
}

//This is from k_inc_force, Sp_RunForcePowers()
//I had the effects last 2 rounds plus one each four character levels, that is a short while
//at low levels (18 seconds) and a reasonably long while at level 20 (42 seconds)
//I also limited to 6 the number of creatures Jolee can keep under the spell,
//all in all it's reasonable, in TSL Force Confusion is a prestige power
//and can affect just one creature at a time
case SPECIAL_ABILITY_PSYCHIC_STANCE:
{
SWFP_HARMFUL = TRUE;
int nCurrent = GetGlobalNumber("CONFUSION_CURRENT");
int nRemaining = 6 - nCurrent;
int nCnt, nRoll, nFaction;
location loc = GetLocation(oTarget);
object oCreature = GetFirstObjectInShape(SHAPE_SPHERE, 8.0, loc, TRUE, OBJECT_TYPE_CREATURE);
while( (nCnt < nRemaining) && GetIsObjectValid(oCreature))
{
if( GetIsEnemy(oCreature) && (GetRacialType(oCreature) != RACIAL_TYPE_DROID) && !GetIsDead(oCreature) )
{
nRoll = Random(100);
if(nRoll < 80)
{
++nCnt;
SetListening(oCreature, TRUE);
SetListenPattern(oCreature,"PSYCHIC_STATIC", 100 + GetStandardFaction(oCreature));
nFaction = STANDARD_FACTION_FRIENDLY_1;
if(nRoll < 40) nFaction = STANDARD_FACTION_NEUTRAL;
ChangeToStandardFaction(oCreature,nFaction);
eLink1 = EffectPsychicStatic();
eLink1 = SetEffectIcon(eLink1,0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, oCreature, RoundsToSeconds(GetHitDice(oTarget)/4 + 2));
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(8003), oCreature);
}
}
oCreature = GetNextObjectInShape(SHAPE_SPHERE, 8.0, loc, TRUE, OBJECT_TYPE_CREATURE);
}
if(nCnt > 0)
{
SetGlobalNumber("CONFUSION_CURRENT",nRemaining - nCnt);
if(!GetIsObjectValid(GetObjectByTag("plc_confusion"))) CreateObject(OBJECT_TYPE_PLACEABLE,"plc_confusion",loc);
}
}
break;

//This is the heartbeat of the placeable
void main()
{
SpeakString("PSYCHIC_STATIC");
object oCreature = GetFirstObjectInArea();
while(GetIsObjectValid(oCreature))
{
if(GetHasSpellEffect(SPECIAL_ABILITY_PSYCHIC_STANC E,oCreature)) return;
oCreature = GetNextObjectInArea();
}
DestroyObject(OBJECT_SELF);
}


//And this is from k_ai_master
//Switches the creature back to normal if spell effects are expired.
//I had Psychic Static listen pattern numbers offset by 100 the original faction of the creature.
case 1004: //KOTOR_DEFAULT_EVENT_ON_DIALOGUE
{
int nMatch = GetListenPatternNumber();
if(nMatch > 99)
{
ResetDialogState();
if(!GetHasSpellEffect(SPECIAL_ABILITY_PSYCHIC_STAN CE))
{
int nCurrent = GetGlobalNumber("CONFUSION_CURRENT");
if(nCurrent > 0) SetGlobalNumber("CONFUSION_CURRENT",nCurrent - 1);
ChangeToStandardFaction(OBJECT_SELF,nMatch - 100);
GN_DetermineCombatRound();
}
return;
}
I went through all this trouble :D but the spell is kind of cool, it deserved restoring.
 WRFan
06-27-2009, 1:51 PM
#7
I also tried to fix the cut henchmen abilities, both in Kotor 1 and Kotor 2 (Obsidian didn't remove the abilities introduced by Bioware). Don't care much about Zaalbar's rage, but I was checking out the following powers:

Body Fuel (Bastila, regenerates ALL of her FP every round, loses vitality points when casting, very similar to Body Fuel in TSL)

Enhanced Senses (Awareness skill increase, True Seeing, Cathar ability for Juhani)

PSYCHIC_STANCE (Jolee ability, effect EffectConfused).

The abilities are all broken. Psychic stance doesn't work at all, as pointed out by the poster above, Body Fuel actually works, but there's no penalty for casting spells while under the effect of this spell (no vitality point loss), so it makes the game too easy and the spell too powerful.

Enhanced senses spell contains an error - the effects are not properly linked, so the True Seeing effect is not applied - Kotor TSL k_inc_force.nss:


effect eAC = EffectACDecrease(6);
effect eAware = EffectSkillIncrease(SKILL_AWARENESS, 10);
effect eSee = EffectTrueSeeing();
eLink1 = EffectLinkEffects(eAC, eAware);
eLink1 = EffectLinkEffects(eLink1, eAware);


see the error? Awareness increase is linked twice and the True Seeing effect isn't linked at all. Can be fixed, but the spell is not very useful
 DarthCyclopsRLZ
06-27-2009, 4:26 PM
#8
Well, there's a reason all of these weren't in the final game.

As lazy as it sound, you might want to consider going the cheap route and just giving your character personalized armbands that can only be equipped after some requirements (say, dummy feats given either with feat.2da (non-jedi) or conditional scripted events).
 Allronix
06-28-2009, 1:56 AM
#9
Well, who says we need to give these abilities only to our friends? body Fuel scripted into say, Uthar or Jorak Uln, could make for a good headache.

I wouldn't be surprised that Zaalbar has a weaker version of rage. He's still a young fellow by Wookiee standards, and a hell of a lot saner. (One reason I prefer K1, the crew didn't make me squirm). All bets are off if you play DS and take his little buddy out of the picture, though.
Page: 1 of 1