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

Simple Spells

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
well would help me to spell called "Gother", I would like to know how the spell would be no leaks.

And once resolved to share it with everyone.

Keywords:
knight,wars,footmen,tower
Contents

Simple Spells By ArOn v1.3 (Map)

Reviews
12th Dec 2015 IcemanBo: For too long time as NeedsFix. Rejected. Your leak removals are in wrong places here and there. The seconds spell is not MUI. You can ask for help in Triggers and Scripts subforum :)

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For too long time as NeedsFix. Rejected.

Maker, 3rd Aug 2011, Simple Spells

Your leak removals are in wrong places here and there.
The seconds spell is not MUI.
You can ask for help in Triggers and Scripts subforum :)
 
Level 11
Joined
Jun 28, 2011
Messages
540
When you upload spells, you should post the triggers in [Trigger][/Trigger] tags.


Please improve your description, tell us what makes your spell pack good. Describe the spells.


You also need an in game screenshot.

well would help me to spell called "Gother", I would like to know how the spell would be no leaks.

And once resolved to share it with everyone.

Resources must be completed. For works in progress, post in the relevant forum, or the Pastebin.

I believe you should've posted this in the Triggers and Scripts forum. This section of the site is for finished spells, not works in progress.

  • Spell
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) has buff Spell Buff ) Equal to True
    • Actions
      • Set Spell_Porcentaje = (15.00 + (5.00 x (Real((Level of Spell for (Attacking unit))))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random percentage) Less than or equal to Spell_Porcentaje
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Attacked unit) has buff Slow) Not equal to True
              • ((Attacked unit) is A ground unit) Equal to True
              • ((Attacked unit) is A structure) Not equal to True
              • ((Attacked unit) is alive) Equal to True
              • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
            • Then - Actions
              • Set Spell_Point = (Position of (Attacked unit))
              • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at Spell_Point facing Default building facing degrees
              • Unit - Add Dummy Spell to (Last created unit)
              • Unit - Set level of Dummy Spell for (Last created unit) to (Level of Spell for (Attacking unit))
              • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
            • Else - Actions
              • Custom script: call RemoveLocation(udg_Spell_Point)
        • Else - Actions
  • Spell 2
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) has buff Spell Buff 2 ) Equal to True
    • Actions
      • Set Spell_Porcentaje = (15.00 + (5.00 x (Real((Level of Spell 2 for (Attacking unit))))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random percentage) Less than or equal to Spell_Porcentaje
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Attacked unit) is A ground unit) Equal to True
              • ((Attacked unit) is A structure) Not equal to True
              • ((Attacked unit) is alive) Equal to True
              • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
            • Then - Actions
              • Set Spell_Point = (Position of (Attacked unit))
              • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at Spell_Point facing Default building facing degrees
              • Unit - Add Dummy Spell 2 to (Last created unit)
              • Unit - Set level of Dummy Spell 2 for (Last created unit) to (Level of Spell 2 for (Attacking unit))
              • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
            • Else - Actions
              • Custom script: call RemoveLocation(udg_Spell_Point)
        • Else - Actions
  • Base Robo de Alma
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spell Robo de Alma
    • Actions
      • Set SRA_Caster = (Triggering unit)
      • Trigger - Turn on Spell Robo de Alma <gen>
  • Spell Robo de Alma
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
      • (SRA_Caster has buff Soul Theft) Equal to True
    • Actions
      • Unit - Remove Spell Robo de Alma from SRA_Caster
      • Unit - Add Pum to SRA_Caster
      • Unit - Add Reincarnation to SRA_Caster
      • Trigger - Turn off (This trigger)
  • Robo de Alma Spell
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Vidente_Group = (Units in (Playable map area) matching ((Unit-type of (Triggering unit)) Equal to Far Seer))
      • Unit Group - Pick every unit in Vidente_Group and do (Actions)
        • Loop - Actions
          • Set Vidente_Respawn = ((Owner of (Picked unit)) start location)
          • Hero - Instantly revive (Picked unit) at Vidente_Respawn, Hide revival graphics
          • Unit - Add Spell Robo de Alma to (Triggering unit)
          • Unit - Remove Pum from (Triggering unit)
          • Unit - Remove Reincarnation from (Triggering unit)
          • Custom script: call RemoveLocation(udg_Vidente_Respawn)
          • Custom script: call DestroyGroup(udg_Vidente_Group)
  • Gother
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Gother
        • Then - Actions
          • Set Gother_Caster = (Triggering unit)
          • Set Gother_Target = (Target unit of ability being cast)
          • Set Gother_Point = (Position of Gother_Target)
          • Set ForestWolf_Effects[1] = Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
          • Special Effect - Create a special effect at Gother_Point using ForestWolf_Effects[1]
          • Special Effect - Destroy (Last created special effect)
          • Trigger - Turn on Gother Loop <gen>
          • Set Gother_Damage = (50.00 + (50.00 x (Real((Level of Gother for Gother_Caster)))))
          • Unit - Cause Gother_Caster to damage Gother_Target, dealing Gother_Damage damage of attack type Chaos and damage type Unknown
          • Unit - Create 1 Dummy for (Owner of Gother_Caster) at Gother_Point facing Default building facing degrees
          • Unit - Add Gother Dummy Spell to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Slow Gother_Target
          • Unit - Set level of Gother Dummy Spell for (Last created unit) to (Level of Gother for Gother_Caster)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Set Gother_Group = (Units within 225.00 of Gother_Point)
          • Unit Group - Pick every unit in Gother_Group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                  • (Picked unit) Not equal to Gother_Target
                  • ((Picked unit) is A structure) Not equal to True
                  • ((Picked unit) belongs to an enemy of (Owner of Gother_Caster)) Equal to True
                • Then - Actions
                  • Set Gother_Point2 = (Position of (Picked unit))
                  • Set Gother_Damage2 = (25.00 + (25.00 x (Real((Level of Gother for Gother_Caster)))))
                  • Unit - Cause Gother_Caster to damage (Picked unit), dealing Gother_Damage2 damage of attack type Chaos and damage type Unknown
                  • Set ForestWolf_Effects[2] = Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
                  • Special Effect - Create a special effect at Gother_Point2 using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • Custom script: call DestroyGroup(udg_Gother_Group)
                  • Custom script: call RemoveLocation(udg_Gother_Point2)
        • Else - Actions
          • Custom script: call RemoveLocation(udg_Gother_Point)
  • Gother Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Unit - Move Gother_Caster instantly to Gother_Point, facing Default building facing degrees
          • Set ForestWolf_Effects[3] = Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
          • Special Effect - Create a special effect at Gother_Point using ForestWolf_Effects[3]
          • Special Effect - Destroy (Last created special effect)
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Custom script: call RemoveLocation(udg_Gother_Point)


