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

*Spell Problem* What i'm doing wrong?

Status
Not open for further replies.
Level 5
Joined
Mar 17, 2005
Messages
135
This trigger i will provide is suppose to add life to the caster during the day and defense to the caster at night. The problem i'm having is that the ability will not go past level 1 stats. It will stay at 2 armor or 100 hit points even at level four. Now i have double checked to make sure the ability has the right stats and all that so it has nothing other to do than with my trigger so if anyone can help me figure out what is wrong with my trigger. I would greatly appreciate it.

Add Life def Sage
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Sage
Actions
Set Sage_Unit = (Casting unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Level of Sage for Sage_Unit) Equal to 1
(In-game time of day) Greater than or equal to 6.00
(In-game time of day) Less than or equal to 18.00
Then - Actions
Unit - Add +100 Life (Sage-level1) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +100 Life (Sage-level1) from Sage_Unit
Else - Actions
Unit - Add +2 Armor (Sage-level1) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +2 Armor (Sage-level1) from Sage_Unit
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Level of Sage for (Casting unit)) Equal to 2
(In-game time of day) Greater than or equal to 6.00
(In-game time of day) Less than or equal to 18.00
Then - Actions
Unit - Add +200 Life (Sage-level2) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +200 Life (Sage-level2) from Sage_Unit
Else - Actions
Unit - Add +4 Armor (Sage-level2) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +4 Armor (Sage-level2) from Sage_Unit
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Level of Sage for Sage_Unit) Equal to 3
(In-game time of day) Greater than or equal to 6.00
(In-game time of day) Less than or equal to 18.00
Then - Actions
Unit - Add +300 Life (Sage-level3) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +300 Life (Sage-level3) from Sage_Unit
Else - Actions
Unit - Add +6 Armor (Sage-level3) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +6 Armor (Sage-level3) from Sage_Unit
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Level of Sage for Sage_Unit) Equal to 4
(In-game time of day) Greater than or equal to 6.00
(In-game time of day) Less than or equal to 18.00
Then - Actions
Unit - Add +400 Life (Sage-level4) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +400 Life (Sage-level4) from Sage_Unit
Else - Actions
Unit - Add +8 Armor (Sage-level4) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +8 Armor (Sage-level4) from Sage_Unit

Edit: Sorry if this trigger looks a little sloppy, i can break it down for you if you need.
 
Level 3
Joined
Jul 29, 2006
Messages
61
I belive its because you put night as an else, I would suggest make one if then else for night and another for day for each level.

also is this passive? Because if it is you cannot use cast, as that would make it only fire once, when it is learned.
 
Level 11
Joined
Jul 12, 2005
Messages
764
you use awrong structure of the if-then-else:

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true Conditions
(Level of Sage for Sage_Unit) Equal to 1
(In-game time of day) Greater than or equal to 6.00
(In-game time of day) Less than or equal to 18.00
Then - Actions
Unit - Add +100 Life (Sage-level1) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +100 Life (Sage-level1) from Sage_Unit
Else - Actions
Unit - Add +2 Armor (Sage-level1) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +2 Armor (Sage-level1) from Sage_Unit

there are problems with the conditions.
it checks if the ability is level 1, and it's day.
BUT the else will activate on any other levels!!!

try this:
if level == 1
if it's day
add +100 life
else
add +2 armor
else (this is not necessary)
do nothing

so use an if to check the level, then INSIDE that if, use an other if to check if it's day.
this should work.
 
Level 5
Joined
Mar 17, 2005
Messages
135
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Sage for Sage_Unit) Equal to 1
And - All (Conditions) are true
Conditions
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(In-game time of day) Less than or equal to 18.00
(In-game time of day) Greater than or equal to 6.00
Then - Actions
Unit - Add +100 Life (Sage-level1) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +100 Life (Sage-level1) from Sage_Unit
Else - Actions
Unit - Add +2 Armor (Sage-level1) to Sage_Unit
Wait 60.00 seconds
Unit - Remove +2 Armor (Sage-level1) from Sage_Unit
Else - Actions
Do nothing

Is what your say? Thanks i'll try this when i get home.
 
Level 5
Joined
Mar 17, 2005
Messages
135
Sweet, it works flawlessly now. Thank you guys very much for the help. Also, to gralamin, i believe this is what you was trying to tell me as well. I'm sorry that i didn't understand you as well, but thank you very much.
 
Status
Not open for further replies.
Top