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

[Trigger] Unit hit by Ability?

Status
Not open for further replies.
Level 4
Joined
Dec 8, 2007
Messages
86
I have some problems with a spell i'm working on which does that those that are hit of it gets decreased movement speed by 50% and armor reduced (spell is based on Shockwave, so do not say "Just use Thunder Clap")

I've tried several times but i can't seem to get it to work, please if you could help me i would be grateful ^^

  • Wave of Loss
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions
I cant figure it out from there xD
Is this even possible?
 
Level 20
Joined
Oct 21, 2006
Messages
3,230
You cant get event "Unit is hit by shockwave", so you have to make a triggered shockwave and use it to deal damage, then there you can get the event. Its from my old map, so there are some unnecessary stuff.

On second trigger "picks unit" you can use set speed of picked unit or add buff for it.
  • Shockwave
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave
    • Actions
      • Set Point1 = (Position of (Triggering unit))
      • Set Point2 = (Point1 offset by 50.00 towards (Facing of (Triggering unit)) degrees)
      • Unit - Create 1 Dummy: Shockwave for (Owner of (Triggering unit)) at Point2 facing (Facing of (Triggering unit)) degrees
      • Custom script: call RemoveLocation(udg_Point1)
      • Custom script: call RemoveLocation(udg_Point2)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Wait 1.00 seconds
      • Unit Group - Remove all units from Shockwave_Picked[(Player number of (Owner of (Triggering unit)))]
  • Shockwave loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units of type Dummy: Shockwave) and do (Actions)
        • Loop - Actions
          • Set Temp_Unit = (Picked unit)
          • Set Point1 = (Position of (Picked unit))
          • Set Point2 = (Point1 offset by 100.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to Point2
          • Special Effect - Create a special effect at Point2 using Abilities\Spells\Other\Volcano\VolcanoDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: set bj_wantDestroyGroup = true
          • Set RageSystem_Disabled = True
          • Set Dodge_Disabled = True
          • Set DefaultColors_Disabled = True
          • Unit Group - Pick every unit in (Units within 150.00 of Point2 matching ((((Matching unit) is alive) Equal to True) and (((Owner of Temp_Unit) is an enemy of (Owner of (Matching unit))) Equal to True))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in Shockwave_Picked[(Player number of (Owner of Temp_Unit))]) Equal to True
                • Then - Actions
                • Else - Actions
                  • Unit Group - Add (Picked unit) to Shockwave_Picked[(Player number of (Owner of Temp_Unit))]
                  • Set Text_Color1 = 100.00
                  • Set Text_Color2 = 100.00
                  • Set Text_Color3 = 0.00
                  • Set Text_Color4 = 0.00
                  • Unit - Cause Hero[(Player number of (Owner of Temp_Unit))] to damage (Picked unit), dealing (Real(Damage_Shockwave[(Player number of (Owner of Temp_Unit))])) damage of attack type Spells and damage type Normal
                  • Set DefaultColors_Disabled = False
          • Set RageSystem_Disabled = False
          • Set Dodge_Disabled = False
          • Custom script: call RemoveLocation(udg_Point1)
          • Custom script: call RemoveLocation(udg_Point2)
 
Level 4
Joined
Dec 8, 2007
Messages
86
I hope i've done it correctly, will test it shortly ^^

  • Wave of Loss
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Wave of Loss
        • Then - Actions
          • Set WoLPoint[1] = (Position of (Triggering unit))
          • Set WoLPoint[2] = (Target point of ability being cast)
          • Unit - Create 1 Wave of Loss for (Owner of (Triggering unit)) at WoLPoint[1] facing WoLPoint[2]
          • Custom script: call RemoveLocation(udg_WoLPoint[1])
          • Custom script: call RemoveLocation(udg_WoLPoint[2])
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Wait 1.00 seconds
          • Unit Group - Remove all units from WoL_Picked[(Player number of (Owner of (Triggering unit)))]
        • Else - Actions
  • Wave of Loss Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units of type Wave of Loss) and do (Actions)
        • Loop - Actions
          • Set Temp_WoL = (Picked unit)
          • Set WoLPoint[1] = (Position of (Picked unit))
          • Set WoLPoint[2] = (Target point of ability being cast)
          • Unit - Move (Picked unit) instantly to WoLPoint[2]
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 150.00 of WoLPoint[2] matching ((((Matching unit) is alive) Equal to True) and (((Owner of Temp_WoL) is an enemy of (Owner of (Matching unit))) Equal to True))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in WoL_Picked[(Player number of (Owner of Temp_WoL))]) Equal to True
                • Then - Actions
                • Else - Actions
                  • Unit Group - Add (Picked unit) to WoL_Picked[(Player number of (Owner of Temp_WoL))]
                  • Unit - Cause Hero[(Player number of (Owner of Temp_WoL))] to damage (Picked unit), dealing (Real(Damage_WoL[(Player number of (Owner of Temp_WoL))])) damage of attack type Spells and damage type Normal
          • Custom script: call RemoveLocation(udg_WoLPoint[1])
          • Custom script: call RemoveLocation(udg_WoLPoint[2])
 
Last edited:
Level 9
Joined
Nov 4, 2007
Messages
933
There is another way of doing this if you haven't solved the problem yet, you could just use breath of fire ability and change the stats to match shockwave and use a custom buff inside of that ability to be checked for by a trigger, so if unit x has buff (custom buff) then carry out your actions for said unit. This will probably involve a periodic check for the custom buff which you could turn on and off to prevent the possibility of small leaks building up.
 
Level 15
Joined
Dec 18, 2007
Messages
1,098
BoF is not the best idea. It acts weirdly and it does not make the ground sink.
Also, since its not possible to check the level of the buff for BoF without JASS, you will need JASS to get the level of the ability. It should be rather easy to get the level of the ability, use a custom script something like this:
set udg_Variable = GetUnitAbilityLevel(GetEnumUnit(), 'buffcode')
Just change the buffcode to the buffcode of the buff, change view to view Raw Data.
 
Level 15
Joined
Dec 18, 2007
Messages
1,098
Gah. Just look at my spellpack and rip Entangling Magic form KotG. You can just change the spell the dummy cast and you're done.
PS: Since its troublesome to trigger the damage for shockwave (hit each unit once), I suggest simply using your current Shockwave skill and change the entangling magic spell to trigger on it. Then Shockwave will do the damage part and the buff thingy will be done by triggers.
SpellPack
 
Status
Not open for further replies.
Top