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

Spell Help...

Status
Not open for further replies.
Level 10
Joined
Nov 3, 2009
Messages
686
Hello,

I made trigger that when unit hasn't specific buff it deals normal damage when it have specific buff it deals double damage... here my trigger but I don't want to work :dd...

  • Lava Burst
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Lava Burst [Shaman]
    • Actions
      • Set LavaDamage = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Flame Shock) Equal to False
        • Then - Actions
          • Unit - Cause (Triggering unit) to damage LavaDamage, dealing (30.00 x (Real((Level of Lava Burst [Shaman] for (Triggering unit))))) damage of attack type Spells and damage type Fire
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has buff Flame Shock) Equal to True
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage LavaDamage, dealing (30.00 x ((Real((Level of Lava Burst [Shaman] for (Triggering unit)))) x 2.00)) damage of attack type Spells and damage type Fire
            • Else - Actions
              • Do nothing
Will wait for help :>
 
Use this:
  • Lava Burst
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Lava Burst [Shaman]
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Triggering unit) has buff Flame Shock) Equal to False
      • Then - Actions
        • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (30.00 x (Real((Level of Lava Burst [Shaman] for (Triggering unit))))) damage of attack type Spells and damage type Fire
      • Else - Actions
        • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing ((30.00 x ((Real((Level of Lava Burst [Shaman] for (Triggering unit)))) x 2.00) damage of attack type Spells and damage type Fire
I optimized the trigger AND you can see that you actually multiply the level of the ability with 2, not the result of 30*level.
It needs to be ((30*level)*2), when your current one is (30*(level*2)), which is not what you want.
 
Turilli, Casting unit functions slower than Triggering unit. Generally, prefer Triggering unit on every ocassion, unless you have a damage detection, for example, system, which requires Damage Source as well.
The problem is definitely the one I described. He didn't make the formula properly. The way he did it, at Level 1, the spell will deal 30*1 = 30 damage and the double damage will deal (30*(1*2)) = 32 damage, because he placed the "Level" in the wrong arithmetic function.
 
Status
Not open for further replies.
Top