• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Lightning Strike

Status
Not open for further replies.
Level 5
Joined
Feb 1, 2011
Messages
178
I'm trying to make a spell where lightning strikes at the location targeted by the hero, and any hero/unit that was in that area would take damage.

Just to clarify I don't want it to be an aoe, just a single target(without an actual target, sort of like how blink targets the ground).

I tried to create it out of the Blizzard spell but couldn't get it to work, any suggestions?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Here's ho you can do the lightning:

  • Untitled Trigger 016
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave
    • Actions
      • Custom script: local unit u = GetTriggerUnit()
      • Custom script: local location loc1 = GetUnitLoc(u)
      • Custom script: local location loc2 = GetSpellTargetLoc()
      • Custom script: local lightning l = AddLightningEx("CLPB", true, GetUnitX(u), GetUnitY(u), GetLocationZ(loc1) + 60, GetSpellTargetX(), GetSpellTargetY(), GetLocationZ(loc2))
      • Wait 1.00 seconds
      • Custom script: call DestroyLightning(l)
      • Custom script: call RemoveLocation(loc1)
      • Custom script: call RemoveLocation(loc2)
      • Custom script: set loc1 = null
      • Custom script: set loc2 = null
      • Custom script: set u = null
      • Custom script: set l = null
 
Level 5
Joined
Feb 1, 2011
Messages
178
Thank you very much, but how can i change it so the lightning doesn't originate from the hero but instead the sky, like how the lightning doodad works.

Also how can i make the spell do damage?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Untitled Trigger 016
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to *your ability*
    • Actions
      • Custom script: local unit u = GetTriggerUnit()
      • Custom script: local location loc = GetSpellTargetLoc()
      • Custom script: local lightning l = AddLightningEx("CLPB", true, GetSpellTargetX(), GetSpellTargetY(), GetLocationZ(loc) + 2000, GetSpellTargetX(), GetSpellTargetY(), GetLocationZ(loc))
      • Wait 1.00 seconds
      • Custom script: call DestroyLightning(l)
      • Custom script: call RemoveLocation(loc)
      • Custom script: set loc = null
      • Custom script: set u = null
      • Custom script: set l = null
For the damage, use Unit group - pick all units in range matching ((matching unit) is alive) and ((matching unit) belongs to an enemy of (owner of (triggering unit)))

In the unit group loop, make the triggering unit damage picked unit.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
I can't seem to find that field in the trigger editor, everything works but the damage.

  • Unit Group - Pick every unit in (Units within 512.00 of (Position of (Triggering unit)) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))) and do (Actions)
    • Loop - Actions
      • make the triggering unit damage the picked unit here...
 
Status
Not open for further replies.
Top