• 🏆 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!

[Spell] Detecting an ablitiy turned On/Off

Status
Not open for further replies.
Level 5
Joined
Dec 25, 2011
Messages
45
Dear Hive members,
I have been working on a simple spell for a few hours, and I can't find a solution for it.
It is an ability based on searing arrows, but I can find no way in GUI to detect whether the spell is turned on or off; which means I also cannot control the actions that happen when the unit attacks.

Hoping to get a quick response

Pyro
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Custom script: if ( GetIssuedOrderId() == OrderId("searingarrows") ) then
      • Set SearingArrowsOn = True
      • Custom script: elseif ( GetIssuedOrderId() == OrderId("searingarrowsoff") ) then
      • Set SearingArrowsOn = False
      • Custom script: endif
 
Level 8
Joined
Oct 26, 2008
Messages
387
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Custom script: if ( GetIssuedOrderId() == OrderId("searingarrows") ) then
      • Set SearingArrowsOn = True
      • Custom script: elseif ( GetIssuedOrderId() == OrderId("searingarrowsoff") ) then
      • Set SearingArrowsOn = False
      • Custom script: endif

How about spells like mana/divine shield, which you can turn on and off? Same thing?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
How about spells like mana/divine shield, which you can turn on and off? Same thing?

For Mana Shield, i would check if the unit has the mana shield buff because it can be deactivated by losing all of your mana. For divine shield, it would be set by a Unit - Any unit starts the effect of an ability. Ability = Divine Shield (because divine shield cannot be interrupted or ended before the duration is expired)
 
Level 8
Joined
Oct 26, 2008
Messages
387
For Mana Shield, i would check if the unit has the mana shield buff because it can be deactivated by losing all of your mana. For divine shield, it would be set by a Unit - Any unit starts the effect of an ability. Ability = Divine Shield (because divine shield cannot be interrupted or ended before the duration is expired)

You can make divine shield like mana shield, turn on, turned off, but if duration expires it will go off, same as mana shield, so i would check the buff there too.
Thanks!!
 
Status
Not open for further replies.
Top