• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Stats while unit is alive

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
Hello folks, i have an idea of a spell, but i dont know how to execute it, the spell should be based of "Feral Spirit", and the idea is: If [This] unt is alive, then set the attributes of the casting hero to X.
Been trying around for a while now but cant seem to make it work.

Any idea on how to make this?
 
Event
Unit starts the effect of the ability

Condition
[Ability] Ability being cast is equal to Feral Wolf ability
• You don't really need [Boolean] YourHero is alive Equal to True here since dead units cannot cast abilities.

Action
(Hero - Set Attributes)
Hero - Set Strength of YourHero to 5
Hero - Set Agility of YourHero to 5
Hero - Set Intelligence of YourHero to 5
 
Last edited:
Level 7
Joined
Feb 23, 2020
Messages
253
Event
Unit starts the effect of the ability

Condition
[Ability] Ability being cast is equal to Feral Wolf ability
• You don't really need [Boolean] YourHero is alive Equal to True here since dead units cannot cast abilities.

Action
(Hero - Set Attributes)
Hero - Set Strength of YourHero to 5
Hero - Set Agility of YourHero to 5
Hero - Set Intelligence of YourHero to 5

Yeah i got this one going for me, but idk how to get the stats removed if my summoned unit is dead/doesnt exist.
 
Level 6
Joined
Dec 31, 2017
Messages
138
It's not what you asked for, but I would recomend giving your unit bonus stats instead of equating them to some value.
It can be done in a more natural way.

1. Create a custom ability that improves stats. It can have several levels if your spell does have several levels.

2. When "Feral Spirit" is used, add this custom ability to (Triggering unit). And set appropriate level.

3. When the summoned unit dies, remove the ability.
The only thing that can go wrong is: when the hero uses the ability the previously summoned unit dies.
And this death is registred after "unit start effect of an ability" is registred.
So, you need to make sure the summoned unit died not due to self-kill.
In order to acheve that one can compare (Killing unit) and (No unit)/null.
 
Last edited:
Level 29
Joined
Feb 18, 2014
Messages
3,584
You can give the hero tomes of power that gives Positive/Negative attributes.
Now as for the summoning thing : You could add them to a unit group when they spawn and then make a trigger that checks when they die to subtract the stats. Something like this :

A unit dies

Dying unit is in Unit Group Equal to True

Decrease hero stats
 
Level 7
Joined
Feb 23, 2020
Messages
253
It's not what you asked for, but I would recomend giving your unit bonus stats instead of equatштп them to some value.
It can be done in a more natural way.

1. Create a custom ability that improves stats. It can have several levels if your spell does have several levels.

2. When "Feral Spirit" is used, add this custom ability to (Triggering unit). And set appropriate level.

3. When the summoned unit dies, remove the ability.
The only thing that can go wrong is: when the hero uses the ability the previously summoned unit dies.
And this death is registred after "unit start effect of an ability" is registred.
So, you need to make sure the summoned unit died not due to self-kill.
In order to acheve that one can compare (Killing unit) and (No unit)/null.

Well it was what i asked for. I manage to make my triggers work till i want the stats to be removed if the summoned unit is dead. I guess i have to use if, then, else, but with what condition?
"If ((Summoned unit) is dead) Equal to True" does not seem to work. :/
 
Status
Not open for further replies.
Top