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.
Untitled Trigger 001

Events


Unit - A unit Starts the effect of an ability

Conditions

Actions


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



If - Conditions




(Ability being cast) Equal to Eat Tree



Then - Actions




Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + '"Your amount of added life")



Else - Actions




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





If - Conditions






(Ability being cast) Equal to Eat Mushroom





Then - Actions






Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + "Your amount of added mana")





Else - Actions
Eat Mushroom

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Eat Mushroom

Actions


Unit - Kill (Target unit of ability being cast)


Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 100.00)
Untitled Trigger 001

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Eat Mushroom

Actions


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



If - Conditions




(Target destructible of ability being cast) Equal to Mushroom



Then - Actions




Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 50.00)



Else - Actions
I already answered this:Unit - Kill (Target unit of ability being cast)
But he wants to eat a mushroom and i'm sure mushroom isn't a unit=) Destructible probably.
ap0calypse said:For the mana, you can create a new unit based off a ward (like the Sentry Ward) and turn it into a mushroom.
Indeed!ap0calypse said:Units are far easier to work with.
Untitled Trigger 001

Events


Unit - Paladin 0000 <gen> Starts the effect of an ability

Conditions

Actions


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



If - Conditions




(Ability being cast) Equal to Eat a tree



Then - Actions




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





If - Conditions






(Destructible-type of (Target destructible of ability being cast)) Equal to Outland Tree Wall





Then - Actions






Set Countdown1 = 15





Else - Actions



Else - Actions


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



If - Conditions




(Ability being cast) Equal to Eat a tree



Then - Actions




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





If - Conditions






(Destructible-type of (Target destructible of ability being cast)) Equal to Dungeon Tree Wall





Then - Actions






Set Countdown1 = 15





Else - Actions



Else - Actions


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



If - Conditions




(Ability being cast) Equal to Eat a tree



Then - Actions




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





If - Conditions






(Destructible-type of (Target destructible of ability being cast)) Equal to Ashenvale Tree Wall





Then - Actions






Set Countdown2 = 15





Else - Actions



Else - Actions


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



If - Conditions




(Ability being cast) Equal to Eat a tree



Then - Actions




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





If - Conditions






(Destructible-type of (Target destructible of ability being cast)) Equal to Underground Tree Wall





Then - Actions






Set Countdown1 = 15





Else - Actions



Else - Actions
Untitled Trigger 002 Copy

Events


Time - Every 2.00 seconds of game time

Conditions

Actions


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



If - Conditions




Countdown2 Greater than or equal to 1



Then - Actions




Set Countdown1 = (Countdown1 - 1)




Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 15.00)



Else - Actions


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



If - Conditions




Countdown1 Greater than or equal to 1



Then - Actions




Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 15.00)




Set Countdown1 = (Countdown1 - 1)



Else - Actions
Woah, yeah... that's not MUI
Aaand it could all be combined into something more efficient (by using "or").
I didn't know you were planning to make it regenerate over time, in that case you'll need a different approach:
Instead of triggering everything, why don't you create a spell based on item scrolls and use that on the unit eating the tree/mushroom?
Item scrolls regenerate mana/health over time, so that would mean there's no need for the second trigger at all: just order the unit to cast that spell (give spell to unit, order unit to cast spell, remove spell from unit).
Hero - Order Unit to use (Last created item)
Yeah order a unit to cast a spellsquelch said:and is there a way to code it without using items?
Untitled Trigger 001

Events


Unit - Paladin 0000 <gen> Starts the effect of an ability

Conditions

Actions


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



If - Conditions




(Ability being cast) Equal to Eat a tree



Then - Actions




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





If - Conditions






((Destructible-type of (Last created destructible)) Equal to Dungeon Tree Wall) and (((Destructible-type of (Last created destructible)) Equal to Outland Tree Wall) and ((Destructible-type of (Last created destructible)) Equal to Underground Tree Wall))






(Destructible-type of (Target destructible of ability being cast)) Equal to Outland Tree Wall





