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

[Spell] Lifesteal

Status
Not open for further replies.
Level 4
Joined
Apr 23, 2008
Messages
119
I would like to trigger lifesteal and mana burn and Spell Vamp.

Id imagine the script would go:

Unit is attacked

Attacking unit has (Item)

Set life of attacking unit to (Current life + (.1 x Damage Dealt))

And for mana burn:

Unit is attacked

Attacking unit has (Item)

Set life of attacked unit to (Current mana - 40)

Lastly Spell Vamp

And for mana burn:

Unit Starts the Effects of an Ability

Casting Unit has (item) equals true

Set life of Casting Unit to (.25 x Damage Dealt)

I have GDD Damage Detector Installed as well. But I don't want leaks or the character to continue the effects after the item is sold or dropped.

Would perfer GUI but have little knowledge of Jass.
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
If you have GDD already installed you probably know that it's piece of cake.
Just use unit event: Unit - Acquires new item; follow this with condition about item-type. As action add given unit to custom unit group (you need to create that group before, in variable editor).

Create additionaly trigger with event: Unit - Loses an item, (again item-type condition); action: Unit Group - Remove (Triggering unit) from CustomUnitGroup.

Now, go back to GDD. AS event (like always) GDD_Event becomes Equal to 0.00 -> Condition (boolean one) GDD_DamageSource is in CustomUnitGroup Equal to True -> fire actions.

Depending on which spell you what to trigger use differend damage values in Unit - Damage Target action.
 
Status
Not open for further replies.
Top