thanks!
Attack of the statues...
#1
Posté 05 mai 2011 - 03:46
thanks!
#2
Posté 05 mai 2011 - 06:51
do a loop through all the object in the area, and if it's an Encounter Creature, remove the effect from them..
Use a special function to remove the effect, because you will need to do 2 loops in one script...
You can't use a loop inside a loop or you will get the TMI error (Too Many Instructions)..
If you need help with loops or the custom function let me know..
#3
Posté 06 mai 2011 - 01:17
As far as looping for encounter creatures that could work if you are spawning you statues from an encounter. For some reason I do not think you are.
Here is what I would do. I would give all of your statues the same Tag. then place this script in the OnOpen event for the door.
Just change "TagOfStatue" in the two places in the script to the tag you are useing.
void main()
{
object oStat = GetNearestObjectByTag ("TagOfStatue");
object oDoor = OBJECT_SELF;
int nCount= 1;
effect eLook;
// if the object is valid the statues are still there.
if (GetIsObjectValid(oStat))
{
// Stop the door from opening by reclosing it.
// let the area do it to make sure it gets done. doors are fickle
ActionCloseDoor(oDoor);
// remove the paralisis from the statues.
do
{
eLook = GetFirstEffect(oStat);
while(GetIsEffectValid(eLook))
{
if(GetEffectType(eLook) == EFFECT_TYPE_PETRIFY)
{
SetCommandable(TRUE, oStat);
RemoveEffect(oStat, eLook);
ApplyEffectToObject
(
DURATION_TYPE_PERMANENT,
EffectVisualEffect(VFX_DUR_PROT_STONESKIN),
oStat
);
}
eLook = GetNextEffect(oStat);
}
// change the target for next loop.
nCount = nCount +1 ;
oStat = GetNearestObjectByTag ("TagOfStatue",OBJECT_SELF,nCount);
}while (GetIsObjectValid(oStat));
}
}





Retour en haut






