joohen
New Member
- Reaction score
- 20
I would like to know how to make a skill when enemies are close to you and it hits the surrounding creeps like how the old Razor in DotA.Sorry for my poor english.
Putting roXplosive's words into two triggers:
You'll need 4 variables: ShockTroopers (unit group), ShockVictims (unit group), Shocker (unit) and ShockCenter (point)
Replace MegaShock with your spell's name, the 3 second timer with how often you want it to activate, the (Real((((Level of MegaShock for Shocker) x 30) + 60))) with how much damage you want it to do, the 700 with your range and the special effect with what you want to appear on the victims.
Trigger:
- Shock1
- Events
- Unit - A unit Learns a skill
- Conditions
- (Learned Hero Skill) Equal to MegaShock
- ((Triggering unit) is in ShockTroopers) Equal to False
- Actions
- Unit Group - Add (Triggering unit) to ShockTroopers
Trigger:
- Shock2
- Events
- Time - Every 3.00 seconds of game time
- Conditions
- Actions
- Unit Group - Pick every unit in ShockTroopers and do (Actions)
- Loop - Actions
- Set ShockCenter = (Position of (Picked unit))
- Set Shocker = (Picked unit)
- Set ShockVictims = (Units within 700.00 of ShockCenter matching (((Matching unit) belongs to an ally of (Owner of (Picked unit))) Equal to False))
- Unit Group - Pick every unit in ShockVictims and do (Actions)
- Loop - Actions
- Unit - Cause Shocker to damage (Picked unit), dealing (Real((((Level of MegaShock for Shocker) x 30) + 60))) damage of attack type Spells and damage type Normal
- Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Weapons\Bolt\BoltImpact.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation(udg_ShockCenter)
- Custom script: call DestroyGroup(udg_ShockVictims)
- Custom script: set Shocker = null
Yep, gotta love that prefix.ChangetoJASS:Custom script: set Shocker = null
JASS:Custom script: set udg_Shocker = null