The custom script needs to be moved outside of the else block, into the same block the variable is.

This applies to all of your triggers.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Attacked unit) has buff Slow) Not equal to True
      • ((Attacked unit) is A ground unit) Equal to True
      • ((Attacked unit) is A structure) Not equal to True
      • ((Attacked unit) is alive) Equal to True
      • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    • Then - Actions
      • Set Spell_Point = (Position of (Attacked unit))
      • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at Spell_Point facing Default building facing degrees
      • Unit - Add Dummy Spell to (Last created unit)
      • Unit - Set level of Dummy Spell for (Last created unit) to (Level of Spell for (Attacking unit))
      • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
    • Else - Actions
      • Custom script: call RemoveLocation(udg_Spell_Point)






Using set bj_wantDestroyGroup = true is preferred over setting the group to a variable and destroying it.
  • Set Vidente_Group = (Units in (Playable map area) matching ((Unit-type of (Triggering unit)) Equal to Far Seer))
  • Unit Group - Pick every unit in Vidente_Group and do (Actions)
    • Loop - Actions
      • Set Vidente_Respawn = ((Owner of (Picked unit)) start location)
      • Hero - Instantly revive (Picked unit) at Vidente_Respawn, Hide revival graphics
      • Unit - Add Spell Robo de Alma to (Triggering unit)
      • Unit - Remove Pum from (Triggering unit)
      • Unit - Remove Reincarnation from (Triggering unit)
      • Custom script: call RemoveLocation(udg_Vidente_Respawn)
      • Custom script: call DestroyGroup(udg_Vidente_Group)
  • ==
  • This can be simplified to:
  • ==
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Triggering unit)) Equal to Far Seer)) and do (Actions)
    • Loop - Actions
      • Set Vidente_Respawn = ((Owner of (Picked unit)) start location)
      • Hero - Instantly revive (Picked unit) at Vidente_Respawn, Hide revival graphics
      • Unit - Add Spell Robo de Alma to (Triggering unit)
      • Unit - Remove Pum from (Triggering unit)
      • Unit - Remove Reincarnation from (Triggering unit)
      • Custom script: call RemoveLocation(udg_Vidente_Respawn)



.03 is preferred over .02. It is more efficient and you won't see a difference visually.




I don't think Robo de Alma is MUI, meaning that multiple units may cast the spell at the same time and it have its desired effect.




This can be simplified to:
  • Set Gother_Group = (Units within 225.00 of Gother_Point)
  • Unit Group - Pick every unit in Gother_Group and do (Actions)
    • Loop - Actions
  • ==
  • Simplified to:
  • ==
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 225.00 of Gother_Point) and do (Actions)
    • Loop - Actions

Gother is not MUI. The variable Gother_Caster will be overwritten when cast be another unit and will not have its desired effect. I'd suggest looking at one of the many MUI tutorials we have to fix this.
 
Last edited:
  • Set Vidente_Group = (Units in (Playable map area) matching ((Unit-type of (Triggering unit)) Equal to Far Seer))
  • Unit Group - Pick every unit in Vidente_Group and do (Actions)
    • Loop - Actions
      • Set Vidente_Respawn = ((Owner of (Picked unit)) start location)
      • Hero - Instantly revive (Picked unit) at Vidente_Respawn, Hide revival graphics
      • Unit - Add Spell Robo de Alma to (Triggering unit)
      • Unit - Remove Pum from (Triggering unit)
      • Unit - Remove Reincarnation from (Triggering unit)
      • Custom script: call RemoveLocation(udg_Vidente_Respawn)
      • Custom script: call DestroyGroup(udg_Vidente_Group)
You do know that destroys the group after the first unit is enumerated..
 
Top