Removing Special Effect Help

MorbazanRhot

New Member
Reaction score
7
Alright, so a quick question involving a triggered spell's special effect. When the unit casts this spell, which is a Damage Over Time that lasts 15 seconds, it creates a special effect on the casting unit. Now I have a wait that gets rid of it when the spell expires, and a seperate trigger to remove the effect when the debuffed unit dies. My question is: how do I make a trigger that will remove the special effect from the casting unit when the debuffed unit is dispelled.
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
Well, I didn't quite actually understand what you said. I think this should work though:
Code:
<Freehand>
    If - Conditions
        <Unit> has <Buff> Equal to True
    Then - Actions
        <Dispell the buff>
        Special Effect - Destroy (<Effect>)
    Else - Actions

I also believe just destroying the effect when it is created makes it last its full duration, unless it is an "Always Looping" effect. :)
 

MorbazanRhot

New Member
Reaction score
7
I guess I was kind of unclear, so I'll specify. The spell, when cast, creates the possession (caster) effect over the target. In order to make it look like something is being siphoned out of the target to the caster, I made a trigger that also puts the effect over the casting hero. This effect lasts indefinitely until destroyed, so I need a trigger that destroys it when the time is up. I don't want to dispel it off of the target for any reason (if that's what your trigger does), but rather I want to have a trigger that will get rid of the special effect from the caster when the buff is dispelled from the targetted unit. And yes, I know I could just make a trigger that checks every .5 seconds or so to see if the targetted unit has the buff and if he doesn't then destroy the special effect from the caster, but I've got a lot of periodic triggers already so I'm looking for another solution if there is one. Thanks a lot in advance :). (easy +rep)
 

ertaboy356b

Old School Gamer
Reaction score
86
Code:
e: unit cast spell
c: ability cast = <ability>
a:
    Custom Script: local effect FX
    Custom Script: local integer a  = 0
    <your special effect trigger>
    Custom Script: set FX = bj_LastCreatedEffect
    Custom Script: loop
    Custom Script: exitwhen a == 1
    [B]If[/B] 
    [B]triggering unit[/B] has [B]buff[/B] = false
    [B]Then[/B]
    Custom Script: set a = 1
    [B]Else[/B]
    Wait 0.27 seconds
    Custom Script: endloop
    Custom Script: call DestroyEffect(FX)
    Custom Script: set FX = null
 

MorbazanRhot

New Member
Reaction score
7
Awesome, since I don't really know much about JASS I'll just assume this works and thank you a ton for it :). My only 1 question is: in the line "Custom Script: exitwhen a == 1" should there actually be 2 ='s or just 1 and should exitwhen be 1 word? Thanks again.
 

ertaboy356b

Old School Gamer
Reaction score
86
There should be 2 '='... That's just how programming works.. '==' is equals to equality..
exitwhen be 1 word.
 

MorbazanRhot

New Member
Reaction score
7
Sweet, thanks for the quick reply, but one problem I just realized when I was entering this into my map: the triggering (casting) unit never gets any sort of buff with this spell, but rather the targetted unit, which is the one I'm worried about getting dispelled. But since I'm not completely sure how everything here works, I wanted to ask if that is already taken into account with this trigger, or should I just change triggering unit to the unit that is affected by the spell, or what? Thanks a ton.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top