• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Shock effect on damaged units

Status
Not open for further replies.
Level 1
Joined
Mar 2, 2010
Messages
3
Ok so what I'm trying to do is create a shock/lightning special effect attached to the chest of each damaged unit by this spell:

  • Electrokinesis
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Electrokinesis
    • Actions
      • Special Effect - Create a special effect attached to the chest of Caster using Abilities\Weapons\Bolt\BoltImpact.mdl
      • Set ElectroCaster = (Last created special effect)
      • Special Effect - Create a special effect attached to the hand,left of Caster using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
      • Set ElectroCaster2 = (Last created special effect)
      • Special Effect - Create a special effect attached to the hand,left of Caster using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
      • Set ElectroCaster3 = (Last created special effect)
      • Hashtable - Create a hashtable
      • Set ElectroTable = (Last created hashtable)
      • Set Caster = (Triggering unit)
      • Set CasLoc = (Position of (Triggering unit))
      • Set Sptarget = (Target point of ability being cast)
      • Set Real = ((Facing of Caster) - 90.00)
      • Set CasDist = (Distance between CasLoc and Sptarget)
      • Set CasAng = (Angle from CasLoc to Sptarget)
      • Set ElectroTableVar = 0
      • Unit - Create 1 Dummy for (Owner of Caster) at CasLoc facing Default building facing degrees
      • Unit - Turn collision for (Last created unit) Off
      • Unit - Add Electrokinesis Dummy to (Last created unit)
      • Unit - Set level of Electrokinesis Dummy for (Last created unit) to (Level of Electrokinesis for Caster)
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm Sptarget
      • Unit - Add a 3.50 second Generic expiration timer to (Last created unit)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set LocOffset = (CasLoc offset by 200.00 towards Real degrees)
          • Set AngOffset = (LocOffset offset by CasDist towards CasAng degrees)
          • Lightning - Create a Chain Lightning - Primary lightning effect from source CasLoc to target LocOffset
          • Hashtable - Save Handle Of(Last created lightning effect) as (ElectroTableVar + 1) of 1 in ElectroTable
          • Lightning - Create a Chain Lightning - Secondary lightning effect from source LocOffset to target AngOffset
          • Hashtable - Save Handle Of(Last created lightning effect) as (ElectroTableVar + 1) of 2 in ElectroTable
          • Set Real = (Real + (180.00 / 5.00))
          • Set ElectroTableVar = (ElectroTableVar + 1)
      • Custom script: call RemoveLocation(udg_CasLoc)
      • Wait 0.75 seconds
      • Special Effect - Destroy ElectroCaster
      • Special Effect - Destroy ElectroCaster2
      • Special Effect - Destroy ElectroCaster3
      • Lightning - Destroy (Load 1 of 1 in ElectroTable)
      • Lightning - Destroy (Load 1 of 2 in ElectroTable)
      • Lightning - Destroy (Load 2 of 1 in ElectroTable)
      • Lightning - Destroy (Load 2 of 2 in ElectroTable)
      • Lightning - Destroy (Load 3 of 1 in ElectroTable)
      • Lightning - Destroy (Load 3 of 2 in ElectroTable)
      • Lightning - Destroy (Load 4 of 1 in ElectroTable)
      • Lightning - Destroy (Load 4 of 2 in ElectroTable)
      • Lightning - Destroy (Load 5 of 1 in ElectroTable)
      • Lightning - Destroy (Load 5 of 2 in ElectroTable)
      • Lightning - Destroy (Load 6 of 1 in ElectroTable)
      • Lightning - Destroy (Load 6 of 2 in ElectroTable)
      • Hashtable - Clear all child hashtables of child ElectroTableVar in ElectroTable
Hope it doesn't leak. The actual spell that deals damage is based on Carrion Swarm. The effect the damaged units get is a black smoke. I don't necessarily want to replace it. I want to have a lightning or shock effect too. Any ideas on how to trigger it?:confused:
 
Status
Not open for further replies.
Top