I'm looking for a script that will see if the player and/or all members of the party - ASSOCIATE_TYPE_ANIMALCOMPANION, ASSOCIATE_TYPE_DOMINATED, ASSOCIATE_TYPE_FAMILIAR, ASSOCIATE_TYPE_HENCHMAN and ASSOCIATE_TYPE_SUMMONED - are invisible.
This is a requirement for sneaking through a particular section and if the player and all associated members of the party are also invisible, they can get past without triggering conversations or particular events.
Now I've fiddled with a few scripts on my own, attempting to put something together, which I'll post below but if there's an easier way to check I'd like to hear it and also get some help in putting it to working order.
#1 is a conditional script for conversations. In this case, when the player clicks on the NPCs that they would need to sneak past, the NPC should detect no one. Currently, I have it working with the NPC only but the problem is, it works even when other party members are NOT invisible - the NPCs conversation line just fires a random "Huh? Is someone there?" type of line when the PC is has either spell applied (#3 below I hope will solve all party members).
int StartingConditional()
{
object oPC = GetFirstPC();
// CHECKING FOR INVISIBILITY SPELLS
object oAC = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC);
object oD = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
object oF = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
object oH = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oPC);
object oS = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);
if (! (GetHasSpellEffect(SPELL_INVISIBILITY, oPC)) || (GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE, oPC)) ) return FALSE;
return TRUE;
}
#2 is a variation of the above script, used for a trigger that would fire an event if the player and/or party is not invisible.
void main()
{
object oPC = GetFirstPC();
object oAC = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC);
object oD = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
object oF = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
object oH = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oPC);
object oS = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);
if (
( (GetHasSpellEffect(SPELL_INVISIBILITY, oPC)) || (GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE, oPC)) ) &&
( (GetHasSpellEffect(SPELL_INVISIBILITY, oAC)) || (GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE, oAC)) ) &&
( (GetHasSpellEffect(SPELL_INVISIBILITY, oD)) || (GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE, oD)) ) &&
( (GetHasSpellEffect(SPELL_INVISIBILITY, oF)) || (GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE, oF)) ) &&
( (GetHasSpellEffect(SPELL_INVISIBILITY, oH)) || (GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE, oH)) ) &&
( (GetHasSpellEffect(SPELL_INVISIBILITY, oS)) || (GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE, oS)) ) )
{
AssignCommand(GetObjectByTag("250B10_NPC3"), SpeakString("Keep a sharp eye for anything out of the ordinary!"));
return;
}
else
{
// OTHER EVENTS - PARTY SPOTTED
}
}
#3 is simply a revision of #1, using the Bioware InvisibleTrue function that comes with the "nw_i0_generic" include.
#include "nw_i0_generic"
int StartingConditional()
{
object oPC = GetPCSpeaker();
object oAC = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC);
object oD = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
object oF = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
object oH = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oPC);
object oS = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);
int nPC = InvisibleTrue(oPC);
int nAnimalCompanion = InvisibleTrue(oAC);
int nDominated = InvisibleTrue(oD);
int nFamiliar = InvisibleTrue(oF);
int nHenchman = InvisibleTrue(oH);
int nSummoned = InvisibleTrue(oS);
if ( (nPC == TRUE) &&
(nAnimalCompanion == TRUE) &&
(nDominated == TRUE) &&
(nFamiliar == TRUE) &&
(nHenchman == TRUE) &&
(nSummoned == TRUE)) return TRUE;
return FALSE;
}
Is there an easier way to do this or a function already that was written by Bioware that such scripts are not required?
I suppose I'd like to go the route of using the InvisibleTrue function as it supports - EFFECT_TYPE_INVISIBILITY/IMPROVED, STEALTH, SANCTUARY and ETHEREAL
FP!





Retour en haut







