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

[Trigger] Trigger damage

Status
Not open for further replies.
Level 4
Joined
Feb 24, 2018
Messages
71
Hello there! I'm trying to make an ability where my hero has x chance on melee hit to deal 5% of target's maximum hp as damage on lvl 1 / 10% on level 2 / 15 % on level 3. But it does a lot more than that. Is something wrong with the trigger ?
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Obliterate for GDD_DamageSource) Greater than 0
    • Then - Actions
      • Set unit[1] = GDD_DamageSource
      • Set unit[2] = GDD_DamagedUnit
      • Trigger - Run SETTINGS FOR OBLITERATE <gen> (checking conditions)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 50
        • Then - Actions
          • Unit - Cause unit[1] to damage unit[2], dealing real[12] damage of attack type Normal and damage type Normal
          • Special Effect - Create a special effect attached to the chest of unit[2] using Abilities\Spells\Undead\FrostArmor\FrostArmorDamage.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
    • Else - Actions
  • SETTINGS FOR OBLITERATE
    • Events
    • Conditions
    • Actions
      • -------- DMG --------
      • Set real[12] = (0.05 x (Max life of unit[2]))
      • Set real[12] = (real[12] x (Real((Level of Obliterate for unit[1]))))
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Instead of *0.05 try /20

real[12] is a real-type, right?
I have the feeling that one of the conversions returns an Int instead of Real... I cant remember if WE round Int conversions up or down, but if it is up, then that would be causing the problem.


Also, you don't need to separate the set-up, do you? In the given context it does not make sense putting it in a separate trigger...

Also, is the auto-attack damage the only thing that runs this trigger? Could it be possible that there is some extra damage that triggers this, like added damage to the AA or else? You need to Disable the DDS before dealing trigger damage and Enable it after trigger damage is dealt.
 
Level 4
Joined
Feb 24, 2018
Messages
71
I put the damage in the same trigger and I removed the separate trigger but still doesn't work.It is possible that there is some extra damage that triggers this.
Do you mind if I send you the map to check it out ?
 
Status
Not open for further replies.
Top