• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Detecting when unit is order to drop one corpse

Hello, fellow hivers. I'm currently working on abilities for a corpse chart. The idea behind the ability is that every time the unit acquires a corpse, it levels up an aura ability, and when it drops one it lowers the level of the aura ability.
I have figured out how to detect when a corpse is generated by exhumed corpse, get a corpse, and drop a corpse.


Get Corpse
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Get Corpse
Actions
Unit - Increase level of Command Aura for (Triggering unit)


Exhume Corpses
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Exhume Corpses
Actions
Unit - Increase level of Command Aura for (Triggering unit)


Drop Corpse
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Drop Corpse
Actions
Unit - Set level of Command Aura for (Triggering unit) to 1


What I'm having trouble with is detecting when a single corpse is dropped by clicking on its icon via the cargo hold. Lowering the aura ability level. by 1
I've tried Detecting it via order conditions such as smart and ordered an order with no target thought trigger editor.

Here's my latest attempt.

Click Cargo
Events
Unit - A unit Is issued an order with no target
Conditions
(Unit-type of (Ordered unit)) Equal to Corpse Wagon (Corpse Silo)
(Issued order) Equal to (Order(smart))
Actions
Unit - Decrease level of Command Aura for (Triggering unit)


Any help is appreciated.

PS: I have no experience with JASS, and I have only partial knowledge of custom scripts. I learn best via visual and auditory means, so if anyone can point me in the direction of any tutorial videos, I'd be very grateful.
 
Last edited:
Level 20
Joined
Aug 29, 2012
Messages
826
It's counter intuitive, but this actually works

  • Unload
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Meat Wagon
      • (Issued order) Equal to (Order(unload))
    • Actions
      • -------- Your actions --------
Apparently it's targeting an object when you click on the portrait... Note that this also works with units in transports in general, which is useful because of the lack of any such event
This doesn't fire when using the "drop all corpses" ability though
 
It's counter intuitive, but this actually works

  • Unload
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Meat Wagon
      • (Issued order) Equal to (Order(unload))
    • Actions
      • -------- Your actions --------
Apparently it's targeting an object when you click on the portrait... Note that this also works with units in transports in general, which is useful because of the lack of any such event
This doesn't fire when using the "drop all corpses" ability though
Thank you!
 
Top