• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Need help with a easy trigger

Status
Not open for further replies.
Level 2
Joined
Oct 13, 2007
Messages
20
Pretty simple, so I am making a caster map and i wanted a trigger that costs the caster 5 mana per normal attack, can anyone tell me the triggers for that?::cry:
 
y, try this:

Events
Unit - A unit Is attacked
Conditions
((Attacking unit) is in (Units of type Bloodmage)) is True
Actions
Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 5.00)

Just a little explication (any questions left?..read down or just ask me):


Use for the event: "Unit-Generic unit event" and look for "a unit is attacked"

Use for the condition: "Boolean Comparison" and look for "unit-unit in unit group". then change triggering unit in attacking units and the second part into "unit-unit of type" and choose your mage.

Use for the action: "unit-set mana (to value)". change "triggering unit" in "attacking unit" and change the number to the example i gave you above.

HF
 
You forgot another thing:

The trigger runs even when the bloodmage has less than 5 mana.

Condition:
(Attacking unit)'s mana is greater than or equal to 5
lets better make an if-then-else action.

if (Attacking unit)'s mana is greater than or equal to 5 then do nothing else unit-order (attacking unit) to stop


just add this action before the action i gave you.
 
Level 6
Joined
Jan 15, 2005
Messages
188
lets better make an if-then-else action.

if (Attacking unit)'s mana is greater than or equal to 5 then do nothing else unit-order (attacking unit) to stop


just add this action before the action i gave you.

Ah, I stand corrected.

But now a new problem. When he hits attack, even if the attack doesn't go off, he will still get drained by 5 mana and go down to 0 again, which might continue endlessly. So here's another action you need to add after that:

if (Attacking unit)'s mana is greater than or equal to 5 then Do nothing else Skip remaining actions


So in the end it would look like this (2 triggers to make it easy):

Variables Required:
spelldrainvarsbs8.png


Trigger 1 (Abilities):
spelldrainabilityxk0.png


Trigger 2 (Attack):
spelldrainattackul1.png
 
Level 2
Joined
Oct 13, 2007
Messages
20
you both helped me a lot for telling me this, i apreciate you both so i will give credit to you both in my map: Kamikazzee and paladon~
 
Level 2
Joined
Oct 13, 2007
Messages
20
a few more questions:
step by step, how do i make-Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 5.00)
and
(mana of CurrentUnit) less than or equal to 5 ?
 
Level 6
Joined
Jan 15, 2005
Messages
188
a few more questions:
step by step, how do i make-Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - 5.00)
and
(mana of CurrentUnit) less than or equal to 5 ?

Alright first off, I don't go by the name of Kamikazzee anymore, it's SinisteRing =).

Anyways, here's how you do it (In the most simple, smallest steps I could possibly do it):

Step 1, select Unit - Set Mana (Value):
smstep1zt5.png


Step 2, make the unit whose mana to be set is CurrentUnit:
smstep2dm3.png


Step 3, select Arithmetic for what the operation on the mana will be. This will allow you to select the units mana, then subtract from it, all in 1 fell swoop:
smstep3fc5.png


Step 4, select the first of the Arithmetic, and go to Unit - Property:
smstep4wt0.png


Step 5, set the first part of it to "Mana" and the picked unit to "CurrentUnit":
smstep5zf1.png


Step 6, set the operator of the Arithmetic to subtraction, and the amount to be subtracted to 5.00:
smstep6nt9.png


Finally, you are done. It should look like so:
smstep7et5.png


I hope that helped you out a little more.

Oh, and for the (Mana of CurrentUnit) less than or equal to 5:

The condition is not Integer, it's Real. If that is what confused you, just go to the "Real Condition" instead of "Integer Condition".
 
Status
Not open for further replies.
Top