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

How to make a passive skill that gives mana per hit?

Status
Not open for further replies.

_PV

_PV

Level 7
Joined
Aug 28, 2010
Messages
285
A GUI trigger will suffice. Gimme a sec and I'll see what I can do.
Firstly, Do you want the amount of mana regenerated increase as the damage increases or as the mana pool increases?
e.g. Steals 5 mana per hit and has 100 damage,
Steals 10 mana per hit and has 200 damage.
OR
Steals 10 mana per hit with a mana pool of 1000
Steals 20 mana per hit with a mana pool of 2000

Understand? :pP
 
Level 9
Joined
Jul 10, 2011
Messages
562
search for DDS (i recommend bribes) and then do whenever a unit damaged, check whether the unit has ability level 1 or higher then do add X mana (X can also be calculated by damage ; for example (dealt damage/10))
 

_PV

_PV

Level 7
Joined
Aug 28, 2010
Messages
285
Can you add % mana? That makes it much more practical, Like gaining a fixed amount of mana, like 5 per hit, would suck if you have a mana pool of 10000. Or it would be IMBA if you gain 50 per hit with a mana pool of 500
IMO
 
Level 9
Joined
Jul 10, 2011
Messages
562
its not hard to do..^^

if you wanna add percentage mana you just have to change the action after the trigger runs (the event the DDS uses)

just do :
set percentage mana of 'DamageSource' to (current percentage mana of 'DamageSource' + X)

or if you want it to be percentage mana of the target added to the attacker just change DamageSource to 'DamagedUnit' in the equation.

(i just used understandable variable names they will be different in the system)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Actually, this way the unit wold gain mana everytime it deals damage with anything: hit, ability, etc, which wouldn't actually work as a "Mana steal" thing or something.

You have to detect the damage source actually hit the target unit.

What I would do?

On event "A unit is attacked" save "True" on the attacked unit index or id. That works for detecting the unit began the attack animation of a unit. To add the mana only when the unit hits, you need this boolean to be "True". If the unit is given any order (target, no target, point), and boolean is "True" you set the boolean to False, just in case a player tries to spam the small time gap between the "Attack" and the Damage. When damage is received the boolean is also set to false.

It's a pain in the ass tough for ranged unit, which could receive an order while the missile is still on the air, or could have more than 1 missile in the air.

You could also do the ooposite: Set "True" when the unit is casting to prevent attack bonuses apply, and set to false when the unit is not casting anymore.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Event: Damage Event Happens
Condition: Level of PassiveManaRegain for DamageSource is > 0
Action: Set mana of DamageSource = (Mana of DamageSource + 10)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I have a DDS but I still can't figure out how to do it.
Did you, at least, read how the DDS works?

DAMAGE DETECTION SYSTEM creates a Real Variable used to detect when damage is dealt, and by whom, and to who. You have to use "Game - Value of Real Variable" event and follow the selected DDS Instructions to use it.

Yes, you set the mana with that action "Unit - Set mana (To value)". To make it scale with levels you can base it on the Level of the Ability like

"Set mana of DamageSource = (MAna of Damage Source + (Level of PassiveManaGain for (Triggering Unit) * 2.5)))"
 
Level 5
Joined
Jan 5, 2012
Messages
116
Mana Steal
Events
Game - GDD_Damage becomes Equal to 0.00
Conditions
(Level of Mana Steal for GDD_DamageSource) Greater than 0
Actions
Unit - Set mana of GDD_DamageSource to ((Mana of GDD_DamageSource) + ((Real((Level of Mana Steal for (Triggering unit)))) x 5.00))

I made this trigger but when I try it ingame it doesn't work. Maybe I'm doing something wrong since I'm new to triggers.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
If it has the buff, then it works.

Razwerd, i'm not sure, but I've heard around that if the gained mana is higher than the maximum mana, it does nothing. So you have to check if the current mana + restored mana is higher than maximum mana, set mana to max, else, set mana to current mana + restored mana.

Try to display a message (Game - Display message) to test if the event and conditions are working.
 
Level 5
Joined
Jan 5, 2012
Messages
116
The thing is the skill doesn't work even if the mana doesn't exceed the maximum mana. I based my skill on Devotion Aura and I even put a buff and used the buff condition but it doesn't work. Any other ideas?
P.S. Really thanks for the help you gave me and the time you spent so far.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Ooooh.. I've spot the problem.

Have you seen the event you're using? "GDD_Damage".

Check the instructions. You have to use "GDD_Event" in the Event :)
 
Status
Not open for further replies.
Top