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

[MUI][GUI] Unholy / Holy Strike v.1.06



Autor's Note

  • Credits are appreciated, but not needed.
  • I recommend checking the code with the comments in the World Editor. Many things are explained especially for beginners.
  • This is my first submitted spell.

Note: Custom Describtion removed.
Init
  • Creat the Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set UH_HashTable = (Last created hashtable)
      • Set UH_Floating_Text = True
      • Set UH_Special_Effect[1] = Abilities\Spells\Other\HealingSpray\HealBottleMissile.mdl
      • Set UH_Special_Effect[2] = Abilities\Weapons\ProcMissile\ProcMissile.mdl
      • Set UH_Special_Effect[3] = Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
      • Set UH_Special_Effect[4] = Abilities\Weapons\AvengerMissile\AvengerMissile.mdl
      • Set UH_Special_Effect[5] = Abilities\Spells\Other\BlackArrow\BlackArrowMissile.mdl
      • Set UH_Special_Effect[6] = Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
Unholy / Holy Strike
  • Unholy Holy Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Unholy/Holy Strike
    • Actions
      • Set UH_Caster = (Triggering unit)
      • Set UH_Player = (Owner of UH_Caster)
      • Set UH_Target = (Target unit of ability being cast)
      • Set UH_TargetLoc = (Position of UH_Target)
      • Set UH_Enemy = (Owner of UH_Target)
      • Set UH_Distance = 250.00
      • Set UH_High = 1000.00
      • Set UH_Rotation = 15.00
      • Set UH_Projectile_Number = ((Level of (Ability being cast) for UH_Caster) x 2)
      • Set UH_Circle_Decrease = 5.00
      • Set UH_Sinking_Speed = 22.00
      • Set UH_Heal = 25.00
      • Set UH_Damage = 50.00
      • Set UH_Message[1] = (String((Integer((UH_Heal x (Real(UH_Projectile_Number)))))))
      • Set UH_Message[2] = (String((Integer((UH_Damage x (Real(UH_Projectile_Number)))))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in UH_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn on Unholy Holy Strike Loop <gen>
        • Else - Actions
      • For each (Integer UH_Integer) from 1 to UH_Projectile_Number, do (Actions)
        • Loop - Actions
          • Set UH_DummyLoc = (UH_TargetLoc offset by UH_Distance towards ((Real(UH_Integer)) x (360.00 / (Real(UH_Projectile_Number)))) degrees)
          • Set UH_Angle = (Angle from UH_DummyLoc to UH_TargetLoc)
          • Unit - Create 1 Dummy for UH_Player at UH_DummyLoc facing Default building facing degrees
          • Unit Group - Add (Last created unit) to UH_Group
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (UH_Target belongs to an ally of UH_Player) Equal to True
            • Then - Actions
              • Special Effect - Create a special effect attached to the origin of (Last created unit) using UH_Special_Effect[1]
            • Else - Actions
              • Special Effect - Create a special effect attached to the origin of (Last created unit) using UH_Special_Effect[4]
          • Hashtable - Save Handle Of(Last created special effect) as 11 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save UH_Angle as 1 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save UH_Distance as 2 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save Handle OfUH_Target as 3 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save UH_High as 4 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save Handle OfUH_Enemy as 5 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save UH_Heal as 6 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save UH_Damage as 7 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save UH_Rotation as 8 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save UH_Circle_Decrease as 9 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save UH_Sinking_Speed as 10 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save UH_Floating_Text as 12 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save UH_Message[1] as 13 of (Key (Last created unit)) in UH_HashTable
          • Hashtable - Save UH_Message[2] as 14 of (Key (Last created unit)) in UH_HashTable
          • Custom script: call RemoveLocation(udg_UH_DummyLoc)
      • Custom script: call RemoveLocation(udg_UH_TargetLoc)
Unholy / Holy Strike Loop
  • Unholy Holy Strike Loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UH_Group and do (Actions)
        • Loop - Actions
          • Set UH_Dummy = (Picked unit)
          • Set UH_Angle = (Load 1 of (Key (Picked unit)) from UH_HashTable)
          • Set UH_Distance = (Load 2 of (Key (Picked unit)) from UH_HashTable)
          • Set UH_Target = (Load 3 of (Key (Picked unit)) in UH_HashTable)
          • Set UH_Enemy = (Load 5 of (Key (Picked unit)) in UH_HashTable)
          • Set UH_Point[1] = (Position of UH_Target)
          • Set UH_Point[2] = (Position of UH_Dummy)
          • Set UH_Angle = ((Angle from UH_Point[1] to UH_Point[2]) + (Load 8 of (Key (Picked unit)) from UH_HashTable))
          • Set UH_Point[3] = (UH_Point[1] offset by UH_Distance towards UH_Angle degrees)
          • Hashtable - Save UH_Angle as 1 of (Key (Picked unit)) in UH_HashTable
          • Set UH_Distance = ((Load 2 of (Key (Picked unit)) from UH_HashTable) - (Load 9 of (Key (Picked unit)) from UH_HashTable))
          • Hashtable - Save UH_Distance as 2 of (Key (Picked unit)) in UH_HashTable
          • Set UH_High = ((Load 4 of (Key (Picked unit)) from UH_HashTable) - (Load 10 of (Key (Picked unit)) from UH_HashTable))
          • Hashtable - Save UH_High as 4 of (Key (Picked unit)) in UH_HashTable
          • Unit - Move UH_Dummy instantly to UH_Point[3]
          • Animation - Change UH_Dummy flying height to UH_High at 0.00
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (UH_Dummy belongs to an ally of UH_Enemy) Equal to True
            • Then - Actions
              • Special Effect - Create a special effect attached to the origin of UH_Dummy using UH_Special_Effect[2]
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Special Effect - Create a special effect attached to the origin of UH_Dummy using UH_Special_Effect[5]
              • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (UH_Distance Less than or equal to 10.00) or ((UH_Target is alive) Not equal to True)
            • Then - Actions
              • Set UH_Effect = (Load 11 of (Key (Picked unit)) in UH_HashTable)
              • Special Effect - Destroy UH_Effect
              • Unit - Remove UH_Dummy from the game
              • Unit Group - Remove UH_Dummy from UH_Group
              • Set UH_Floating_Text = (Load 12 of (Key (Picked unit)) from UH_HashTable)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (UH_Dummy belongs to an ally of UH_Enemy) Equal to True
                • Then - Actions
                  • Set UH_Heal = (Load 6 of (Key (Picked unit)) from UH_HashTable)
                  • Unit - Set life of UH_Target to ((Life of UH_Target) + UH_Heal)
                  • Special Effect - Create a special effect attached to the origin of UH_Target using UH_Special_Effect[3]
                  • Special Effect - Destroy (Last created special effect)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • UH_Floating_Text Equal to True
                    • Then - Actions
                      • Set UH_Message[1] = (Load 13 of (Key (Picked unit)) from UH_HashTable)
                      • Floating Text - Create floating text that reads UH_Message[1] above UH_Target with Z offset 0.00, using font size 10.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
                      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                    • Else - Actions
                • Else - Actions
                  • Set UH_TargetLoc = (Position of UH_Target)
                  • Set UH_Damage = (Load 7 of (Key (Picked unit)) from UH_HashTable)
                  • Unit - Make UH_Target Explode on death
                  • Unit - Cause UH_Dummy to damage UH_Target, dealing UH_Damage damage of attack type Spells and damage type Normal
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (UH_Target is alive) Equal to True
                    • Then - Actions
                      • Unit - Make UH_Target Die normally on death
                    • Else - Actions
                  • Special Effect - Create a special effect at UH_TargetLoc using UH_Special_Effect[6]
                  • Special Effect - Destroy (Last created special effect)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • UH_Floating_Text Equal to True
                    • Then - Actions
                      • Set UH_Message[2] = (Load 14 of (Key (Picked unit)) from UH_HashTable)
                      • Floating Text - Create floating text that reads UH_Message[2] at UH_TargetLoc with Z offset 0.00, using font size 10.00, color (80.00%, 0.00%, 80.00%), and 0.00% transparency
                      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_UH_TargetLoc)
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in UH_HashTable
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in UH_Group) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
          • Custom script: call RemoveLocation(udg_UH_Point[1])
          • Custom script: call RemoveLocation(udg_UH_Point[2])
          • Custom script: call RemoveLocation(udg_UH_Point[3])




