• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[GUI]Lightning Counter v7.1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
My second spell! again, hope you like this
  • Description
    Gives a chance to avoid enemy attacks by moving so fast behind enemy and stunning them for 2 seconds, also cast chain lightning.

    Level 1 - 20% chance, 4 chain lightning targets.
    Level 2 - 30% chance, 6 chain lightning targets.
    Level 3 - 40% chance, 8 chain lightning targets.
    Level 4 - 50% chance, 10 chain lightning targets.
  • Image
    Lightning%20Counter2.jpg

    Lightning%20Counter3.jpg
  • Trigger
    • Lightning Counter Setting
      • Events
        • Map initialization
      • Conditions
      • Actions
        • -------- --------------------------- --------
        • -------- IMPORTANT VARIABLES --------
        • -------- --------------------------- --------
        • -------- Determines the ability --------
        • Set LC_Ability = Lightning Counter
        • -------- Determines the chain lightning ability --------
        • Set LC_ChainLightningAbil = Chain Lightning
        • -------- Determines the stun ability --------
        • Set LC_StunAbil = Stun
        • -------- --------------------------- --------
        • -------- Determines the chance to trigger this spell --------
        • Set LC_Chance[1] = 20.00
        • Set LC_Chance[2] = 30.00
        • Set LC_Chance[3] = 40.00
        • Set LC_Chance[4] = 50.00
        • -------- --------------------------- --------
        • -------- Determines the teleport offset distance from target position --------
        • Set LC_TeleportOffset[1] = 150.00
        • Set LC_TeleportOffset[2] = 150.00
        • Set LC_TeleportOffset[3] = 150.00
        • Set LC_TeleportOffset[4] = 150.00
        • -------- --------------------------- --------
        • -------- Determines the teleport effect --------
        • Set LC_TeleportEffect = Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
        • -------- --------------------------- --------
        • -------- Determines the stun area effect --------
        • Set LC_StunEffect = Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
        • -------- --------------------------- --------
        • Custom script: set udg_LC_Dummy=CreateUnit(Player(15),'u000',0,0,0)
        • Unit - Add LC_ChainLightningAbil to LC_Dummy
        • Unit - Add LC_StunAbil to LC_Dummy
    • Lightning Counter
      • Events
        • Unit - A unit Is attacked
      • Conditions
      • Actions
        • Set LC_Unit = (Triggering unit)
        • Set LC_Level = (Level of LC_Ability for LC_Unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • LC_Level Greater than 0
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Random real number between 0.00 and 100.00) Less than or equal to LC_Chance[LC_Level]
              • Then - Actions
                • Set LC_Owner = (Triggering player)
                • Set LC_Target = (Attacking unit)
                • Set LC_TempLoc = (Position of LC_Unit)
                • Unit - Change ownership of LC_Dummy to LC_Owner and Retain color
                • Custom script: call SetUnitX(udg_LC_Dummy,GetLocationX(udg_LC_TempLoc))
                • Custom script: call SetUnitY(udg_LC_Dummy,GetLocationY(udg_LC_TempLoc))
                • Unit - Set level of LC_ChainLightningAbil for LC_Dummy to LC_Level
                • Unit - Order LC_Dummy to Orc Far Seer - Chain Lightning LC_Target
                • Unit - Set level of LC_StunAbil for LC_Dummy to LC_Level
                • Unit - Order LC_Dummy to Orc Tauren Chieftain - War Stomp
                • Special Effect - Create a special effect at LC_TempLoc using LC_StunEffect
                • Special Effect - Destroy (Last created special effect)
                • Set LC_TempLoc2 = (Position of LC_Target)
                • Set LC_Angle = (Angle from LC_TempLoc to LC_TempLoc2)
                • Set LC_TempLoc3 = (LC_TempLoc2 offset by LC_TeleportOffset[LC_Level] towards LC_Angle degrees)
                • Unit - Move LC_Unit instantly to LC_TempLoc3
                • Special Effect - Create a special effect at LC_TempLoc3 using LC_TeleportEffect
                • Special Effect - Destroy (Last created special effect)
                • Custom script: call RemoveLocation(udg_LC_TempLoc)
                • Custom script: call RemoveLocation(udg_LC_TempLoc2)
                • Custom script: call RemoveLocation(udg_LC_TempLoc3)
              • Else - Actions
          • Else - Actions
  • Changelog
    v7.0
    - Initial version​
    v7.1
    - Uses only 1 caster dummy
    - More configurable variables
    - More efficient​
  • Credits
    - Ofel for spell idea
    - BPower for suggestions
    - Maker for advice
