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

[Solved] Triggering Spell problem

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
Hello, the spell itself works good, but why is it killing everything instantly, no matter the HP of the picked units?
Note: It does work as intended if it hits only 1 or 2 units.

  • Fire Slash Work
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Fire Slash for GDD_DamageSource) Greater than 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random real number between 0.00 and 1.00) Less than or equal to FireSlash_Chance[(Level of Fire Slash for GDD_DamageSource)]
        • Then - Actions
          • Animation - Play GDD_DamageSource's Spell Slam Third animation
          • Set VariableSet FireSlash_Damage = ((Base Damage of GDD_DamageSource for weapon index 0) + (Strength of GDD_DamageSource (Include bonuses)))
          • Set VariableSet FireSlash_CPoint = (Position of GDD_DamageSource)
          • Set VariableSet FireSlash_Group = (Units within 200.00 of FireSlash_CPoint.)
          • Unit Group - Pick every unit in FireSlash_Group and do (Actions)
            • Loop - Actions
              • Set VariableSet FireSlash_Target = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (FireSlash_Target is A structure) Equal to False
                  • (FireSlash_Target is Mechanical) Equal to False
                  • (Owner of FireSlash_Target) Equal to Player 12 (Brown)
                  • (FireSlash_Target is alive) Equal to True
                • Then - Actions
                  • Unit - Cause GDD_DamageSource to damage FireSlash_Target, dealing (Real(FireSlash_Damage)) damage of attack type Spells and damage type Normal
                • Else - Actions
          • Custom script: call RemoveLocation(udg_FireSlash_CPoint)
          • Custom script: call DestroyGroup(udg_FireSlash_Group)
        • Else - Actions
 
Level 4
Joined
Sep 2, 2016
Messages
48
Isn't "GDD_Event becomes Equal to 0.00" all the time? SHouldn't it be "1.00" to represent the damage detection moment?
 
Level 7
Joined
Feb 23, 2020
Messages
253
Isn't "GDD_Event becomes Equal to 0.00" all the time? SHouldn't it be "1.00" to represent the damage detection moment?
I guess that's different depending on what system you use. I've used 0 for almost everything and it's been working as intended.
 
Level 4
Joined
Sep 2, 2016
Messages
48
Ooooh! I see it now. When you do damage with this Fire Slash this trigger fires again. It's obviously recurrent!
Before the line:
Unit - Cause GDD_DamageSource to damage FireSlash_Target
Turn off <this trigger>
and after it
Turn on <this trigger>
 
Level 7
Joined
Feb 23, 2020
Messages
253
Ooooh! I see it now. When you do damage with this Fire Slash this trigger fires again. It's obviously recurrent!
Before the line:
Unit - Cause GDD_DamageSource to damage FireSlash_Target
Turn off <this trigger>
and after it
Turn on <this trigger>
Yes! Now it works properly, thanks a lot! :)
 
Status
Not open for further replies.
Top