• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Dota´s Axe Culling Blade spell

Status
Not open for further replies.
Level 4
Joined
Mar 15, 2011
Messages
39
How I can program this skill? My problem is not part of "kill with one strike" but that "if you kill the hero, this skill recharges instantly." In the trigger editor there is an action that resets the cooldowns of a unit, but all not of a specific skill. some help?
 
Level 13
Joined
Jan 2, 2016
Messages
978
Remove and re-add the ability. That will reset the cooldown.
The problem is that I haven't tried it with hero skills, and not sure if you wouldn't get any extra skill points after doing that, and not sure if the ability wouldn't lose its level.
The latter can easily be fixed.. just not sure about the 1-st.
 
Level 23
Joined
Dec 4, 2007
Messages
1,559
WereElf is right.
1 Save the level of the ability in an integer variable
2 Remove the ability
3 Add the ability
4 Set its level to that of your integer variable

By the way, the spell event might be, like so often, crucial for success. Basically some spell casts are canceled if you remove the ability too soon when using:

Unit - A unit Starts the effect of an ability
Unit - A unit Begins casting an ability


A similar problem can occur when using:

Unit - A unit Finishes casting an ability

Since it fires when the the spell animation is done, but what if you stopped/aborted the animation (most players immediately click somewhere to precisely get rid of that prolonging animation)? In that case your trigger-actions won't fire.

I suggest using:
Unit - A unit Starts the effect of an ability

And use a very short mpi/mui triggered countdown, or even the basic wait function before your actions. But i'm not sure if it is mpi/mui this way.

This at least works like intended:

  • Untitled Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Holy Light
    • Actions
      • Set temp_integer = (Level of Holy Light for (Triggering unit))
      • Wait 0.01 seconds
      • Unit - Remove Holy Light from (Triggering unit)
      • Unit - Add Holy Light to (Triggering unit)
      • Unit - Set level of Holy Light for (Triggering unit) to temp_integer
Cheers
 
Level 4
Joined
Mar 15, 2011
Messages
39
A]mun;2789235 said:
WereElf is right.
1 Save the level of the ability in an integer variable
2 Remove the ability
3 Add the ability
4 Set its level to that of your integer variable

By the way, the spell event might be, like so often, crucial for success. Basically some spell casts are canceled if you remove the ability too soon when using:

Unit - A unit Starts the effect of an ability
Unit - A unit Begins casting an ability


A similar problem can occur when using:

Unit - A unit Finishes casting an ability

Since it fires when the the spell animation is done, but what if you stopped/aborted the animation (most players immediately click somewhere to precisely get rid of that prolonging animation)? In that case your trigger-actions won't fire.

I suggest using:
Unit - A unit Starts the effect of an ability

And use a very short mpi/mui triggered countdown, or even the basic wait function before your actions. But i'm not sure if it is mpi/mui this way.

This at least works like intended:

  • Untitled Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Holy Light
    • Actions
      • Set temp_integer = (Level of Holy Light for (Triggering unit))
      • Wait 0.01 seconds
      • Unit - Remove Holy Light from (Triggering unit)
      • Unit - Add Holy Light to (Triggering unit)
      • Unit - Set level of Holy Light for (Triggering unit) to temp_integer
Cheers

Thereafter, how I remove the integral variable to prevent leak?
 
Level 23
Joined
Dec 4, 2007
Messages
1,559
You don't have to.

Check the tutorial section on this page, or google for things that leak in warcraft 3. Integers do not.
 
Level 23
Joined
Dec 4, 2007
Messages
1,559
Thanks, i didn't know that.

And btw, is there any advantage by setting the wait to 0.2 instead of the lowest possible value of 0.01?
 
Status
Not open for further replies.
Top