Spell Calamity Strike

13lade619

is now a game developer :)
Reaction score
399
okay, sorry about the caster_loc leak,

what should i do about the group leak?

EDIT:

this is what the trigger looks like now:

Code:
Calamity Strike
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Calamity Strike 
    Actions
        Set CS_Caster = (Triggering unit)
        If ((Level of Calamity Strike  for CS_Caster) Equal to 1) then do (Set CS_Loops = 10) else do (Do nothing)
        If ((Level of Calamity Strike  for CS_Caster) Equal to 2) then do (Set CS_Loops = 15) else do (Do nothing)
        If ((Level of Calamity Strike  for CS_Caster) Equal to 3) then do (Set CS_Loops = 20) else do (Do nothing)
        For each (Integer A) from 1 to CS_Loops, do (Actions)
            Loop - Actions
                Set CS_Caster_loc = (Position of CS_Caster)
                Set CS_TargetGroup = (Units within 1000.00 of CS_Caster_loc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of CS_Caster)) Equal to True)))
                Set CS_RealTargetGroup = (Random 1 units from CS_TargetGroup)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in CS_TargetGroup) Greater than 0
                        (CS_Caster is alive) Equal to True
                    Then - Actions
                        Unit Group - Pick every unit in CS_RealTargetGroup and do (Actions)
                            Loop - Actions
                                Set CS_Target = (Picked unit)
                                Set CS_Point = (Position of CS_Target)
                                Unit - Create 1 Dummy for (Owner of CS_Caster) at CS_Point facing Default building facing degrees
                                Unit - Add Crow Form to (Last created unit)
                                Animation - Change (Last created unit) flying height to 1000.00 at 1000000000.00
                                Unit - Add LightningFX  to (Last created unit)
                                Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning CS_Target
                                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                        Wait 0.10 seconds
                        Unit Group - Pick every unit in CS_RealTargetGroup and do (Actions)
                            Loop - Actions
                                Unit - Create 1 Dummy for (Owner of CS_Caster) at CS_Point facing Default building facing degrees
                                Unit - Add CalamityStrikeDamage  to (Last created unit)
                                Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                                Special Effect - Create a special effect at CS_Point using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                                Special Effect - Destroy (Last created special effect)
                    Else - Actions
                Custom script:   call DestroyGroup(udg_CS_TargetGroup)
                Custom script:   call RemoveLocation(udg_CS_Point)
                Custom script:   call DestroyGroup(udg_CS_RealTargetGroup)
                Custom script:   call RemoveLocation(udg_CS_Caster_loc)
                Wait 1.00 seconds

i moved the leak removal from the if/then/else function.

one question:

can i remove this unit group loop and just paste the functions under the loop below the wait?

Code:
Unit Group - Pick every unit in CS_RealTargetGroup and do (Actions)
    Loop - Actions
        Unit - Create 1 Dummy for (Owner of CS_Caster) at CS_Point facing Default building facing degrees
        Unit - Add CalamityStrikeDamage  to (Last created unit)
        Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
        Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        Special Effect - Create a special effect at CS_Point using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
        Special Effect - Destroy (Last created special effect)

EDIT # 2 :

i removed the second unit group loop.

Re-uploaded the map. it should be leak-free by now.

-
thehelperDoubleAnimatedUB.gif
 

Sim

Forum Administrator
Staff member
Reaction score
534
> can i remove this unit group loop and just paste the functions under the loop below the wait?

Depends if you want the wait to happen or not. If you do not need the wait, paste it. If you need the wait, don't do it. :p

------------

Looks ok, except one point removal.

"Custom script: call RemoveLocation(udg_CS_Point)"

Put it inside the if-then-else. More precisely: in the "Then actions", inside the Unit group loop.
 

13lade619

is now a game developer :)
Reaction score
399
this is the trigger now:

