- Joined
- Jan 12, 2011
- Messages
- 1,537
So i need a trigger to make a unit regenerate 2 hp per second in water when the player researched an ability. x.x
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Heal Upgrade

Events


Unit - A unit Finishes research

Conditions


(Researched tech-type) Equal to Naga Siren Adept Training

Actions


Set HealsInWater[(Player number of (Owner of (Researching unit)))] = True


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Execution count of (This trigger)) Greater than or equal to 1



Then - Actions




Trigger - Turn on Heal In Water <gen>



Else - Actions
Heal In Water

Events


Time - Every 0.50 seconds of game time

Conditions

Actions


For each (Integer Int) from 1 to 12, do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






HealsInWater[Int] Equal to True





Then - Actions






Unit Group - Pick every unit in (Units owned by (Player(Int)) of type Naga Siren) and do (Actions)







Loop - Actions








Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl








Set Point = (Position of (Picked unit))








Custom script: set udg_Real = GetLocationZ( udg_Point )








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










Real Less than or equal to 166.40









Then - Actions










Special Effect - Create a special effect attached to the overhead of (Picked unit) using Objects\InventoryItems\Rune\Rune.mdl










Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 1.00)









Else - Actions





Else - Actions
|
Unit Group - Pick every unit in (Units owned by (Player(Int)) of type Naga Siren) and do (Actions)
I did not know that this existed: (Terrain pathing at Point of type Floatability is off) Equal to False
Let me make a simpler trigger that is worthy of pleasing Spartipilo.![]()
Heal Upgrade

Events


Unit - A unit Finishes research

Conditions


(Researched tech-type) Equal to Naga Siren Adept Training

Actions


Unit Group - Pick every unit in (Units owned by (Owner of (Researching unit)) of type Naga Siren) and do (Actions)



Loop - Actions




Unit Group - Add (Picked unit) to UnitsThatHealInWater


Set HealsInWater[(Player number of (Owner of (Researching unit)))] = True


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Execution count of (This trigger)) Greater than or equal to 1



Then - Actions




Trigger - Turn on Heal In Water <gen>



Else - Actions
Add Units

Events


Unit - A unit enters (Playable map area)

Conditions

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




HealsInWater[(Player number of (Owner of (Triggering unit)))] Equal to True



Then - Actions




Unit Group - Add (Triggering unit) to UnitsThatHealInWater



Else - Actions
Heal In Water

Events


Time - Every 0.50 seconds of game time

Conditions

Actions


Unit Group - Pick every unit in UnitsThatHealInWater and do (Actions)



Loop - Actions




Set Point = (Position of (Picked unit))




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(Terrain pathing at Point of type Floatability is off) Equal to False





Then - Actions






Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 1.00)





Else - Actions
This works:
Heal Upgrade
Events
Unit - A unit Finishes research
Conditions
(Researched tech-type) Equal to Naga Siren Adept Training
Actions
Unit Group - Pick every unit in (Units owned by (Owner of (Researching unit)) of type Naga Siren) and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to UnitsThatHealInWater
Set HealsInWater[(Player number of (Owner of (Researching unit)))] = True
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Execution count of (This trigger)) Greater than or equal to 1
Then - Actions
Trigger - Turn on Heal In Water <gen>
Else - Actions
Add Units
Events
Unit - A unit enters (Playable map area)
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
HealsInWater[(Player number of (Owner of (Triggering unit)))] Equal to True
Then - Actions
Unit Group - Add (Triggering unit) to UnitsThatHealInWater
Else - Actions
I have Heal In Water off at first so the game goes a little faster until someone researches Nada Siren Adept Training. Also, this probably goes much much faster than my past trigger. Enjoy!
Heal In Water
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in UnitsThatHealInWater and do (Actions)
Loop - Actions
Set Point = (Position of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at Point of type Floatability is off) Equal to False
Then - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 1.00)
Else - Actions
1. Pick Every Unit of Type LEAKS. Instead Pick Every Unit and do "If Unit Type of Picked Unit = xxx, then..."
2. (Owner of (Researching unit)) is used twice. Store it into a variable in the trigger beginning, and use the variable instead.
3. After " Trigger - Turn on Heal In Water <gen>" use "Custom script: call DestroyTrigger(GetTriggeringTrigger())or "DestroyTrigger(gg_trg_Heal Upgrade)"
4. In "Add Units" trigger you have to filter the unit type, since you only heal Naga types.
5. "Heal In Water" trigger Leaks position: Also repeats several times the "Picked Unit", Set Picked Unit to a variable and use the variable instead. Also I would prefer adding a Life Regeneration ability rather than triggering the life modification
set u = Picked Unit
set L = Life Of u
Unit - set life of u = L + 1
Heal Upgrade

