Aller au contenu

Photo

RemoveSpecificEffect


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Quevy

Quevy
  • Members
  • 68 messages
void main()
{
    // Get the creature who triggered this event.
    object oPC = GetEnteringObject();
 
    // Only fire for (real) PCs.
    if ( !GetIsPC(oPC)  ||  GetIsDMPossessed(oPC) )
        return;
 
    // Remove all effects of a specified type.
    RemoveSpecificEffect(EFFECT_TYPE_MOVEMENT_SPEED_DECREASE, oPC);
}

 

 

Hi, I have created this script with "generator" script but RemoveSpecificEffect function does not seem to exist anymore, how to achieve the desired effect?
Thanks for your help.
 


#2
Neverwinter Owl

Neverwinter Owl
  • Members
  • 16 messages
effect eEffect = GetFirstEffect(oPC);

while(GetIsEffectValid(eEffect)){

if(GetEffectType(eEffect) == EFFECT_TYPE_MOVEMENT_SPEED_DECREASE) RemoveEffect(oPC, eEffect);

eEffect = GetNextEffect(oPC);

}

You have to loop through effects manually.


  • Quevy aime ceci

#3
Quevy

Quevy
  • Members
  • 68 messages

Thanks



#4
Proleric

Proleric
  • Members
  • 2 363 messages

RemoveSpecificEffect does exist.

 

I use it all the time.

 

As that Lexicon entry shows, because it's a library function, you need the #include statement for the library before the main section of your script.


  • meaglyn et Quevy aiment ceci

#5
Quevy

Quevy
  • Members
  • 68 messages

Thanks Proleric