Code:
Calamity Strike
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Calamity Strike 
    Actions
        Set CS_Caster = (Triggering unit)
        If ((Level of Calamity Strike  for CS_Caster) Equal to 1) then do (Set CS_Loops = 10) else do (Do nothing)
        If ((Level of Calamity Strike  for CS_Caster) Equal to 2) then do (Set CS_Loops = 15) else do (Do nothing)
        If ((Level of Calamity Strike  for CS_Caster) Equal to 3) then do (Set CS_Loops = 20) else do (Do nothing)
        For each (Integer A) from 1 to CS_Loops, do (Actions)
            Loop - Actions
                Set CS_Caster_loc = (Position of CS_Caster)
                Set CS_TargetGroup = (Units within 1000.00 of CS_Caster_loc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of CS_Caster)) Equal to True)))
                Set CS_RealTargetGroup = (Random 1 units from CS_TargetGroup)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in CS_TargetGroup) Greater than 0
                        (CS_Caster is alive) Equal to True
                    Then - Actions
                        Unit Group - Pick every unit in CS_RealTargetGroup and do (Actions)
                            Loop - Actions
                                Set CS_Target = (Picked unit)
                                Set CS_Point = (Position of CS_Target)
                                Unit - Create 1 Dummy for (Owner of CS_Caster) at CS_Point facing Default building facing degrees
                                Unit - Add Crow Form to (Last created unit)
                                Animation - Change (Last created unit) flying height to 1000.00 at 1000000000.00
                                Unit - Add LightningFX  to (Last created unit)
                                Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning CS_Target
                                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                        Wait 0.10 seconds
                        Unit - Create 1 Dummy for (Owner of CS_Caster) at CS_Point facing Default building facing degrees
                        Unit - Add CalamityStrikeDamage  to (Last created unit)
                        Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                        Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                        Special Effect - Create a special effect at CS_Point using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                        Special Effect - Destroy (Last created special effect)
                        Custom script:   call RemoveLocation(udg_CS_Point)
                    Else - Actions
                Custom script:   call DestroyGroup(udg_CS_TargetGroup)
                Custom script:   call DestroyGroup(udg_CS_RealTargetGroup)
                Custom script:   call RemoveLocation(udg_CS_Caster_loc)
                Wait 1.00 seconds

please reply ASAP:D
 

Sim

Forum Administrator
Staff member
Reaction score
534
Well, right now the line

"Custom script: call RemoveLocation(udg_CS_Point)"

isn't in the loop and, normally wouldn't remove the leaks. But as your group contains only one unit... It works out :p

Just know that if you have a group composed of more than one unit, it is important to remove the location everytime at the end of the loop (IF you set it in that loop!)

Update the map and I'll test it again.
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Nice job 13lade! It looks nice, clean, and leakless, but IMO isn't too hard to implement and create. All the same, it is great! :D

@Daxtreme: Woah, when did you become a spells moderator? :D
 
W

wutizdo

Guest
how do i export tat skill to my map plz help im new ^^ n i only kno som stuff not sure about the trigger part only
 

13lade619

is now a game developer :)
Reaction score
399
i think there's a small bug but it's only in the object editor. sorry.

the ability doesn't target air units, eventhough the lightning hits them.

all you have to do is add "air" to the targets of the damage ability (custom war stomp)

-

there's a readme on the triggers

-
thanks for approving my spell:D
thehelperTripleAnimatedUB.gif
 

Sim

Forum Administrator
Staff member
Reaction score
534
I would suggest updating your post with the new map with added "air" target.
 
J

Javonovich

Guest
Help with Calamity Strike and another ability

Hi guys,

I'm just having a slight problem with Calamity Strike that I thought you might be able to help me out with. I'm using Calamity Strike (limited to 10 loops with no cinematic effects) in my map on a hero that also has this ability, <http://www.hiveworkshop.com/resources_new/spells/780/>, Thunder Call.

My problem is that after I cast Calamity Strike, if I cast Thunder Call right after it, then Calamity Strike will stop and no more lightning bolts will come down. I was just wondering if you had any ideas about why this was happening.

Here is the code for Calamity Strike in my map:
Code:
Calamity Strike
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Impact (calamity strike)
    Actions
        Set CS_Caster = (Triggering unit)
        If ((Level of Impact (calamity strike) for CS_Caster) Equal to 1) then do (Set CS_Loops = 10) else do (Do nothing)
        For each (Integer A) from 1 to CS_Loops, do (Actions)
            Loop - Actions
                Set CS_Caster_loc = (Position of CS_Caster)
                Set CS_TargetGroup = (Units within 1000.00 of CS_Caster_loc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of CS_Caster)) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) is A s
                Set CS_RealTargetGroup = (Random 1 units from CS_TargetGroup)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in CS_TargetGroup) Greater than 0
                        (CS_Caster is alive) Equal to True
                    Then - Actions
                        Unit Group - Pick every unit in CS_RealTargetGroup and do (Actions)
                            Loop - Actions
                                Set CS_Target = (Picked unit)
                                Set CS_Point = (Position of CS_Target)
                                Unit - Create 1 Dummy (Calamity Strike) for (Owner of CS_Caster) at CS_Point facing Default building facing degrees
                                Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning CS_Target
                        Wait 0.10 seconds
                        Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                        Special Effect - Create a special effect at CS_Point using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                        Special Effect - Destroy (Last created special effect)
                        Custom script:   call RemoveLocation(udg_CS_Point)
                        Wait 0.50 seconds
                    Else - Actions
                Custom script:   call DestroyGroup(udg_CS_TargetGroup)
                Custom script:   call DestroyGroup(udg_CS_RealTargetGroup)
                Custom script:   call RemoveLocation(udg_CS_Caster_loc)

