• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Event for deactivation of Mana Shield/Immolate?

Status
Not open for further replies.
Level 2
Joined
Sep 17, 2007
Messages
12
Is there one or should i make a trigger along the lines of

Casts spell

Spell = Blah

Then remove "original spell"
add "another spell"


*New trigger*

casts another spell

spell = blah

then remove "another spell"
add "original spell"

So essentially im trying to make a spell that has a trigger accosiated with its activation and deactivation.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
OrderIDs:

Immolation on: 852177
Immolation off: 852178
Mana Shield on: 852589
Mana Shield off: 852590

NOTE: Some of these orderIDs have string equivalents, but not all of them do. I know for sure that at least Mana Shield off doesn't, haven't checked though, so I don't know if the others do/don't.

Application examples: (uses Boolean variable TempBool)

  • Blah
    • Events
      • Unit - A Unit is Issued an order with No Target
    • Conditions
    • Actions
      • Custom script: set udg_TempBool = GetIssuedOrderId() == 852177
      • If (All Conditions are True) Then do (Then Actions) Else do (Else Actions)
        • If - Conditions
          • TempBool Equal to True
        • Then - Actions
          • -------- Immolation was turned on --------
        • Else - Actions
          • Custom script: set udg_TempBool = GetIssuedOrderId() == 852178
          • If (All Conditions are True) Then do (Then Actions) Else do (Else Actions)
            • If - Conditions
              • TempBool Equal to True
            • Then - Actions
              • -------- Immolation was turned off --------
            • Else - Actions
For different OrderIDs, just change the value GetIssuedOrderId() is compared to (eg 852177 was Turn On Immolation)

To find the code of ANY order issued, convert a trigger called DebugOrderFinder to custom text, and put this code inside;

JASS:
function DebugOrderFinder takes nothing returns nothing
    call BJDebugMsg(I2S(GetIssuedOrderId()))
endfunction

function InitTrig_DebugOrderFinder takes nothing returns nothing
    set gg_trg_DebugOrderFinder = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_DebugOrderFinder,EVENT_PLAYER_UNIT_ISSUED_ORDER)
    call TriggerRegisterAnyUnitEventBJ(gg_trg_DebugOrderFinder,EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
    call TriggerRegisterAnyUnitEventBJ(gg_trg_DebugOrderFinder,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
    call TriggerAddAction(gg_trg_DebugOrderFinder,function DebugOrderFinder)
endfunction

That code will display the OrderID of any order issued.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
JASS:
native IssueImmediateOrderById      takes unit whichUnit, integer order returns boolean
native IssuePointOrderById          takes unit whichUnit, integer order, real x, real y returns boolean
native IssueTargetOrderById         takes unit whichUnit, integer order, widget targetWidget returns boolean

EDIT: Forgot to mention;

For instant orders like Berserk, Immolation, Mana Shield, etc, these interrupt orders same as the string equivalents... it's stupid, I know.
 
Last edited:
Status
Not open for further replies.
Top