• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Spell Help...

Status
Not open for further replies.
Level 10
Joined
Nov 3, 2009
Messages
687
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