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

How to detect if a region has blight ?

Status
Not open for further replies.
Level 4
Joined
Dec 22, 2016
Messages
67
Hello all.
I want a quest in my map , in which the player must clear blight from a region using dispel.
The problem is that I can't find any condition that determines if a "region" has blight (there is a function for detecting if a "point" has blight but not a region).
So is there any way or trick to do this in GUI?
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Loop through all points in the region (I think the size of one cell is 128).
It's not very efficient, but the only way to do it.
JASS would make it easier and faster, as it supports using coordinates instead of points, but if you want it GUI you can do it by using a lot of "point with offset" I guess.
Once you have found a point with blight make sure to exit the loop.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
As people said above, you will need to test all tiles that make up the region for blight, and fail if any of them still has blight. This can be quite resource intensive so it might be a good idea to only check when the player performs an action to dispel blight.
 
Level 25
Joined
May 11, 2007
Messages
4,651
Create an integer variable named blightCounter, default value of 0.
Create a summoned unit with the bonus damage from dispel as health, give them evasion 100%.
Place 4 of them in the region, one for each corner of the region.

Create a trigger that that checks when their unit-type dies, if the killing unit has dispel == ok! set blightCounter++
if not, (aoe damage from spells) recreate them

Check when blightCounter >= 4
voilá! No more blight in the area.
 
Level 4
Joined
Dec 22, 2016
Messages
67
Yes, it's also possible in GUI. Still -- have you JassHelper access? Can't promise when, but I could probably write a GUI addon for such rect functionality.
Unfortunately no , I use the basic WE of Warcraft (because I don't know JASS and also newgen has issues too -when I click "test map" I doesn't open the map-)
 
Level 4
Joined
Dec 22, 2016
Messages
67
Create an integer variable named blightCounter, default value of 0.
Create a summoned unit with the bonus damage from dispel as health, give them evasion 100%.
Place 4 of them in the region, one for each corner of the region.

Create a trigger that that checks when their unit-type dies, if the killing unit has dispel == ok! set blightCounter++
if not, (aoe damage from spells) recreate them

Check when blightCounter >= 4
voilá! No more blight in the area.
in this method if someone cast dispel on the corners , the region will be assumed as clear while it's center still has blight , btw I tried this way , somehow you cannot pick units with locust ability and remove them , so there is no way to remove those dummy units after they are dispelled , and if they are not locusts , there will be life bars over them which is weird and many other issues.
 
Last edited:
Status
Not open for further replies.
Top