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

[Spell] Trigger activated on specific health amount

Status
Not open for further replies.
Level 4
Joined
Jan 6, 2023
Messages
33
I want to make a boss unit with a skill that would activate when Boss gets to specific health amount.

To be specific I want to make a boss with 10000 health. Let's say when he gets down to 4000hp it will display a message something like "Run" for all players, then wait 10seconds of game time and kill all units within 500 range.

But main problem is that I can't figure out how to set it to activate at specific health amount like 4000hp
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
  • Untitled Trigger 001
    • Events
      • Unit - Footman 0000 <gen>'s life becomes Less than or equal to 4000.00
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Game - Display to (All players) the text: Run
      • -------- other stuff like the 10 sec wait, etc. --------
This will execute the trigger only once per game (since the first thing the trigger does is turn off, otherwise it would run any time the boss unit takes damage while it has less than 4000 health).
If your boss unit can reset the encounter, then during the reset process you would have to use the following action in your reset trigger:
  • Trigger - Turn on Untitled Trigger 001 <gen>
 
Level 4
Joined
Jan 6, 2023
Messages
33
And about that encounter reset, how exactly do I do that? Because I want the boss to respawn (which I've done) and then make this trigger work again. Or when the army fails to kill the boss, the boss instantly regains it's max hp (havent done yet), and the trigger turns on again
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
Hard to say how to do it optimally when I do not know the map in question.
Since you wrote you already respawn the boss, I would guess then that you have a trigger for it - in that trigger you add the action
  • Trigger - Turn on Your_Trigger
where Your_Trigger is the name of the trigger that checks if boss's health dropped below 4000.

Similar approach should be used when you reset boss because the army fails to kill him.
 
Level 6
Joined
Jul 22, 2015
Messages
66
Maybe i can help with this.. but the problem is always adding new event everytime you kill the bosses

  • Maybe i can help
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set YourBoss = Boss Scorpion 0000 <gen>
      • Set YourTypeBoss = Boss Scorpion
      • Trigger - Add to Bossbelow4k <gen> the event (Unit - YourBoss's life becomes Less than or equal to 4000.00)
  • Bossbelow4k
    • Events
    • Conditions
    • Actions
      • Unit - Add Your Ability to YourBoss
  • RunAgainanAgain
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to YourTypeBoss
    • Actions
      • Wait 10.00 seconds
      • Set YourPoint = (Center of Region 000 <gen>)
      • Unit - Create 1 Boss Scorpion for Neutral Hostile at YourPoint facing (Random angle) degrees
      • Set YourBoss = (Last created unit)
      • Trigger - Add to Bossbelow4k <gen> the event (Unit - YourBoss's life becomes Less than or equal to 4000.00)
      • Custom script: call RemoveLocation(udg_YourPoint)
 

Attachments

  • BossWhenHPlow.w3x
    13.4 KB · Views: 0
Level 4
Joined
Jan 6, 2023
Messages
33
Maybe i can help with this.. but the problem is always adding new event everytime you kill the bosses

  • Maybe i can help
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set YourBoss = Boss Scorpion 0000 <gen>
      • Set YourTypeBoss = Boss Scorpion
      • Trigger - Add to Bossbelow4k <gen> the event (Unit - YourBoss's life becomes Less than or equal to 4000.00)
  • Bossbelow4k
    • Events
    • Conditions
    • Actions
      • Unit - Add Your Ability to YourBoss
  • RunAgainanAgain
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to YourTypeBoss
    • Actions
      • Wait 10.00 seconds
      • Set YourPoint = (Center of Region 000 <gen>)
      • Unit - Create 1 Boss Scorpion for Neutral Hostile at YourPoint facing (Random angle) degrees
      • Set YourBoss = (Last created unit)
      • Trigger - Add to Bossbelow4k <gen> the event (Unit - YourBoss's life becomes Less than or equal to 4000.00)
      • Custom script: call RemoveLocation(udg_YourPoint)
It seems to work just fine, boss respawns after wait time with the HPbelow trigger. I just wonder if there's an easy way to make boss stop for 10seconds before casting the spell?
The idea of it all is following:
If the boss gets to 4000HP it stops moving (like it's casting), players have 10seconds to run away, then the spell is cast (spell makes everyone in area die). But the problem is that the boss follows the target instead of staying despite using Order: Stop or Order: move to location of the boss. And the issue is that it's unescapable if the boss follows the target
 
Last edited:
Level 20
Joined
Aug 29, 2012
Messages
832
Have you tried entering 10 in that field? It could probably achieve what you're trying to do

1674268415291.png


Once he uses the ability, it will channel for the amount you put in there and then trigger the effect. I assume that might not work on certain spells though
 
Level 6
Joined
Jul 22, 2015
Messages
66
It seems to work just fine, boss respawns after wait time with the HPbelow trigger. I just wonder if there's an easy way to make boss stop for 10seconds before casting the spell?
The idea of it all is following:
If the boss gets to 4000HP it stops moving (like it's casting), players have 10seconds to run away, then the spell is cast (spell makes everyone in area die). But the problem is that the boss follows the target instead of staying despite using Order: Stop or Order: move to location of the boss. And the issue is that it's unescapable if the boss follows the target

hmmmm,,.... Try to set casting time to 10 second and then order the boss using your instant kill ability (i'm using chain lightning in this case) assuming the boss only use it for one time
  • Bossbelow4k
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Add Your Ability to YourBoss
      • Set YourPoint = (Position of (Triggering unit))
      • Set YourGroup = (Units within 500.00 of YourPoint matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is Magic Immune) Equal to False))))
      • Set TargetGroup = (Random 1 units from YourGroup)
      • Unit Group - Pick every unit in TargetGroup and do (Actions)
        • Loop - Actions
          • Unit - Order (Triggering unit) to Orc Far Seer - Chain Lightning (Picked unit)
      • Custom script: call DestroyGroup(udg_YourGroup)
      • Custom script: call DestroyGroup(udg_TargetGroup)
      • Custom script: call RemoveLocation(udg_YourPoint)
EDIT some example for not picking the boss xD
Here the file example...
 

Attachments

  • BossWhenHPlow.w3x
    17 KB · Views: 1
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,381
Instead of using 'Casting Time' which just makes a unit stand still (note: in case of spells that use 'Casting Time' by default it will cause strange behavior), use the Channel ability and its 'Data - Follow Through Time' field.

The unit casting Channel ability will just 'channel' the spell for X seconds and while the ability itself does nothing (and so cannot cause strange behavior) it will make the unit casting it play its animations and also show any custom effect you set up.
That in my opinion is better for the game, as players will understand better that they have to get away from the boss when he casts channel, rather than the boss just standing still for 10 seconds.
 
Level 4
Joined
Jan 6, 2023
Messages
33
Instead of using 'Casting Time' which just makes a unit stand still (note: in case of spells that use 'Casting Time' by default it will cause strange behavior), use the Channel ability and its 'Data - Follow Through Time' field.

The unit casting Channel ability will just 'channel' the spell for X seconds and while the ability itself does nothing (and so cannot cause strange behavior) it will make the unit casting it play its animations and also show any custom effect you set up.
That in my opinion is better for the game, as players will understand better that they have to get away from the boss when he casts channel, rather than the boss just standing still for 10 seconds.
For some reason when I put Casting Time to 10 it doesn't work. I don't know why, was wondering if it can be because when I put: Order Archmage Blizzard then It'll just cast it instantly (my spell is based on blizzard). Haven't tried with Channel yet


Edit: So yeah, adding cast time for some reason doesn't do anything, it still casts instantly. Aaand I don't exactly know how to make an AoE spell that kills everyone and is based on Channel Ability
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,023
Flamestrike has a casting time; use that as a base.
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to FLAMESTRIKE_BOSS_KILL_ABILITY
  • Actions
    • Set TempPoint = (Target point of ability being cast)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within RANGE of TempPoint matching (((Matching Unit) belongs to an enemy of (Triggering Unit)) equal to True) and do (Actions)
      • Loop - Actions
        • Unit - Kill (Picked unit)
    • Custom script: call RemoveLocation(udg_TempPoint)
 
Level 4
Joined
Jan 6, 2023
Messages
33
Pasted this message in the wrong post, so posting it again here lol


Hmm so I ran into some issues with that

First of all I'll paste triggers I have so far
  • base.gif
    Mannoroth Variables
    • joinminus.gif
      events.gif
      Events
      • line.gif
        joinbottom.gif
        folder.gif
        Map initialization
    • join.gif
      cond.gif
      Conditions
    • joinbottomminus.gif
      actions.gif
      Actions
      • empty.gif
        join.gif
        set.gif
        Set MannorothBoss = Mannoroth (Level 60) 0272 <gen>
      • empty.gif
        join.gif
        set.gif
        Set MannorothType = Mannoroth (Level 60)
      • empty.gif
        joinbottom.gif
        page.gif
        Trigger - Add to Mannoroth HP below <gen> the event (Unit - MannorothBoss's life becomes Less than or Equal to 1000.00)
  • base.gif
    Mannoroth HP below
    • join.gif
      events.gif
      Events
    • join.gif
      cond.gif
      Conditions
    • joinbottomminus.gif
      actions.gif
      Actions
      • empty.gif
        join.gif
        unit.gif
        Unit - Add Death to MannorothBoss
      • empty.gif
        join.gif
        game.gif
        Game - Display to (All players) the text: RUN!
      • empty.gif
        join.gif
        unit.gif
        Unit - Make MannorothBoss Invulnerable
      • empty.gif
        join.gif
        unit.gif
        Unit - Order MannorothBoss to Human Blood Mage Flamestrike (Position of (Triggering unit))
      • empty.gif
        join.gif
        zzz.gif
        Wait 5.00 seconds
      • empty.gif
        joinbottom.gif
        unit.gif
        Unit - Make MannorothBoss Vulnerable
  • base.gif
    Mannoroth Death_Skill
    • joinminus.gif
      events.gif
      Events
      • line.gif
        joinbottom.gif
        unit.gif
        Unit - Starts the effect of an Ability
    • joinminus.gif
      cond.gif
      Conditions
      • line.gif
        joinbottom.gif
        if.gif
        (Ability being cast) Equal to Death
    • joinbottomminus.gif
      actions.gif
      Actions
      • empty.gif
        join.gif
        set.gif
        Set TempPoint = (Target point of ability being cast)
      • empty.gif
        join.gif
        page.gif
        Custom script: set bj_wantDestroyGroup = true
      • empty.gif
        joinminus.gif
        unitgroup.gif
        Unit Group - Pick every unit in (Units within 1000.00 of TempPoint matching (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)) and do (Actions)
        • empty.gif
          line.gif
          joinbottomminus.gif
          actions.gif
          Loop - Actions
          • empty.gif
            line.gif
            empty.gif
            joinbottom.gif
            unit.gif
            Unit - Kill (Picked unit)
      • empty.gif
        joinbottom.gif
        page.gif
        Custom script: call RemoveLocation(udg_TempPoint)
1) In the attached image you can see (it's in my language but it's casting time bar) that casting time is set to 10sec, but in game it still casts right after the message display.

2) Even after putting "Turn off (This trigger)" before any actions it casts everytime I hit the Boss when it's below set hp. (I discovered it on other ability that I gave him)

  • base.gif
    Mannoroth HP below Doom
    • joinminus.gif
      events.gif
      Events
      • line.gif
        joinbottom.gif
        unit.gif
        Unit - Mannoroth (Level 60) 0272 <gen>'s life becomes Less than or Equal to 1500.00
    • join.gif
      cond.gif
      Conditions
    • joinbottomminus.gif
      actions.gif
      Actions
      • empty.gif
        join.gif
        page.gif
        Trigger - Turn off (This trigger)
      • empty.gif
        join.gif
        unit.gif
        Unit - Add Doom to MannorothBoss
      • empty.gif
        joinbottom.gif
        unit.gif
        Unit - Order MannorothBoss to Special Archimonde: Chaos Rain (Position of (Triggering unit))
Spell works, summons (3) units as the spell should do, but everytime I hit the Boss when it's below 1500 HP it summons another 3 and so on.

Edit: I've put "Make Invulnerable" - wait 5sec - "Make Vulnerable" because Flamestrike was killing the boss itself (didn't want to give him an immunity to spells) and didn't come up with another way to do it

(Sorry if any text in the trigger seems weird, but after copying it from my editor I had to change/translate some names to make it readable here on the forum)
 

Attachments

  • 10 sec.png
    10 sec.png
    1.3 KB · Views: 3
Level 4
Joined
Jan 6, 2023
Messages
33
My bad, copied the wrong way from previous post
  • Mannoroth Variables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set MannorothBoss = Mannoroth (Level 60) 0272 <gen>
      • Set MannorothType = Mannoroth (Level 60)
      • Trigger - Add to Mannoroth HP below Death <gen> the event (Unit - MannorothBoss's life becomes Less than or Equal to 1000.00)
      • Trigger - Add to Mannoroth HP below Doom <gen> the event (Jednostka - MannorothBoss's life becomes Less than or Equal to 1500.00)
  • Mannoroth HP below
    • Events
    • Conditions
    • Actions
      • Unit - Add Death to MannorothBoss
      • Game - Display to (All players) the text: RUN!
      • Unit - Order MannorothBoss to Human: BloodMage Flamestrike (Position of (Triggering unit))
  • Mannoroth Death_Skill
    • Events
      • Unit - A unit Starts the effect of an Ability
    • Conditions
      • (Ability being cast) Equal to Death
    • Actions
      • Set TempPoint = (Target point of ability being cast)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 1000.00 of TempPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call RemoveLocation(udg_TempPoint)
1) In the attached image you can see (it's in my language but it's casting time bar) that casting time is set to 10sec, but in game it still casts right after the message display.

2) Even after putting "Turn off (This trigger)" before any actions it casts everytime I hit the Boss when it's below set hp. (I discovered it on other ability that I gave him)
  • Mannoroth HP below Doom_Skill
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Add Doom (Archimonde) to MannorothBoss
      • Unit - Order MannorothBoss to Special: Archimonde Chaos Rain (Position of (Triggering unit))
Spell works, summons (3) units as the spell should do, but everytime I hit the Boss when it's below 1500 HP it summons another 3 and so on.

For now I've put 1h cooldown on those abilities because he kept using the ability. I was wondering if there's a way to make him do it one time, so I can order him use it again when he get's even lower on HP

Edit: Also is there a way to put not-preplaced unit in the "MannorothBoss" variable? Because when he respawns.. I can't use this variable because preplaced Mannoroth boss is dead
 

Attachments

  • 10 sec.png
    10 sec.png
    1.3 KB · Views: 3
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,381
Ad 1)
That is what happens when you use Flamestrike as base of the ability, because this ability is using the 'Casting time' field as a way to offset when the fiery explosion occurs after Blood Mage starts casting the spell.

You have spells that either use or do not use the Casting Time
  • Usually, if Casting Time is > 0 in the original spell, then it is used for something (for example: Blizzard spell uses Casting Time to determine how often should wave of frost drop on enemies). In this case, you need to find out yourself what Casting Time does (as it changes from spell to spell) and if it fits your need
  • If Casting Time is 0, then it is usually not used. So when you set Casting Time for such spells and use them in game, what happens here is that the casting unit just stands still for the Casting Time amount (plays no spell animation, does not show any special effect) and after that casts the spell.
Using Flamestrike (or in my case Channel) was intentional here - yes, the moment the Boss casts the spell, it will trigger the 'Unit Starts the effect of an ability' event, but it will take the Casting Time amount before the spell finishes.
The pros here is that the casting unit will play animations, display special effects, etc.

You can detect if unit finished casting an ability by using the 'Unit finishes casting an ability' event. At that point you will not have access to all the related information - you will know who is the caster, but you will not know where is the 'Target Point of ability being cast'. However this should not pose any issue to you spell - since you center the AoE around the caster, you can just check 'Position of (Triggering unit)'.
Another thing you can do in this trigger is to remove the Invulnerability from the caster and also remove the ability itself from the caster.

Ad 2)
The trigger should work. Just tried on new map the same setup as you have and it worked as intended.
Either you turn on the trigger again somewhere or the trigger is not fired at all, but the unit's AI is making it cast it.
Just print a debug message whenever the trigger is executed and you will see what the issue is.

