Jump Hammer Spell

balnazar

New Member
Reaction score
2
I am working on a spell called Storm Hammer. Basically it should be a hammer that is thrown at an enemy unit dealing Strength in damage and stunning the target and then it jumps to another enemy unit dealing the same damage and same stun. I do not know JASS so I tried to do it in GUI. Here is my trigger:

Storm Hammer
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Storm Hammer
Actions
Set TempUnit = (Casting unit)
Set TempUnit2 = (Target unit of ability being cast)
Set TempLoc = (Position of TempUnit2)
Set TempGroup = (Units within 600.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of TempUnit)) Equal to True))))
Wait ((Distance between (Position of TempUnit) and TempLoc) / 1000.00) game-time seconds
Unit - Cause TempUnit to damage TempUnit2, dealing ((1.00 + (1.00 x (Real((Level of Storm Hammer for TempUnit))))) x (Real((Strength of TempUnit (Include bonuses))))) damage of attack type Spells and damage type Normal
Unit Group - Pick every unit in (Random 1 units from TempGroup) and do (Actions)
Loop - Actions
Unit - Create 1 Wisp for (Owner of TempUnit) at (Position of TempUnit2) facing Default building facing degrees
Set Casting_Unit = (Last created unit)
Unit - Add Stun to Casting_Unit
Unit - Add a 5.00 second Generic expiration timer to Casting_Unit
Unit - Order Casting_Unit to Human Mountain King - Storm Bolt (Picked unit)
Wait ((Distance between (Position of Casting_Unit) and (Position of (Picked unit))) / 1000.00) game-time seconds
Unit - Cause TempUnit to damage (Picked unit), dealing ((1.00 + (1.00 x (Real((Level of Storm Hammer for TempUnit))))) x (Real((Strength of TempUnit (Include bonuses))))) damage of attack type Spells and damage type Normal
Custom script: call DestroyGroup( udg_TempGroup )
Custom script: call RemoveLocation( udg_TempLoc )

Basically the problem is that the first target receives the damage and the stun but the second target doesnt get it. It sometimes receives the stun but the damage is still not received. I removed the waits to see if it will work and it worked partially, but again sometimes the target didn't get stunned or damaged (the second target). Any help will be appreciated :)
 

sentrywiz

New Member
Reaction score
25
I am working on a spell called Storm Hammer. Basically it should be a hammer that is thrown at an enemy unit dealing Strength in damage and stunning the target and then it jumps to another enemy unit dealing the same damage and same stun. I do not know JASS so I tried to do it in GUI. Here is my trigger:

Storm Hammer
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Storm Hammer
Actions
Set TempUnit = (Casting unit)
Set TempUnit2 = (Target unit of ability being cast)
Set TempLoc = (Position of TempUnit2)
Set TempGroup = (Units within 600.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of TempUnit)) Equal to True))))
Wait ((Distance between (Position of TempUnit) and TempLoc) / 1000.00) game-time seconds
Unit - Cause TempUnit to damage TempUnit2, dealing ((1.00 + (1.00 x (Real((Level of Storm Hammer for TempUnit))))) x (Real((Strength of TempUnit (Include bonuses))))) damage of attack type Spells and damage type Normal
Unit Group - Pick every unit in (Random 1 units from TempGroup) and do (Actions)
Loop - Actions
Unit - Create 1 Wisp for (Owner of TempUnit) at (Position of TempUnit2) facing Default building facing degrees
Set Casting_Unit = (Last created unit)
Unit - Add Stun to Casting_Unit
Unit - Add a 5.00 second Generic expiration timer to Casting_Unit
Unit - Order Casting_Unit to Human Mountain King - Storm Bolt (Picked unit)
Wait ((Distance between (Position of Casting_Unit) and (Position of (Picked unit))) / 1000.00) game-time seconds
Unit - Cause TempUnit to damage (Picked unit), dealing ((1.00 + (1.00 x (Real((Level of Storm Hammer for TempUnit))))) x (Real((Strength of TempUnit (Include bonuses))))) damage of attack type Spells and damage type Normal
Custom script: call DestroyGroup( udg_TempGroup )
Custom script: call RemoveLocation( udg_TempLoc )

Basically the problem is that the first target receives the damage and the stun but the second target doesnt get it. It sometimes receives the stun but the damage is still not received. I removed the waits to see if it will work and it worked partially, but again sometimes the target didn't get stunned or damaged (the second target). Any help will be appreciated :)

Use GUI tags? Pretty please... look how better it looks.

Trigger:
  • Storm Hammer
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Hammer
    • Actions
      • Set TempUnit = (Casting unit)
      • Set TempUnit2 = (Target unit of ability being cast)
      • Set TempLoc = (Position of TempUnit2)
      • Set TempGroup = (Units within 600.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of TempUnit)) Equal to True))))
      • Wait ((Distance between (Position of TempUnit) and TempLoc) / 1000.00) game-time seconds
      • Unit - Cause TempUnit to damage TempUnit2, dealing ((1.00 + (1.00 x (Real((Level of Storm Hammer for TempUnit))))) x (Real((Strength of TempUnit (Include bonuses))))) damage of attack type Spells and damage type Normal
      • Unit Group - Pick every unit in (Random 1 units from TempGroup) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Wisp for (Owner of TempUnit) at (Position of TempUnit2) facing Default building facing degrees
          • Set Casting_Unit = (Last created unit)
          • Unit - Add Stun to Casting_Unit
          • Unit - Add a 5.00 second Generic expiration timer to Casting_Unit
          • Unit - Order Casting_Unit to Human Mountain King - Storm Bolt (Picked unit)
          • Wait ((Distance between (Position of Casting_Unit) and (Position of (Picked unit))) / 1000.00) game-time seconds
          • Unit - Cause TempUnit to damage (Picked unit), dealing ((1.00 + (1.00 x (Real((Level of Storm Hammer for TempUnit))))) x (Real((Strength of TempUnit (Include bonuses))))) damage of attack type Spells and damage type Normal
      • Custom script: call DestroyGroup( udg_TempGroup )
      • Custom script: call RemoveLocation( udg_TempLoc )


I think the damage+effect depend on two things here. You may damage+stun the same unit again, and your waits may overlap at some point.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top