HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

get it working!

03-07-2006, 03:49 AM#1
Tiki
Ok I have a 3 level engineering upgrade (husbandry) ability, which improves "mangle".

Mangle is a cripple spell, then there is a mangle dummy which is taunt, which casts it.

I need the trigger to cast the right level mangle with the right level husbandry.
If husbandry is not learned, levle 0?, then it casts level 1 mangle, and so on.

Trigger:
Mangle
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Mangle
Collapse Actions
Set Ancient[1] = (Casting unit)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Husbandry for Ancient[1]) Equal to 0
Collapse Then - Actions
Unit - Create 1 Caster [Caster System] for (Owner of Ancient[1]) at (Position of Ancient[1]) facing Default building facing degrees
Unit - Add Mangle [1] to (Last created unit)
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Undead Necromancer - Cripple Ancient[1]
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Husbandry for Ancient[1]) Equal to 1
Collapse Then - Actions
Unit - Create 1 Caster [Caster System] for (Owner of Ancient[1]) at (Position of Ancient[1]) facing Default building facing degrees
Unit - Add Mangle [2] to (Last created unit)
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Undead Necromancer - Cripple Ancient[1]
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Husbandry for Ancient[1]) Equal to 2
Collapse Then - Actions
Unit - Create 1 Caster [Caster System] for (Owner of Ancient[1]) at (Position of Ancient[1]) facing Default building facing degrees
Unit - Add Mangle [3] to (Last created unit)
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Undead Necromancer - Cripple Ancient[1]
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Husbandry for Ancient[1]) Equal to 3
Collapse Then - Actions
Unit - Create 1 Caster [Caster System] for (Owner of Ancient[1]) at (Position of Ancient[1]) facing Default building facing degrees
Unit - Add Mangle [4] to (Last created unit)
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Undead Necromancer - Cripple Ancient[1]
Collapse Else - Actions
Do nothing
03-07-2006, 06:32 AM#2
Hyarion
Try removing the "Do Nothing"s, and moving the IFs up to be the ELSE of the one above.
03-07-2006, 06:43 AM#3
Anitarf
So, what's the problem with the trigger?

And you could seriously optimize this, either by adding the Mangle abilities to an ability array variable at map startup, and then using the (level of husbandry + 1) as the array index instead of all those if-then-elses, or just make mangle a multi-leveled ability and set it's level to (level of husbandry + 1) before casting it; either way, you wouldn't need to repeat all that code 4 times.
03-07-2006, 02:11 PM#4
Tiki
Well since it gets upgraded by engineering upgrade, you need x of the spells, not one spell with levels.

Also the spell wont cast period, thats whats not working.
03-07-2006, 04:04 PM#5
Anitarf
If the hero already casts mangle himself, why would you need a dummy caster to cast it as well?
03-07-2006, 04:53 PM#6
Tiki
Because mangle is a cripple based, and youd have to select your hero to use it...

But i have taunt as a dummy spell so you dont have to select your hero to use it, and plus i wanted the enemies to attack you. so you taunt and then gain the bonus.
03-07-2006, 04:54 PM#7
Whitehorn
Tiki, use JASS so you don't make these GUI mistakes :)
03-07-2006, 05:29 PM#8
Anitarf
That's the explanation I was looking for... but it's no reason for the dummy caster's ability to not be a single multi-leveled ability.

However, the trigger will only work if the hero casts the default Mangle, since the trigger's condition doesn't account for upgraded versions of the ability.
03-07-2006, 11:05 PM#9
Tiki
Alright, ill mess with it.