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

I cannot add or remove effects properly.

Level 17
Joined
Jun 2, 2009
Messages
1,137
Update: After 100+ tests i have realized main problem is effects. They we're aura based and stays for 5 seconds even if i removed.
Now i have changed it but still my issue not solved.
I want to destroy all effects when integer lesser than or equal to 5.

  • Heart of War Stack
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource has an item of type Claws of Attack +15) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Heart_of_War_Int[(Player number of (Owner of DamageEventSource))] Less than or equal to 11
        • Then - Actions
          • Set Heart_of_War_Int[(Player number of (Owner of DamageEventSource))] = (Heart_of_War_Int[(Player number of (Owner of DamageEventSource))] + 1)
          • Unit - Set level of Warheart2 (Gloves of Haste) for DamageEventSource to ((Level of Warheart2 (Gloves of Haste) for DamageEventSource) + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Heart_of_War_Int[(Player number of (Owner of DamageEventSource))] Equal to 6
        • Then - Actions
          • Special Effect - Destroy EfektWarHeart[(Player number of (Owner of DamageEventSource))]
          • Special Effect - Create a special effect attached to the overhead of DamageEventSource using Abilities\Spells\Orc\SpiritLink\SpiritLinkTarget.mdl
          • Set EfektWarHeart[(Player number of (Owner of DamageEventSource))] = (Last created special effect)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Heart_of_War_Int[(Player number of (Owner of DamageEventSource))] Equal to 11
            • Then - Actions
              • Special Effect - Destroy EfektWarHeart[(Player number of (Owner of DamageEventSource))]
              • Special Effect - Create a special effect attached to the origin of DamageEventSource using war3mapImported\Spell Marker Red.mdx
              • Set EfektWarHeart[(Player number of (Owner of DamageEventSource))] = (Last created special effect)
            • Else - Actions

  • Heart of War Stack2 Copy Copy 8
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Heart_of_War_Int[(Integer A)] Greater than or equal to 2
            • Then - Actions
              • Set Heart_of_War_Int[(Integer A)] = (Heart_of_War_Int[(Integer A)] - 1)
              • Unit - Set level of Warheart2 (Gloves of Haste) for HeroOoO[17] to ((Level of Warheart2 (Gloves of Haste) for HeroOoO[17]) - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Heart_of_War_Int[(Integer A)] Less than or equal to 10
                  • Heart_of_War_Int[(Integer A)] Greater than or equal to 6
                • Then - Actions
                  • Special Effect - Destroy EfektWarHeart[(Integer A)]
                  • Special Effect - Create a special effect attached to the overhead of HeroOyuncu[(Integer A)] using Abilities\Spells\Orc\SpiritLink\SpiritLinkTarget.mdl
                  • Set EfektWarHeart[(Player number of (Player((Integer A))))] = (Last created special effect)
                • Else - Actions
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Heart_of_War_Int[(Integer A)] Less than or equal to 5
        • Then - Actions
          • Special Effect - Destroy EfektWarHeart[(Integer A)]
          • Game - Display to (All players) for 1.00 seconds the text: bütün efeklerin s...
        • Else - Actions
[/TRIGGER]
Effects not adding/removing properly and stacking many effects.
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,378
Player(x) starts from 0, So Player(0) is Player 1 (Red). In your second trigger, you loop from 1 to 12 but you should iterate from 0 to 11.

What your triggers currently do:
First trigger:
  • Set EfektWarHeart[(Player number of (Owner of DamageEventSource))] = (Last created special effect)
  • DamageEventSource belongs to Player 1 (Red)
  • (Owner of DamageEventSource) returns the "Player 1 (Red)"
  • Player number of (Owner of DamageEventSource) evaluates to 1
  • EfektWarHeart[1] = (Last created special effect)
Second trigger:
  • Special Effect - Destroy EfektWarHeart[(Integer A)]
  • Set EfektWarHeart[(Player number of (Player((Integer A))))] = (Last created special effect)
  • Integer A is 1
  • Special Effect - Destroy EfektWarHeart[1] - destroys special effect for player 1 (Red)
  • Player(X) is zero-based, so Player(1) returns "Player 2 (Blue)"
  • Player number of (Player(1) evaluates to 2
  • EfektWarHeart[2] = (Last Created special effect)
 
Top