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

[Spell] Is this trigger done right?

Status
Not open for further replies.
Hello guys, i'm creating an Aura that gives to friendly units a 30% life steal chance with each attack.

Is this trigger done right?

----------------------------------------------------
Untitled Trigger
Events
Unit - A unit Is attacked
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 0 and 100) Less than or equal to 30
((Attacking unit) has buff Unholy Aura) Equal to True
Then - Actions
Unit - Add Item Life Steal to (Attacking unit)
Unit - Set level of Item Life Steal for (Attacking unit) to (Level of Unholy Aura for Arthas (Evil) 0001 <gen>)
Wait 1.00 seconds
Unit - Remove Item Life Steal from (Attacking unit)
Else - Actions
----------------------------------------------------

Sorry for posting the trigger like that, i'm still not used to using this new Hive.
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
I'm afraid not. Your units can be attacked anytime earlier than 1 seconds and when that happens, your trigger won't work correctly and might even cause a bug.
I recommend you to use Physical DDS to detect enemy's attack and use "Unit - Set YourUnit's life to YourUnit'sLife+YourValue" then give the attacking unit a special effect to make it look like an ordinary life steal.
 
Your Trigger has some problems. Attacking unit is not keeped over a wait, resulting in everyone once gained this effect having it permantly. And like
Rheiko said an attack might take longer than 1 second.

Well, the remove part should be changed you don't need this wait anyway. Better would be to Remove the lifesteal ability if either the unit doesn't have the Aura or the roll fails.

A better solution for the Remove part is to do it in the Else-Actions.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Bedingungen
      • (Random integer number between 1 and 10) Kleiner gleich 3
      • ((Attacking unit) has buff Unheilige Aura) Gleich True
    • 'THEN'-Actions
      • Unit - Add Lifesteal to (Attacking unit)
    • 'ELSE'-Actions
      • Unit - Remove Lifesteal from (Attacking unit)
You can do the Physical DDS way too, After all DDS give you alot of features.

Interesting, tried something out, considering your Problem. The Ability Item - Lifesteal (AIva) can be used the way you need, as you do.

theory stuff

The Item - Lifesteal-Ability-"Effect" is calculated on "damage - point" of an attack (The start of a missle/ Melee Hit), unlike crit or bash.
->
It works for each single attack instance.
Means if you add it in an "attack Event" it works for this attack-instance only, because the "Attack - Event" fires before the "damage -point".

 
Last edited:
Level 12
Joined
May 22, 2015
Messages
1,051
Has it been tested? I know I've had problems trying to add things like critical strike like this. It just doesn't register except on attack start (to start special animation and stuff), so the end result is it won't work for the current attack.

Could you not do something super similar with just vampiric aura? You'd lose the % chance to work, but if you change the life steal % to be 30% of the value, it averages out to the same amount.
 
I tried it with poison, ATK and lifesteal recently :). This effects are fired on damage point -> working in this situation.

Lifesteal-test is attached, uses Bribes Healing event for visuel showing.

Effect:
On Foes
1.Attack 50% Lifesteal
2.Attack 200%
3. None
repeats

  • Attack
    • Ereignisse
      • Einheit - A unit is attacked
    • Bedingungen
      • ((Triggering unit) belongs to an enemy of (Owner of (Attacking unit))) Gleich True
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Level of Lebendiebstahl for (Attacking unit)) Kleiner als 2
        • 'THEN'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Level of Lebendiebstahl for (Attacking unit)) Gleich 0
            • 'THEN'-Aktionen
              • Einheit - Add Lebendiebstahl to (Attacking unit)
            • 'ELSE'-Aktionen
              • Einheit - Increase level of Lebendiebstahl for (Attacking unit)
        • 'ELSE'-Aktionen
          • Einheit - Remove Lebendiebstahl from (Attacking unit)
 

Attachments

  • Lifesteal.w3x
    30.8 KB · Views: 23
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
(Random integer number between 0 and 100) Less than or equal to 30
Just to point out, what you are doing here gives a 31 in 101 (probability 0.306930 or 30.6930%) chance for it to proc.

This looks like a fairly typical off by 1 error as it is unlikely you intended such strange numbers. You might be after something like...
(Random integer number between 1 and 100) Less than or equal to 30
This gives a 30 in 100 (probability 0.3 or 30%) chance for it to proc.
 
Status
Not open for further replies.
Top