• 🏆 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!

Lightning Path v1.2

This is my 1st spell and my 1st post in hiveworkshop .

This Spell is Send a ball of lightning that strike enemy in it path deals damage and slow oppoment movement speed by 75% and attack speed by 25%.

Level 1 - Deals 75 damage.
Level 2 - Deals 150 damage.
Level 3 - Deals 225 damage.
Level 4 - Deals 300 damage.


  • Lightning Ball Begin
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Lightning Path
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LP_Integer[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on Lightning Ball Move <gen>
        • Else - Actions
      • Set LP_Integer[1] = (LP_Integer[1] + 1)
      • Set LP_Integer[2] = (LP_Integer[2] + 1)
      • Set LP_Caster[LP_Integer[2]] = (Triggering unit)
      • Set LP_Location[LP_Integer[2]] = (Position of LP_Caster[LP_Integer[2]])
      • Set LP_Location2[LP_Integer[2]] = (Target point of ability being cast)
      • Set LP_Angle[LP_Integer[2]] = (Angle from LP_Location[LP_Integer[2]] to LP_Location2[LP_Integer[2]])
      • Set LP_Tick[LP_Integer[2]] = 21
      • Unit - Create 1 Lightning Ball Dummy for (Owner of LP_Caster[LP_Integer[2]]) at LP_Location[LP_Integer[2]] facing LP_Angle[LP_Integer[2]] degrees
      • Set LP_Dummy[LP_Integer[2]] = (Last created unit)
      • Set LP_DummyPoint[LP_Integer[2]] = (Position of LP_Dummy[LP_Integer[2]])
      • Unit Group - Add (Last created unit) to LP_DummyGroup[LP_Integer[2]]
      • Lightning - Create a Forked Lightning lightning effect from source LP_Location[LP_Integer[2]] to target LP_DummyPoint[LP_Integer[2]]
      • Set LP_Lightning[LP_Integer[2]] = (Last created lightning effect)
      • Custom script: call RemoveLocation ( udg_LP_Location2[udg_LP_Integer[2]] )
      • Custom script: call RemoveLocation ( udg_LP_DummyPoint[udg_LP_Integer[2]] )


  • Lightning Ball Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer LP_Integer[3]) from 1 to LP_Integer[2], do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in LP_DummyGroup[LP_Integer[3]] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LP_Tick[LP_Integer[3]] Greater than 0
                • Then - Actions
                  • Set LP_DummyPoint[LP_Integer[3]] = (Position of (Picked unit))
                  • Set LP_Location2[LP_Integer[3]] = (LP_DummyPoint[LP_Integer[3]] offset by 50.00 towards LP_Angle[LP_Integer[3]] degrees)
                  • Special Effect - Create a special effect at LP_DummyPoint[LP_Integer[3]] using Abilities\Weapons\Bolt\BoltImpact.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Move LP_Dummy[LP_Integer[3]] instantly to LP_Location2[LP_Integer[3]]
                  • Lightning - Move LP_Lightning[LP_Integer[3]] to source LP_Location[LP_Integer[3]] and target LP_DummyPoint[LP_Integer[3]]
                  • Set LP_Strike[LP_Integer[3]] = (Units within 125.00 of LP_DummyPoint[LP_Integer[3]] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy
                  • Unit Group - Pick every unit in LP_Strike[LP_Integer[3]] and do (Actions)
                    • Loop - Actions
                      • Set LP_PickedUnit[LP_Integer[3]] = (Picked unit)
                      • Set LP_PositionPickedUnit[LP_Integer[3]] = (Position of LP_PickedUnit[LP_Integer[3]])
                      • Unit - Create 1 Lightning Ball Dummy Slower for (Owner of LP_Caster[LP_Integer[3]]) at LP_DummyPoint[LP_Integer[3]] facing LP_Angle[LP_Integer[3]] degrees
                      • Unit - Hide (Last created unit)
                      • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
                      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                      • Special Effect - Create a special effect at LP_PositionPickedUnit[LP_Integer[3]] using Abilities\Weapons\Bolt\BoltImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Cause LP_Caster[LP_Integer[3]] to damage (Picked unit), dealing (75.00 x (Real((Level of Lightning Path for LP_Caster[LP_Integer[3]])))) damage of attack type Spells and damage type Normal
                      • Unit Group - Add (Picked unit) to LP_NonStrike[LP_Integer[3]]
                  • Custom script: call RemoveLocation ( udg_LP_DummyPoint[udg_LP_Integer[3]] )
                  • Custom script: call RemoveLocation ( udg_LP_Location2[udg_LP_Integer[3]] )
                  • Custom script: call RemoveLocation ( udg_LP_PositionPickedUnit[udg_LP_Integer[3]] )
                  • Custom script: call DestroyGroup ( udg_LP_Strike[udg_LP_Integer[3]] )
                  • Set LP_Tick[LP_Integer[3]] = (LP_Tick[LP_Integer[3]] - 1)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LP_Tick[LP_Integer[3]] Equal to 0
                • Then - Actions
                  • Unit Group - Remove LP_Dummy[LP_Integer[3]] from LP_DummyGroup[LP_Integer[3]]
                  • Unit - Kill (Picked unit)
                  • Lightning - Destroy LP_Lightning[LP_Integer[3]]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (LP_DummyGroup[LP_Integer[3]] is empty) Equal to True
                    • Then - Actions
                      • Set LP_Integer[1] = (LP_Integer[1] - 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • LP_Integer[1] Equal to 0
                        • Then - Actions
                          • Set LP_Integer[2] = 0
                          • Unit Group - Remove all units from LP_NonStrike[LP_Integer[3]]
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                • Else - Actions


V1.0 Released
V1.1 Remove Bug and turn it MUI , post the trigger
V1.2 Remove special effect location leaks

Keywords:
Light , Lightning , Path , Lightning Path , Strike , Lightning Ball , Ball , Electric
Contents

Lightning Path v1.1 (Map)

Reviews
19:09, 12th Jul 2010 TriggerHappy: Code and spell were fine.

Moderator

M

Moderator

19:09, 12th Jul 2010
TriggerHappy:

Code and spell were fine.
 
Level 6
Joined
Jun 14, 2009
Messages
124
Well, there the trigger :



  • Lightning Ball Begin
    • Events
      • Unit - A unit Initie l'effet d'une compétence
    • Conditions
      • (Ability being cast) Equal Lightning Path
    • Actions
      • Set LP_Caster = (Triggering unit)
      • Set LP_Location = (Position of LP_Caster)
      • Set LP_Location2 = (Target point of ability being cast)
      • Set LP_Angle = (Angle from LP_Location to LP_Location2)
      • Set LP_Tick = 21
      • Unit - Create 1 Lightning Ball Dummy for (Owner of LP_Caster) at LP_Location facing Orientation bâtiment par défaut degrees
      • Set LP_Dummy = (Last created unit)
      • Set LP_DummyPoint = (Position of LP_Dummy)
      • Lightning - Create a Pluie d'éclairs lightning effect from source LP_Location to target LP_DummyPoint
      • Set LP_Lightning = (Last created lightning effect)
      • Custom script: call RemoveLocation ( udg_LP_Location2 )
      • Custom script: call RemoveLocation ( udg_LP_DummyPoint )
      • Trigger - Turn on Lightning Ball Move <gen>


  • Lightning Ball Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set LP_DummyPoint = (Position of LP_Dummy)
      • Set LP_Location2 = (LP_DummyPoint offset by 50.00 towards LP_Angle degrees)
      • Unit - Move LP_Dummy instantly to LP_Location2
      • Lightning - Move LP_Lightning to source LP_Location and target LP_DummyPoint
      • Set LP_Strike = (Units within 125.00 of LP_DummyPoint matching ((((Matching unit) is Un bâtiment) Egal Ã* FALSE) and ((((Matching unit) is alive) Egal Ã* TRUE) and ((((Matching unit) is Insensible Ã* la magie) Egal Ã* FALSE) and ((((Matching unit) belongs to an enemy of (Ow
      • Groupe unit - Pick every unit in LP_Strike and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Lightning Ball Dummy Slower for (Owner of LP_Caster) at LP_Location facing Orientation bâtiment par défaut degrees
          • Unit - Hide (Last created unit)
          • Unit - Order (Last created unit) to Sorcière humaine - Lenteur (Picked unit)
          • Unit - Add a 2.00 second Générique expiration timer to (Last created unit)
          • Set LP_LightningStrike[(Integer A)] = (Last created lightning effect)
          • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Weapons\Bolt\BoltImpact.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Cause LP_Caster to damage (Picked unit), dealing (75.00 x (Real((Level of Lightning Path for LP_Caster)))) damage of attack type Sorts and damage type Normal
          • Unit Group - Add (Picked unit) to LP_NonStrike
      • Special Effect - Create a special effect at LP_DummyPoint using Abilities\Weapons\Bolt\BoltImpact.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation ( udg_LP_DummyPoint )
      • Custom script: call RemoveLocation ( udg_LP_Location2 )
      • Custom script: call DestroyGroup ( udg_LP_Strike )
      • Set LP_Tick = (LP_Tick - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LP_Tick Equal 0
        • Then - Actions
          • Unit - Kill LP_Dummy
          • Lightning - Destroy LP_Lightning
          • Unit Group - Remove all units from LP_NonStrike
          • Trigger - Turn off (This trigger)
        • Else - Actions



The Trigger can have some part in French...

Bad Things :
- Not MUI
- No Changeable DATA


Good Things :
- Nice Effect
- Not [Wait]


Well the spell is pretty nice, but you need to fix toose point.

How to fix?

You have to check some tutorial, !THERE!

Btw, keep it up!
 
Level 7
Joined
Jun 6, 2010
Messages
224
Index are faster than hashtable plus I think indexing is easier to understand.

There are both cons and pros in these
Yeah indexing is faster as the only thing you do is use arrays
Re-indexing however is slower than flushing a hashtable.
Blizzard tech team made it, you can't just outsmart them that easily.
Also DotA uses hashtables, and as far as i'm aware of, it's been working flawlessly for a very long time, even when it was using Gamecache instead of HT which is way more slow.
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Blizzard tech team made it, you can't just outsmart them that easily.

Arrays are faster than hashtables.
They made hashtables just because of GUI users and to prevent the H2I usage.

Look at structs for example, they are in basic just arrays.

Re-indexing however is slower than flushing a hashtable.

I don't have a clue what are you talking about here.
 
Top