Then - Actions






Unit - Add Replenish Mana to (Triggering unit)






Unit Group - Order (Units in (Playable map area)) to Night Elf Druid Of The Claw - Rejuvenation Paladin 0000 <gen>






Unit - Remove Replenish Mana from (Triggering unit)





Else - Actions



Else - Actions


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



If - Conditions




(Ability being cast) Equal to Eat a tree



Then - Actions




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





If - Conditions






(Destructible-type of (Target destructible of ability being cast)) Equal to Ashenvale Tree Wall





Then - Actions






Unit - Add Replenish Life to (Triggering unit)






Unit Group - Order (Units in (Playable map area)) to Night Elf Druid Of The Claw - Rejuvenation Paladin 0000 <gen>






Unit - Remove Replenish Life from (Triggering unit)





Else - Actions



Else - Actions
Explain a bit more please...squelch said:now whenever I eat mushrooms it wont eat the ashenvale trees?
You leak a group. Add custom script: set bj_wantDestroyGroup = true before the Unit Group - Order ...
And do you need to order every unit in map to replenish? or just one? If one, the order to cast a spell is under section "Unit"
Explain a bit more please...
Untitled Trigger 001 Copy 2

Events


Unit - Paladin 0000 <gen> Starts the effect of an ability

Conditions

Actions


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



If - Conditions




(Ability being cast) Equal to Eat a tree



Then - Actions




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





If - Conditions






((Destructible-type of (Last created destructible)) Equal to Ashenvale Tree Wall) or (((Destructible-type of (Last created destructible)) Equal to Outland Tree Wall) or (((Destructible-type of (Last created destructible)) Equal to Dungeon Tree Wall) or ((Destructible-type of (Last created destructible)) Equal to Ashenvale Tree Wall)))





Then - Actions






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







If - Conditions








(Destructible-type of (Target destructible of ability being cast)) Equal to Dungeon Tree Wall







Then - Actions








Set Point = (Target point of ability being cast)








Unit - Create 1 Druid of the Claw (Mana) for Player 1 (Red) at Point facing (Position of Paladin 0000 <gen>)








Unit - Add Replen Mana Mush to (Last created unit)








Unit - Set level of Replen Mana Mush for (Last created unit) to 1








Custom script: set bj_wantDestroyGroup = true








-------- e001 = dummy unit --------








-------- a007 = replenish mana --------








Custom script: call GroupTargetOrderBJ( GetUnitsOfTypeIdAll('e001'), "A007", gg_unit_Hpal_0000 )








Custom script: call RemoveLocation (udg_Point)







Else - Actions








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









If - Conditions










(Destructible-type of (Target destructible of ability being cast)) Equal to Underground Tree Wall









Then - Actions










Set Point = (Target point of ability being cast)










Unit - Create 1 Druid of the Claw (Mana) for Player 1 (Red) at Point facing (Position of Paladin 0000 <gen>)










Unit - Add Replen Mana Mush to (Last created unit)










Unit - Set level of Replen Mana Mush for (Last created unit) to 1










Custom script: set bj_wantDestroyGroup = true










Custom script: call GroupTargetOrderBJ( GetUnitsOfTypeIdAll('e001'), "A007", gg_unit_Hpal_0000 )










Custom script: call RemoveLocation (udg_Point)









Else - Actions










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











If - Conditions












(Destructible-type of (Target destructible of ability being cast)) Equal to Ashenvale Tree Wall











Then - Actions












Set Point = (Target point of ability being cast)












Unit - Create 1 Druid of the Claw (Life) for Player 1 (Red) at Point facing (Position of Paladin 0000 <gen>)












Unit - Add Replenish Life to (Last created unit)












Unit - Set level of Replenish Life for (Last created unit) to 1












Custom script: set bj_wantDestroyGroup = true












Custom script: call GroupTargetOrderBJ( GetUnitsOfTypeIdAll('e000'), "A006", gg_unit_Hpal_0000 )