Please rate and comment!

Keywords:
Lightning, Counter, Thunder, Teleport, Move, AoE, Fast.
Contents

testmap (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 11:52, 20th Jan 2014 Maker: The dummy unit type needs to be set in a variable and since moving unit instantly issues stop order, the spell can almost lock the attacked unit in place if...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

11:52, 20th Jan 2014
Maker: The dummy unit type needs to be set in a variable
and since moving unit instantly issues stop order,
the spell can almost lock the attacked unit in place
if there are many enemies attacking
 
Level 13
Joined
Mar 29, 2012
Messages
530
Yes, it works...

REVIEW|Lightning Counter|v7.0

Resource Status: Approved
Rating: 3/5

GENERAL
  • None
PROS
  • MUI
  • Leakless
  • Simple (not really)
CONS
  • None
SUGGESTIONS
  • Add more idea
[/TD][/tr]
If you have any question about this review, PM or VM me Review template by Doomlord
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Yes, it works...

REVIEW|Lightning Counter|v7.0

Resource Status: Approved
Rating: 3/5

GENERAL
  • None
PROS
  • MUI
  • Leakless
  • Simple (not really)
CONS
  • None
SUGGESTIONS
  • Add more idea
[/TD][/tr]
If you have any question about this review, PM or VM me Review template by Doomlord

You should put approvable not approved.

@TO
The pic looks interesting but it does seem a little too simple.
Also why is it version 7.0 already ?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I think it would be best to use one permanent dummy since a unit can be attacked very often and therefore you create lots of dummy units. Creating a dummy is a heavy operation.

Or when a unit is attacked, create a dummy if one does not exist already. Make it be removed 10 seconds after the attack. If the unit is attacked again during that 10 seconds, reset the time.
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
  • Instead of creating a dummy over and over again, you should do it once on map init.
    • Custom script: set udg_LC_Dummy = CreateUnit(Player(15), 'u000', 0,0,0)
    udg is the prefix for GUI generated variables in you case LC_Dummy, the set keyword is the same as set variable. Player(15) is neutral passive, 'u000' is the raw-code of your dummy and 0,0,0 are x-coordinate, y-coordinate and facing.
    • Unit - Move LC_Dummy instantly to LC_TempLoc
    • Unit - Change ownership of LC_Dummy to LC_Owner and Retain color
    Instead of creating the dummy and add an expiration timer to it, you can now just move it to the casters location and change the ownership.

So far the spell is leakless and MUI. The coding style is rather simple has been common years ago.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I prefer using DDS than
  • Unit - A Unit is attacked
That event can be abused

In this case using a DDS would change the functionality of the ability. With A unit is attacked event, the counter is preemptive. It is not likely that the attacker would use the attack-stop method to get the event to fire more often, it would be disadvantageous to the attacking unit.
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
Terraindeformations are handles which won't be destroyed once they are finished. They exist permanently in data and can't be removed GUI or in JASS.
Warstomp does create such a terraindeformation, hence you should choose another spell for the dummy.

The coding is ok, but I don't see any practical use for such a spell. To me it feels more like disadvantage playing the attacked unit, because it gets uncontrollable once you are under attack.
i.e. Try to run away from the gryphons in your demo map. In most maps you are not always in attack mode :).

You could move the ability level check into the Trigger condition.
 
Level 7
Joined
Jan 3, 2014
Messages
59
I don't see any practical use for such a spell. To me it feels more like disadvantage playing the attacked unit, because it gets uncontrollable once you are under attack.
i.e. Try to run away from the gryphons in your demo map. In most maps you are not always in attack mode :).

so how to cover this? the best way? and not too hard...:ogre_haosis:
 
Top