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

[Trigger] Check this for errors please

Status
Not open for further replies.
Level 8
Joined
Apr 30, 2009
Messages
338
I decided to make my withering heat spell from my other thread based on channel and totally trigger it, since drain life acts really weird requiring like 8 buffs.

So the spell is a single-target channel that deals damage per second and slows as long as the caster channels it. Check for errors/exploits please:

  • WitheringHeat1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Withering Heat (Bright Wizard - Active)
    • Actions
      • Hashtable - Save Handle Of(Target unit of ability being cast) as (Key target) of (Key (Triggering unit)) in H_WitheringHeat
      • Hashtable - Save ((15.00 + (5.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))) + (0.20 x (Load 100 of (Key (Triggering unit)) from H_Spellpower))) as (Key damage/sec) of (Key (Triggering unit)) in H_WitheringHeat
      • Hashtable - Save 6.00 as (Key duration) of (Key (Triggering unit)) in H_WitheringHeat
      • Set temp_point[0] = (Position of (Target unit of ability being cast))
      • Unit - Create 1 dummy for (Owner of (Triggering unit)) at temp_point[0] facing Default building facing degrees
      • Custom script: call RemoveLocation( udg_temp_point[0] )
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Human Sorceress - Slow (Target unit of ability being cast)
      • Unit Group - Add (Triggering unit) to WitheringHeatCasters
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (WitheringHeat2 <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on WitheringHeat2 <gen>
        • Else - Actions
  • WitheringHeat2
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in WitheringHeatCasters) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in WitheringHeatCasters and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key duration) of (Key (Picked unit)) from H_WitheringHeat) Less than or equal to 0.00
                • Then - Actions
                  • Unit - Remove a_Withering Heat Slow (Bright Wizard) buff from (Load (Key target) of (Key (Picked unit)) in H_WitheringHeat)
                  • Unit Group - Remove (Picked unit) from WitheringHeatCasters
                • Else - Actions
                  • Unit - Cause (Picked unit) to damage (Load (Key target) of (Key (Picked unit)) in H_WitheringHeat), dealing (0.10 x (Load (Key damage/sec) of (Key (Picked unit)) from H_WitheringHeat)) damage of attack type Spells and damage type Fire
                  • Hashtable - Save ((Load (Key duration) of (Key (Picked unit)) from H_WitheringHeat) - 0.10) as (Key duration) of (Key (Picked unit)) in H_WitheringHeat
                  • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 1.30)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • ((Load (Key target) of (Key (Picked unit)) in H_WitheringHeat) is dead) Equal to True
                          • (Mana of (Picked unit)) Less than 13.00
                    • Then - Actions
                      • Unit - Order (Picked unit) to Stop
                      • Hashtable - Save 0.00 as (Key duration) of (Key (Picked unit)) in H_WitheringHeat
                    • Else - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
  • WitheringHeat3
    • Events
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) is in WitheringHeatCasters) Equal to True
    • Actions
      • Hashtable - Save 0.00 as (Key duration) of (Key (Triggering unit)) in H_WitheringHeat
 
Level 4
Joined
Apr 23, 2009
Messages
65
You could make this spell better by adding more variables and such. Also IMO it would be a better spell if the unit was slowed by 10% a second. < just an example. So the longer the spell was held, the slower the unit would get.
 
Level 1
Joined
Nov 6, 2009
Messages
3
It leaks on Unit groups.

How to solve this issue.
1: You must set the group as a Variable.
- Create a new variable name it whatever you like (for example: unit_group)
- The type of the variable is ofc "Unit Group".
- Set the variable to: Unit Group - Units of type (Triggering Unit)
- When you pick the group, pick the variable (you name), example: Unit group- Pick every unit in unit_group and do actions.

2: Once you are done using the unit group, use this custom script:
Call DestroyGroup(udg_unit_group)


If your spell still leaks or does not work, send a Private Message to me.
Peace

~ HankyPanky ~
 
Status
Not open for further replies.
Top