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

[Trigger] Index problem about detecting if unit casts ability...

Status
Not open for further replies.
Level 3
Joined
Sep 9, 2015
Messages
56
It simply bugs out. Any fix?



  • Chal Omenic Scrye
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Omenic Scrye
    • Actions
      • -------- The target unit will be watched for 20 seconds. When it casts any spell within that time frame, it will suffer damage. --------
      • Set Chal_Omenic_Index = (Chal_Omenic_Index + 1)
      • Set Chal_Omenic_Caster[Chal_Omenic_Index] = (Casting unit)
      • Set Chal_Omenic_Targ[Chal_Omenic_Index] = (Target unit of ability being cast)
      • Set Chal_Omenic_Damage[Chal_Omenic_Index] = ((Level of Omenic Scrye for Chal_Omenic_Caster[Chal_Omenic_Index]) x 100)
      • Set Chal_Omenic_Counter[Chal_Omenic_Index] = 0.00



  • Chal Omenic Scrye Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Casting unit) Equal to Chal_Omenic_Targ[Chal_Omenic_Index]
    • Actions
      • For each (Integer AA_Omenic_Loop) from 1 to Chal_Omenic_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Omenic Scrye for Chal_Omenic_Targ[AA_Omenic_Loop]) Less than or equal to 3
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Chal_Omenic_Targ[AA_Omenic_Loop] is A Hero) Equal to False
                  • (Chal_Omenic_Targ[AA_Omenic_Loop] has buff Omenic Scrye ) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Chal_Omenic_Targ[AA_Omenic_Loop]) Less than 6
                    • Then - Actions
                      • Special Effect - Create a special effect attached to the chest of Chal_Omenic_Targ[AA_Omenic_Loop] using EXPSET4FXSPLSBFS\Arcane Nova\Arcane Nova.mdx
                      • Unit - Kill Chal_Omenic_Targ[AA_Omenic_Loop]
                      • Wait 1.00 seconds
                      • Memory Leak - Destroy (Last created special effect)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Chal_Omenic_Targ[AA_Omenic_Loop]) Greater than or equal to 6
                    • Then - Actions
                      • Special Effect - Create a special effect attached to the chest of Chal_Omenic_Targ[AA_Omenic_Loop] using EXPSET4FXSPLSBFS\Arcane Nova\Arcane Nova.mdx
                      • Unit - Set life of Chal_Omenic_Targ[AA_Omenic_Loop] to ((Life of Chal_Omenic_Targ[AA_Omenic_Loop]) - (Real(Chal_Omenic_Damage[AA_Omenic_Loop])))
                      • Wait 1.00 seconds
                      • Memory Leak - Destroy (Last created special effect)
                      • Set Chal_Omenic_Counter[AA_Omenic_Loop] = (Chal_Omenic_Counter[AA_Omenic_Loop] + 1.00)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Chal_Omenic_Counter[AA_Omenic_Loop] Equal to 3.00
                        • Then - Actions
                          • Unit - Remove Omenic Scrye buff from Chal_Omenic_Targ[AA_Omenic_Loop]
                          • Set Chal_Omenic_Targ[AA_Omenic_Loop] = Chal_Omenic_Targ[Chal_Omenic_Index]
                        • Else - Actions
                    • Else - Actions
                • Else - Actions
            • Else - Actions
 
Last edited:
Level 3
Joined
Sep 9, 2015
Messages
56
reply

It has waits, I think waits are bad. What exactly happens when it bugs out?

The effect of the ability (the suffer damage) against the target unit has some delay issues.

Delays just like these:
Let's just say I have 2 targets and 2 casters
- Caster 1
- Caster 2
- Target 1
- Target 2

EVENTS LOG
* At game time 10 seconds late:
Caster 1 uses this skill on Target 1 (he suffers damage)
* At game time 12 seconds late:
Caster 2 uses this skill on Target 2 (he does not suffer damage)
* At game time 15 seconds late:
Caster 1 uses this skill again on Target 1 (he suffers damage, and then the Target 2) <- these really bugs me out.
 
Level 13
Joined
Jun 20, 2014
Messages
479
Check out my curse of terror. It is similar to what you are trying to achieve. Ill be updating it tonight.

Edit: hello i have updated my spell. To achieve this you need to store affected units in a unit group also store the damaging unit and the damage to be dealt on an enemy. Then create another trigger that finds the caster from where you store it using unit comparison. Then deal damage to the caster. Thats about it.
 
Last edited:
Status
Not open for further replies.
Top