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

Curse of the Death God v1.4

  • Like
Reactions: deepstrasz
Hello guys, Im back and i made a spell.


Curse of the Death God

Curses enemy units in the target area turning them into undead and preventing them from recovering hitpoints. If the unit is undead, it will be turned into non-undead. It does not stack.

Level 1 - 300 area, lasts 5 seconds .
Level 2 - 300 area, lasts 9 seconds.
Level 3 - 300 area, lasts 12 seconds.



  • Curse of Terror Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- set the main ability --------
      • Set CT_Ability = Curse of Terror
      • -------- - --------
      • -------- set the dummy's ability --------
      • Set CT_DummyAbility = Curse of Terror (Dummy)
      • -------- - --------
      • -------- set the buff of the ability --------
      • Set CT_Buff = Curse of Terror (Buff)
      • -------- - --------
      • -------- set the AoE --------
      • Set CT_AoE[1] = 300.00
      • Set CT_AoE[2] = 350.00
      • Set CT_AoE[3] = 400.00
      • -------- - --------
      • -------- set the damage type --------
      • Set CT_DamageType = Normal
      • -------- - --------
      • -------- set the attack type --------
      • Set CT_AttackType = Spells
      • -------- - --------
      • -------- set the percent of strength bonus damage --------
      • -------- Note: to deal 30% damage set the value to 30 not 0.3 --------
      • Set CT_StrengthDamage[1] = 0.00
      • Set CT_StrengthDamage[2] = 0.00
      • Set CT_StrengthDamage[3] = 0.00
      • -------- - --------
      • -------- set the percent of agility bonus damage --------
      • -------- Note: to deal 30% damage set the value to 30 not 0.3 --------
      • Set CT_AgilityDamage[1] = 0.00
      • Set CT_AgilityDamage[2] = 0.00
      • Set CT_AgilityDamage[3] = 0.00
      • -------- - --------
      • -------- set the percent of intelligence bonus damage --------
      • -------- Note: to deal 30% damage set the value to 30 not 0.3 --------
      • Set CT_IntelligenceDamage[1] = 5.00
      • Set CT_IntelligenceDamage[2] = 10.00
      • Set CT_IntelligenceDamage[3] = 15.00
      • -------- - --------
      • -------- set the constant damage --------
      • Set CT_AbsoluteDamage[1] = 60.00
      • Set CT_AbsoluteDamage[2] = 120.00
      • Set CT_AbsoluteDamage[3] = 180.00
      • -------- - --------
      • -------- Note: To set the ability's duration go to the object editor and look for the --------
      • -------- Curse of Terror (dummy) ability. Set up the duration to your liking. --------
      • -------- - --------
      • -------- set the special effects --------
      • Set CT_Attach = origin
      • Set CT_UnitSFX = Abilities\Spells\Items\AIil\AIilTarget.mdl
      • Set CT_AreaSFX = Abilities\Spells\Items\AItb\AItbTarget.mdl
      • -------- - --------
      • -------- set the dummy type --------
      • Set CT_DummyType = Dummy
      • -------- - --------
      • -------- preload and one dummy caster set up --------
      • Set CT_Point = (Random point in (Playable map area))
      • Unit - Create 1 CT_DummyType for Neutral Passive at CT_Point facing Default building facing degrees
      • Set CT_Dummy = (Last created unit)
      • Custom script: call RemoveLocation(udg_CT_Point)
      • Unit - Add CT_Ability to CT_Dummy
      • Unit - Remove CT_Ability from CT_Dummy
      • Unit - Add CT_DummyAbility to CT_Dummy
  • Curse of Terror Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to CT_Ability
    • Actions
      • -------- - --------
      • -------- store temporary values --------
      • Set CT_TempCaster = (Triggering unit)
      • Set CT_TempPlayer = (Triggering player)
      • Set CT_Level = (Level of CT_Ability for CT_TempCaster)
      • Set CT_Point = (Target point of ability being cast)
      • Set CT_TempAgiDamage = (((Real((Agility of CT_TempCaster (Include bonuses)))) x CT_AgilityDamage[CT_Level]) x 0.01)
      • Set CT_TempStrDamage = (((Real((Strength of CT_TempCaster (Include bonuses)))) x CT_StrengthDamage[CT_Level]) x 0.01)
      • Set CT_TempIntDamage = (((Real((Intelligence of CT_TempCaster (Include bonuses)))) x CT_IntelligenceDamage[CT_Level]) x 0.01)
      • Set CT_TempDamage = ((CT_TempAgiDamage + CT_TempStrDamage) + (CT_TempIntDamage + CT_AbsoluteDamage[CT_Level]))
      • Set CT_TempGroup = (Units within CT_AoE[CT_Level] of CT_Point)
      • -------- - --------
      • -------- create special effects --------
      • Special Effect - Create a special effect at CT_Point using CT_AreaSFX
      • Special Effect - Destroy (Last created special effect)
      • -------- - --------
      • -------- move dummy --------
      • Unit - Set level of CT_DummyAbility for CT_Dummy to CT_Level
      • Set CT_Point = (Position of CT_Picked)
      • Custom script: call SetUnitX(udg_CT_Dummy, GetLocationX(udg_CT_Point))
      • Custom script: call SetUnitY(udg_CT_Dummy, GetLocationY(udg_CT_Point))
      • Custom script: call RemoveLocation(udg_CT_Point)
      • -------- - --------
      • -------- affected units --------
      • Unit Group - Pick every unit in CT_TempGroup and do (Actions)
        • Loop - Actions
          • Set CT_Picked = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (CT_Picked is A structure) Equal to False
              • (CT_Picked is Magic Immune) Equal to False
              • (CT_Picked belongs to an enemy of CT_TempPlayer) Equal to True
              • (CT_Picked is alive) Equal to True
            • Then - Actions
              • -------- - --------
              • -------- checks if the unit is already affected --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CT_Picked has buff CT_Buff) Equal to False
                • Then - Actions
                  • -------- - --------
                  • -------- if no, add it to the group --------
                  • Set CT_Index = (CT_Index + 1)
                  • Set CT_Caster[CT_Index] = CT_TempCaster
                  • Set CT_Target[CT_Index] = CT_Picked
                  • Set CT_Damage[CT_Index] = CT_TempDamage
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CT_Index Equal to 1
                    • Then - Actions
                      • Trigger - Turn on Curse of Terror Duration <gen>
                      • Trigger - Turn on Curse of Terror Effect <gen>
                    • Else - Actions
                • Else - Actions
                  • -------- - --------
                  • -------- if yes, apply new damage --------
                  • For each (Integer CT_Looper) from 1 to CT_Index, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CT_Picked Equal to CT_Target[CT_Looper]
                        • Then - Actions
                          • Set CT_Damage[CT_Looper] = CT_TempDamage
                        • Else - Actions
              • -------- - --------
              • -------- add buff to picked units --------
              • Unit - Order CT_Dummy to Neutral Alchemist - Acid Bomb CT_Picked
            • Else - Actions
              • -------- - --------
              • -------- clean up --------
              • Set CT_Picked = No unit
      • -------- - --------
      • -------- clean up --------
      • Custom script: call DestroyGroup(udg_CT_TempGroup)
  • Curse of Terror Duration
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer CT_Looper) from 1 to CT_Index, do (Actions)
        • Loop - Actions
          • -------- - --------
          • -------- check if unit has buff --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (CT_Target[CT_Looper] has buff CT_Buff) Equal to False
            • Then - Actions
              • -------- - --------
              • -------- deindex --------
              • Set CT_Caster[CT_Looper] = CT_Caster[CT_Index]
              • Set CT_Target[CT_Looper] = CT_Target[CT_Index]
              • Set CT_Damage[CT_Looper] = CT_Damage[CT_Index]
              • Set CT_Looper = (CT_Looper - 1)
              • Set CT_Index = (CT_Index - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CT_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                  • Trigger - Turn off Curse of Terror Effect <gen>
                • Else - Actions
            • Else - Actions
  • Curse of Terror Effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) has buff CT_Buff) Equal to True
    • Actions
      • Set CT_TempCaster = (Triggering unit)
      • -------- - --------
      • -------- find and deal damage to casting unit --------
      • For each (Integer CT_Looper) from 1 to CT_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CT_TempCaster Equal to CT_Target[CT_Looper]
            • Then - Actions
              • Unit - Cause CT_Caster[CT_Looper] to damage CT_Target[CT_Looper], dealing CT_Damage[CT_Looper] damage of attack type CT_AttackType and damage type CT_DamageType
              • Special Effect - Create a special effect attached to the CT_Attach of CT_Target[CT_Looper] using CT_UnitSFX
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions



