• 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] Cripple - Single Press Self Cast

Status
Not open for further replies.
Level 13
Joined
Sep 11, 2013
Messages
467
Hello :)
I have this spell "Cripple(Undead)" with negative value for attack speed and speed bonus(only self cast allowed) (hero ability).

When I press the hotkey of the spell i need to click on my hero to activate the spell and i want to change that in an Single Press(just hotkey press) and the spell must be auto casted on the hero (like berserk):


The question is.. How can i do that??
Can anyone help me with a map example, please?
As always, the help will be appreciated!
 
Level 13
Joined
Sep 11, 2013
Messages
467
Instead of cripple just use berserk as your base spell (it can do attack and movement speed). It's that simple.

It is not so simple..
Berserk do not have [Art - Animation Name (aani)]
Well has one but do not work at all
like "attack" or "spell" nothing work on Berserk and i want that demn fluid animation when a spell is casted (very important for me)

Edit: Also Cripple has Damage bonus and i'll need that in a future update..
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
In the future you should specify why something is insufficient for your needs. None of that information was included in your first post. Yes that's why Berserk is a special spell. It can be cast while moving and doesn't interrupt the unit's current orders. If you want this functionality you can play the unit's animation with a trigger when the spell is cast:
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to SPELL
  • Actions
    • Animation - Play (Triggering Unit)'s spell animation
If that is still insufficient for you, in general you would achieve an effect like this with a dummy cast. Instead of giving the hero this cripple ability, you either give it a non-targeted ability like Fan of Knives or a custom Channel-based ability (this is what I would recommend), and you make the cripple ability into a regular unit ability that you will order a dummy unit to cast on the hero with a trigger when the hero ability is cast. Channel is preferable for this because it can have any order id you want to give it so it will not conflict with other spells on the unit, and it can also be made into any targeting type as well as provide effects (though it does not apply any buffs).

So make your 'fake' hero ability that does nothing, make your actual cripple ability that does whatever you want it to do, and create a dummy unit: Spells - Dummy Casters or Spells - Dummy Casters (I would also set cast backswing and cast point to 0). Then your trigger looks like this:
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to HERO_SPELL
  • Actions
    • Set TempPoint = (Position of (Triggering Unit))
    • Unit - Create 1 DUMMY_CASTER for (Owner of (Triggering Unit)) at TempPoint facing Default building facing degrees
    • Unit - Add a 2.00 second generic expiration timer to (Last created unit)
    • Unit - Add CRIPPLE_SPELL to (Last created unit)
    • Unit - Set level of CRIPPLE_SPELL for (Last created unit) to (Level of HERO_SPELL for (Triggering Unit))
    • Unit - Order (Last created unit) to Undead Necromancer - Cripple (Triggering Unit)
    • Custom script: call RemoveLocation(udg_TempPoint) //change this to match the name of your point variable but keep the udg_ prefix
 
Level 13
Joined
Sep 11, 2013
Messages
467
In the future you should specify why something is insufficient for your needs.
Sorry about that.. I'll try to make it right next time:)

I did it with your help, i make the trigger and the dummy and now i think work almost perfect..
Thanks.JPG
For the moment i found just one problem with this channel spell..
It reset hero spell animation after 1 second and idk why so fast :(
The spell animation become incompleted..
How can i fix that issue?
+4 anyway :)
 
Status
Not open for further replies.
Top