- Joined
- Jun 9, 2018
- Messages
- 10
I made a spell like frost nova from WC3
And now I want the damage received by nearby units to be based on how close they are from the target
the closer the unit = the closer the damage received by the target
However, I don't know how
Need help guys
EDIT:
fixed the format
-
Thunderstruck Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Thunderstuck
-
Actions
- Set Unit_TS_Caster = (Casting unit)
- Set Unit_TS_Target = (Target unit of ability being cast)
- Set Point_TS_TargetPoint = (Position of Unit_TS_Target)
- -------- >>>>> SET DAMAGE <<<<< --------
- Set Real_TS_Damage[1] = (100.00 + ((Real((Intelligence of Unit_TS_Caster (Include bonuses)))) x 2.00))
- Set Real_TS_Damage[2] = (175.00 + ((Real((Intelligence of Unit_TS_Caster (Include bonuses)))) x 2.00))
- Set Real_TS_Damage[3] = (250.00 + ((Real((Intelligence of Unit_TS_Caster (Include bonuses)))) x 2.00))
- Set Real_TS_Damage[4] = (325.00 + ((Real((Intelligence of Unit_TS_Caster (Include bonuses)))) x 2.00))
- Set Real_TS_Damage[5] = (400.00 + ((Real((Intelligence of Unit_TS_Caster (Include bonuses)))) x 2.00))
- -------- >>>>> SET AoE <<<<< --------
- Set Real_TS_AoE[1] = 300.00
- Set Real_TS_AoE[2] = 350.00
- Set Real_TS_AoE[3] = 400.00
- Set Real_TS_AoE[4] = 450.00
- Set Real_TS_AoE[5] = 500.00
- -------- >>>>> FUNCTION <<<<< --------
- Unit - Cause Unit_TS_Caster to damage Unit_TS_Target, dealing Real_TS_Damage[(Level of (Ability being cast) for Unit_TS_Caster)] damage of attack type Spells and damage type Lightning
- Set UnitGroup_TS_Targets = (Units within Real_TS_AoE[(Level of (Ability being cast) for Unit_TS_Caster)] of Point_TS_TargetPoint)
-
Unit Group - Pick every unit in UnitGroup_TS_Targets and do (Actions)
-
Loop - Actions
- Set Unit_TS_TempUnit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit_TS_TempUnit is A structure) Equal to False
- (Unit_TS_TempUnit is alive) Equal to True
- (Unit_TS_TempUnit belongs to an enemy of (Owner of Unit_TS_Caster)) Equal to True
- Unit_TS_TempUnit Not equal to Unit_TS_Target
-
Then - Actions
- Unit - Cause Unit_TS_Caster to damage Unit_TS_TempUnit, dealing (Real_TS_Damage[(Level of (Ability being cast) for Unit_TS_Caster)] / 2.00) damage of attack type Spells and damage type Lightning
- Special Effect - Create a special effect attached to the origin of Unit_TS_TempUnit using Abilities\Weapons\Bolt\BoltImpact.mdl
- Special Effect - Destroy (Last created special effect)
- Else - Actions
-
If - Conditions
-
Loop - Actions
- Game - Display to (All players) the text: ((String(Real_TS_AoE[(Level of (Ability being cast) for Unit_TS_Caster)])) + (String(Real_TS_Damage[(Level of (Ability being cast) for Unit_TS_Caster)])))
- Custom script: call DestroyGroup(udg_UnitGroup_TS_Targets)
- Custom script: call RemoveLocation( udg_Point_TS_TargetPoint )
-
Events
And now I want the damage received by nearby units to be based on how close they are from the target
the closer the unit = the closer the damage received by the target
However, I don't know how
Need help guys
EDIT:
fixed the format