• 🏆 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] Life steal spell

Status
Not open for further replies.
Level 6
Joined
Jul 5, 2014
Messages
174
Again I seem stuck. Is it possible to create a spell (buff) that gives a unit temporary life-steal? Vampiric aura badly resist my attempts to turn it into an active ability.
 
Level 11
Joined
Jun 2, 2004
Messages
849
Well vamp aura is the only temporary ability like that. You could trigger it by adding/removing the vamp aura ability itself (after setting it to have 0 range and only affect "self"), using waits or timers to remove it after the duration should be up.

EDIT: See post below mine.
 
Last edited:
Level 6
Joined
Jul 5, 2014
Messages
174
There's the Vampiric Potion ability. It's temporary, adds damage, and life steal (either flat value or %).

Wow, I totally forgot about that item. But if I turn it into an ability, will it show up among the skills? I made the orb of corruption into a passive ability and while it worked, it didn't show up after being learned, probably because of its item status.

Edit: it does appear, but it can't be used on other units.
 
Last edited:
Level 9
Joined
Apr 23, 2011
Messages
527
If you want it to be used on other units, you can base a dummy ability on Channel (if it is instant cast) or Acid Bomb (if it is projectile-based). If the dummy spell's effect starts (or detect if damage is dealt if using Acid Bomb, which requires a DDS), make a dummy unit cast the Vampiric Potion ability on the target.
 
Level 6
Joined
Jul 5, 2014
Messages
174
When I order the dummy to cast a spell, it can only pick the spell I based my ability on. It doesn't offer any item ability, so I have no idea how should I make it casting vampiric potion.
 
Level 9
Joined
Apr 23, 2011
Messages
527
Ah, in that case, you'd probably need a custom script to detect the order id. Try issuing this action when a unit issues an order targeting a unit (i.e. manually make a unit cast Vampiric Potion ingame).
JASS:
call BJDebugMsg(GetUnitName(GetTriggerUnit())+": "+I2S(GetIssuedOrderId()))
(Taken from a post by @BloodSoul)

Then to make the unit cast the ability, use this (replace the unit variable to whatever you use):
JASS:
call IssueImmediateOrderById(unit_var, order_id)
 
Level 6
Joined
Jul 5, 2014
Messages
174
Uhh, I'm not adept at JASS at all, I don't know what's what among these scripts. I'm also not sure where can I see spell ID.
 
Level 6
Joined
Jul 5, 2014
Messages
174
I'm trying to make a custom race for fun and I intend to give that ability to one of the caster units. There are more tricky spells the map editor trolling me with (life spell shield which makes my cursor disappear when I try targeting a unit), but if I could make the life-steal work, I may be able to use the same method for them as well.
 
Level 13
Joined
May 10, 2009
Messages
868
Oh, I see. Well, there is a hacky way of doing so. You'd have to use the "tome technique", which is basically giving the Vampiric Potion ability to a new item created based on a tome (Manual of Health, for example). The good thing about tomes is that they do not interrupt orders. The bad thing is that they leak, because Blizzard just reduce their size, and leave the item there. But, as you already know, units don't have hero inventories, rendering them unable to pick up tomes in general. It is still possible for units, but you'd have to take into account units with "Unit Inventory" (Can't use items).
 
Level 6
Joined
Jul 5, 2014
Messages
174
So, should I give units hero inventory? That would mess up many things in the game due to the ability to use items. :/
 
Level 13
Joined
May 10, 2009
Messages
868
Not exactly. Actually, I don't really like this idea exactly because of this:
- You can detect if a unit has any "Unit Inventory", then remove it, add hero inventory, add tome, destroy tome (preventing a leak), remove hero inventory, add "Unit Inventory" back.
 
Level 6
Joined
Jul 5, 2014
Messages
174
Yeah, it seems tricky. If the JASS version could bypass it, I could try that if I know what to replace with what. But the example I saw was confusing, I dunno which parts should I customize or how to check the ID of an item-based spell. The editor dislikes my idea, even though it would be an easy thing to solve if I could just point at units with the vampiric potion.
 
