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

Light of Dawn v1.5

Created by Manasurge

This is my second spell.
it's extremely simple.
i just made it because i think it looks cool and i was bored :O
Uniqueness is the crit and accurate heal display.
highly customiseable.
Thanks to hive for great inspiration.
Thanks to Blizzard Entertainment for the spell icon and to Adiktuz for helping me make the spell better.

Mostly everything can be customised in Startup trigger, the rest is in the object editor spell.

The map got a fun test system :) try it and you'll see what it is.

Heals units in a cone from the caster to the target unit. Heals X dmg and has a Y range and a Z radius. Heals Q nr of units and has a W crit chance and a V small crit chance.

Best tooltip ever? (the answer is no :p)



  • Startup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ======================================================================= --------
      • -------- DON'T TOUCH THIS --------
      • -------- ======================================================================= --------
      • Hashtable - Create a hashtable
      • Set SS_Hashtable = (Last created hashtable)
      • -------- ======================================================================= --------
      • -------- Configure this --------
      • -------- Formula: BaseValue + (BonusValue x Level of ability) = ActualValue --------
      • -------- ======================================================================= --------
      • Set SS_CritAmount = 125.00
      • Set SS_CritAmountSmall = 75.00
      • Set SS_CritBonus = 50.00
      • Set SS_HealAmount = 50.00
      • Set SS_HealAmountBonus = 50.00
      • Set SS_Range = 150.00
      • Set SS_RangeBonus = 25.00
      • Set SS_NrHitUnits = 3
      • Set SS_NrHitUnitsBonus = 1
      • Set SS_SmallCritChance = 20
      • Set SS_SmallCritChanceBonus = 3
      • Set SS_CritChance = 10
      • Set SS_CritChanceBonus = 3
      • Set SS_LightningType = Healing Wave - Secondary
      • Set SS_LightningHeight = 35.00
      • Set St_FloatingText = True
      • -------- Mana cost, Cooldown, Cast Range, levels and Description is changed in Object Editor --------
      • -------- Trust me, i wish too it could be done in a trigger. --------
      • -------- ======================================================================= --------


  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Light of Dawn
    • Actions
      • Set SS_Caster = (Triggering unit)
      • Set SS_Level = (Level of (Ability being cast) for SS_Caster)
      • Set SS_Point1 = (Position of SS_Caster)
      • Set SS_LastHit = (Target unit of ability being cast)
      • Set SS_LastHitPos = (Position of SS_LastHit)
      • Set Actual_CritAmount = (SS_CritAmount + (SS_CritBonus x (Real(SS_Level))))
      • Set Actual_CritAmountSmall = (SS_CritAmountSmall + (SS_CritBonus x (Real(SS_Level))))
      • Set Actual_CritChance = (SS_CritChance + (SS_CritChanceBonus x SS_Level))
      • Set Actual_SmallCritChance = (SS_SmallCritChance + (SS_SmallCritChanceBonus x SS_Level))
      • Set Actual_HealAmount = (SS_HealAmount + (SS_HealAmountBonus x (Real(SS_Level))))
      • Set Actual_NrHitUnits = (SS_NrHitUnits + (SS_NrHitUnitsBonus x SS_Level))
      • Set Actual_Range = (SS_Range + (SS_RangeBonus x (Real(SS_Level))))
      • Set SS_FirstGroup = (Units within Actual_Range of SS_LastHitPos matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an ally of (Triggering player)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((Percentage life of (
      • Set SS_LightningGroup = (Random (Actual_NrHitUnits - 1) units from SS_FirstGroup)
      • Unit Group - Add SS_LastHit to SS_LightningGroup
      • Set SS_Group_Integer = (SS_Group_Integer + 1)
      • Custom script: set udg_x1 = GetLocationX(udg_SS_Point1)
      • Custom script: set udg_y1 = GetLocationY(udg_SS_Point1)
      • Custom script: set udg_z1 = GetLocationZ(udg_SS_Point1) + (GetUnitFlyHeight(udg_SS_Caster) + udg_SS_LightningHeight)
      • Trigger - Turn on Lightning Clear <gen>
      • Unit Group - Pick every unit in SS_LightningGroup and do (Actions)
        • Loop - Actions
          • Set SS_RandomInteger = (Random integer number between 1 and 100)
          • Set SS_RandomUnit = (Picked unit)
          • Set SS_Point2 = (Position of SS_RandomUnit)
          • Set SS_Life = (Life of SS_RandomUnit)
          • Custom script: set udg_x2 = GetLocationX(udg_SS_Point2)
          • Custom script: set udg_y2 = GetLocationY(udg_SS_Point2)
          • Custom script: set udg_z2 = GetLocationZ(udg_SS_Point2) + (GetUnitFlyHeight(udg_SS_RandomUnit) + udg_SS_LightningHeight)
          • Unit - Create 1 Dummy for Neutral Passive at SS_LastHitPos facing Default building facing degrees
          • Set SS_Dummy = (Last created unit)
          • Unit - Add a 0.70 second Generic expiration timer to SS_Dummy
          • Unit - Make SS_Dummy Explode on death
          • Unit Group - Add SS_Dummy to SS_RemoveLightningGroup
          • Custom script: set bj_lastCreatedLightning = AddLightningEx(udg_SS_LightningType,true,udg_x1,udg_y1,udg_z1,udg_x2,udg_y2,udg_z2)
          • Hashtable - Save Handle Of(Last created lightning effect) as 0 of (Key (Last created unit)) in SS_Hashtable
          • Special Effect - Create a special effect attached to the origin of SS_RandomUnit using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_SS_Point2)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SS_RandomInteger Less than or equal to Actual_CritChance
            • Then - Actions
              • Unit - Set life of SS_RandomUnit to ((Life of SS_RandomUnit) + Actual_CritAmount)
              • Set SS_AfterLife = (Life of SS_RandomUnit)
              • Set SS_HealText = (+ + (String(((Integer(SS_AfterLife)) - (Integer(SS_Life))))))
              • Set SS_HealTextSize = 20.00
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SS_RandomInteger Less than or equal to Actual_SmallCritChance
                • Then - Actions
                  • Unit - Set life of SS_RandomUnit to ((Life of SS_RandomUnit) + Actual_CritAmountSmall)
                  • Set SS_AfterLife = (Life of SS_RandomUnit)
                  • Set SS_HealText = (+ + (String(((Integer(SS_AfterLife)) - (Integer(SS_Life))))))
                  • Set SS_HealTextSize = 15.00
                • Else - Actions
                  • Unit - Set life of SS_RandomUnit to ((Life of SS_RandomUnit) + Actual_HealAmount)
                  • Set SS_AfterLife = (Life of SS_RandomUnit)
                  • Set SS_HealText = (+ + (String(((Integer(SS_AfterLife)) - (Integer(SS_Life))))))
                  • Set SS_HealTextSize = 10.00
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • St_FloatingText Equal to True
            • Then - Actions
              • Set SS_ShowGroup = (Player group((Triggering player)))
              • Floating Text - Create floating text that reads (String(SS_HealText) as Upper case) above SS_RandomUnit with Z offset 0.00, using font size SS_HealTextSize, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
              • Set SS_TextTag = (Last created floating text)
              • Floating Text - Set the velocity of SS_TextTag to 64.00 towards 90.00 degrees
              • Floating Text - Hide SS_TextTag for (All players)
              • Floating Text - Show SS_TextTag for SS_ShowGroup
              • Floating Text - Change SS_TextTag: Disable permanence
              • Floating Text - Change the fading age of SS_TextTag to 1.20 seconds
              • Floating Text - Change the lifespan of SS_TextTag to 2.00 seconds
            • Else - Actions
          • Unit Group - Remove SS_RandomUnit from SS_LightningGroup
      • Custom script: call RemoveLocation(udg_SS_Point1)
      • Custom script: call RemoveLocation(udg_SS_LastHitPos)
      • Custom script: call DestroyGroup(udg_SS_LightningGroup)
      • Custom script: call DestroyGroup(udg_SS_FirstGroup)
      • Custom script: call DestroyForce(udg_SS_ShowGroup)



  • Lightning Clear
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in SS_RemoveLightningGroup) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from SS_RemoveLightningGroup
      • Lightning - Destroy (Load 0 of (Key (Triggering unit)) in SS_Hashtable)
      • Set SS_Group_Integer = (SS_Group_Integer - 1)
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in SS_Hashtable
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SS_Group_Integer Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions


Updated 1.1
- leaks cleared.
Updated 1.2
- New Icon, Tooltip and the spell now only hits Ground units.
Updated 1.2b
- Spell hits air and lightning is at proper height.
Updated 1.3
- Spell loop made more efficient.
Updated 1.3b
- Spell loop made more efficient. (no, really)
Updated 1.4
- Cleared leak, improved tooltip, fixed efficiency, added another customizeable variable for height
Updated 1.5
- Fixed leak.

Keywords:
light, dawn, sun, holy, Light of Dawn, cone, forked, healing, heal, crit, crit heal, manasurge, test map, fun, ground, target, multi, multi target
Contents

Manasurge's Manastorm Spellbase (Map)

Reviews
Light of Dawn v1.5 | Reviewed by Maker | 12th Oct 2013 APPROVED Approved Use a variable for the ability DestroyForce is in a wrong place [TR] 11:59, 3rd Jun 2011 Maker: Causes leaks in the cast...

Moderator

M

Moderator


Light of Dawn v1.5 | Reviewed by Maker | 12th Oct 2013
APPROVED


126248-albums6177-picture66521.png


  • Approved
126248-albums6177-picture66523.png


  • Use a variable for the ability
  • DestroyForce is in a wrong place
[tr]


11:59, 3rd Jun 2011
Maker:
Causes leaks in the cast trigger, the call RemoveLocation(udg_Set SS_Point2) is in wrong place:
  • Set SS_Point2 = (Position of SS_RandomUnit)
Lightning clear shouldn't be on all the time.
 
Level 1
Joined
Aug 9, 2009
Messages
275
Well, by taking a quick look in the triggers, i couldn't see anything wrong with them, though you've got a unit group leaking, if i didn't miss something :)

But maybe you should change the "heals X dmg" to "heals X hp/hit points/health", or whatever pleases you :p
 
  • Set SS_Caster = (Triggering unit)
  • Set SS_Point1 = (Position of (Triggering unit))
I loled x)
You should use SS_Caster instead of Triggering Unit in the second line.

Overall, you did a pretty good job :)

