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

[Solved] spell damage

Level 4
Joined
Mar 7, 2024
Messages
45
I need everyone's help? when the hero uses spell thunder clap with normal damage of 5 x str and has a chance of 30% excellent damage rate of 10 x str and displays Floating Text Damage in a different color from normal Floating Text Damage.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
I need everyone's help? when the hero uses spell thunder clap with normal damage of 5 x str and has a chance of 30% excellent damage rate of 10 x str and displays Floating Text Damage in a different color from normal Floating Text Damage.
Here's how you can modify the damage of the ability:
  • Cast Thunderclap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • -------- Calculate how much damage to deal: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Greater than 30
        • Then - Actions
          • -------- Normal damage: --------
          • Set VariableSet Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 5.00)
        • Else - Actions
          • -------- Excellent damage: --------
          • Set VariableSet Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 10.00)
      • -------- --------
      • -------- Modify Thunderclap's damage to use Strength (5x or 10x): --------
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Thunder Clap)'s Real Level Field: AOE Damage ('Htc1') of Level: ((Level of (Ability being cast) for (Triggering unit)) - 1) to Thunderclap_Damage
The Set Ability action requires at least patch 1.31.

I attached a map (requires latest patch) that shows another way to do this with Floating Text. The way it's handling the Floating Text is not perfect but it should work 99% of the time. It'd only be a visual bug if it ever goes wrong.
 

Attachments

  • Thunderclap Str.w3m
    20.1 KB · Views: 2
Last edited:
Level 4
Joined
Mar 7, 2024
Messages
45
You are such a good person, I thank you very much 😍
Here's how you can modify the damage of the ability:
  • Cast Thunderclap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • -------- Calculate how much damage to deal: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Greater than 30
        • Then - Actions
          • -------- Normal damage: --------
          • Set VariableSet Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 5.00)
        • Else - Actions
          • -------- Excellent damage: --------
          • Set VariableSet Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 10.00)
      • -------- --------
      • -------- Modify Thunderclap's damage to use Strength (5x or 10x): --------
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Thunder Clap)'s Real Level Field: AOE Damage ('Htc1') of Level: ((Level of (Ability being cast) for (Triggering unit)) - 1) to Thunderclap_Damage
The Set Ability action requires at least patch 1.31.

I attached a map (requires latest patch) that shows another way to do this with Floating Text. The way it's handling the Floating Text is not perfect but it should work 99% of the time. It'd only be a visual bug if it ever goes wrong.
 
Level 4
Joined
Mar 7, 2024
Messages
45
Here's how you can modify the damage of the ability:
  • Cast Thunderclap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • -------- Calculate how much damage to deal: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Greater than 30
        • Then - Actions
          • -------- Normal damage: --------
          • Set VariableSet Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 5.00)
        • Else - Actions
          • -------- Excellent damage: --------
          • Set VariableSet Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 10.00)
      • -------- --------
      • -------- Modify Thunderclap's damage to use Strength (5x or 10x): --------
      • Ability - Set Ability: (Unit: (Triggering unit)'s Ability with Ability Code: Thunder Clap)'s Real Level Field: AOE Damage ('Htc1') of Level: ((Level of (Ability being cast) for (Triggering unit)) - 1) to Thunderclap_Damage
The Set Ability action requires at least patch 1.31.

I attached a map (requires latest patch) that shows another way to do this with Floating Text. The way it's handling the Floating Text is not perfect but it should work 99% of the time. It'd only be a visual bug if it ever goes wrong.
I'm using World Editor Version 1.29 :(( Can you help me make a map in World Editor Version under 1.30?
 
I'm using World Editor Version 1.29 :(( Can you help me make a map in World Editor Version under 1.30?
It's a good idea to mention that in initial post imo.
I'd just deal the damage with triggers instead of with the ability in that case?
Note: I assume things such as radius and targets allowed here.
  • Thunderclap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Set point1 = (Position of (Triggering unit))
      • Set group1 = (Units within 300.00 of point1)
      • Custom script: call RemoveLocation(udg_point1)
      • Unit Group - Pick every unit in group1 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Triggering player)) Equal to True
              • ((Picked unit) is A ground unit) Equal to True
              • ((Picked unit) is Mechanical) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 100) Greater than 30
                • Then - Actions
                  • Set Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 5.00)
                • Else - Actions
                  • Set Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 10.00)
                • Unit - Cause (Triggering unit) to damage (Picked unit), dealing Thunderclap_Damage damage of attack type Spells and damage type Normal
            • Else - Actions
      • Custom script: call DestroyGroup(udg_group1)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