Events


Unit - A unit Finishes research

Conditions


(Researched tech-type) Equal to Naga Siren Adept Training

Actions


Set Unit = (Researching unit)


Set HealsInWater[(Player number of (Owner of Unit))] = True


Unit Group - Pick every unit in (Units owned by (Owner of Unit)) and do (Actions)



Loop - Actions




Set Unit = (Picked unit)




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(Unit-type of Unit) Equal to Naga Siren





Then - Actions






Unit Group - Add Unit to UnitsThatHealInWater





Else - Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Execution count of (This trigger)) Greater than or equal to 1



Then - Actions




Trigger - Turn on Heal In Water <gen>



Else - Actions
Add Units

Events


Unit - A unit enters (Playable map area)

Conditions


(Unit-type of (Triggering unit)) Equal to Naga Siren

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




HealsInWater[(Player number of (Owner of (Triggering unit)))] Equal to True



Then - Actions




Unit Group - Add (Triggering unit) to UnitsThatHealInWater



Else - Actions
Heal In Water

Events


Time - Every 0.50 seconds of game time

Conditions

Actions


Unit Group - Pick every unit in UnitsThatHealInWater and do (Actions)



Loop - Actions




Set Unit = (Picked unit)




Set Point = (Position of Unit)




Set Real = (Life of Unit)




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(Terrain pathing at Point of type Floatability is off) Equal to False





Then - Actions






Unit - Set life of Unit to (Real + 1.00)





Else - Actions




Custom script: call RemoveLocation( udg_Point )
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Execution count of (This trigger)) Greater than or equal to 1
Then - Actions
Trigger - Turn on Heal In Water <gen>
Custom Script: set bj_wantDestroyGroup = true.1. Pick Every Unit of Type LEAKS. Instead Pick Every Unit and do "If Unit Type of Picked Unit = xxx, then..."
2. (Owner of (Researching unit)) is used twice. Store it into a variable in the trigger beginning, and use the variable instead.
3. After " Trigger - Turn on Heal In Water <gen>" use "Custom script: call DestroyTrigger(GetTriggeringTrigger())or "DestroyTrigger(gg_trg_Heal Upgrade)"
4. In "Add Units" trigger you have to filter the unit type, since you only heal Naga types.
5. "Heal In Water" trigger Leaks position: Also repeats several times the "Picked Unit", Set Picked Unit to a variable and use the variable instead. Also I would prefer adding a Life Regeneration ability rather than triggering the life modification
set u = Picked Unit
set L = Life Of u
Unit - set life of u = L + 1
Actually, you just have to Copy/Paste and maybe edit two or three global values![]()
This MUST NOT BE DONE: Custom script: call DestroyGroup(udg_unitsthathealinwater). You need that group.
Then just filter the units with the ability instead of the unit type.
(Unit-type of (Triggering unit)) Equal to (==) Naga Royal Guard
(Unit-type of (Triggering unit)) Equal to (==) Naga Myrmidon
(Unit-type of (Triggering unit)) Equal to (==) Naga Siren
(Unit-type of (Triggering unit)) Equal to (==) Naga Summoner
Level of HealINwater for (Triggering Unit) is greater than 0
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Execution count of (This trigger)) Greater than or equal to (>=) 1
Then - Actions
Trigger - Turn on Heal In Water <gen>
Else - Actions
Special Effect - Create a special effect attached to the chest of (Picked unit) using war3mapImported\Large Bubbles.mdx
