• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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