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

[Trigger] Is there a better way to develop this trigger?

Status
Not open for further replies.
Hello guys,
I'm making a spell that goes like this:
Illidan has the regular 'immolation' spell. When 'immolation' is activated, illidan will gain a new passive spell called 'Fire' and it'll have the same level of 'immolation'. When 'immolation' is deactivated, illidan will no longer have the passive spell called 'Fire'.

I can't find an event that marks the activation and deactivation of the spell 'immolation' that's why i created a trigger that checks every 0.01 seconds of game time if Illidan has an immolation buff or not.


  • Immo
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Illidan (Evil) 0379 <gen> has buff Immolation) Equal to True
        • Then - Actions
          • Unit - Add Fire to Illidan (Evil) 0379 <gen>
          • Unit - Set level of Fire for Illidan (Evil) 0379 <gen> to (Level of Immolation for Illidan (Evil) 0379 <gen>)
        • Else - Actions
          • Unit - Remove Fire from Illidan (Evil) 0379 <gen>
This doesn't look good to me. It's not an optimal trigger and this might cause lag. I mean every 0.01 seconds of game time actions will be effected for no reason when the spell only requires two events (the user turns immolation on or off).
What do you think of this trigger?

Is there a better solution? If yes please post it.

Thank you all.
:)
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
You can check by orders. Its "immolation" and "unimmolation" I guess, but you should check in the ability. Then you can use a unit is issued an order with no target.
And check if it's immolation/unimmolation and add/remove fire accordingly.
Since immolation is a toggle spell, ordering the spell and casting is basically the same, because there is no casting time.
 
Level 16
Joined
Mar 24, 2017
Messages
827
You could just use a modified bear form ability to transform illidan into an identical illidan with the fire ability, and you could develop a periodic trigger which checks if for 1) if illidan's mana is below a certain number 2) if illidan unit = illidan with fire, if so transform him back into the normal unit
 

Cokemonkey11

Spell Reviewer
Level 29
Joined
May 9, 2006
Messages
3,534
You can check by orders. Its "immolation" and "unimmolation" I guess, but you should check in the ability. Then you can use a unit is issued an order with no target.
And check if it's immolation/unimmolation and add/remove fire accordingly.
Since immolation is a toggle spell, ordering the spell and casting is basically the same, because there is no casting time.

This is the correct solution
 
Status
Not open for further replies.
Top