• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Hell hunt 1.03

  • Like
Reactions: Imadori and Almia
Hi everyone, this is a spell that I made for a contest, I think it's really funny so, I post it here
It's in GUI, and I think it's "heavily configurable" because you don't have to change anything in the spell, all can be change in the configuration. I suppose it's MUI because it's working nice with many units.

It's a kind of Dash/Blink because it's instant and move the caster to the targeted location

Credits goes to:
The Panda for the FireTornado Icons

Triggers are here:

  • Setting Hell Hunt
    • Evénements
      • Temps - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Setting the Ability --------
      • Set HH_Ability = Hell hunt
      • -------- Setting the Manacost for 1 dash --------
      • Set HH_Manacost = 5.00
      • -------- Setting the Buff of the ability --------
      • Set HH_Buff = Hell hunt
      • -------- Setting the Chaser type --------
      • Set HH_ChaserType = Hell hunter
      • -------- Setting Base and level damage --------
      • Set HH_Damage_Base = 35.00
      • Set HH_Damage_Level = 35.00
      • -------- Setting Base and level range --------
      • Set HH_MaxRange_Base = 800.00
      • Set HH_MaxRange_Level = 200.00
      • -------- Setting Model of the effects --------
      • Set HH_EffectModel = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • -------- Setting Range between the effects --------
      • Set HH_DistanceBetweenEffects = 90.00
      • -------- Setting Range of Damage --------
      • Set HH_RangeofDamage = 70.00
      • -------- Setting if the spell check the terrain type for going back the hunter --------
      • Set HH_Checking_Terrain = TRUE
      • -------- Setting if the spell destroy trees --------
      • Set HH_Destroying_Trees = TRUE
      • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
      • -------- !!!!!!!!!!!!!!!!!DON'T TOUCH THIS !!!!!!!!!!!!!!!!!!! --------
      • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
      • -------- Creating the TreeRemover unit --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • HH_Destroying_Trees Egal à TRUE
        • Alors - Actions
          • Set HH_TmpPoint = (Center of (Playable map area))
          • Unité - Create 1 TreeRemover for Neutre Passif at HH_TmpPoint facing Orientation bâtiment par défaut degrees
          • Set HH_TreeRemover = (Last created unit)
          • Unité - Hide HH_TreeRemover
          • Custom script: call UnitAddAbility( udg_HH_TreeRemover, 'Aloc')
          • Custom script: call RemoveLocation(udg_HH_TmpPoint)
        • Sinon - Actions
  • Hell Hunt
    • Evénements
      • Unité - A unit Reçoit un ordre avec point pour cible
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • (Unit-type of (Triggering unit)) Egal à HH_ChaserType
          • ((Triggering unit) has buff HH_Buff) Egal à TRUE
        • Alors - Actions
          • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
          • -------- !!!!!! Setting every values which are used in the spell!!!!!! --------
          • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
          • Set HH_Chaser = (Triggering unit)
          • If ((Mana of HH_Chaser) Supérieur ou égal à HH_Manacost) then do (Unité - Set mana of HH_Chaser to ((Mana of HH_Chaser) - HH_Manacost)) else do (Skip remaining actions)
          • Set HH_TmpPoint = (Position of HH_Chaser)
          • Set HH_TmpPoint2 = (Target point of issued order)
          • If (HH_Checking_Terrain Egal à TRUE) then do (If ((Terrain pathing at HH_TmpPoint2 of type En marchant is off) Egal à TRUE) then do (Skip remaining actions) else do (Do nothing)) else do (Do nothing)
          • Unité - Make HH_Chaser face (Angle from HH_TmpPoint to HH_TmpPoint2) over 0.00 seconds
          • Set HH_TmpReal = (Distance between HH_TmpPoint and HH_TmpPoint2)
          • Set HH_TotalRange = (HH_MaxRange_Base + (HH_MaxRange_Level x (Real((Level of HH_Ability for HH_Chaser)))))
          • Set HH_TotalDamage = (HH_Damage_Base + (HH_Damage_Level x (Real((Level of HH_Ability for HH_Chaser)))))
          • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
          • -------- !!!!!!!!!!!!! Checking if OrderRange > TotalRange!!!!!!!!!!!!! --------
          • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • HH_TmpReal Supérieur à HH_TotalRange
            • Alors - Actions
              • Set HH_TmpPoint4 = (HH_TmpPoint offset by HH_TotalRange towards (Angle from HH_TmpPoint to HH_TmpPoint2) degrees)
              • Unité - Move HH_Chaser instantly to HH_TmpPoint4
              • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
              • -------- !!!!!!!!!!!!!!!!Moving the caster to the MaxRange!!!!!!!!!!!!!!! --------
              • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
              • Set HH_TmpReal = (HH_TotalRange / HH_DistanceBetweenEffects)
              • For each (Integer HH_TmpInt) from 1 to (Integer(HH_TmpReal)), do (Actions)
                • Boucle - Actions
                  • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
                  • -------- !!!!!!!!!!!!!!!! Creating the specials effects and applying damage!!!!!!!!!!!!!!! --------
                  • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
                  • Set HH_TmpPoint3 = (HH_TmpPoint offset by (HH_DistanceBetweenEffects x (Real(HH_TmpInt))) towards (Angle from HH_TmpPoint to HH_TmpPoint2) degrees)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Si - Conditions
                      • HH_Destroying_Trees Egal à TRUE
                    • Alors - Actions
                      • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
                      • -------- !!!!!!!!!!!!!!!! DestroyingTrees if enabled!!!!!!!!!!!!!!! --------
                      • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
                      • Destructible - Pick every destructible within HH_RangeofDamage of HH_TmpPoint3 and do (Set HH_Des = (Picked destructible))
                      • Unité - Order HH_TreeRemover to Récolter HH_Des
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • Si - Conditions
                          • (Current order of HH_TreeRemover) Egal à (Order(harvest))
                        • Alors - Actions
                          • Destructible - Kill HH_Des
                        • Sinon - Actions
                          • Unité - Order HH_TreeRemover to Arrêter
                    • Sinon - Actions
                  • Set HH_Group = (Units within HH_RangeofDamage of HH_TmpPoint3 matching ((((Matching unit) is Un bâtiment) Egal à FALSE) and ((((Matching unit) is Une unité volante) Egal à FALSE) and ((((Matching unit) is Insensible à la magie) Egal à FALSE) and (((Matching unit) belo
                  • Groupe unité - Pick every unit in HH_Group and do (Unité - Cause HH_Chaser to damage (Picked unit), dealing (HH_Damage_Base + (HH_Damage_Level x (Real((Level of HH_Ability for HH_Chaser))))) damage of attack type Chaos and damage type Normal)
                  • Custom script: call DestroyGroup(udg_HH_Group)
                  • Effet spécial - Create a special effect at HH_TmpPoint3 using HH_EffectModel
                  • Effet spécial - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_HH_TmpPoint3)
              • Custom script: call RemoveLocation(udg_HH_TmpPoint4)
            • Sinon - Actions
              • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
              • -------- !!!!!!!!!!!!!!!! Moving the caster to the targetpoint!!!!!!!!!!!!!!! --------
              • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
              • Set HH_TmpReal2 = (HH_TmpReal / HH_DistanceBetweenEffects)
              • Unité - Move HH_Chaser instantly to HH_TmpPoint2
              • For each (Integer HH_TmpInt) from 1 to (Integer(HH_TmpReal2)), do (Actions)
                • Boucle - Actions
                  • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
                  • -------- !!!!!!!!!!!!!!!! Creating the specials effects and applying damage!!!!!!!!!!!!!!! --------
                  • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
                  • Set HH_TmpPoint3 = (HH_TmpPoint offset by (HH_DistanceBetweenEffects x (Real(HH_TmpInt))) towards (Angle from HH_TmpPoint to HH_TmpPoint2) degrees)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Si - Conditions
                      • HH_Destroying_Trees Egal à TRUE
                    • Alors - Actions
                      • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
                      • -------- !!!!!!!!!!!!!!!! DestroyingTrees if enabled!!!!!!!!!!!!!!! --------
                      • -------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --------
                      • Destructible - Pick every destructible within HH_RangeofDamage of HH_TmpPoint3 and do (Set HH_Des = (Picked destructible))
                      • Unité - Order HH_TreeRemover to Récolter HH_Des
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • Si - Conditions
                          • (Current order of HH_TreeRemover) Egal à (Order(harvest))
                        • Alors - Actions
                          • Destructible - Kill HH_Des
                        • Sinon - Actions
                      • Unité - Order HH_TreeRemover to Arrêter
                    • Sinon - Actions
                  • Set HH_Group = (Units within HH_RangeofDamage of HH_TmpPoint3 matching ((((Matching unit) is Un bâtiment) Egal à FALSE) and ((((Matching unit) is Une unité volante) Egal à FALSE) and ((((Matching unit) is Insensible à la magie) Egal à FALSE) and (((Matching unit) belo
                  • Groupe unité - Pick every unit in HH_Group and do (Unité - Cause HH_Chaser to damage (Picked unit), dealing (HH_Damage_Base + (HH_Damage_Level x (Real((Level of HH_Ability for HH_Chaser))))) damage of attack type Chaos and damage type Normal)
                  • Custom script: call DestroyGroup(udg_HH_Group)
                  • Effet spécial - Create a special effect at HH_TmpPoint3 using HH_EffectModel
                  • Effet spécial - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_HH_TmpPoint3)
          • Custom script: call RemoveLocation(udg_HH_TmpPoint)
          • Custom script: call RemoveLocation(udg_HH_TmpPoint2)
        • Sinon - Actions

v1.00 - Uploaded the spell

v1.01 - Added the "peasant system" for Destroying Trees and improved a bit the code

v1.02 - Improved the code as Magtheridon96 suggested

v1.03 - Fixed a bug that made the hunter able to move everywhere on the map with no range limitation


sry if the code is a bit strange, it's because my WE is in french.

Keywords:
Hell hunt, Hell, Spell, Lord_Demon_X
Contents

Hell hunt v1.03 (Map)

Reviews
21:12, 8th Dec 2012 Magtheridon96: Approved. It's not as flashy or original as all the other approved spells, but the coding is decent. This is useful! Good job.

Moderator

M

Moderator

21:12, 8th Dec 2012
Magtheridon96: Approved.
It's not as flashy or original as all the other approved spells, but the coding is decent.
This is useful!
Good job.
 
174 kb? too large for a spell.

  • Setting Hell Hunt
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Setting the Ability --------
      • Set HH_Ability = Hell hunt
      • -------- Setting the Buff of the ability --------
      • Set HH_Buff = Hell hunt
      • -------- Setting the Chaser type --------
      • Set HH_ChaserType = Hell hunter
      • -------- Setting Base and level damage --------
      • Set HH_Damage_Base = 35.00
      • Set HH_Damage_Level = 35.00
      • -------- Setting Base and level range --------
      • Set HH_MaxRange_Base = 800.00
      • Set HH_MaxRange_Level = 200.00
      • -------- Setting Model of the effects --------
      • Set HH_EffectModel = Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • -------- Setting Range between the effects --------
      • Set HH_DistanceBetweenEffects = 90.00
      • -------- Setting Range of Damage --------
      • Set HH_RangeofDamage = 70.00
      • -------- Setting if the spell check the terrain type for going back the hunter --------
      • Set HH_Checking_Terrain = True
      • -------- Setting if the spell destroy trees --------
      • Set HH_Destroying_Trees = True
  • Hell Hunt
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to HH_ChaserType
          • ((Triggering unit) has buff HH_Buff) Equal to True
        • Then - Actions
          • Set TmpPoint = (Position of (Triggering unit))
          • Set TmpPoint2 = (Target point of issued order)
          • If (HH_Checking_Terrain Equal to True) then do (If ((Terrain pathing at TmpPoint2 of type Walkability is off) Equal to True) then do (Skip remaining actions) else do (Do nothing)) else do (Do nothing)
          • Set HH_Chaser = (Ordered unit)
          • Set TmpReal = (Distance between TmpPoint and TmpPoint2)
          • Set HH_TotalRange = (HH_MaxRange_Base + (HH_MaxRange_Level x (Real((Level of HH_Ability for HH_Chaser)))))
          • Set HH_TotalDamage = (HH_Damage_Base + (HH_Damage_Level x (Real((Level of HH_Ability for HH_Chaser)))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TmpReal Greater than HH_TotalRange
            • Then - Actions
              • Set TmpReal = (HH_TotalRange / HH_DistanceBetweenEffects)
              • Unit - Move HH_Chaser instantly to (TmpPoint offset by HH_TotalRange towards (Angle from TmpPoint to TmpPoint2) degrees)
              • For each (Integer TmpInt) from 1 to (Integer(TmpReal)), do (Actions)
                • Loop - Actions
                  • Set TmpPoint3 = (TmpPoint offset by (HH_DistanceBetweenEffects x (Real(TmpInt))) towards (Angle from TmpPoint to TmpPoint2) degrees)
                  • If (HH_Destroying_Trees Equal to True) then do (Destructible - Pick every destructible within HH_RangeofDamage of TmpPoint3 and do (Destructible - Kill (Picked destructible))) else do (Do nothing)
                  • Unit Group - Pick every unit in (Units within HH_RangeofDamage of TmpPoint3 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A flying unit) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) belongs to an enemy and do (Unit - Cause HH_Chaser to damage (Picked unit), dealing HH_TotalDamage damage of attack type Chaos and damage type Normal)
                  • Special Effect - Create a special effect at TmpPoint3 using HH_EffectModel
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_TmpPoint3)
              • Custom script: call RemoveLocation(udg_TmpPoint)
              • Custom script: call RemoveLocation(udg_TmpPoint2)
            • Else - Actions
              • Set TmpReal2 = (TmpReal / HH_DistanceBetweenEffects)
              • Unit - Move HH_Chaser instantly to TmpPoint2
              • For each (Integer TmpInt) from 1 to (Integer(TmpReal2)), do (Actions)
                • Loop - Actions
                  • Set TmpPoint3 = (TmpPoint offset by (HH_DistanceBetweenEffects x (Real(TmpInt))) towards (Angle from TmpPoint to TmpPoint2) degrees)
                  • If (HH_Destroying_Trees Equal to True) then do (Destructible - Pick every destructible within HH_RangeofDamage of TmpPoint3 and do (Destructible - Kill (Picked destructible))) else do (Do nothing)
                  • Unit Group - Pick every unit in (Units within HH_RangeofDamage of TmpPoint3 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A flying unit) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) belongs to an enemy and do (Unit - Cause HH_Chaser to damage (Picked unit), dealing HH_Damage_Base damage of attack type Chaos and damage type Normal)
                  • Special Effect - Create a special effect at TmpPoint3 using HH_EffectModel
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_TmpPoint3)
              • Custom script: call RemoveLocation(udg_TmpPoint)
              • Custom script: call RemoveLocation(udg_TmpPoint2)
        • Else - Actions
Review:
  • Move the call RemoveLocation Temppoint and Temppoint2 outside the 2nd if/block
  • You leak a point:

    • Unit - Move HH_Chaser instantly to (TmpPoint offset by HH_TotalRange towards (Angle from TmpPoint to TmpPoint2) degrees)
    You have an offset,w/c is also needed to be destroyed.
  • move this:

    • Set TmpReal2 = (TmpReal / HH_DistanceBetweenEffects)
    outside the 2nd ifblock
  • You leak group two times:

    • Unit Group - Pick every unit in (Units within HH_RangeofDamage of TmpPoint3 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A flying unit) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((Matching unit) belongs to an enemy and do (Unit - Cause HH_Chaser to damage (Picked unit), dealing HH_TotalDamage damage of attack type Chaos and damage type Normal)
    Use Custom script: bj_wantDestroyGroup = true before you call this.
  • You are destroying any kind of destructables in your spell's path.You must create first a peasant,hide it,make it invulnarable.Then pick the destructables,order the peasant to harvest it,Check if the current order of that unit is harvesting,if true kill destructable.
    Then order it to stop.
  • Set HH_Chaser = (Ordered unit)
    >
    Set HH_Chaser = (Triggering Unit)
    Also this must be at the top of your action.
  • Add prefixes to your locations.
  • make the unit face the angle of the target point from you for much better spell.
  • Cache those function calls you have repeated.Because this makes your trigger slower.
  • Also what is the Ability for and why did you cached it?it doesnt make any sense

NEEDS FIX

 
Level 4
Joined
Nov 13, 2012
Messages
28
I don't know why it's so large, because I made spells which are bigger than it with their codes and are smallers, something likes 60 Ko

Moved the "call RemoveLocation" at the end of the spell so I have only to use them one time instead of two

Remplaced the w/o with TmpPoint2

Renamed all TmpVariables as HH_TmpVariables

Added the wantDestroyGroup before the groupunits actions

I suppose that I must use the Peasant for checking the destructibles are trees else it will destroy any destructable and not only trees ?

It's better like it ?

  • Hell Hunt
    • Evénements
      • Unité - A unit Reçoit un ordre avec point pour cible
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • (Unit-type of (Triggering unit)) Egal Ã* HH_ChaserType
          • ((Triggering unit) has buff HH_Buff) Egal Ã* TRUE
        • Alors - Actions
          • Set HH_Chaser = (Triggering unit)
          • If ((Mana of HH_Chaser) Supérieur ou égal Ã* HH_Manacost) then do (Unité - Set mana of HH_Chaser to ((Mana of HH_Chaser) - HH_Manacost)) else do (Skip remaining actions)
          • Set HH_TmpPoint = (Position of HH_Chaser)
          • Set HH_TmpPoint2 = (Target point of issued order)
          • If (HH_Checking_Terrain Egal Ã* TRUE) then do (If ((Terrain pathing at HH_TmpPoint2 of type En marchant is off) Egal Ã* TRUE) then do (Skip remaining actions) else do (Do nothing)) else do (Do nothing)
          • Unité - Make HH_Chaser face (Angle from HH_TmpPoint to HH_TmpPoint2) over 0.00 seconds
          • Set HH_TmpReal = (Distance between HH_TmpPoint and HH_TmpPoint2)
          • Set HH_TotalRange = (HH_MaxRange_Base + (HH_MaxRange_Level x (Real((Level of HH_Ability for HH_Chaser)))))
          • Set HH_TotalDamage = (HH_Damage_Base + (HH_Damage_Level x (Real((Level of HH_Ability for HH_Chaser)))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • HH_TmpReal Supérieur Ã* HH_TotalRange
            • Alors - Actions
              • Set HH_TmpReal = (HH_TotalRange / HH_DistanceBetweenEffects)
              • Unité - Move HH_Chaser instantly to HH_TmpPoint2
              • For each (Integer HH_TmpInt) from 1 to (Integer(HH_TmpReal)), do (Actions)
                • Boucle - Actions
                  • Set HH_TmpPoint3 = (HH_TmpPoint offset by (HH_DistanceBetweenEffects x (Real(HH_TmpInt))) towards (Angle from HH_TmpPoint to HH_TmpPoint2) degrees)
                  • If (HH_Destroying_Trees Egal Ã* TRUE) then do (Destructible - Pick every destructible within HH_RangeofDamage of HH_TmpPoint3 and do (Destructible - Kill (Picked destructible))) else do (Do nothing)
                  • Custom script: call bj_wantDestroyGroup = true
                  • Groupe unité - Pick every unit in (Units within HH_RangeofDamage of HH_TmpPoint3 matching ((((Matching unit) is Un bâtiment) Egal Ã* FALSE) and ((((Matching unit) is Une unité volante) Egal Ã* FALSE) and ((((Matching unit) is Insensible Ã* la magie) Egal Ã* FALSE) and (((Matching unit) belo and do (Unité - Cause HH_Chaser to damage (Picked unit), dealing HH_TotalDamage damage of attack type Chaos and damage type Normal)
                  • Effet spécial - Create a special effect at HH_TmpPoint3 using HH_EffectModel
                  • Effet spécial - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_HH_TmpPoint3)
            • Sinon - Actions
              • Set HH_TmpReal2 = (HH_TmpReal / HH_DistanceBetweenEffects)
              • Unité - Move HH_Chaser instantly to HH_TmpPoint2
              • For each (Integer HH_TmpInt) from 1 to (Integer(HH_TmpReal2)), do (Actions)
                • Boucle - Actions
                  • Set HH_TmpPoint3 = (HH_TmpPoint offset by (HH_DistanceBetweenEffects x (Real(HH_TmpInt))) towards (Angle from HH_TmpPoint to HH_TmpPoint2) degrees)
                  • If (HH_Destroying_Trees Egal Ã* TRUE) then do (Destructible - Pick every destructible within HH_RangeofDamage of HH_TmpPoint3 and do (Destructible - Kill (Picked destructible))) else do (Do nothing)
                  • Custom script: call bj_wantDestroyGroup = true
                  • Groupe unité - Pick every unit in (Units within HH_RangeofDamage of HH_TmpPoint3 matching ((((Matching unit) is Un bâtiment) Egal Ã* FALSE) and ((((Matching unit) is Une unité volante) Egal Ã* FALSE) and ((((Matching unit) is Insensible Ã* la magie) Egal Ã* FALSE) and (((Matching unit) belo and do (Unité - Cause HH_Chaser to damage (Picked unit), dealing HH_Damage_Base damage of attack type Chaos and damage type Normal)
                  • Effet spécial - Create a special effect at HH_TmpPoint3 using HH_EffectModel
                  • Effet spécial - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_HH_TmpPoint3)
          • Custom script: call RemoveLocation(udg_HH_TmpPoint)
          • Custom script: call RemoveLocation(udg_HH_TmpPoint2)
        • Sinon - Actions
I didn't do the actions with the peasant because I wanted to see if the new code was enough good.
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,994
Your map is large because of the imported file in Import manager: war3mapPreview.tga
Which is not necessary for a map with a spell.
Also there is another way to destroy trees, pick every destructiables in range and then check if they are any kind of trees, and if they are alive, trees shouldn't be destroyed if they are already dead.
 
Rad, linking to your entire projectile system is hardly useful, need something more consise on the matter, like a tutorial on how to do it

It's done like this:

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempPoint = (Center of (Playable map area))
      • Unit - Create 1 Peasant for Neutral Passive at TempPoint facing Default building facing degrees
      • Set TreeChecker = (Last created unit)
      • Unit - Hide TreeChecker
      • Unit - Make TreeChecker Invulnerable
      • Custom script: call RemoveLocation (udg_TempPoint)
Use the Peasent "TreeChecker" as your sensor for trees

Then when you want to detect a tree

  • Unit - Order TreeChecker to Harvest (Picked destructible)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Current order of TreeChecker) Equal to (Order(harvest))
    • Then - Actions
      • <<actions>>
  • Unit - Order AB_TreeChecker to Stop
When the "sensor" is ordered to go to a tree, if it's a regular destructible it'll no longer have the harvest command, but if it's a tree, it'll keep it, thus you can detect the trees
 
Top