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

[Trigger] Damage targets in a cone with it's stats as damage

Status
Not open for further replies.
Level 5
Joined
Jun 26, 2016
Messages
60
I tried to do that by doing dmg only to units that has a buff but the ability isn't fast, and I'm trying to make a cone with travel time that deals dmg based on stats not instant.
Help plss ^^
  • Shear Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shear
    • Actions
      • Set VariableSet Shear_Caster = (Triggering unit)
      • Set VariableSet Shear_Owner = (Owner of Shear_Caster)
      • Set VariableSet Shear_Caster_Loc = (Position of Shear_Caster)
      • Unit - Create 1Dummy Shear for Shear_Owner at Shear_Caster_Loc facing (Facing of Shear_Caster) degrees
      • Unit - Set level of Breath of Frost Shear Dummy for (Last created unit) to (Level of Shear for Shear_Caster)
      • Unit - Order (Last created unit) to Neutral - Breath Of Frost((Position of (Last created unit)) offset by 0.00 towards (Facing of (Last created unit)) degrees.)
      • Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
      • Hashtable - Save (Real((Agility of (Triggering unit) (Include bonuses)))) as 0 of 0 in Hashtable_Shear.
      • Hashtable - Save (Real((Level of Shear for (Triggering unit)))) as 1 of 0 in Hashtable_Shear.
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Shear_Hero_Caster is empty) Equal to True
        • Then - Actions
          • Trigger - Turn on Shear Activation Damage Copy 2 <gen>
        • Else - Actions
  • [/code]
  • [code]Shear Activation Damage Copy 2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Breath of Frost Shear Dummy
    • Actions
      • Set VariableSet Betrayer_Agi = (Load 0 of 0 from Hashtable_Shear.)
      • Set VariableSet Betrayer_Shear_Lvl = (Load 1 of 0 from Hashtable_Shear.)
      • Set VariableSet Shear_Damage_Group = (Units in (Playable map area) matching ((((Matching unit) has buff Shear) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True)))
      • Unit Group - Pick every unit in Shear_Damage_Group and do (Actions)
        • Loop - Actions
          • Unit - Cause Shear_Caster to damage (Picked unit), dealing ((Betrayer_Shear_Lvl x (Betrayer_Agi / 2.00)) + (5.00 x ((Life of (Picked unit)) / 100.00))) damage of attack type Spells and damage type Unknown
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Shear_Hero_Caster is empty) Equal to True
            • Then - Actions
              • Hashtable - Clear all child hashtables of child (Key (Picked unit).) in Hashtable_Shear.
              • Trigger - Turn off (This trigger)
            • Else - Actions
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,377
Honestly, I would advise either using a damage detection system to detect when a unit takes damage from your dummy unit (assuming the unit-type of the dummy would be unique for this spell) or do it via math by picking all units within range of caster, calculating where the cone area is and damaging only picked units which happen to be in the cone area.
Since you want the spell to damage closest units first and furthest units last, you could implement the above cone logic in a loop trigger. E.g. first iteration damages units in cone that are within 200 range of caster, second iteration damages units in cone that are within 400 range, etc.
 
Level 39
Joined
Feb 27, 2007
Messages
4,989
Use [trigger][/trigger] tags for GUI triggers.

While what Nichilius wrote above would work, the simplest way is going to be to use Breath of Fire. You can give the ability to a dummy and then use the new functions to set ability field values to change the damage dealt by the ability. Compute what the damage should be based on the caster’s stats and set it to that value using ‘set ability real field’.

If you then want to prevent damage to units that don’t have a buff you can either finagle the spell’s damage, duration, and DoT values as well as using that buff instead of the buff BoF normally checks for to ignite targets. The other solution would be to use a DDS, detect when damage is dealt by this dummy unit, and then prevent damage to units that don’t have the buff.
 
Level 24
Joined
Feb 9, 2009
Messages
1,783
Try fiddling with this, it's based (roughly) off of pantheon's aegis assault from league of legends and blocks and deals damage in a cone direction, Frankenstein the math from its group check and use it in yours, if you cant manage that I'll be back at my computer later tomorrow and I can go more in depth with you.
 
Level 5
Joined
Jun 26, 2016
Messages
60
Honestly, I would advise either using a damage detection system to detect when a unit takes damage from your dummy unit (assuming the unit-type of the dummy would be unique for this spell) or do it via math by picking all units within range of caster, calculating where the cone area is and damaging only picked units which happen to be in the cone area.
Since you want the spell to damage closest units first and furthest units last, you could implement the above cone logic in a loop trigger. E.g. first iteration damages units in cone that are within 200 range of caster, second iteration damages units in cone that are within 400 range, etc.
I've tried to use Damage Engine 5.4.2.3 but I'm not sure how to use it
 
Level 5
Joined
Jun 26, 2016
Messages
60
Use [trigger][/trigger] tags for GUI triggers.

While what Nichilius wrote above would work, the simplest way is going to be to use Breath of Fire. You can give the ability to a dummy and then use the new functions to set ability field values to change the damage dealt by the ability. Compute what the damage should be based on the caster’s stats and set it to that value using ‘set ability real field’.

If you then want to prevent damage to units that don’t have a buff you can either finagle the spell’s damage, duration, and DoT values as well as using that buff instead of the buff BoF normally checks for to ignite targets. The other solution would be to use a DDS, detect when damage is dealt by this dummy unit, and then prevent damage to units that don’t have the buff.
Doesnt both breath of fire/frost applies buff to targets hit
 
Level 24
Joined
Feb 9, 2009
Messages
1,783
Now that I'm not half awake I see you want to have a stat based breathe of fire?
The tricky part is dealing damage to each of the units hit individually under your conditions, because there is no way to isolate a single spell usage outside of using some voodoo triggers.

Nichilus is has the best option, to do that with damage engine use this:
  • Shear hit
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to True
      • (Unit-type of DamageEventSource) Equal to YourDummyUnit
      • (Level of (YourDummySpell) for DamageEventSource) Greater than 0
    • Actions
      • Unit - Cause OriginalCaster to damage DamageEventTarget, dealing (Agi x (.50 x S_Lvl)) + ((Life of DamageEventTarget) x 0.05) damage of attack type Spells and damage type Normal
      • Set DamageEventAmount = 0.00
      • -------- OR --------
      • Set DamageEventAmount = (Agi x (.50 x S_Lvl)) + ((Life of DamageEventTarget) x 0.05)

The former sources the damage to your caster for later purposes down the line, but you can simply use the latter part to modify the damage that was originally dealt.
 
Level 24
Joined
Feb 9, 2009
Messages
1,783
DDS + cast spell with dummy + put dummy in a unit group + check that damage sources is in group = that spell dealt that damage.

Like I said, Voodoo
Voodoo.gif
 
Status
Not open for further replies.
Top