• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Power of Blight (1.6)

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
This spell is almost similar to the "Blight Walker" spell which i created earlier.
When on blight all attributes are temporarily increased by x value.
For my example, the attributes are increased by 5 each level of the spell.
This doesn't use indexing or hashtables. There are importing instructions written along with the triggers.
Here are the triggers:

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PB_Ability = Stat Bonus
      • Set PB_Effect = Effects
  • Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Power of Blight
    • Actions
      • Unit Group - Add (Triggering unit) to PB_UG
  • PB Effect
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in PB_UG and do (Actions)
        • Loop - Actions
          • Set PB_Unit = (Picked unit)
          • Set PB_level = (Level of PB_Ability for PB_Unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Position of PB_Unit) is blighted) Equal to True
            • Then - Actions
              • Unit - Add PB_Ability to PB_Unit
              • Unit - Add PB_Effect to PB_Unit
              • Unit - Set level of PB_Ability for PB_Unit to (Level of Power of Blight for PB_Unit)
            • Else - Actions
              • Unit - Remove PB_Ability from (Picked unit)
              • Unit - Remove PB_Effect from (Picked unit)

v1.0
-Release
v1.1
-Fixed the leaks
-Changed the way aura is displayed
v1.2
-Changed the way attribute is added to unit
v1.3
-removed player group
-increase interval
v1.4
-back to original settings
v1.5
-removed text_ug variable
-moved the 2nd if to the else of the first if
v1.6
-made it simple

Thanks for your time.

Keywords:
Undead, Blight, Status, Increase, Power, Passive,
Contents

