• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Vampiric Potion/Vampiric Aura Autocast buff?

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
You can use Bloodlust as the base ability if you want the spell to target allies or Frenzy (Quilbeast autocast) if you want it to only target yourself. Then you add the Vampiric effect through triggers by adding one of the many Lifesteal abilities to the caster of said base ability. The trigger will depend on which effect you want, self cast or ally cast.
 
Level 9
Joined
Apr 15, 2022
Messages
61
You can use Bloodlust as the base ability if you want the spell to target allies or Frenzy (Quilbeast autocast) if you want it to only target yourself. Then you add the Vampiric effect through triggers by adding one of the many Lifesteal abilities to the caster of said base ability. The trigger will depend on which effect you want, self cast or ally cast.
How would the ally cast trigger look like? Also is it free from any dispell/control magic glitches?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
How would the ally cast trigger look like? Also is it free from any dispell/control magic glitches?
If you want it to be undispellable/unstealable then you'll need to remove the Buff from it. Giving Bloodlust a 0.001 second Buff duration should be good enough.

And a simple trigger would look like this:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to YourBloodlustAbility
  • Actions
    • Custom script: local unit udg_TempUnit
    • Set Variable TempUnit = (Target unit of ability being cast)
    • Unit - Add Lifesteal to TempUnit
    • Wait 10.00 seconds
    • Unit - Remove Lifesteal from TempUnit
    • Custom script: set udg_TempUnit = null
The problem with this design is that it will break if a unit is targeted by the spell a second time while it's already affected by a previous cast. This is because it will now have two Waits running, the first of which will remove Lifesteal once it's finished. This means the second cast will have it's Lifesteal removed early instead of overwriting the first cast.

A fix to this issue would be to use a more advanced method like a Unit Indexer/Hashtable which is used to track the Duration of the spell on the unit. By tracking the Duration we can simply "refresh" it on additional casts like how all buffs in Warcraft 3 work.
 
Status
Not open for further replies.
Top