[Spell] Is it possible that Vampiric Potion is casted by Unit Target?

Status
Not open for further replies.
Level 5
Joined
Oct 29, 2020
Messages
87
As we all know, Vampiric Potion is an item ability and it is used with no target.
I wanna use it as a hero ability (but only can be cast on heroes) and make it unit-targeted like Frost Armor.
How to do this?
 
Level 29
Joined
Sep 26, 2009
Messages
2,594
You can't. An instant self-cast ability cannot be remade into target cast ability.
But considering that the Vampiric Potion just heals the unit for % of damage done, you can trigger it quite easily if you are on 1.35 version:
  • Create ability based off some existing auto-cast ability. You can for example take Inner Fire, but just remove any positive effects it has.
  • Create a custom buff that your new ability will apply
In triggers:
  • There's an event for detecting when unit takes damage
  • You can check in condition if the (Damage source) has the custom buff you created
  • If it has the buff, you can access the amount of damage dealt and heal the (Damage source) for a percentage of it
On older versions you would probably need to import damage detection system into your map to detect when unit took damage
 
Level 28
Joined
Nov 25, 2021
Messages
507
There's a really stupid workaround without using DDS, like this:
  • Make an ability based off Inventory(Hero), but with 0 Item Capacity. If you can't input 0, just use Shift-Enter.
  • Give the Vampiric Potion ability to a custom powerup item (based off a rune/tome).
  • Make a trigger like this:

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Your Ability
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Inventory (Hero) for (Target unit of ability being cast)) Greater than 0
      • Then - Actions
        • -------- If the target already has Inventory (Hero), then no need to add/remove Inventory (Hero 0 Slot) in case of weird bugs. --------
        • Hero - Create Rune of Vamp and give it to (Target unit of ability being cast)
      • Else - Actions
        • Unit - Add Inventory (Hero 0 Slot) to (Target unit of ability being cast)
        • Hero - Create Rune of Vamp and give it to (Target unit of ability being cast)
        • Unit - Remove Inventory (Hero 0 Slot) from (Target unit of ability being cast)
Disclaimer:
  • Doesn't work very well, and by that, I mean doesn't work at all, with units who already have Unit Inventory.
  • The powerup sometimes appears briefly before being given to the unit. Just replace its model with a blank one to circumvent it.
  • The item pickup thingy will appear near the unit's feet briefly. If you want to be thorough, just replace Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl with a blank model. Although, I don't recommend it.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Why not just add the Item Life Steal ability to the target? It's passive and can be hidden away.

In here I have it setup so that the Hero is using a new version of Bloodlust with it's own unique buff:
  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bloodlust
      • (Level of Item Life Steal for (Target unit of ability being cast)) Equal to 0
    • Actions
      • Unit - Add Item Life Steal to (Target unit of ability being cast)
      • Unit Group - Add (Target unit of ability being cast) to VampiricGroup
      • Set VariableSet VampiricCount = (VampiricCount + 1)
      • Trigger - Turn on Loop <gen>
  • Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in VampiricGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Bloodlust) Equal to False
            • Then - Actions
              • Unit - Remove Item Life Steal from (Picked unit)
              • Unit Group - Remove (Picked unit) from VampiricGroup.
              • Set VariableSet VampiricCount = (VampiricCount - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • VampiricCount Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
You can hide the Life Steal ability by setting it's Art Button Positions to 0, -11. Or just use the Hide ability Action to do so.

Also, make sure the Loop trigger is Initially OFF.
 
Last edited:
Status
Not open for further replies.
Top