Aller au contenu

Photo

Remove aoe effect


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

#1
Hilltop2012

Hilltop2012
  • Members
  • 66 messages
I kind of ran into a wall of fire :P 

I used a generic trigger with an on enter event to apply a visual effect at a waypoint. (Wall of Fire). Now I need to get rid of it, but I can't. No matter what I do it just keeps on burning.

Please help :)

Here is the code I used to Apply the Effect. This part works great!

effect eFirewall = EffectAreaOfEffect(AOE_PER_WALLFIRE);

if ( GetLocalInt(OBJECT_SELF, "MarkAsDone") == 0 )
{
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eFirewall, lfw1); ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eFirewall, lfw2);.
}
//*******************************************

This is what I found in the old forums but I can't get it to work. I don't know how to define oTarget since the effect is applied to a location, rather then a creature. Thanks in advance!

object oTarget = GetArea(OBJECT_SELF);
effect eEffect = GetFirstEffect(oTarget);    
while(GetIsEffectValid(eEffect))
    {        
 if(GetEffectType(eEffect) == EFFECT_TYPE_AREA_OF_EFFECT        
                                                  && GetEffectInteger(eEffect, 0) == AOE_PER_WALLFIRE)      
 {            
RemoveEffect(oTarget, eEffect);            
break;      
 }        
eEffect = GetNextEffect(oTarget);    
}

Modifié par Hilltop2012, 30 juillet 2010 - 08:06 .


#2
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Try using an IPoint instead of a waypoint. Apply the effect to the IPoint, then you have a valid object from which to remove the effect. That's what I do in cases like this.

#3
Hilltop2012

Hilltop2012
  • Members
  • 66 messages
Thanks Knightmare. Thats a great idea. I'm at work so I can't test yet, but I'd like to try to use 'DestroyObject' to get rid of the iPoint if possible. If not, this still opens up an array of solutions.

#4
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Destroy the AOE, when you create it set a custom tag when you create it ( last parameter on EffectAreaOfEffect ), and store this on the way point. That way you can use the fire to damage folks and it has on enter and the like. Most of it will use the code from the spell wall of fire even though caster level and HD of damage per round might be an issue..



If you don't want this and just want a visual then a placed effect via an ipoint is the best way to do it, just set up a custom one with the visual attached.

#5
Hilltop2012

Hilltop2012
  • Members
  • 66 messages
@painofdungeoneternal,
Thats great! I didnt read all the parameters of 'EffectAreaOfEffect' So I added a tag to that and I'll try this for removing it. Thanks!

void main()
{
string sTag = "sWallOfFire";
int    n;    
location lEffect;
object oEffect = GetObjectByTag(sTag, n++);
while ( GetIsObjectValid(oEffect) )
{
lEffect = GetLocation(oEffect);
DestroyObject(oEffect);
oEffect = GetObjectByTag(sTag, n++);
}

}

Modifié par Hilltop2012, 30 juillet 2010 - 09:04 .


#6
Hilltop2012

Hilltop2012
  • Members
  • 66 messages
I got it to work! Thanks for everyones help!