Anyway, I would advise you to remove that ability from the Boss unit after he stops casting it.
You can use the 'Unit stops casting an ability' event which fires anytime unit stops casting it (be it because the unit was interrupted, got different order, or just finished casting the spell) or the 'Unit finishes casting an ability' which fires only if unit successfully finished the spell without any interruption.
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
because this ability is using the 'Casting time' field as a way to offset when the fiery explosion occurs after Blood Mage starts casting the spell.
Ah, well... oops. That was just the only default ability I could think of that has a cast time. Channel also has to have 'follow through time' set properly to work as a channeled ability, I believe.
 
Level 4
Joined
Jan 6, 2023
Messages
33
Ad 1)
That is what happens when you use Flamestrike as base of the ability, because this ability is using the 'Casting time' field as a way to offset when the fiery explosion occurs after Blood Mage starts casting the spell.

You have spells that either use or do not use the Casting Time
  • Usually, if Casting Time is > 0 in the original spell, then it is used for something (for example: Blizzard spell uses Casting Time to determine how often should wave of frost drop on enemies). In this case, you need to find out yourself what Casting Time does (as it changes from spell to spell) and if it fits your need
  • If Casting Time is 0, then it is usually not used. So when you set Casting Time for such spells and use them in game, what happens here is that the casting unit just stands still for the Casting Time amount (plays no spell animation, does not show any special effect) and after that casts the spell.