Custom script: call RemoveLocation (udg_Point)











Else - Actions












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













If - Conditions














(Destructible-type of (Target destructible of ability being cast)) Equal to Outland Tree Wall













Then - Actions














Set Point = (Target point of ability being cast)














Unit - Create 1 Druid of the Claw (Mana) for Player 1 (Red) at Point facing (Position of Paladin 0000 <gen>)














Unit - Add Replen Mana Mush to (Last created unit)














Unit - Set level of Replen Mana Mush for (Last created unit) to 1














Custom script: set bj_wantDestroyGroup = true














Custom script: call GroupTargetOrderBJ( GetUnitsOfTypeIdAll('e001'), "A007", gg_unit_Hpal_0000 )














Custom script: call RemoveLocation (udg_Point)













Else - Actions





Else - Actions



Else - Actions
-------- e001 = dummy unit --------
-------- a007 = replenish mana --------
said:
-------- e001 = dummy unit --------
-------- a007 = replenish mana --------
I fixed what you said it works when I use the first code you gave me for healing mana and health but it doesn't work when I try to get the ability to castYou use the second conditions in If/Then/Else wrong, you use Last Created Destructible but you don't create any! maybe you had in mind Target destructible of ability being cast? but in the 5th If/Then/Else you typed some other raw values into script, maybe that's the problem?
That's not his point.Those are comments they don't do anything accept tell you whats going in the script.
I wasn't trying to say thatap0calypse said:But since spells usually start with a capital A, that is most likely not the problem.
-------- e001 = dummy unit --------

-------- a007 = replenish mana --------
Version of Trigger that doesnt work

Events


Unit - Paladin 0000 <gen> Starts the effect of an ability

Conditions

Actions


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



If - Conditions




(Ability being cast) Equal to Eat a tree



Then - Actions




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





If - Conditions






(Casting unit) Equal to Paladin 0000 <gen>





Then - Actions






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







If - Conditions