Just use AddLightningEx to give the lightnings height so that the effect
would be nicer ^^

5/5 :D

EDIT: One more thing,
For efficiency, in the following block, store Triggering Unit in a variable and use it
instead of calling "GetTriggerUnit()" every time (Jass thing ;p)

  • Unit Group - Remove (Triggering unit) from SS_RemoveLightningGroup
  • Lightning - Destroy (Load 0 of (Key (Triggering unit)) in SS_Hashtable)
  • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in SS_Hashtable
 
Level 7
Joined
Apr 1, 2010
Messages
289
nice!

cool spell :thumbs_up:

but you might change the for each integer to a pick every unit, that way you don't have to remove the unit from the unit group, and you are doing a pick every unit. save the handle of triggering unit as an integer so
  • set handint = key(triggering unit)
and use that instead of key(triggering unit)
it has to do with what mag said, efficiency.

you do a good job making spell keep up the good work
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Set SS_LightningGroup = (Random Actual_NrHitUnits units from (Units within Actual_Range of SS_LastHitPos matching

- This actually creates two unit groups, not just one. You need to store "(Units within Actual_Range of SS_LastHitPos matching..." into a unit group and destroy it seperately.

Actually, if I understand correctly, you want to pick a minimum of Actual_NrHitUnits compared to the actual count of SS_NrUnits, there is an easier way. You just count the units in "(Units within Actual_Range of SS_LastHitPos matching..." and loop through whichever count is smaller. There is also "Custom script: set udg_SS_RandomUnit = FirstOfGroup(udg_SS_LightningGroup)".

I think you may be better off doing a "pick all units in unit group" and keeping a counter that just ignores all actions after the limit is reached.
 
You used picked every unit, but still uses the set unit = random unit from group???

you just made it more inefficient...

what you need to do is:

1) remove the SS_NrUnits --> this would be useless
2) remove all lines using the SS_NrUnits variable
3) instead of SS_RandomUnit = (Random unit from SS_LightningGroup), make it: SS_RandomUnit = PickedUnit
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Uploaded abilities don't need imported icons.
The learn tooltip coild mention the hotkey, and you could add level stats like standard Blizz abilities have. Also use colour codes.
Lightning Clear shouldn't be on all the time, only when dummies exist.
You could set these in reversed order and use the unit variable in the level thingy:
  • Set SS_Level = (Level of (Ability being cast) for (Triggering unit))
  • Set SS_Caster = (Triggering unit)