Using Flamestrike (or in my case Channel) was intentional here - yes, the moment the Boss casts the spell, it will trigger the 'Unit Starts the effect of an ability' event, but it will take the Casting Time amount before the spell finishes.
The pros here is that the casting unit will play animations, display special effects, etc.

You can detect if unit finished casting an ability by using the 'Unit finishes casting an ability' event. At that point you will not have access to all the related information - you will know who is the caster, but you will not know where is the 'Target Point of ability being cast'. However this should not pose any issue to you spell - since you center the AoE around the caster, you can just check 'Position of (Triggering unit)'.
Another thing you can do in this trigger is to remove the Invulnerability from the caster and also remove the ability itself from the caster.

Ad 2)
The trigger should work. Just tried on new map the same setup as you have and it worked as intended.
Either you turn on the trigger again somewhere or the trigger is not fired at all, but the unit's AI is making it cast it.
Just print a debug message whenever the trigger is executed and you will see what the issue is.

Anyway, I would advise you to remove that ability from the Boss unit after he stops casting it.
You can use the 'Unit stops casting an ability' event which fires anytime unit stops casting it (be it because the unit was interrupted, got different order, or just finished casting the spell) or the 'Unit finishes casting an ability' which fires only if unit successfully finished the spell without any interruption.
So I kind of got lost with detecting and stuff (I'm not any good with triggers yet) and I tried to go around a bit.. kind of doing a mess, and thought it would work but it doesn't end up casting the Death ability. (prepare death is based on Blizzard with cast time set to 10 but idk if that does the trick, he's not casting the blizzard for 10sec ;/ )
  • Mannoroth Variables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set MannorothBoss = Mannoroth (Level 60) 0272 <gen>
      • Set MannorothType = Mannoroth (Level 60)
      • Trigger - Add to Mannoroth HP below Prepare Death <gen> the event (Unit - MannorothBoss's life becomes Less than or Equal to 1000.00)
      • Trigger - Add to Mannoroth HP below Doom <gen> the event (Jednostka - MannorothBoss's life becomes Less than or Equal to 1500.00)
  • Mannoroth HP below Prepare Death
    • Events
    • Conditions
    • Actions
      • Unit - Add Prepare Death to MannorothBoss
      • Game - Display to (All players) the text: RUN!
      • Unit - Order MannorothBoss to Human: Archmage Blizzard (Position of (Triggering unit))
  • Mannoroth HP below Death
    • Events
      • Unit - Mannoroth (Level 60) 0272 <gen> finishes casting an Ability
    • Conditions
      • (Ability being cast) Equal to Prepare Death
    • Actions
      • Unit - Add Death to MannorothBoss
      • Unit - Order MannorothBoss to Human: Bloodmage Flamestrike (Position of (Triggering unit))
I'd be delighted if you showed a trigger to detecting what's needed to make it work. I'm absolutely lost atm :xxd:


Edit: something broke, after he casts blizzard, and I run away, he just stops moving and attacking even after I come back to attack him lol
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
So I kind of got lost with detecting and stuff (I'm not any good with triggers yet) and I tried to go around a bit.. kind of doing a mess, and thought it would work but it doesn't end up casting the Death ability. (prepare death is based on Blizzard with cast time set to 10 but idk if that does the trick, he's not casting the blizzard for 10sec ;/ )
See what I wrote in my earlier post:
(for example: Blizzard spell uses Casting Time to determine how often should wave of frost drop on enemies)
So if you set Cast Time to 10 seconds and set number of waves to let's say 5, then the total cast time of the spell is 5*10 = 50 seconds.

Anyway, I made the spell in an empty map. I based the actual spell on Channel and because the boss always casts the spell on his own position, I left the spell as Instant rather than targeted AoE circle.
Also, the Base Order ID for that ability is set to howlofterror (hence why I order unit to cast that spell in triggers below)
  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Trigger - Add to Death Health Check <gen> the event (Unit - Boss 0000 <gen>'s life becomes Less than 1000.00)
  • Death Health Check
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Add Death to (Triggering unit)
      • Unit - Order (Triggering unit) to Neutral Pit Lord - Howl Of Terror.
      • Game - Display to (All players) the text: RUN
  • Death Cast End
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Death
    • Actions
      • Unit - Remove Death from (Triggering unit)
      • Set VariableSet Loc = (Position of (Triggering unit))
      • Set VariableSet UnitGroup = (Units within 1000.00 of Loc matching (((Matching unit) belongs to an enemy of (Triggering player).) Equal to True).)
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call RemoveLocation(udg_Loc)
      • Custom script: call DestroyGroup(udg_UnitGroup)
See the attached map
 

Attachments

  • CastSpellOnHealthDrop.w3m
    18.4 KB · Views: 2
Level 4
Joined
Jan 6, 2023
Messages
33
See what I wrote in my earlier post:

So if you set Cast Time to 10 seconds and set number of waves to let's say 5, then the total cast time of the spell is 5*10 = 50 seconds.

Anyway, I made the spell in an empty map. I based the actual spell on Channel and because the boss always casts the spell on his own position, I left the spell as Instant rather than targeted AoE circle.
Also, the Base Order ID for that ability is set to howlofterror (hence why I order unit to cast that spell in triggers below)
  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Trigger - Add to Death Health Check <gen> the event (Unit - Boss 0000 <gen>'s life becomes Less than 1000.00)
  • Death Health Check
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Add Death to (Triggering unit)
      • Unit - Order (Triggering unit) to Neutral Pit Lord - Howl Of Terror.
      • Game - Display to (All players) the text: RUN
  • Death Cast End
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Death
    • Actions
      • Unit - Remove Death from (Triggering unit)
      • Set VariableSet Loc = (Position of (Triggering unit))
      • Set VariableSet UnitGroup = (Units within 1000.00 of Loc matching (((Matching unit) belongs to an enemy of (Triggering player).) Equal to True).)
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call RemoveLocation(udg_Loc)
      • Custom script: call DestroyGroup(udg_UnitGroup)
See the attached map
Welp I just tried that exact plugin but can't get it to work for absolutely no reason. on the attached map it works but here... doesnt. Maybe I'm doing something wrong with the channel ability, i changed follow through time to 10 and base id to howl of terror. The trigger is exactly the same as yours

Edit: It does display the message "Run" but can't tell if it's doing anything after that. I think it doesnt cast channel because the Boss doesn't stay in place for 10seconds
 
Level 4
Joined
Jan 6, 2023
Messages
33
Nevermind, I've put "howlofterror" in the wrong string. Fixed it and everything works, thank you! You're a life saver Nichilus!

Just a quick simple question. may be tricky or easy. When he casts it and I run away.. he resets when I go too far. Is there a way to fix it? because there are two problems

1) Fight kind of resets and I want him to chase his enemies after he casts the death ability
2) I'm working on a health reset system for him, so if he reset after losing track of enemies from death ability... his health will reset and the fight will start over

He resets when my hero is out of his sight
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,381
There are two things that can prevent unit from attacking
  • unit cannot see any other unit
    • can be fixed by increasing unit's Sight radius (object editor => Stats - Sight Range (day/night))
    • since this is related to boss unit who, I assume, is in some specific boss room, you can actually use Visibility Modifiers to give the Boss's player sight range over selected region (see below)
  • unit's acquisition range is too short
    • determines the range at which unit acquires a target for combat
    • can be changed in object editor (Object editor => Combat - Acquisition Range)
Since you want boss to reset via your system, it may be better if the boss has low acquisition range and sight range before fight starts (so that players start the fight rather than the boss getting aggro from miles away).
Basically the idea is as follow:
  • Boss starts with short sight range and acquisition range
  • Players get close enough to the boss to start fight
  • You increase boss's sight and acquisition ranges via triggers for the duration of the fight
  • If fights resets: You decrease both sight and acquisition range to initial values
I don't know how you detect in your map if boss engaged in combat or if he resets, so modify the trigger to fit your needs:
  • Fight starts
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for BossOwningPlayer emitting Visibility across BossFightArea
      • Set VariableSet BossVisibilityModifier = (Last created visibility modifier)
      • -------- Note: below is WCIII Reforged-only action: 'Unit - Set Unit Real Field' --------
      • Unit - Set Unit: Boss 0000 <gen>'s Real Field: Acquisition Range ('uacq') to Value: 1500.00 //modify as needed. This should basically be the length of the fight area
  • Fight resets
    • Actions
      • Visibility - Destroy BossVisibilityModifier
      • Unit - Set Unit: Boss 0000 <gen>'s Real Field: Acquisition Range ('uacq') to Value: 500.00 //this is the default range
 
Level 4
Joined
Jan 6, 2023
Messages
33
There are two things that can prevent unit from attacking
  • unit cannot see any other unit
    • can be fixed by increasing unit's Sight radius (object editor => Stats - Sight Range (day/night))
    • since this is related to boss unit who, I assume, is in some specific boss room, you can actually use Visibility Modifiers to give the Boss's player sight range over selected region (see below)
  • unit's acquisition range is too short
    • determines the range at which unit acquires a target for combat
    • can be changed in object editor (Object editor => Combat - Acquisition Range)
Since you want boss to reset via your system, it may be better if the boss has low acquisition range and sight range before fight starts (so that players start the fight rather than the boss getting aggro from miles away).
Basically the idea is as follow:
  • Boss starts with short sight range and acquisition range
  • Players get close enough to the boss to start fight
  • You increase boss's sight and acquisition ranges via triggers for the duration of the fight
  • If fights resets: You decrease both sight and acquisition range to initial values
I don't know how you detect in your map if boss engaged in combat or if he resets, so modify the trigger to fit your needs:
  • Fight starts
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for BossOwningPlayer emitting Visibility across BossFightArea
      • Set VariableSet BossVisibilityModifier = (Last created visibility modifier)
      • -------- Note: below is WCIII Reforged-only action: 'Unit - Set Unit Real Field' --------
      • Unit - Set Unit: Boss 0000 <gen>'s Real Field: Acquisition Range ('uacq') to Value: 1500.00 //modify as needed. This should basically be the length of the fight area
  • Fight resets
    • Actions
      • Visibility - Destroy BossVisibilityModifier
      • Unit - Set Unit: Boss 0000 <gen>'s Real Field: Acquisition Range ('uacq') to Value: 500.00 //this is the default range
Because that action is Reforged only, then it's not possible to do it in pre Reforged right? Or I misunderstood
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
Reforged is not an update, that's what I'm trying to tell you. Any wc3 install can be upgraded to the current patch (1.35), which does include additional assets for Reforged but it's still just a baseline update for the game. If you do still have old CDs you should register your cd keys to your Battle.net account and then you'll never need the physical disks again.
 
Level 4
Joined
Jan 6, 2023
Messages
33
Sorry for reviving that post once again but just placed around 12units to check how it works with more units and the trigger doesn't kill every unit (even though every unit is in range of "pick unit" action). It kills random selected ones, everytime different ones, just like it can't handle all units or something
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
If you have the same group setup as I posted, then there isn't really anything that would prevent units from being picked up by the trigger - so long as those units are owned by players that are enemies to the player owning the Boss unit.

Also, make sure that the custom scripts are placed correctly - that they are not part of the 'pick every unit in group' Action block (only the 'Unit - kill (picked unit)' action should be there).

What I mean is the following.
In this example the custom scripts are not part of the 'Pick every unit' Action block (that's the correct way):
  • Unit Group - Pick every unit in UnitGroup and do (Actions)
    • Loop - Actions
      • Unit - Kill (Picked unit)
  • Custom script: call RemoveLocation(udg_Loc)
  • Custom script: call DestroyGroup(udg_UnitGroup)
In this example the script actions are (wrongly) part of the action block
  • Unit Group - Pick every unit in UnitGroup and do (Actions)
    • Loop - Actions
      • Unit - Kill (Picked unit)
      • Custom script: call RemoveLocation(udg_Loc)
      • Custom script: call DestroyGroup(udg_UnitGroup)
 
Level 4
Joined
Jan 6, 2023
Messages
33
I have the exact same setup as you posted above, and scripts are not a part of the Pick action. The only thing I changed was changing from "Kill" to "set (Picked Unit) life percentage to 25%" but I think it shouldn't be the thing that stops the trigger (haven't checked if "Kill" kills every unit, will check in a second)

Edit: Checked and "Kill" action killed 9 out of 12 units (those 12units consist of a hero and 11 gryphon riders) (for some reason from all tries it didnt kill the hero even once, but if I place ONLY the hero unit, then it works and kills the hero, thats some weird stuff going on)

Edit 2: After trying couple things, the only way I got it to work, was when units weren't running away when the boss was casting and they kept attacking him. This way every unit got their health reduced/killed if I set it to Kill. Have no idea how that's possible. I thought maybe that if i run away/ stand still next to boss casting, then I quit the fight and I am no longer an enemy of the boss? But that's weird because that would mean that when the boss starts casting, he kind of loses the track of fight and acts like there was no fight. But that may not be it
 
Last edited:
Level 4
Joined
Jan 6, 2023
Messages
33
Here they are:
  • Variables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set MannorothBoss = Mannoroth (Level 60) 0272 <gen>
      • Trigger - Add to Death Health Check <gen> the event (Unit - Mannoroth (Level 60) 0272 <gen>'s life becomes Less than 1000.00)
  • Death Health Check
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Add Death to MannorothBoss
      • Unit - Order MannorothBoss to Pit Lord - Howl of Terror
      • Game - Display to (All players) the text: IT IS YOUR END
  • Death Cast End
    • Events
      • Unit - A unit finishes casting an Ability
    • Conditions
      • (Ability being cast) Equal to Smierc
    • Actions
      • Unit - Remove Death from MannorothBoss
      • Set ER_Loc = (Position of MannorothBoss)
      • Set ER_Group = (Units within 1000.00 of ER_Loc matching (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True))
      • Unit Group - Pick every unit in ER_Group and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to 25.00%
      • Custom script: call RemoveLocation(udg_ER_Loc)
      • Custom script: call DestroyGroup(udg_ER_Group)
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
Those triggers seem alright.
Since these trigger are quite simple, you can try this in empty/new map. Just recreate those three triggers, create the ability and boss in object editor, place 12 units around the boss again and let him cast the spell. Then check if all 12 units had health decreased or if the issue persists.
If all units had health decreased, then most probably some other trigger is affecting your Death Cast End in your actual map.

Two things that you could try then:
  1. If the ER_Group and ER_Loc variables are used in more triggers, then try to resolve this issue by creating new variable only used in the Death Cast End trigger
  2. Try to detect which trigger causes the issue (for example disable one half of your triggers, then the other half ... except these 3 Death Health triggers of course; once you find out which half is causing the issue, disable one half of the triggers in the 'problematic' half and continue this disabling process until you find the possible candidate)
 
Status
Not open for further replies.
Top