I'm using World Editor Version 1.29 :(( Can you help me make a map in World Editor Version under 1.30?
I can't send you a map since I'm on the latest version but you can trigger the damage like this:
  • Cast Thunderclap v129
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Set Thunderclap_Point = (Position of (Triggering unit))
      • -------- --------
      • -------- Calculate the Strength bonus damage: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Greater than 30
        • Then - Actions
          • -------- Normal damage: --------
          • Set Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 5.00)
        • Else - Actions
          • -------- Excellent damage: --------
          • Set Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 10.00)
      • -------- --------
      • -------- Store units within the Area of Effect inside of a Unit Group: --------
      • Set Thunderclap_Group = (Units within (200.00 + (50.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))) of Thunderclap_Point.)
      • -------- --------
      • -------- Deal damage to enemy units: --------
      • Unit Group - Pick every unit in Thunderclap_Group and do (Actions)
        • Loop - Actions
          • Set Thunderclap_Target = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Thunderclap_Target is alive) Equal to True
              • (Thunderclap_Target belongs to an enemy of (Owner of (Triggering unit)).) Equal to True
              • (Thunderclap_Target is A ground unit) Equal to True
              • (Thunderclap_Target is A structure) Equal to False
              • (Thunderclap_Target is Mechanical) Equal to False
              • (Thunderclap_Target is Magic Immune) Equal to False
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage Thunderclap_Target, dealing Thunderclap_Damage damage of attack type Spells and damage type Normal
            • Else - Actions
      • -------- --------
      • -------- Clean up memory leaks: --------
      • Custom script: call RemoveLocation( udg_Thunderclap_Point )
      • Custom script: call DestroyGroup( udg_Thunderclap_Group )
And if you want Floating Text you can add that when dealing the damage:
  • Cast Thunderclap v129 ft
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Set Thunderclap_Point = (Position of (Triggering unit))
      • -------- --------
      • -------- Calculate the Strength bonus damage: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Greater than 30
        • Then - Actions
          • -------- Normal damage: --------
          • Set Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 5.00)
        • Else - Actions
          • -------- Excellent damage: --------
          • Set Thunderclap_Damage = ((Real((Strength of (Triggering unit) (Include bonuses)))) x 10.00)
      • -------- --------
      • -------- Store units within the Area of Effect inside of a Unit Group: --------
      • Set Thunderclap_Group = (Units within (200.00 + (50.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))) of Thunderclap_Point.)
      • -------- --------
      • -------- Get the message used in the Floating Text: --------
      • Set Thunderclap_Text = (String((Integer(Thunderclap_Damage))))
      • -------- --------
      • -------- Deal damage to enemy units: --------
      • Unit Group - Pick every unit in Thunderclap_Group and do (Actions)
        • Loop - Actions
          • Set Thunderclap_Target = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Thunderclap_Target is alive) Equal to True
              • (Thunderclap_Target belongs to an enemy of (Owner of (Triggering unit)).) Equal to True
              • (Thunderclap_Target is A ground unit) Equal to True
              • (Thunderclap_Target is A structure) Equal to False
              • (Thunderclap_Target is Mechanical) Equal to False
              • (Thunderclap_Target is Magic Immune) Equal to False
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage Thunderclap_Target, dealing Thunderclap_Damage damage of attack type Spells and damage type Normal
              • -------- --------
              • Floating Text - Create floating text that reads Thunderclap_Text above Thunderclap_Target with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
              • Set Thunderclap_Tag = (Last created floating text)
              • Floating Text - Set the velocity of Thunderclap_Tag to 64.00 towards 90.00 degrees
              • Floating Text - Change the lifespan of Thunderclap_Tag to 3.00 seconds
              • Floating Text - Change the fading age of Thunderclap_Tag to 2.00 seconds
              • Floating Text - Change Thunderclap_Tag: Disable permanence
            • Else - Actions
      • -------- --------
      • -------- Clean up memory leaks: --------
      • Custom script: call RemoveLocation( udg_Thunderclap_Point )
      • Custom script: call DestroyGroup( udg_Thunderclap_Group )
Make sure your Unit Group uses the same Area of Effect as the ability in the Object Editor:
  • Set Thunderclap_Group = (Units within (200.00 + (50.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))) of Thunderclap_Point.)
That being said, you may need to increase this range slightly because it's not an exact match. People usually add 32 or 64 as to include collision sizes.

The arithmetic being used: 200 + 50 * Ability Level = 250/300/350.

Alternatively, you can trigger all of the effects of Thunderclap yourself and have the base ability do nothing. This would solve any weird issues. The trigger would be the same as the above triggers but you'd also have a Dummy unit cast Slow on the Thunderclap_Target. A Dummy unit is based on the undead Locust with it's Model, Shadow, Attack, and Movement Type set to None and Speed Base set to 0. This allows it to cast spells instantly while being completely unseen/uncontrollable. There's many examples of this on Hive if you search around for "Dummy caster".
 
Last edited:
Top