Level 1
level1p.jpg

Holy
holy2.jpg
Unholy
unholy2x.jpg
Level 2
level2.jpg

Holy
holy4.jpg
Unholy
unholy4.jpg
Level 3
level3t.jpg

Holy
holy6.jpg
Unholy



Changelog

Version 1.00
  • Release.
Version 1.01
  • Rotation Speed now easier to edit (added variable).
  • Target explodes when killed by Unholy Strike.
  • Unholy End Special Effect now attached to Point instead of Unit.
Version 1.02
  • Sinking Speed and Circle Decrease now easier to edit.
  • Added Mui Testing Spell.
  • Camera Distance can now be changed to have a better view.
  • Starting High increased to 1000 instead of 750.
  • Added a few Describtions.
Version 1.03
  • Different performance improvements.
  • New Screenshot.
Version 1.04
  • Added Floating Texts which can be turned off.
  • Fixed a minor bug.
Version 1.05
  • Improved the triggering in some points.
Version 1.06
  • Added high amount of further describtions.
  • Added alternative spell triggers without comments.

Keywords:
Holy, Unholy, Strike, Purple, Yellow, Heal, Damage, Dark, Darkness, Shadow, Rotation, GUI, MUI.
Contents

Unholy/Holy Strike (Map)

Reviews
13:11, 19th Oct 2010 TriggerHappy: The spells effect was pretty generic, but it could be useful. Also nice comments and the spell was MUI and leakless.

