Aller au contenu

Photo

Whats The Trick To Removing EffectCutsceneImmobilize? (Solved)


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

#1
Morbane

Morbane
  • Members
  • 1 883 messages
 I tried to loop through valid effects with

RemoveEffect(...)

but it doesnt seem to be working :pinched:

Any advice?

Modifié par Morbane, 28 avril 2012 - 06:09 .


#2
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
try this...

CSLRemoveEffectByType(oTarget, EFFECT_TYPE_CUTSCENEIMMOBILIZE);


http://pastebin.myrror.net/3152


int CSLRemoveEffectByType(object oPC, int nEffectType, int nEffectSubType=-1, object oCreator=OBJECT_INVALID)
{
	int bRemove = FALSE;
	effect eSearch = GetFirstEffect(oPC);
	while (GetIsEffectValid(eSearch))
	{
		int bRestart = FALSE;
		//Check to see if the effect matches a particular type defined below
		if (GetEffectType(eSearch)==nEffectType)
		{
			if (nEffectSubType==-1 || GetEffectSubType(eSearch)==nEffectSubType)
			{
				if (oCreator==OBJECT_INVALID)
				{
					RemoveEffect(oPC, eSearch);
					bRemove = TRUE;
					bRestart = TRUE;
				}
				else
				{
					if (GetEffectCreator(eSearch)==oCreator)
					{
						RemoveEffect(oPC, eSearch);
						bRemove = TRUE;
						bRestart = TRUE;
					}
				}
			}
		}
		if (bRestart)
		{
			eSearch = GetFirstEffect(oPC);
		}
		else
		{
			eSearch = GetNextEffect(oPC);
		}
	}
	return bRemove;
}


Modifié par painofdungeoneternal, 28 avril 2012 - 12:26 .


#3
Morbane

Morbane
  • Members
  • 1 883 messages
Thanks Pain - I'll give it a try


EDIT:

I was using the wrong syntax for GetEffectType(eEffect) == EFFECT_TYPE_CUTSCENEIMMOBILIZE

I still have to test it but I am pretty sure that will do it.

Thanks again Pain :wizard:

Modifié par Morbane, 28 avril 2012 - 12:47 .