HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Attack = Mana Loss

05-25-2006, 10:47 PM#1
Kevin
How do I make it so each time a unit attacks, they lose a specific amount of mana?

I've tried making adjusting flaming arrows to do this, but it doesn't work right.

I've tried a trigger, but I can't seem to get it to work right.

Quote:
Untitled Trigger 003
Events
Unit - A unit Is issued an order targeting an object
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to CLERIC
(Triggering unit) Equal to (Damage source)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Mana of (Triggering unit)) Less than or equal to 1.00
Then - Actions
Unit - Pause (Triggering unit)
Else - Actions
Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 2.00)

Can someone please help me make this work right.

Is there an ability I can modify? What?
05-25-2006, 10:51 PM#2
sheep.spirit
You may have forgotten to unpause the unit.

Another thing is that because the mana reduced is so low, the regen covers it up, so u cant see anything.

If i am not wrong, when u cast a damaging spell, you may run into the mana depletion trigger again.
05-25-2006, 10:53 PM#3
GaDDeN
Quote:
Originally Posted by Kevin
Untitled Trigger 003
Events
Unit - A unit Is issued an order targeting an object
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to CLERIC
(Triggering unit) Equal to (Damage source)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Mana of (Triggering unit)) Less than or equal to 1.00
Then - Actions
Unit - Pause (Triggering unit)
Else - Actions
Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 2.00)

That event triggers when a unit is issued an order. I assume you want the trigger to drain mana every time the unit attacks:

Quote:
Untitled Trigger 003
Events
Unit - A unit Is attacked
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Attacking unit)) Equal to CLERIC
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Mana of (Attacking unit)) Less than or equal to 1.00
Then - Actions
Unit - Pause (Attacking unit)
Else - Actions
Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 2.00)

This will drain 2 mana every time a unit attacks untill its mana reaches 0. When that happens, the unit will be paused.
05-25-2006, 11:00 PM#4
Kevin
OH THANK YOU!
05-25-2006, 11:39 PM#5
Tim.
Also, please use [trigger] tags rather than [quote] tags.
05-26-2006, 12:14 AM#6
Kevin
Just for future reference, this is my trigger. It works perfectly. Maybe it should go into the trigger database:

Trigger for Subtracting Mana each time a Unit Attacks:

Trigger:
attackmana
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
(Unit-type of (Attacking unit)) Equal to CLERIC
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Mana of (Attacking unit)) Less than or equal to 2.00
Collapse Then - Actions
Unit - Order (Attacking unit) to Stop
Collapse Else - Actions
Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 2.50)

there, :P in ur precious trigger tag :P

:D

Edit: just to clarify I was just teasin ;D