((Destructible-type of (Target destructible of ability being cast)) Equal to Ashenvale Tree Wall) or (((Destructible-type of (Target destructible of ability being cast)) Equal to Outland Tree Wall) or (((Destructible-type of (Target destructible of ability being cast)) Equal to Dungeon Tree Wall) or ((Destructible-type of (Target destructible of ability bein







Then - Actions








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









If - Conditions










(Destructible-type of (Target destructible of ability being cast)) Equal to Dungeon Tree Wall









Then - Actions










Set Point = (Target point of ability being cast)










Unit - Create 1 Druid of the Claw (Mana) for Player 1 (Red) at Point facing (Position of Paladin 0000 <gen>)










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











If - Conditions












((Triggering unit) is A structure) Equal to False











Then - Actions












Unit - Add Replen Mana Mush to (Last created unit)












Unit - Set level of Replen Mana Mush for (Last created unit) to 1












Custom script: set bj_wantDestroyGroup = true












-------- e001 = dummy unit --------












-------- A007 = replenish mana --------












Custom script: call IssueTargetOrderBJ( GetLastCreatedUnit(), "A007", gg_unit_Hpal_0000 )












Custom script: call RemoveLocation (udg_Point)











Else - Actions









Else - Actions










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











If - Conditions












(Destructible-type of (Target destructible of ability being cast)) Equal to Underground Tree Wall











Then - Actions












Set Point = (Target point of ability being cast)












Unit - Create 1 Druid of the Claw (Mana) for Player 1 (Red) at Point facing (Position of Paladin 0000 <gen>)












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













If - Conditions














((Triggering unit) is A structure) Equal to False













Then - Actions














Unit - Add Replen Mana Mush to (Last created unit)














Unit - Set level of Replen Mana Mush for (Last created unit) to 1














Custom script: set bj_wantDestroyGroup = true














-------- e001 = dummy unit --------














-------- A007 = replenish mana --------














Custom script: call IssueTargetOrderBJ( GetLastCreatedUnit(), "A007", gg_unit_Hpal_0000 )














Custom script: call RemoveLocation (udg_Point)













Else - Actions











Else - Actions












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













If - Conditions














(Destructible-type of (Target destructible of ability being cast)) Equal to Ashenvale Tree Wall













Then - Actions














Set Point = (Target point of ability being cast)














Unit - Create 1 Druid of the Claw (Life) for Player 1 (Red) at Point facing (Position of Paladin 0000 <gen>)














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















If - Conditions
















((Triggering unit) is A structure) Equal to False















Then - Actions
















Unit - Add Replen Life mush to (Last created unit)
















Unit - Set level of Replen Life mush for (Last created unit) to 1
















Custom script: set bj_wantDestroyGroup = true
















-------- e001 = dummy unit --------
















-------- A007 = replenish mana --------
















Custom script: call IssueTargetOrderBJ( GetLastCreatedUnit(), "A006", gg_unit_Hpal_0000 )
















Custom script: call RemoveLocation (udg_Point)















Else - Actions













Else - Actions














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















If - Conditions
















(Destructible-type of (Target destructible of ability being cast)) Equal to Outland Tree Wall















Then - Actions
















Set Point = (Target point of ability being cast)
















Unit - Create 1 Druid of the Claw (Mana) for Player 1 (Red) at Point facing (Position of Paladin 0000 <gen>)
















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

















If - Conditions


















((Triggering unit) is A structure) Equal to False

















Then - Actions


















Unit - Add Replen Mana Mush to (Last created unit)


















Unit - Set level of Replen Mana Mush for (Last created unit) to 1


















Custom script: set bj_wantDestroyGroup = true


















-------- e001 = dummy unit --------


















-------- A007 = replenish mana --------


















Custom script: call IssueTargetOrderBJ( GetLastCreatedUnit(), "rejuvination", gg_unit_Hpal_0000 )


















Custom script: call RemoveLocation (udg_Point)

















Else - Actions















Else - Actions







Else - Actions





Else - Actions



Else - Actions
Version of Trigger that works

Events


Unit - Paladin 0000 <gen> Starts the effect of an ability

Conditions

Actions


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



If - Conditions




(Ability being cast) Equal to Eat a tree



Then - Actions




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





If - Conditions






(Casting unit) Equal to Paladin 0000 <gen>





Then - Actions






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







If - Conditions








((Destructible-type of (Target destructible of ability being cast)) Equal to Ashenvale Tree Wall) or (((Destructible-type of (Target destructible of ability being cast)) Equal to Outland Tree Wall) or (((Destructible-type of (Target destructible of ability being cast)) Equal to Dungeon Tree Wall) or ((Destructible-type of (Target destructible of ability bein







Then - Actions








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









If - Conditions










(Destructible-type of (Target destructible of ability being cast)) Equal to Dungeon Tree Wall









Then - Actions










Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 225.00)









Else - Actions










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











If - Conditions












(Destructible-type of (Target destructible of ability being cast)) Equal to Underground Tree Wall











Then - Actions












Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 300.00)











Else - Actions












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













If - Conditions














(Destructible-type of (Target destructible of ability being cast)) Equal to Ashenvale Tree Wall













Then - Actions














Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 300.00)













Else - Actions














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















If - Conditions
















(Destructible-type of (Target destructible of ability being cast)) Equal to Outland Tree Wall















Then - Actions
















Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 300.00)















Else - Actions







Else - Actions





Else - Actions



Else - Actions
Then - Actions
Unit - Add Replen Life mush to (Last created unit)
Unit - Set level of Replen Life mush for (Last created unit) to 1
Custom script: set bj_wantDestroyGroup = true
-------- e001 = dummy unit --------
-------- A007 = replenish mana --------
Custom script: call IssueTargetOrderBJ( GetLastCreatedUnit(), "A006", gg_unit_Hpal_0000 )
Custom script: call RemoveLocation (udg_Point)
Else - Actions
