Timestop portrait

I've written an override for the timestop spell, which freezes, paralyzes and immobilizes (all done with the cutscreen functions) every creature in the area.
The latest addition to this script I've tinkered with is the change of the portrait of whoever is affected by it.
I'm trying to change the portrait to the actual Time Stop portrait used in the game, but this is nowhere to be found in 2da's or anywhere else. Hence it must be hardcoded into the engine itself for use when EffectTimeStop(); is called. The Portrait overhaul project on https://nwn.wiki/display/NWNOP/Overhaul+Portraits mentions "po_timestop", however when calling this via the SetPortraitResRef function you end up with the Null Human (Default) portrait instead.
Here's the code, any ideas on how to set the timestop portrait is welcome. Feel free to use the code as you like.
The latest addition to this script I've tinkered with is the change of the portrait of whoever is affected by it.
I'm trying to change the portrait to the actual Time Stop portrait used in the game, but this is nowhere to be found in 2da's or anywhere else. Hence it must be hardcoded into the engine itself for use when EffectTimeStop(); is called. The Portrait overhaul project on https://nwn.wiki/display/NWNOP/Overhaul+Portraits mentions "po_timestop", however when calling this via the SetPortraitResRef function you end up with the Null Human (Default) portrait instead.
Here's the code, any ideas on how to set the timestop portrait is welcome. Feel free to use the code as you like.
//:://///////////////////////////////////////////// //:: Time Stop //:: NW_S0_TimeStop.nss //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* All persons in the Area are frozen in time except the caster. */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: Jan 7, 2002 //::////////////////////////////////////////////// #include "x2_inc_spellhook" void main() { /* Spellcast Hook Code Added 2003-06-20 by Georg If you want to make changes to all spells, check x2_inc_spellhook.nss to find out more */ if (!X2PreSpellCastCode()) { // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell return; } // End of Spell Cast Hook //Declare major variables location lTarget = GetSpellTargetLocation(); effect eVis = EffectVisualEffect(VFX_FNF_TIME_STOP); effect ePara = EffectCutsceneParalyze(); effect eImob = EffectCutsceneImmobilize(); effect eFreeze = EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION); object oCaster = OBJECT_SELF; object oTarget; object oArea = GetArea(oCaster); string sPortrait; //Fire cast spell at event for the specified target SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_TIME_STOP, FALSE)); ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lTarget); //Apply the VFX impact and effects oTarget = GetFirstObjectInArea(oArea); while (GetIsObjectValid(oTarget)) { if (oTarget != oCaster) { sPortrait = GetPortraitResRef(oTarget); SetLocalString(oTarget, "PORTRAIT", sPortrait); SetPortraitResRef(oTarget, "po_timestop"); DelayCommand(0.50, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFreeze, oTarget, 12.0)); DelayCommand(0.50, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePara, oTarget, 12.0)); DelayCommand(0.50, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eImob, oTarget, 12.0)); DelayCommand(12.0, SetPortraitResRef(oTarget, GetLocalString(oTarget, "PORTRAIT"))); } oTarget = GetNextObjectInArea(oArea); } }
0
Comments
I'll take a look with the resource extractor I have, maybe I can find the portrait.
I know for sure that you can get it to work with nwnx, because I played for years on a server that did it. I don't know anything about how to use nwnx though.
The best I got was to change to a unused portrait like po_btlbomb_. It's a hand-drawn TEMP. Looks tacky, but you could find something else.
My other idea was to add a line to the portraits.2da then use SetPortraitId(). I haven't tried that yet. It might end with the same results.
However if the EffectTimeStopImmunity is applied globally, wouldn't that also not apply the timestop portrait? As for timers, not sure if it would change much, since noone is affected by it other than the module clock.
We had a weird bug in 1.69 where time stood still upon module load, when EffectTimestop was cast as per unmodified bioware spell, the clock would skip to the current time, affecting daylight and timestap on compass. This isn't a problem in NWN:EE though.
Giving the global immunity should work like normal for those that get the immunity removed for the duration of the spell.
I'm imagining adding the immunity in the main when a player first joins script, and in all the onspawn scripts.
I'm (still) disappointed in how hard it is to work with Time Stop.