Here is the code for Thunder Call:
Code:
Thunder Call
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Thunder Call 
    Actions
        Set LocPoint1 = (Position of (Casting unit))
        Set LocPoint2 = (Target point of ability being cast)
        Set LocPoint3 = (LocPoint1 offset by 150.00 towards (Angle from LocPoint1 to LocPoint2) degrees)
        Special Effect - Create a special effect at LocPoint3 using Objects\Spawnmodels\NightElf\NEDeathSmall\NEDeathSmall.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect at LocPoint3 using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
        Special Effect - Destroy (Last created special effect)
        Unit - Create 1 Dummy Damage for (Owner of (Casting unit)) at LocPoint3 facing (Angle from LocPoint1 to LocPoint2) degrees
        Animation - Change (Last created unit)'s size to ((250.00 + (Real(((Level of (Ability being cast) for (Casting unit)) x 10))))%, (250.00 + (Real(((Level of (Ability being cast) for (Casting unit)) x 10))))%, (250.00 + (Real(((Level of (Ability being cast) for (Casting unit)) x 10))))%) of its original size
        Unit - Create 1 Dummy Thunder Clap for (Owner of (Casting unit)) at LocPoint3 facing (Angle from LocPoint1 to LocPoint2) degrees
        Animation - Change (Last created unit)'s size to ((350.00 + (Real(((Level of (Ability being cast) for (Casting unit)) x 10))))%, (350.00 + (Real(((Level of (Ability being cast) for (Casting unit)) x 10))))%, (350.00 + (Real(((Level of (Ability being cast) for (Casting unit)) x 10))))%) of its original size
        Animation - Change (Last created unit)'s animation speed to 15.00% of its original speed
        Custom script:   call RemoveLocation( udg_LocPoint3 ) 
        Set LocReal = ((((Real((Intelligence of (Triggering unit) (Exclude bonuses)))) x (Real((Level of (Ability being cast) for (Triggering unit))))) x 2.00) + 100.00)
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Set LocPoint3 = (LocPoint1 offset by ((Real((Integer A))) x 200.00) towards (Angle from LocPoint1 to LocPoint2) degrees)
                Unit - Create 1 Dummy Nuke for (Owner of (Triggering unit)) at LocPoint3 facing Default building facing degrees
                Set TempUnitGroup = (Units within 300.00 of LocPoint3 matching ((((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit))) Equal to False) and ((((Matching unit) is An Ancient) Equal to False) and (((Unit-type of (Matching unit)) is Magic Immune) Equal to False))))
                Unit Group - Pick every unit in TempUnitGroup and do (Actions)
                    Loop - Actions
                        Unit - Cause (Last created unit) to damage (Picked unit), dealing LocReal damage of attack type Normal and damage type Normal
                        Unit - Add classification of An Ancient to (Picked unit)
                Custom script:   call DestroyGroup( udg_TempUnitGroup ) 
                Destructible - Pick every destructible within 300.00 of LocPoint3 and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Picked destructible) is alive) Equal to True
                            Then - Actions
                                Destructible - Kill (Picked destructible)
                            Else - Actions
                Custom script:   call RemoveLocation( udg_LocPoint3 ) 
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Set LocPoint3 = (LocPoint1 offset by ((Real((Integer A))) x 200.00) towards (Angle from LocPoint1 to LocPoint2) degrees)
                Set TempUnitGroup = (Units within 300.00 of LocPoint3 matching ((((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit))) Equal to False) and (((Matching unit) is An Ancient) Equal to True)))
                Unit Group - Pick every unit in TempUnitGroup and do (Actions)
                    Loop - Actions
                        Unit - Remove classification of An Ancient from (Picked unit)
                Custom script:   call DestroyGroup( udg_TempUnitGroup ) 
                Custom script:   call RemoveLocation( udg_LocPoint3 ) 
        Set LocPoint3 = (LocPoint1 offset by ((Real((Integer A))) x 900.00) towards (Angle from LocPoint1 to LocPoint2) degrees)
        Environment - Create a 3.00 second wave deformation from LocPoint1 to LocPoint3 with radius 400.00, depth 128.00, and a 1.00 second trailing delay
        Custom script:   call RemoveLocation( udg_LocPoint1 ) 
        Custom script:   call RemoveLocation( udg_LocPoint2 ) 
        Custom script:   call RemoveLocation( udg_LocPoint3 )

It's almost as if the dummy unit for Calamity Strike is being removed somehow, or the loops are just ending. Any ideas?

-Javonovich
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top