|
|
|
|
| World Editor Help Zone Ask general questions about World Editor features and use in this forum. If you need help fixing a trigger, please post it in Triggers & Scripts. Please review the forum rules before posting. |
 |
|
08-09-2012, 01:55 PM
|
#1 (permalink)
|
|
User
Join Date: Jan 2012
Posts: 74
|
How to make a passive skill that gives mana per hit?
Hello! As the title says, I want to make a passive skill that gives the Hero mana with every hit (prefferably a fixed amount, but you could tell me based on damage if you have time).
Can anyone help?
|
|
|
08-09-2012, 02:09 PM
|
#2 (permalink)
|
|
*Le hive random ^_^*
Join Date: Aug 2010
Posts: 187
|
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
__________________
 Cool story bro
|
|
|
08-09-2012, 02:16 PM
|
#3 (permalink)
|
|
User
Join Date: Jul 2011
Posts: 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))
|
|
|
08-09-2012, 02:25 PM
|
#4 (permalink)
|
|
*Le hive random ^_^*
Join Date: Aug 2010
Posts: 187
|
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
__________________
 Cool story bro
|
|
|
08-09-2012, 02:33 PM
|
#5 (permalink)
|
|
User
Join Date: Jan 2012
Posts: 74
|
It would be nice if I added % mana based on maximum mana, like 1/2/3 % of maximun mana with every hit. If it's too difficult to do (because I'm new to triggers) just tell me the fixed amount one. :D
|
|
|
08-09-2012, 02:49 PM
|
#6 (permalink)
|
|
User
Join Date: Jul 2011
Posts: 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)
|
|
|
08-09-2012, 03:54 PM
|
#7 (permalink)
|
|
User
Join Date: Jul 2011
Posts: 2,522
|
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.
|
|
|
08-09-2012, 07:34 PM
|
#8 (permalink)
|
|
User
Join Date: Jan 2012
Posts: 74
|
The skill is for a ranged unit. I have a DDS but I still can't figure out how to do it.
|
|
|
08-09-2012, 07:55 PM
|
#9 (permalink)
|
|
User
Join Date: Jul 2011
Posts: 2,522
|
Event: Damage Event Happens
Condition: Level of PassiveManaRegain for DamageSource is > 0
Action: Set mana of DamageSource = (Mana of DamageSource + 10)
|
|
|
08-09-2012, 08:52 PM
|
#10 (permalink)
|
|
Ghost
Join Date: Apr 2012
Posts: 620
|
And how may you make a damage event
__________________
|
|
|
“When the snows fall and the white winds blow, the lone wolf dies but the pack survives.”
None
|
|
|
|
08-09-2012, 08:55 PM
|
#11 (permalink)
|
|
User
Join Date: Jan 2012
Posts: 74
|
Action: Set mana of DamageSource = (Mana of DamageSource + 10)
How to do this? Through the Unit - Set Mana (To Value) ?
And I also want to make it have levels, please explain how to increase mana after leveling the ability.
|
|
|
08-09-2012, 09:47 PM
|
#12 (permalink)
|
|
User
Join Date: Jul 2011
Posts: 2,522
|
Quote:
|
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)))"
|
|
|
08-09-2012, 10:54 PM
|
#13 (permalink)
|
|
User
Join Date: Jan 2012
Posts: 74
|
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.
|
|
|
08-09-2012, 11:23 PM
|
#14 (permalink)
|
|
Intermediate Modeler
Join Date: May 2012
Posts: 374
|
can the condition be : ((Triggering Unit) has buff "Buff") Equal to True ?
__________________
| My Workshop |
Kael |
What am I working on right now? |
|
|
|
|
|
|
08-10-2012, 01:39 AM
|
#15 (permalink)
|
|
User
Join Date: Jul 2011
Posts: 2,522
|
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.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|
All times are GMT. The time now is 05:49 PM.
|