Item % Splash Damage

BloodySkullz

Active Member
Reaction score
10
Hi, I was trying to make an item that when a ranged Hero carries it, it can splashes a % of the damage to nearby enemy units. How can I make the item with the effect without using the Hero's Attack 2 function?
 

Ayanami

칼리
Reaction score
288
Hi, I was trying to make an item that when a ranged Hero carries it, it can splashes a % of the damage to nearby enemy units. How can I make the item with the effect without using the Hero's Attack 2 function?

Do you mind if the item ability is a buff placer? Can be easily accomplished with a buff placer.
 

Ayanami

칼리
Reaction score
288
Create an Envenomed Spears spell. Ensure that it doesn't require any upgrades and change it to an item ability. Set the duration of the poison to any duration. Set the values such as damage and movement speed reduction to 0. Give this ability to your item. Now, you need an efficient Damage Detection system. Well, there's several in this forums, and there's 1 neat damage detection system that is GUI-friendly. GDD. You do not need any JASS knowledge to use this.

Now, you'll need to create 2 buffs, which are originally the 2 buffs from Envenomed Spears. They're Poison (Non-stacking) and Poison (Stacking). Create the buffs and just name it A and B. Doesn't matter. Now, here's the trigger.

Trigger:
  • Area Damage
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (GDD_Damaged_Unit has buff A) Equal to True
          • (GDD_Damaged_Unit has buff B) Equal to True
    • Actions
      • Trigger - Turn off (This trigger) <-- To prevent infinite loops
      • Set TempSplash = 20.00 <-- This is the % of the damage splashed. In this case, 20%
      • Set TempArea = 500.00 <-- Area of splash
      • Set TempPoint = (Position of GDD_Damaged_Unit) <-- Setting the position of the damaged unit, or attacked unit to prevent leak issues later
      • Set TempGroup = (Units within TempArea of TempPoint) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of GDD_Damage_Source)) Equal to True)))) <-- To check the targets that can be hit
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause GDD_Damage_Source to damage (Picked unit), dealing (GDD_Damage x (TempSplash / 100)) damage of attack type Normal and damage type Normal <-- Dealing the damage. You can change the attack type and damage type accordingly
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl <-- Attach a special effect if you desire. If not, don't include this.
          • Special Effect - Destroy (Last created unit) <-- Removing special effect to prevent memory leak
      • Custom script: call RemoveLocation(udg_TempPoint) <-- Removing location to prevent memory leak
      • Custom script: call DestroyGroup(udg_TempGroup) <-- Destroying group to prevent memory leak
      • Unit - Remove A buff from GDD_Damaged_Unit <-- Removing the buff applied
      • Unit - Remove B buff from GDD_Damaged_Unit <-- Removing the buff applied
      • Trigger - Turn on (This trigger) <-- Turn the trigger on again


Variables:
TempSplash - Real
TempArea - Real
TempPoint - Point
TempGroup - UnitGroup
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top