• 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.

Auto-cast Cleave ability

Status
Not open for further replies.
Level 4
Joined
Apr 28, 2017
Messages
112
Hi, I'm trying to make auto-castable "cleave" ability that costs 5 mana. I've tried many solutions but none of them work 100%. Closest I've come to achieving it is using flaming arrows as dummy ability and then when it's autocast is turned on I add cleave to hero. Here's trigger for it:


  • Events
    • Unit - A unit Is issued an order with no target
  • Conditions
    • (Level of Cleave for (Triggering unit)) Greater than 0
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Issued order) Equal to (Order(flamingarrows))
      • Then - Actions
        • Unit - Add Cleaving Attack (Neutral Hostile) to (Triggering unit)
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Issued order) Equal to (Order(unflamingarrows))
          • Then - Actions
            • Unit - Remove Cleaving Attack (Neutral Hostile) from (Triggering unit)
          • Else - Actions
There are 2 problems with this however:
1) when autocast is turned on, hero will have cleave regardless if he has mana for it or not
2) when autocast is turned off, it won't work when manually casted

If anyone can help me, or find a different working method for this (if possible without using any damage detection systems) I'd be thankful. Cheers!
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
Problem 1 can be solved be checking current mana periodically and adding/removing the ability accordingly.
You can use the event "starts the effect of an ability", if an arrow ability is cast manually. However when you add the cleave ability with this event, it is already too late and the cleave won't have an effect.

I would recommend triggering it all by yourself.
In this thread you can see how to detect usage of arrow abilities by using a DDS: Black/searing arrow detect and attribute stat stealing
 
Level 4
Joined
Apr 28, 2017
Messages
112
Problem 1 can be solved be checking current mana periodically and adding/removing the ability accordingly.
You can use the event "starts the effect of an ability", if an arrow ability is cast manually. However when you add the cleave ability with this event, it is already too late and the cleave won't have an effect.

I would recommend triggering it all by yourself.
In this thread you can see how to detect usage of arrow abilities by using a DDS: Black/searing arrow detect and attribute stat stealing

Can you please help me solve 1). Where exactly to add that checking condition? How would i solve it?
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
Since your solution with the cleave ability will fail when using the ability manually, it makes no sense to even try.
It's also rather dificult, so I would really trigger it using a DDS. Cleave can be coded quite easily by yourself.
It's difficult, because you not only need to remove the ability, if mana is too low, but you also have to add it, if mana is enough, but only if autocast is active at that point.
I guess you will need a periodic check, if it needs to be MUI it is even more difficult, so using a DDS is just a lot easier to do.
 
Level 4
Joined
Apr 28, 2017
Messages
112
I gave up on it. No sense adding DDS to the map for only 1 ability, too much triggers & variables. Thanks for the help anyway!
I just went with active cleave ability with no target (based on channel), that cleaves units in front of the hero. Here are the triggers if anyone's interested:
  • Cleave
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cleave Halahk
    • Actions
      • Set tempPoint = (Position of (Triggering unit))
      • Set tempPoint2 = ((Position of (Triggering unit)) offset by 200.00 towards (Facing of (Triggering unit)) degrees)
      • Set tempGroup = (Units within 200.00 of tempPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
      • Set tempNumber2 = (((Real((Level of Cleave Halahk for (Triggering unit)))) x (Real((Strength of (Triggering unit) (Include bonuses))))) + 10.00)
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • Set tempLoc = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Angle from tempPoint to tempLoc) Greater than or equal to ((Angle from tempPoint to tempPoint2) - 30.00)
              • (Angle from tempPoint to tempLoc) Less than or equal to ((Angle from tempPoint to tempPoint2) + 30.00)
              • ((Picked unit) is A ground unit) Equal to True
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing tempNumber2 damage of attack type Hero and damage type Normal
            • Else - Actions
          • Custom script: call RemoveLocation(udg_tempLoc)
      • Custom script: call DestroyGroup(udg_tempGroup)
      • Custom script: call RemoveLocation(udg_tempPoint)
      • Custom script: call RemoveLocation(udg_tempPoint2)
 