Level 13
Joined
May 10, 2009
Messages
868
Considering that doing this is not a good idea after all, because it could even cause problems related to other triggers with "unit acquires/drops/uses an item" events, and taking into account what Light said, then:

You could simply modify any ability that places a buff on a unit, and use a damage detection system, so that you could make a new life steal that works with any unit.
Try Bribe's Damage Engine, it is very well documented, and it's quite easy to use. Also, with it you expand the possibilities of making new spells related to damage detection in general.
 
Level 6
Joined
Jul 5, 2014
Messages
174
Thanks, I'll give it a try.

Edit: As I looked at the damage detection, I've got an idea and I've ducktaped together a trigger that partially working. (I'm dummy can't find the option to show trigger :( )


I gave a trigger that upon starting an effect of ability (which is the dummy acid bomb), the target gets a lifesteal ability (based on the vampiric aura that only works on self).

But removing is more problematic. Firstly, I don't know how to hide the ability from showing up. Secondly, trying to remove it once the dummy ability wear off is glitchy (it instantly removed it when I gave an if/then/else trigger to do so).
 
Last edited:
Level 9
Joined
Apr 23, 2011
Messages
527
You could use Unit - Hide Ability in 1.29 to keep it from showing the ability.
Since Acid Bomb applies a buff, you could try something like this (requires Damage Engine, may not be accurate to WE):
  • vampcast
  • Events
    • Event - AfterDamageEvent Equal to 1.00
  • Conditions
    • (DamageEventTarget has buff Acid Bomb) Equal to True
  • Actions
    • Unit Group - Add DamageEventTarget to VampGroup
    • Unit - Add Vampiric Aura to DamageEventTarget
    • Unit - For unit DamageEventTarget, Hide Vampiric Aura: True
  • vamploop
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in VampGroup and do (Actions)
      • Actions
        • If (All Conditions) are True then (Do Actions) else (Else Actions)
          • If - Conditions
            • ((Picked unit) has buff Acid Bomb) Not equal to True
          • Then - Actions
            • Unit Group - Remove (Picked unit) from VampGroup
            • Unit - Remove Vampiric Aura from DamageEventTarget
          • Else - Actions
You would need to set VampGroup to something, then remove all units from that group in map initialization.
 
Level 6
Joined
Jul 5, 2014
Messages
174
Thanks, the trigger so far seem to remove the ability. Unfortunately, I don't have the 1.29 patch, only 1.26 so can't hide the ability. Isn't there a custom script to do so?

Edit: Umm, is there a way to make the custom acid bomb dispellable? That should be a buff that can be dispelled, but if the custom acid can't be, neither the life steal.
 
Last edited:
Thanks, I'll give it a try.

Edit: As I looked at the damage detection, I've got an idea and I've ducktaped together a trigger that partially working. (I'm dummy can't find the option to show trigger :( )


I gave a trigger that upon starting an effect of ability (which is the dummy acid bomb), the target gets a lifesteal ability (based on the vampiric aura that only works on self).

But removing is more problematic. Firstly, I don't know how to hide the ability from showing up. Secondly, trying to remove it once the dummy ability wear off is glitchy (it instantly removed it when I gave an if/then/else trigger to do so).
Check the tutorial in my sig below "hiw to post triggers"
 
Level 6
Joined
Jul 5, 2014
Messages
174
Thanks, though the codes link isn't working. You don't happen to know how to hide ability via custom script, do you?
 
Last edited:
Level 11
Joined
Jun 2, 2004
Messages
849
The magic number for position is X: 0, Y: -11, by the way. You hold shift when double clicking the Y position to set it to -11.

Also, abilities can be put on anything, whether they're an item ability or not. Not all item abilities show an icon when used on a unit or hero, but spellbook does. And you can use the above posted tutorial to make it hide icons, if you don't feel like using the magic number method or the new trigger native.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I modified my Temporary Ability System (instead of counting down timers only, now it also checks for the buff on the unit) to achieve what you want (able to be Dispelled).

If you want to modify the value for the Lifesteal, edit the Life Steal ability under Custom Abilities -> Neutral Hostile -> Units.

You can find the testing map attached to my post.
 

Attachments

  • Temporary Ability.w3x
    16.4 KB · Views: 31
Level 6
Joined
Jul 5, 2014
Messages
174
The magic number for position is X: 0, Y: -11, by the way. You hold shift when double clicking the Y position to set it to -11.

Also, abilities can be put on anything, whether they're an item ability or not. Not all item abilities show an icon when used on a unit or hero, but spellbook does. And you can use the above posted tutorial to make it hide icons, if you don't feel like using the magic number method or the new trigger native.

Ah thanks, I tried shift when I was already in it. That solved the showing up issue.

I modified my Temporary Ability System (instead of counting down timers only, now it also checks for the buff on the unit) to achieve what you want (able to be Dispelled).

If you want to modify the value for the Lifesteal, edit the Life Steal ability under Custom Abilities -> Neutral Hostile -> Units.

You can find the testing map attached to my post.

Wow, that triggering is pretty complex, but the overall result looks and works better than my own version. However, wouldn't it be easier to set the position of the ability to -11 instead of triggering a spellbook?

Edit: I may missing something, but using the frostmourne lifesteal (that has no buff nor ability icon) actually solved multiple issues (not working on ranged units, having double buff show up). It also seem to lack the need for complex triggers other than unit group and adding ability that tied to the dummy buff. Should have used frostmourne from the beginning :'D Nevertheless, it wouldn't have worked without your help, if anyone knows a possible problem with my lazy version compared to defskull's more complex triggers, please let me know. In the meantime I distribute some reputations. Thanks again.
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
Ah thanks, I tried shift when I was already in it. That solved the showing up issue.



Wow, that triggering is pretty complex, but the overall result looks and works better than my own version. However, wouldn't it be easier to set the position of the ability to -11 instead of triggering a spellbook?

Edit: I may missing something, but using the frostmourne lifesteal (that has no buff nor ability icon) actually solved multiple issues (not working on ranged units, having double buff show up). It also seem to lack the need for complex triggers other than unit group and adding ability that tied to the dummy buff. Should have used frostmourne from the beginning :'D Nevertheless, it wouldn't have worked without your help, if anyone knows a possible problem with my lazy version compared to defskull's more complex triggers, please let me know. In the meantime I distribute some reputations. Thanks again.

I'm sooo dumb cuz I assumed the Lifesteal Frostmourne would take up a slot in your Command Card but it doesn't at all.
So, with that assumption, I just added the ability into a Spell Book and make the ability buried behind a disabled Spell Book just to hide its view - where the original ability of the Lifesteal Frostmourne doesn't show up at all LOL.

If that's the case, just add the ability directly to the unit and remove it later (you can use my System for that) without using Spell Book at all - but the Dummy Caster is still needed to cast that buff so that it can be Dispelled.
 
Level 6
Joined
Jul 5, 2014
Messages
174
Actually I don't need a dummy for that one. I tied the ability to a dummy buff, using Light's trigger. The buffer unit casts the dummy buff, the target gets the ability and when the target no longer has the dummy buff (dispel or end of duration), the trigger removes the ability.

I just wish I could solve similarly the spell shield spell (because it has no reference to cast it via dummy unit and using it directly make my cursor disappear.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Actually I don't need a dummy for that one. I tied the ability to a dummy buff, using Light's trigger. The buffer unit casts the dummy buff, the target gets the ability and when the target no longer has the dummy buff (dispel or end of duration), the trigger removes the ability.
Once again, my brain fails me haha, guess I was too much getting used on using Channel for every custom ability, I forgot you can just use the Bloodlust to cast the spell (and apply buff), and add the ability via triggers, @@"

I just wish I could solve similarly the spell shield spell (because it has no reference to cast it via dummy unit and using it directly make my cursor disappear.
Which problem was this ?
 
Level 6
Joined
Jul 5, 2014
Messages
174
It isn't related to the life steal spell, but I thought I just bring it up instead of making a new thread. I turned the spell shield rune into an ability, but when I press the button, my cursor disappears and it can't really target units properly. I also can't make a dummy cast it, because the triggers only give me original abilities as references and item abilities aren't among them.
 
Status
Not open for further replies.
Top