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

[Trigger] Lightning Problem

Status
Not open for further replies.
[trigger=]RA Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(RA_LoopGroup is empty) Equal to True
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Unit Group - Pick every unit in RA_LoopGroup and do (Actions)
Loop - Actions
Set RA_U = (Picked unit)
Custom script: set udg_RA_Key = GetHandleId(udg_RA_U)
Set RA_GroupId = (Load (Key Group) of RA_Key from RA_Hash)
Set RA_Owner = (Owner of RA_U)
Set RA_Loc = (Position of RA_U)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RA_GroupId Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(RA_U is alive) Equal to True
Then - Actions
Set RA_Level = (Load (Key Level) of RA_Key from RA_Hash)
For each (Integer Integer) from 1 to (Load 0 of RA_Key from RA_Hash), do (Actions)
Loop - Actions
Lightning - Destroy (Load Integer of RA_Key in RA_Hash)
Set RA_Leashes = 0
Set RA_TempGroup[1] = (Units within RA_Radius of RA_Loc)
Unit Group - Pick every unit in RA_TempGroup[1] and do (Actions)
Loop - Actions
Set RA_Leashes = (RA_Leashes + 1)
Set RA_Picked = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(RA_Picked is A structure) Equal to False
(RA_Picked is Magic Immune) Equal to False
(RA_Picked is alive) Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(RA_Picked belongs to an enemy of RA_Owner) Equal to True
(Unit-type of RA_Picked) Not equal to Dummy
Then - Actions
Set RA_TempGroup[2] = (Units within RA_Radius of RA_Loc 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 of (Owner of RA_Pi
Set RA_DamageMultiplier = (Real((Number of units in RA_TempGroup[2])))
Set RA_Damage = ((RA_DamageBase + (RA_DamagePerLevel x (Real(RA_Level)))) x RA_DamageMultiplier)
Unit - Cause RA_U to damage RA_Picked, dealing (RA_Damage x 0.03) damage of attack type Spells and damage type Normal
Custom script: call DestroyGroup(udg_RA_TempGroup[2])
Else - Actions
Set RA_TempGroup[2] = (Units within RA_Radius of RA_Loc 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 of RA_Owner) Equal
Set RA_HealMultiplier = (Real((Number of units in RA_TempGroup[2])))
Set RA_Heal = ((RA_HealBase + (RA_HealPerLevel x (Real(RA_Level)))) x RA_HealMultiplier)
Unit - Set life of RA_Picked to ((Life of RA_Picked) + RA_Heal)
Custom script: call DestroyGroup(udg_RA_TempGroup[2])
Custom script: set udg_RA_Leash = AddLightningEx(udg_RA_LeashModel,true,GetUnitX(udg_RA_U),GetUnitY(udg_RA_U),GetUnitFlyHeight(udg_RA_U) + 75,GetUnitX(udg_RA_Picked),GetUnitY(udg_RA_Picked),GetUnitFlyHeight(udg_RA_Picked) + 75)
Hashtable - Save Handle OfRA_Leash as RA_Leashes of RA_Key in RA_Hash
Else - Actions
Hashtable - Save RA_Leashes as 0 of RA_Key in RA_Hash
Set RA_Timer = (Load (Key Timer) of RA_Key from RA_Hash)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RA_Timer Greater than or equal to RA_WispInterval
Then - Actions
Hashtable - Save 0.00 as (Key Timer) of RA_Key in RA_Hash
For each (Integer Integer) from 1 to 2, do (Actions)
Loop - Actions
Set RA_Offset = (RA_Loc offset by RA_WispDistance towards (180.00 x (Real(Integer))) degrees)
Unit - Create 1 Dummy for RA_Owner at RA_Offset facing Default building facing degrees
Set RA_Wisp = (Last created unit)
Custom script: set udg_RA_WispKey = GetHandleId(udg_RA_Wisp)
Special Effect - Create a special effect attached to the chest of RA_Wisp using RA_WispModel
Animation - Change RA_Wisp's size to (RA_WispScale%, 100.00%, 100.00%) of its original size
Unit - Change color of RA_Wisp to RA_WispColors[(Random integer number between 1 and 7)]
Hashtable - Save Handle Of(Last created special effect) as (Key Model) of RA_WispKey in RA_Hash
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer Equal to 2
Then - Actions
Custom script: set udg_RA_Lightning = AddLightningEx(udg_RA_WispLeashModel,true,GetUnitX(udg_RA_PrevWisp),GetUnitY(udg_RA_PrevWisp),GetUnitFlyHeight(udg_RA_PrevWisp),GetUnitX(udg_RA_Wisp),GetUnitY(udg_RA_Wisp),GetUnitFlyHeight(udg_RA_Wisp))
Hashtable - Save Handle OfRA_Lightning as (Key Leash) of RA_WispKey in RA_Hash
Set RA_LastWisp = (Load (Key Wisp2) of RA_Key in RA_Hash)
Hashtable - Save Handle OfRA_Wisp as (Key Wisp2) of RA_Key in RA_Hash
Hashtable - Save Handle OfRA_PrevWisp as (Key Wisp) of RA_WispKey in RA_Hash
Else - Actions
Set RA_PrevWisp = RA_Wisp
Set RA_LastWisp = (Load (Key Wisp1) of RA_Key in RA_Hash)
Hashtable - Save Handle OfRA_PrevWisp as (Key Wisp1) of RA_Key in RA_Hash
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RA_LastWisp Not equal to No unit
Then - Actions
Custom script: set udg_RA_Lightning = AddLightningEx(udg_RA_WispLeashModel,true,GetUnitX(udg_RA_Wisp),GetUnitY(udg_RA_Wisp),GetUnitFlyHeight(udg_RA_Wisp)+50,GetUnitX(udg_RA_LastWisp),GetUnitY(udg_RA_LastWisp),GetUnitFlyHeight(udg_RA_LastWisp)+50)
Hashtable - Save Handle OfRA_Lightning as (Key LeashLast) of RA_WispKey in RA_Hash
Hashtable - Save Handle OfRA_LastWisp as (Key LastWisp) of RA_WispKey in RA_Hash
Else - Actions
Custom script: set udg_RA_X = GetUnitX(udg_RA_U)
Custom script: set udg_RA_Y = GetUnitY(udg_RA_U)
Hashtable - Save RA_X as (Key x) of RA_WispKey in RA_Hash
Hashtable - Save RA_Y as (Key y) of RA_WispKey in RA_Hash
Hashtable - Save (180.00 x (Real(Integer))) as (Key Angle) of RA_WispKey in RA_Hash
Hashtable - Save 2 as (Key Group) of RA_WispKey in RA_Hash
Unit Group - Add RA_Wisp to RA_LoopGroup
Custom script: call RemoveLocation(udg_RA_Offset)
Else - Actions
Hashtable - Save (RA_Timer + 0.03) as (Key Timer) of RA_Key in RA_Hash
Else - Actions
For each (Integer Integer) from 1 to (Load 0 of RA_Key from RA_Hash), do (Actions)
Loop - Actions
Lightning - Destroy (Load Integer of RA_Key in RA_Hash)
Special Effect - Destroy (Load (Key Model) of RA_Key in RA_Hash)
Unit Group - Remove RA_U from RA_LoopGroup
Hashtable - Clear all child hashtables of child RA_Key in RA_Hash
Unit - Remove RA_U from the game
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RA_GroupId Equal to 2
Then - Actions
Set RA_PrevWisp = (Load (Key Wisp) of RA_Key in RA_Hash)
Set RA_LastWisp = (Load (Key LastWisp) of RA_Key in RA_Hash)
Set RA_Angle = ((Load (Key Angle) of RA_Key from RA_Hash) + RA_WispSpinSpeed)
Set RA_X = (Load (Key x) of RA_Key from RA_Hash)
Set RA_Y = (Load (Key y) of RA_Key from RA_Hash)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current flying height of RA_U) Less than (RA_HeightSpeed / (0.03 / 2.00))
Then - Actions
Animation - Change RA_U flying height to ((Current flying height of RA_U) + RA_HeightSpeed) at 0.00
Custom script: set udg_RA_X = udg_RA_X + udg_RA_WispDistance * Cos(udg_RA_Angle * bj_DEGTORAD)
Custom script: set udg_RA_Y = udg_RA_Y + udg_RA_WispDistance * Sin(udg_RA_Angle * bj_DEGTORAD)
Custom script: call SetUnitPosition(udg_RA_U,udg_RA_X,udg_RA_Y)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RA_PrevWisp Not equal to No unit
Then - Actions
Set RA_Lightning = (Load (Key Leash) of RA_Key in RA_Hash)
Lightning - Destroy RA_Lightning
Custom script: set udg_RA_Lightning = AddLightningEx(udg_RA_WispLeashModel,true,GetUnitX(udg_RA_PrevWisp),GetUnitY(udg_RA_PrevWisp),GetUnitFlyHeight(udg_RA_PrevWisp) +50,GetUnitX(udg_RA_U),GetUnitY(udg_RA_U),GetUnitFlyHeight(udg_RA_U) + 50)
Hashtable - Save Handle OfRA_Lightning as (Key Leash) of RA_Key in RA_Hash
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RA_LastWisp Not equal to No unit
Then - Actions
Set RA_Lightning = (Load (Key LeashLast) of RA_Key in RA_Hash)
Lightning - Destroy RA_Lightning
Custom script: set udg_RA_Lightning = AddLightningEx(udg_RA_WispLeashModel,true,GetUnitX(udg_RA_LastWisp),GetUnitY(udg_RA_LastWisp),GetUnitFlyHeight(udg_RA_LastWisp) + 50,GetUnitX(udg_RA_U),GetUnitY(udg_RA_U),GetUnitFlyHeight(udg_RA_U) + 50)
Hashtable - Save Handle OfRA_Lightning as (Key LeashLast) of RA_Key in RA_Hash
Else - Actions
Hashtable - Save RA_Angle as (Key Angle) of RA_Key in RA_Hash
Else - Actions
Set RA_Lightning = (Load (Key Leash) of RA_Key in RA_Hash)
Lightning - Destroy RA_Lightning
Set RA_Lightning = (Load (Key LeashLast) of RA_Key in RA_Hash)
Lightning - Destroy RA_Lightning
Special Effect - Destroy (Load (Key Model) of RA_Key in RA_Hash)
Unit Group - Remove RA_U from RA_LoopGroup
Hashtable - Clear all child hashtables of child RA_Key in RA_Hash
Unit - Remove RA_U from the game
Else - Actions
[/trigger]


As of what the name states,i have this problem.

attachment.php

Instead of:
119799d1353749272-hero-contest-6-first-invasion-j.jpg


The thing started when my hero w/ the enemies has been leashed when the time the spell started.
 

Attachments

  • j.JPG
    j.JPG
    178.2 KB · Views: 237
Last edited:
Status
Not open for further replies.
Top