• 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.

Lighting effect problem

Status
Not open for further replies.
Level 4
Joined
Nov 25, 2010
Messages
59
Hey, i want to create a spell that requires trigger, and then i found that theres no action that create a lightning effect from the source of unit. So its like drain life but both caster and target is moving and the lighting effect is created from the target to caster... (i see it in DOTA illidan)

is there anyway to create that without JASS or vJASS??
+rep thanks
 
Level 15
Joined
Mar 8, 2009
Messages
1,651
you can try creating two dummy units (with no models) at positions of casting and target units respectively. the dummy unit at caster's position would have a dummy ability with zero effect, but with lighting you need.
that's doable in GUI as I understand
 
If you go for the idea Trillium suggested, which will not involve any Jass in it (but not the best option, by the way), then, check when the spell is cast (Unit - A unit starts the effect of an ability) and add your dummy caster to a unit group. Save via a hashtable the caster unit and fire a periodic trigger. Pick every unit in the unit group your dummy unit was added to and move them to the loaded caster's position:

  • Life Drain
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Life Drain
    • Actions
      • Set L_Duration = ((Real((Level of Life Drain for (Triggering unit)))) + 5.00)
      • Set L_Points = (Position of (Triggering unit))
      • Unit - Create 1 Footman for (Owner of (Triggering unit)) at L_Points facing Default building facing degrees
      • Unit - Add Life Drain (Neutral Hostile) to (Last created unit)
      • Unit - Hide (Last created unit)
      • Unit - Add a L_Duration second Generic expiration timer to (Last created unit)
      • Custom script: call IssueTargetOrder (GetLastCreatedUnit(), "drain", GetSpellTargetUnit())
      • Unit Group - Add (Last created unit) to L_Group
      • Hashtable - Save Handle Of(Triggering unit) as (Key caster) of (Key (Last created unit)) in Hash
      • Custom script: call RemoveLocation (udg_L_Points)
      • Trigger - Turn on Life Drain Periodic <gen>
  • Life Drain Periodic
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (L_Group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in L_Group and do (Actions)
            • Loop - Actions
              • Set L_Caster = (Load (Key caster) of (Key (Picked unit)) in Hash)
              • Custom script: call SetUnitX (GetEnumUnit(), GetUnitX (udg_L_Caster))
              • Custom script: call SetUnitY (GetEnumUnit(), GetUnitY (udg_L_Caster))
Note: SetUnitX() and SetUnitY() are working like Unit - Move Unit (Instantly), but they do not break the orders of the moving unit.

  • Life Drain Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in L_Group) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from L_Group
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Hash
Test Map:
 

Attachments

  • Life Drain (Non-channeling).w3x
    18.4 KB · Views: 42
Level 4
Joined
Nov 25, 2010
Messages
59
i think the answer is clear, thanks to pharaoh and the other of course. One more thing, if the dummy caster was moved to the loaded position of the hero, it must be cancelled but you add a costum script so it won't cancelled. is it right?
 
Status
Not open for further replies.
Top