Moderator

M

Moderator

13:11, 19th Oct 2010
TriggerHappy:

The spells effect was pretty generic, but it could be useful. Also nice comments and the spell was MUI and leakless.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
you always load all data every 0.04 seconds even if they are not needed all the time (damage/heal/effect)

instead of this:
load distance
distance = distance - something
you can do:
distance = load distance - something

and you dont have to check if the unitgroup is empty all the time
do it only when a unit is removed

edit: updated

I really like the number of screenshots, documentation and all :thumbs_up:
 
Last edited:
Level 14
Joined
Nov 18, 2007
Messages
1,084
There are some things that can be improved with your code:

    • Set UH_Player = (Owner of (Triggering unit))
    ->
    • Set UH_Player = (Owner of UH_Caster)
    Same with UH_Target and UH_Dummy in the second trigger.
  • I think it's a waste to keep setting the variables to the same values whenever the spell is cast. For things that should remain constant no matter the level, it would be better to set them in map initialization.
    Mainly, I'm just talking about the special effects strings and UH_Floating_Text.
    • Hashtable - Save Handle Of(Last created special effect) as 11 of (Key (Last created unit)) in UH_HashTable
    could be outside of the if-then-else since it's done outside of the else. It's not an incredible improvement but it does remove code duplication. You could do that for the other effects in the second trigger.
    • Trigger - Turn on Unholy Holy Strike Loop <gen>
    should have a check to see if the trigger is turned off.
  • You should put
    • Unit - Make UH_Target Die normally on death
    under a check if the target is still alive after receiving damage.
 
Level 11
Joined
Jan 25, 2009
Messages
572
Dude, Quit overload with the comments in the Triggers please.

EDIT: Also, you should let the Dummy be the Special effect instead of create one dummy and attach a special effect on the dummy. That is unneccesary stuffs. Makes the spell more flexible ;)

EDIT 2: Watermelon, I saw your post and I noticed this:
I think it's a waste to keep setting the variables to the same values whenever the spell is cast. For things that should remain constant no matter the level, it would be better to set them in map initialization.
and I think that is wrong because if he have all the constant variables set in the Map Initiation the Initiation will be slower than normal and I really HATE slow Initiations.
 
Dude, Quit overload with the comments in the Triggers please.

EDIT: Also, you should let the Dummy be the Special effect instead of create one dummy and attach a special effect on the dummy. That is unneccesary stuffs. Makes the spell more flexible ;)

EDIT 2: Watermelon, I saw your post and I noticed this: and I think that is wrong because if he have all the constant variables set in the Map Initiation the Initiation will be slower than normal and I really HATE slow Initiations.

@ EDIT 1: well at least it keeps the number of dummy units in the OE to just 1... personally I like it better to just add SFX to a dummy rather than creating lots of dummies...