The lightning height could be set to a variable that one can configure. The default 35 is too low IMO.
You could use
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units withi Actual range...)
Then you don't need a variable and don't need to use call DestroyGroup() line.
Instead of creating the lightning and then moving it, just create it like this and you don't have to move it:
  • Custom script: set bj_lastCreatedLightning = AddLightningEx(udg_SS_LightningType,true,udg_x1,udg_y1,udg_z1,udg_x2,udg_y2,udg_z2)
Then you can use (last created lightning effect) GUI function to deal with the lightning and you don't need a separate variable for that.
Leaks the player group:
  • Floating Text - Show SS_TextTag for (Player group((Triggering player)))
 
Level 7
Joined
Apr 12, 2011
Messages
124
Uploaded abilities don't need imported icons.
The learn tooltip coild mention the hotkey, and you could add level stats like standard Blizz abilities have. Also use colour codes.
Lightning Clear shouldn't be on all the time, only when dummies exist.
You could set these in reversed order and use the unit variable in the level thingy:
  • Set SS_Level = (Level of (Ability being cast) for (Triggering unit))
  • Set SS_Caster = (Triggering unit)
The lightning height could be set to a variable that one can configure. The default 35 is too low IMO.
You could use
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units withi Actual range...)
Then you don't need a variable and don't need to use call DestroyGroup() line.
Instead of creating the lightning and then moving it, just create it like this and you don't have to move it:
  • Custom script: set bj_lastCreatedLightning = AddLightningEx(udg_SS_LightningType,true,udg_x1,udg_y1,udg_z1,udg_x2,udg_y2,udg_z2)
Then you can use (last created lightning effect) GUI function to deal with the lightning and you don't need a separate variable for that.
Leaks the player group:
  • Floating Text - Show SS_TextTag for (Player group((Triggering player)))

Will fix.
set bj_wantDestroyGroup = true is often a good way of doing it, but i want to keep it a group so i can add SS_LastHit to the group outside the loop itself. :wink: and i can't add SS_LastHit to a group that doesn't exist.
35 height? now a variable, change it if you don't like 35 after you download it ;)

EDIT: Noticed i hadn't implemented that change :eek: so your set bj_wantDestroyGroup = true would work.
But not now x) added the function.
 
Top