Power of Blight (v1.6) (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 11:40, 17th Aug 2013 Maker: Check my reply in this thread.

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

11:40, 17th Aug 2013
Maker: Check my reply in this thread.
 
Level 20
Joined
Jun 27, 2011
Messages
1,864
Good that you've improved!

Btw, I don't get the use of this,
  • For each (Integer A) from 0 to 2, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CHECK[(Integer A)] Less than 0
        • Then - Actions
          • Set CHECK[(Integer A)] = 0
 
Hello there, I just got home. Also, I've done the changes required. I've also changed the spell a little. Now, the unit will only have the Unholy Aura graphics when standing on blight. I hope I didn't miss anything. I'm also expecting more suggestions. Please be kind to tell me my mistakes so I can learn. Thanks for your time.

EDIT: also i need to ask somethings. i've used alot of variable for this spell, if i use arrays will it reduce the file size. also, if i destroy the initialization trigger after initializing will my variables retain its value?.
 
Last edited:
u should store this into an integer variable. and use the integer variable.
  • (Level of Power of Blight for blighted_unit)
dont use integer A/B as said above.
change this.
  • For each (Integer A) from 0 to 2, do (Actions)
  • Loop - Actions
  • Set CTR_int = (Integer A)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • CHECK_int[CTR_int] Less than 0
      • Then - Actions
        • Set CHECK_int[CTR_int] = 0
      • Else - Actions
to this
  • For each CTR_int from 0 to 2, do (Actions)
  • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • CHECK_int[CTR_int] Less than 0
      • Then - Actions
        • Set CHECK_int[CTR_int] = 0
      • Else - Actions
it is better to use temp variables that aren't arrays but they will decrease file size by a very small amount. the also decrease efficiency by that small amount of space u gain
 
will update after few mins, ill make it quick

EDIT:
-removed blight_pg, used all player function
-0.3 changed to 0.1
-im not sure what you mean about this, only heroes are selected on the timer. Only those that are standing on blight gets the additional status and is stored on another unit group. Or, did you mean that my 2nd must be created and destroyed all the time? if so, ill adjust it again. thanks
 
Last edited:
Hehe, the first group picks unit that has the ability. Then check if the units are on blight or not. Those that are on blight are given an ability and stored to a separate unit group. When units are not on blight, they are removed from the unit group. The unit learns ability event directly adds the unit to the separate unit group. I used this so that when a hero learns the ability while on blight, it will be added to the separate unit group. Also, when you level your skill while on blight it will take effect immediately. Only test_ug is created and destroyed. the other is just for adding and removing units.
 
oh, yes. I thought of that. create/destryo group 10 times is bad. but if i dont destroy it, wouldnt it leak?

and for the second one, sure ill do that the next update. but please answer the first question. Im really confused right now. The first release,I dont destroy the group but you said it will leak, so i inserted a line for destroying group. and now its just bad. Please advise. thanks
 
Here, when unit learns the ability, it is added to the 2nd unit group. In the periodic trigger, the only group that needs to be picked is the test_ug.

-first item is fixed since it already adds the unit into the 2nd unit group
-the second unit group was never destroyed, it is only for adding units. In the periodic trigger ill just bring it back to the original setting where the unit group is not destroyed.

EDIT: ill just add abiliities into a variable in the initialization then im "ok" ?
 
store triggering unit into a variable and use the variable. anything used twice or more should be stored in a variable.

change this
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (taint_point is blighted) Equal to True
      • (blighted_unit is in increased_ug) Equal to False
        • Then - Actions
          • Unit - Add BlightBonus_ability to blighted_unit
          • Unit - Set level of BlightBonus_ability for blighted_unit to BligjhtLevel_int
          • Unit Group - Add blighted_unit to increased_ug
          • Unit - Add Blight_Ability[1] to blighted_unit
        • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (taint_point is blighted) Equal to False
      • (blighted_unit is in increased_ug) Equal to True
        • Then - Actions
          • Unit - Remove BlightBonus_ability from blighted_unit
          • Unit Group - Remove blighted_unit from increased_ug
          • Unit - Remove Blight_Ability[1] from blighted_unit
        • Else - Actions
to this
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (taint_point is blighted) Equal to True
      • (blighted_unit is in increased_ug) Equal to False
        • Then - Actions
          • Unit - Add BlightBonus_ability to blighted_unit
          • Unit - Set level of BlightBonus_ability for blighted_unit to BligjhtLevel_int
          • Unit Group - Add blighted_unit to increased_ug
          • Unit - Add Blight_Ability[1] to blighted_unit
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (taint_point is blighted) Equal to False
              • (blighted_unit is in increased_ug) Equal to True
                • Then - Actions
                  • Unit - Remove BlightBonus_ability from blighted_unit
                  • Unit Group - Remove blighted_unit from increased_ug
                  • Unit - Remove Blight_Ability[1] from blighted_unit
                • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
anything used twice or more should be stored in a variable.

I see you post this a lot. I might not be completely true. I'd rather say "thrice or more" if a clear limit would have to be set.

For example in jass, you would have to declare a local variable and then possibly null it, so the speed difference decreases.

In GUI that could result in using more variables than needed to give one example.
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
  • Set test_ug = (Units in (Playable map area) matching ((((Matching unit) has buff Blight_buff) Equal to True) and (((Matching unit) is A Hero) Equal to True)))
  • Unit Group - Pick every unit in test_ug and do (Actions)
Remove this, and replace it with:
  • Unit Group - Pick every unit in increased_ug and do (Actions)
also remove the condition where you check if the unit is in the increased_ug

You use basic variable names, make them like: PB_UG (unit group of the spell)

and remove those:
  • Unit Group - Add blighted_unit to increased_ug
and
  • Unit Group - Remove blighted_unit to increased_ug

cool spell btw
 
thanks guys. i havent touched this since my last comment. ill work on this as soon as i can. expect updates today or tomorrow. depends on your time zone.

EDIT: the spell has been updated. i removed the variable "test_ug"
the increased_ug cannot be removed cause i have to keep track on units that has the bonus. the 3rd trigger is for leveling the spell if the hero is stepping on blight. if you level the spell while not on blight is ok without the 3rd trigger. but if you level the spell while on blight without the 3rd trigger, the bonus will not update unless you get out of the blight
 
Last edited:
REVIEW
TRIGGER FIXES
  • Anything used twice or more should be stored into a variable. Example: triggering unit
  • Don’t pick every unit in the map every 0.10 seconds.
  • You should store the units when they enter the map in an indexed array.
FINAL RATING
  • 1/5 Needs Fix
[/TD][/tr]
If you have any questions or problems with my review please tell me. Original Review Template by Doomlord.
 
Last edited:
ill change the "triggering unit" on the 3rd trigger later. hmm. i see, store any unit entering only when they have the ability. then use time to check if they are on blight and add bonus if they are. with this i dont have to crease unit group 10 times every second. Thanks deathismyfriend. ill implement this as soon as i get home.
 
ill change the "triggering unit" on the 3rd trigger later. hmm. i see, store any unit entering only when they have the ability. then use time to check if they are on blight and add bonus if they are. with this i dont have to crease unit group 10 times every second. Thanks deathismyfriend. ill implement this as soon as i get home.

No problem and good luck
 
Level 13
Joined
Jan 30, 2012
Messages
1,298
i think you should also store the Ability into a variable as well
store your Triggering unit into a variable too
  • Unit - Set level of PB_Ability for PB_Unit to (Level of Power of Blight for PB_Unit)
use your stored variable, "PB_level" not "Level of Power of Blight for PB_Unit"
  • Unit - Remove PB_Ability from (Picked unit)
use your stored variable, "PB_Unit" not "Picked unit"
Magetheridon96 said:
Why store a variable if you didn't use it?
  • ((Position of PB_Unit) is blighted) Equal to True
use variable..
i think 0.03 is too quick

other than that good job...
suggestion: make this more configurable (i hope you know what i mean)

2/5 until this fixed
bonus
+rep and keep up the good work
 
Top