@Edit 2: its your opinion... but in long games, its better to have them at map init because setting them everytime reduces your computing power (not noticable I think in early games but as your gametime lengthens, you'll surely start to see it...) Plus the purpose of initialization is to initialize everything that could be initialized so they wont need to be done in-game...
 
Level 6
Joined
May 20, 2010
Messages
94
Dude, Quit overload with the comments in the Triggers please.
Dude, why do I post the code without comments? Just for fun? It's for the good triggerer who don't need some explanations. The comments are for everybody who wants to learn or who's new to triggering. I remember myself being easily confused by so many if/then/else-conditions in some spells. Guess what, just one or two of these empty comment lines "-----" helped me understand where the specific conditions ended and finally helped me understand how it worked.

EDIT: Also, you should let the Dummy be the Special effect instead of create one dummy and attach a special effect on the dummy. That is unneccesary stuffs. Makes the spell more flexible ;)
Your are talking about unneccesary stuff and flexibility, but you choose the hardest way by forcing the user to edit 4 (!) Dummy Units in the Object Editor instead of just changing the Special Effects staying only in the Trigger Editor. Inexperienced people may be happier with my method, because they are able to leave the Object Editor like it is.

EDIT 2: Watermelon, I saw your post and I noticed this: and I think that is wrong because if he have all the constant variables set in the Map Initiation the Initiation will be slower than normal and I really HATE slow Initiations.
He said, he was mainly talking about the special effect strings and one boolean variable. In my opinion it would hardly cause "slow initations".
 
Level 11
Joined
Jan 25, 2009
Messages
572
Mantis Style, 1st, I highly recomend you do stop the overfload because I couldn't make a review of the triggering when you have those unneccesary comments that contains NOTHING... It works for you to place one comment and people will understand.

2nd. What the heck do you mean with 4 units :S You just need to edit one dummy! Because you don't create 4 diffrent unit types, you create one and the same unit type that is loaded in-game as the same dummy.

3rd. Well it may not be noticed but I just want to give you some critisism to make it more flexible. I'm a person who always sees the small issues and that is what I've done so far. Well anyways, my suggestion is that you let it be in the Spell but do as you want because I just want to make all your spells more populary and better, not worse or something bad.
And one more thing (Indexing), You'll have an extra trigger there if you dont have it in the Map Initiation.
And if it hardly create slow initiations it may still do it in the length.
 
Level 6
Joined
May 20, 2010
Messages
94
Mantis Style, 1st, I highly recomend you do stop the overfload because I couldn't make a review of the triggering when you have those unneccesary comments that contains NOTHING... It works for you to place one comment and people will understand.

Well, I like it the way I did it, but I could make an additional spell-version without this overfload, so the people may decide on their own which version they'll want to use.

2nd. What the heck do you mean with 4 units :S You just need to edit one dummy! Because you don't create 4 diffrent unit types, you create one and the same unit type that is loaded in-game as the same dummy.

You said, the dummy should be the special effect, so the dummy's model should be the needed special effect. I'm using 4 different special effects on my dummy, so I would need 4 different dummys to replace the special effects. Whatever, I think it's good the way it is and I don't think I'll change something here.


3rd. Well it may not be noticed but I just want to give you some critisism to make it more flexible. I'm a person who always sees the small issues and that is what I've done so far. Well anyways, my suggestion is that you let it be in the Spell but do as you want because I just want to make all your spells more populary and better, not worse or something bad.
And one more thing (Indexing), You'll have an extra trigger there if you dont have it in the Map Initiation.
And if it hardly create slow initiations it may still do it in the length.

Yes, these are small issues and I don't think they need to be discussed anyway, because it won't make a big difference. But I see your point and I appreciate your suggestions to improve my spell. I'm sorry if you got the feeling I wasn't glad about your comment.
Could you explain the point about the Indexing in detail, I can't really get what you want to say.
 
Level 11
Joined
Jan 25, 2009
Messages
572
For the Indexing stuff, If you use Indexing to get it MUI, you don't need a Map Initiation because that is needed for hashtables in every way. In Indexing you actually dont need to have one extra trigger for the variable set. Just to create an extra trigger takes more memory in the map, not that much though...
 
Top