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

Amplified Damage Spell

Status
Not open for further replies.
Level 8
Joined
Apr 30, 2009
Messages
338
I have a spell for an Assassin class in my map:

Silences the target for 5 seconds. You are healed for 15% of any damage you cause to the target of Lotus Extract, and they suffer 15% amplified damage from you.|n|n|cffaaaaaaRange: Melee|nCooldown: 25|r

Problem with my trigger now is, as you can see I have a floating text spawn when it occurs as a test to show when the damage buff is applied. Well the problem is, it is occurring on every attack from any unit. I just want it to occur on the damage caused by the Assassin

Here are my triggers

  • Lotus Extract 01
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to ASN-3 Lotus Extract
    • Actions
      • Set temp_point = (Position of (Target unit of ability being cast))
      • Unit - Create 1 D.ASN-2 Lotus Extract for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Fire Lord - Soul Burn (Target unit of ability being cast)
      • Hashtable - Save 5.00 as (Key duration) of (Key (Last created unit)) in H_LotusExtract
      • Hashtable - Save Handle Of(Triggering unit) as (Key caster) of (Key (Last created unit)) in H_LotusExtract
      • Hashtable - Save Handle Of(Target unit of ability being cast) as (Key target) of (Key (Last created unit)) in H_LotusExtract
      • Unit Group - Add (Last created unit) to G_LotusExtract
  • Damage
    • Events
    • Conditions
    • Actions
      • Set temp_damage_real = (Damage taken)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff ~Lotus Extract (Assassin)) Equal to True
        • Then - Actions
          • Set temp_group = (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to D.ASN-2 Lotus Extract) and ((Triggering unit) Equal to (Load (Key target) of (Key (Matching unit)) in H_LotusExtract))))
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key caster) of (Key (Picked unit)) in H_LotusExtract) Equal to (Damage source)
                • Then - Actions
                  • Unit - Cause (Picked unit) to damage (Triggering unit), dealing (0.15 x temp_damage_real) damage of attack type Hero and damage type Universal
                  • Floating Text - Create floating text that reads -LOTUS- at (Position of (Triggering unit)) with Z offset 100.00, using font size 10.00, color (75.00%, 50.00%, 50.00%), and 0.00% transparency
                • Else - Actions
              • Unit Group - Remove (Picked unit) from temp_group
          • Custom script: call DestroyGroup(udg_temp_group)
        • Else - Actions
 
Level 7
Joined
Apr 12, 2009
Messages
188
Install Weep's Damage Detection System in your map, and use that to be able to define your damaged unit, damage source unit, and the amount of damage with ease, and without leaking trigger events.

It's an easy copy paste of 3 triggers, takes no JASS knowledge. I wanted to do the same type of thing you are trying to do, and this will make it possible.

GO HERE


I hope this helps, I'm not too sure how hashtables work so I can't really understand your trigger work very well. But I think it'll solve your problems.
 
Status
Not open for further replies.
Top