Curse of the Death God v1.4 - removed unit group and unit group checks
- dummy unit is now moved only once per cast.
- the line that gives vision to neutral passive is now removed
Curse of the Death God v1.3 - code has been optimized
- dummy ability is now added to the dummy on init
- dummy level is now set before the loop
Curse of the Death God v1.2 - minor update you wont feel the difference

Curse of the Death God v1.1 - unnecessary comments has been removed also spell now works with only one condition.

Curse of the Death God v1.0 - initial release




Ever tried playing human againsts race other than undead? or playing undead against undead? holy light and death coil becomes useless against your enemies. So, thats why I made this spell. It converts non-undead units into undead and vice-versa. Additionally, affected units cannot recover hitpoints while under the effect of this spell. It also offers a complication to the enemy because they can no longer use holy light or death coil on their units. Enjoy!


Keywords:
curse, of, the, death, god, undead, horrifying, empirean, freaky, weird
Contents

Curse of the Death God by Empirean (Map)

Reviews
09:50, 15ndth Sep 2015 This resource has been Approved by BPower. Criticism: The spell is MUI, leakless and working. Overall good job! In concept the spell is simple, but interesting for some map types. From moderator to user: Be aware...

Moderator

M

Moderator

09:50, 15ndth Sep 2015

This resource has been Approved by BPower.

Criticism:
The spell is MUI, leakless and working. Overall good job!
In concept the spell is simple, but interesting for some map types.

From moderator to user:
Be aware that the unit life is adjusted every 0.03 seconds. This adds a little inaccuracy to
the spell as there is a potential gap, when units can be healed. This heal amount however will
be balanced after 0.03 seconds. JASS allows a close to perfect, but probably more costly solution
by using the unit state trigger event.
 
Level 13
Joined
Jun 20, 2014
Messages
479
Ok chaosy, ill do it after some required changes to the trigger regarding leaks and performance. But for now, i wont modify it.

EDIT: Unnecessary comments has been removed.

EDIT2: Slow day. can someone please review my spell so i can move on with my life (joking)
 
Last edited:
Level 19
Joined
Mar 18, 2012
Messages
1,716
Couldn't find anything wrong.

In general:
Trigger comments are very helpful to reconstruct your train of thoughts while checking the code.
It also helps you to find crucial bugs in your code.
Important is to differ between useful and not so useful comments.
I.e. "I create the dummy here" and the next line is CreateUnit(owner, dummyId, ...) is a rather
useless comment as the following action is very clear.
 
Top