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!
Hello my dear friends!
Explain to a noob how to calculate a damage that hero deals?..
I mean if I want to make lifesteal without any buffs and auras...
give hero life equal to 0.25*(damage) - how to find this damage in triggers???
I'm a noob and I'd say that ain't for noobs. I had trouble figuring that out myself.
Here is more simpler Trigger for converting DAMAGE INFLICTED into HP. I just recently encountered this problem and just made some changes to use it for Lifesteal.
(1) Set the unit into variable
Set Lifestealer
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
Set LifeStealer = Paladin 0000 <gen>
(2) When a unit is attacked by lifestealer
When A Unit is Attacked by LifeStealer
Events
Unit - A unit Is attacked
Conditions
(Attacking unit) Equal to LifeStealer
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_int Equal to 0
Then - Actions
Trigger - Add to Give Lifestealer HP using Damage <gen> the event (Unit - (Attacked unit) Takes damage)
Else - Actions
Set Temp_int = 0
(3)Gain HP with Damage Inflicted
Give Lifestealer HP using Damage
Events
Conditions
(Damage source) Equal to LifeStealer
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_int Equal to 0
Then - Actions
Set Victim_Unit = (Attacked unit)
Set Damage_Inflicted = (Integer((Damage taken)))
-------- ---------(1)Convert Damage into HP---------- --------
Unit - Set life of LifeStealer to ((Life of LifeStealer) + (Real(Damage_Inflicted)))
-------- ----------(2)You can add Special Effect here as Life Steal---------- --------
-------- ----------(3)Displays the damage you Inflict---------- --------
Game - Display to (All players) the text: (String(Damage_Inflicted))
Set Temp_int = 1
Else - Actions
Temp_int is used to avoid increasing leakage.
I also had provided a test map for you. Hope it works well.
I found it very hilarious that there is anyone who is having a problem using damage engine, since it's just copying abilities, copying triggers, fixing disabled actions. then you can use it to however you want, gorillabull was right, it's really simple and is intended for those who is unexperienced with world editor, that's why there is some small tutorials in the damage engine thread.
and yet it's clearly stated with a title of "HOW TO INSTALL"
How to install
Copy & paste the Unit Indexer trigger into your map (I recommend replacing it if you have an older version of it as it has new features)
Copy & paste the Damage Engine trigger into your map
Copy the Cheat Death Ability from Object Editor, and set it to the variable DamageBlockingAbility.
It's installed
You're probably right it'll be easy as soon as someone understands how it works or how to use it. But I myself prefer to use triggers that I know exactly how they work.
Yes, these are 3 triggers, but it's definitely more convenient for someone who looks for simpler trigger.
I can tell you how Bribe's triggers* work, it's pretty easy to understand I believe:
You pick all units in the entire map (ones that are already there and the ones that have yet to spawn) and create a trigger for them. The trigger that gets created detects when that unit receives any damage.
If he does indeed receive damage, a variable is set from 0 to 1 (this is important, because it can be used as an event).
If the unit dies, the trigger is destroyed (so there are no useless triggers left).
The event (from 0 to 1) is therefore used to detect any instance of a damaged unit.
This makes it very easy for any mapper, because that event allows for a very short, but working trigger to detect the damage (and modify it to your needs).
*actually, Weep's damage detection works like this, but Bribe's is based on that one.
I believe one of the differences is that Weep uses regular Indexing, while Bribe uses a unit indexer for that? (Not sure, haven't checked Bribe's system out yet).
Maltheo: your trigger works, but do try to use "Triggering Unit" instead of "Attacked unit" or "Damaged unit" (and so on).
(Also: if the unit dies, you're left with a leaking event).
I'm a noob and I'd say that ain't for noobs. I had trouble figuring that out myself.
Here is more simpler Trigger for converting DAMAGE INFLICTED into HP. I just recently encountered this problem and just made some changes to use it for Lifesteal.
(1) Set the unit into variable
Set Lifestealer
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
Set LifeStealer = Paladin 0000 <gen>
(2) When a unit is attacked by lifestealer
When A Unit is Attacked by LifeStealer
Events
Unit - A unit Is attacked
Conditions
(Attacking unit) Equal to LifeStealer
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_int Equal to 0
Then - Actions
Trigger - Add to Give Lifestealer HP using Damage <gen> the event (Unit - (Attacked unit) Takes damage)
Else - Actions
Set Temp_int = 0
(3)Gain HP with Damage Inflicted
Give Lifestealer HP using Damage
Events
Conditions
(Damage source) Equal to LifeStealer
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_int Equal to 0
Then - Actions
Set Victim_Unit = (Attacked unit)
Set Damage_Inflicted = (Integer((Damage taken)))
-------- ---------(1)Convert Damage into HP---------- --------
Unit - Set life of LifeStealer to ((Life of LifeStealer) + (Real(Damage_Inflicted)))
-------- ----------(2)You can add Special Effect here as Life Steal---------- --------
-------- ----------(3)Displays the damage you Inflict---------- --------
Game - Display to (All players) the text: (String(Damage_Inflicted))
Set Temp_int = 1
Else - Actions
Temp_int is used to avoid increasing leakage.
I also had provided a test map for you. Hope it works well.
From your trigger I'm starting to understand that "Damage Source" is the damage that attacker deals??? If I multiply "damage source" by 2 - I'll get double damage???
Oh I got it! It's damage taken! Man, that changes a lot!)
Maltheo: your trigger works, but do try to use "Triggering Unit" instead of "Attacked unit" or "Damaged unit" (and so on).
(Also: if the unit dies, you're left with a leaking event).
I used Attacked Unit instead of Triggering Unit because this involves two units, it's the damage source, and the damage taker. Setting Victim_Unit to Triggering Unit might set the Attacking Unit into variable, instead of the attacked unit. Though the variable of attacked unit wasn't used here, it can be used if the editor chooses to add additional actions.
From your trigger I'm starting to understand that "Damage Source" is the damage that attacker deals??? If I multiply "damage source" by 2 - I'll get double damage???
Oh I got it! It's damage taken! Man, that changes a lot!)
If you want to multiply it by 2, you just have to change the value of Damage_Inflicted (Integer((Damage taken) x 2))
From the 2nd trigger, the event Unit is Attacked activates when the unit only starts the animation of attack, therefore the trigger will then activate even it hasn't hit the target yet. But adding the Damage Source as condition from 3rd trigger, it verifies that the unit has already attacked and hit the unit.
If you want to multiply it by 2, you just have to change the value of Damage_Inflicted (Integer((Damage taken) x 2))
From the 2nd trigger, the event Unit is Attacked activates when the unit only starts the animation of attack, therefore the trigger will then activate even it hasn't hit the target yet. But adding the Damage Source as condition from 3rd trigger, it verifies that the unit has already attacked and hit the unit.
You really helped me! I was looking for such an easy task solution for a long time!) +rep
---------------------------
Guys I just don't need such a complex system... maybe one day I'll come back for it, but not today
You really helped me! I was looking for such an easy task solution for a long time!) +rep
---------------------------
Guys I just don't need such a complex system... maybe one day I'll come back for it, but not today
the triggers are very inefficient(is that right word? )
because every time unit is about to attack, new event is added to the trigger and ot will eventually crash bcause trigger can only have a finite number of events before crashing the trigger or even the game
Bribes DDS recreates the trigger every 15 new umits registered to the trigger
Also dead units are not cleared from the event and the only way how to remove an event from the trigger is desrroy it and create it again
Also bribes DDS grants a unit that takes damage 50,000 life for a very short time so you can create even spell that prevents dead
I used Attacked Unit instead of Triggering Unit because this involves two units, it's the damage source, and the damage taker. Setting Victim_Unit to Triggering Unit might set the Attacking Unit into variable, instead of the attacked unit. Though the variable of attacked unit wasn't used here, it can be used if the editor chooses to add additional actions.
No, you're wrong. Triggering unit is only 1 unit, it never involves 2 (it's sthe subject of the event - "A unit takes damage", "A unit" is the subject --> Triggering unit).
Attacked unit --> Triggering unit
"Triggering Unit" can never be the attacking unit or the damage source.
GUI automatically converts it (attacked unit) to "Triggering Unit" anyway, I'm saying you have to change it so it's more efficient.
JASS:
function GetAttackedUnitBJ takes nothing returns unit
return GetTriggerUnit()
endfunction
edo said:
the triggers are very inefficient(is that right word? )
because every time unit is about to attack, new event is added to the trigger and ot will eventually crash bcause trigger can only have a finite number of events before crashing the trigger or even the game
Bribes DDS recreates the trigger every 15 new umits registered to the trigger
That's the right word, but it's not completely correct.
If you keep attacking a single unit, the event will only be added once.
If you attack a unit, then switch to another target for 2 attacks, then switch back: all units will have the event added once (as they should).
However, the problem is that you need to hit the target twice before the event is added (except for the first time). If you attack it once, then switch target (to a unit that already has an event), another event will be created for the unit that already had one.
So, theoretically, if you keep switching target after 1 attack; 1 unit will have many events added while the other won't have any event.
(Didn't notice this last time).
So it's really not a good system to use (unless I re-created it wrongly, looks correct though).
That's the right word, but it's not completely correct.
If you keep attacking a single unit, the event will only be added once.
If you attack a unit, then switch to another target for 2 attacks, then switch back: all units will have the event added once (as they should).
However, the problem is that you need to hit the target twice before the event is added (except for the first time). If you attack it once, then switch target (to a unit that already has an event), another event will be created for the unit that already had one.
So, theoretically, if you keep switching target after 1 attack; 1 unit will have many events added while the other won't have any event.
(Didn't notice this last time).
So it's really not a good system to use (unless I re-created it wrongly, looks correct though).
Nope, I was talking about Maltheo2005's triggers as well .
You say his triggers add an event on every attack, which isn't true. That's just what I wanted to correct.
Sorry for the confusion, I shouldn't just assume that everyone knows what I'm talking about .
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.