• 🏆 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 Kiss. <Spell help>

Status
Not open for further replies.
Level 1
Joined
Jul 30, 2009
Messages
5
<sigh> I have another problem. i am trying to make a spell called vampiric kiss. essentially it drains the life of the unit and transfers it to the caster, kind of like life drain except it isnt a channeling spell. It is because of this similarity that i based it off drain life but it wont work. it will deal the right amount of dmg but wont trasfer any of it to the caster. Does ne1 have suggestions on what needs to done or a better spell to base vampiric kiss off of?
 
Level 8
Joined
Feb 15, 2009
Messages
463
make a trigger registering the spell event(like always)
then use a periodic timer and a struct storing caster and target as well as amount(e.g. 75.*GetUnitAbilityLevel(caster,id))
let the timer run and every intervall u have a callback function which takes the arguments from the struct(TimerUtils needed for this)
then go for
JASS:
SetUnitState( target , UNIT_STATE_LIFE , GetUnitState( target , UNIT_STATE_LIFE) - amount)
SetUnitState( caster , UNIT_STATE_LIFE , GetUnitState( caster , UNIT_STATE_LIFE) + amount)
 
Level 1
Joined
Jul 30, 2009
Messages
5
hmm. Guess im learnig Jass. Dosnt look too hard cuz i understood most of what was wrote. Thx for the help!
 
Status
Not open for further replies.
Top