[Spell] Stop/abort spell effect

Level 7
Joined
May 13, 2011
Messages
310
OK, well, what I want to do is be able to stop/abort/cancel the effect of a spell after the effected unit is hit a certain amount of times.

Like, you know how you can set that a spell's effect dies after a certain amount of time (in spells such as Divine Shield and Invisibility)? Well, I want to (in addition to the time limit) be able to cut off the spell after a certain amount of hits. You know, like a kind of weakening shield or something.

Anyway, I want to know if this is possible, via triggers, object editor, whatever. If it can that'd be great. If you need more elaboration (my explanation might not be clear enough) please say so.
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
Set up an integer system that is connected to that certain spell. Set up a damage detection, then count the integer for each hit, then once it reaches that amount of hits remove the buff/effect of the spell. I havn't done something like this in a while so if there is no way to remove the buff/effect then you have to make the whole spell through triggers, and then just turn off the trigger that gives it the effect.
 
Level 7
Joined
May 13, 2011
Messages
310
Hmm... I was hoping there was a simpler way. A damage detection system isn't really easy (as far as I know).

Second of all, there isn't a way (that I know of) to stop the effect of the spell. All I know how to do is remove a buff, which in my opinion is useless since all buffs do are special effects and such, no actual functionality.
As you said, I could make a trigger that does the spell effect, but the problem is I don't think that it's possible with my spell. What my spell does is increase the attack speed and attack damage of a unit (by a percentage). I don't think there's a way to do that with triggers.

So yeah... if there is no way to do this, I'll just have to say so (I'm making this spell for someone else). Personally I think that a time limit for the spell is enough.
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
Oh so your trying to replicate ursa's ability? Well i could give a crack at it if you wish.

Ahah now i remember, you make a dummy unit using endurance aura, and make it stay at the units point blank, then once number of hits are done, kill the dummy unit. Make sure to change the range to around 100, and hide the dummy unit.
 
Level 7
Joined
May 13, 2011
Messages
310
No idea who ursa is... as I said I'm simply doing what someone requested.

Anyway... on the whole it's a fairly acceptable solution, however I checked it out and unfortunately Endurance Aura only increases the attack speed, not the attack speed and damage. I'm currently using Cripple with negative values (thanks to Maker).

And yes, I understand that increasing the attack speed results in more damage being given out, but as I said I'm making it for someone else and that's what they requested.
 
Level 7
Joined
May 13, 2011
Messages
310
Hm, OK, I'll give that a go tomorrow. Obviously not as simple as I would have liked, but if it's the only way...

In any case +rep, simply for bothering to help me.
 
Level 7
Joined
May 13, 2011
Messages
310
Well, I gave it a go, and it's working... kind of. I can create the unit, hide it, and all that jazz, but it's not being created at the target unit's "point blank" as you called it. This is the trigger I'm using (this is only a test):

  • Dummy Unit Test
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Create 1 HealBiteDummy for Player 1 (Red) at (Position of Paladin 0025 <gen>) facing Default building facing degrees
      • Unit - Hide (Last created unit)
For some reason it wasn't working properly, and by disabling the "Unit - Hide" action I saw that my dummy unit is getting created right next to the Paladin, which is not what I'm wanting. By your explanation I expected him to be created "in" the Paladin. Even with his collision size set to 0 I get the same result. In fact, editing the pathing size doesn't appear to help at all, units still walk around him (instead of through him), and vice versa.

Am I doing something wrong? Or what?

(BTW sorry about the double post, but editing the post wouldn't bump the thread.)
 
Level 7
Joined
May 13, 2011
Messages
310
Well, uh... that depends what you mean by "pathing". If you mean the Collision Size field, then yes, I am telling you that a unit with Locust is ignoring that.
The dummy unit's Collision Size is 0, but he appears beside the Paladin. And units who I expect would walk through him walk around him, just as if he's a normal Peasant (I've based him off the Peasant unit).
 
Level 7
Joined
May 13, 2011
Messages
310
That's fantastic! It's finally working, thanks a lot. +rep

I must say that this is pretty complicated for something that, at first sight, seems so simple (simply cutting off a spell's effect). Still, guess the WE isn't made for everything.

EDIT: Sigh... I'm really sorry but thing just keep coming up. Once I kill my dummy unit to end the spell, the buffs linger for a few seconds after he dies.
I suppose I could simply remove the buffs using triggers after I kill him, but I suspect that the effects will still continue despite the buffs being gone. I also suppose that I could kill him early, but that's a really sloppy method. If there is any other way (something like a "buff linger" field in the ability properties) then that would be extremely helpful.
 
Last edited:
Level 17
Joined
Apr 3, 2010
Messages
1,101
You can use a damage detection
using

Event: Unit is attacked
Condition:Type of attacking unit = Your unit here
Action:
If count=5
Set level of item damage + to 1
Set level of Item increase to level 1
Remove Buffs

Else Set count = Count+1

:p For mui use a Array and Count[playernumberofownerofattackingunit-1]

Then you make instead of creating unit to increase damage You can either use a damage + System or Damage % System or Give the aura to the unit
:p

Also if you want to check whether the unit is getting attacked you can just use a unit array

So on selection of heros set it up so Hero[0] = Player 1's hero
Hero[1]=PLayer 2 hero
Etc
Then Recall it so

Event: Unit is attacked
Condition: Unit type of attacked unit is --- Blah blah
Action: Pick every player in player group
If Hero[Playernumberofpickedplayer]=Attacked unit
Then set count =count+1
After so many counts then you can just reduce the spell level to 1 or remove where 1 is null

Side note
If your doing a shield then maybe you could do

Unit Casts an abillity: Abillity = Divine shield
(Divine shield is a dummy abil)
Set Bolean = True


Even Unit is attacked
Condition Bolean = true
and Unit type of attakced unit = Hero[x]
Action If Count = x
Remove buff
Set bolean = false
Else Set count = count+1
Set Attacked unit hp =Attacked unit hp + Damage taken.
Thus reducing the effect as if nothing had happened

Or if you want to make it as the shield weakens damage starts to come into play then

Set attacked unit hp = attacked unit hp + damage taken -count
 
Level 7
Joined
May 13, 2011
Messages
310
Well thanks for trying to help Brambleclaw, but I got it all sorted. My earlier remarks on a damage detection system were actually kind of stupid, halfway through I realised I can use "Unit Is Attacked", so I've just been using that.
So yeah, thanks for the help but it's really unnecessary.

By the way, when posting triggers could you please use the
  • tags? That makes it much easier to read, I actually skipped half of your post because it's unpleasant on the eyes.
 
Top