Level 4
Joined
Apr 28, 2017
Messages
112
You could also add the Cleaving on spell cast and remove it on spell endcast
Of course, you would only use this triggers when the autocast is off. So you would neee some way to detect that

I gave up on this, too hard to make. I just went with active cleave that cleaves the units in front of the target instead. Thanks anyway
 
Level 25
Joined
May 11, 2007
Messages
4,650
Just use the Destroyer Orb of Annihilation?
"Adds <Afak,DataA1> bonus damage to the Destroyer's attack and causes his attacks to do area of effect damage."
Play around with the splash values and you should be able to get the same effect as Cleaving Attack.
 
Level 4
Joined
Apr 28, 2017
Messages
112
Just use the Destroyer Orb of Annihilation?
"Adds <Afak,DataA1> bonus damage to the Destroyer's attack and causes his attacks to do area of effect damage."
Play around with the splash values and you should be able to get the same effect as Cleaving Attack.

Unfortunately for some reason he also damages allies
Could use is attacked event and trigger cleave if unit has 5 mana or more.

More complex than mere object editor work.
But it should work fine

The whole point of autocast cleave is so you can turn it off when you want. Coz you might want to preserve mana for some other spell also (hero acts like warrior from WoW, has 100 max mana). So this solution wouldn't really be what I want


Guys thank you for trying to help me, but I already mentioned I just went with the other concept ^^. This is too hard to do exactly as I want, so I don't want you to waste your time. If you want to help me, check my other thread with charged spells, I would be thankful :)
 
Level 4
Joined
Apr 28, 2017
Messages
112
I made a test map, he doesn't damage his allies in it.

Make sure that the Hero's area of effect targets has enemy checked in it. Look at the destroyer unit and copy the values for the splash in it.
Then it doesn't damage allies and works perfectly.

yup still damages allies. I left only "enemies" checked in the box. Also it damages target behind the hero, which doesn't make sense for cleave

EDIT: ok, u were right, just tried it again. I changed wrong field previously. But still the issue of hitting targets behind the hero remains
 
Level 12
Joined
Nov 3, 2013
Messages
989
yup still damages allies. I left only "enemies" checked in the box. Also it damages target behind the hero, which doesn't make sense for cleave

EDIT: ok, u were right, just tried it again. I changed wrong field previously. But still the issue of hitting targets behind the hero remains
Cleave and orb of annihilation both have circle of aoe centered around the attacked target, if the target is close and/or the aoe is large enough to hit units behind you then the same thing would happen with cleave. I'm 99% sure of this.
 
Level 4
Joined
Apr 28, 2017
Messages
112
Cleave and orb of annihilation both have circle of aoe centered around the attacked target, if the target is close and/or the aoe is large enough to hit units behind you then the same thing would happen with cleave. I'm 99% sure of this.

Not true. Go test it in world editor. Put cleave aoe to 500 and put orb's aoe to 500 and see for yourself
 
Level 25
Joined
May 11, 2007
Messages
4,650
Pretty sure Cleave works like Tauren's Passive, that it deals the splash damage on the hero position rather than the unit target.
But for a ranged hero, why would you want it to behave like that?

Just use the orb of annihilation and it works like the player would think it would?
 
Level 4
Joined
Apr 28, 2017
Messages
112
Pretty sure Cleave works like Tauren's Passive, that it deals the splash damage on the hero position rather than the unit target.
But for a ranged hero, why would you want it to behave like that?

Just use the orb of annihilation and it works like the player would think it would?

My hero is melee, that's the whole point of this. I think I already mentioned this in the few posts above, that hero is like warrior from WoW.
Thank you for trying to help, but as I said before, I've tried everything, nothing will work. I've already completed my hero with the trigger i posted in previous posts.
 
Level 4
Joined
Apr 28, 2017
Messages
112
The whole point of autocast cleave is so you can turn it off when you want. Coz you might want to preserve mana for some other spell also (hero acts like warrior from WoW, has 100 max mana). So this solution wouldn't really be what I want
Also i used flaming arrows as dummy ability. Dummy being = it does nothing
 
Status
Not open for further replies.
Top