Hi,
First of all, I ask someone to delete my first thread named "Hitting target with skills causes attacker lose HP", because it's useless. I was working on spellvamp there, and I managed to do some kind of it (ball had to die, to transfer hp to it's owner), but now my spellvamp is object-oriented, and works properly (I think, so you can check). Here's the code (it's kinda long and complicated ^^):
Of course, initial frame of ball should have state 311, like this from my previous thread if you don't have special MAX_MP function, which I'll be trying to implement (thanks Silva).
In this code when ball hit's opponent, it stores in dark red hp damage it dealt, so when target has less hp than damage of ball, then it stores his all hp, but damage dealt is divided by 3, so you get 33% spellvamp (ofc you can change value). After that, the ball hits his owner, healing him, and then again it hits target with nothing, but it has to apply visual effect. :p
By the way, don't use injury in this itr, because injury is applied before all this code, so then I should heal him for the amount he was hit, which could cause him to revive, so use "respond" as injury (or change effect 74 to something like 74xxx).
First of all, I ask someone to delete my first thread named "Hitting target with skills causes attacker lose HP", because it's useless. I was working on spellvamp there, and I managed to do some kind of it (ball had to die, to transfer hp to it's owner), but now my spellvamp is object-oriented, and works properly (I think, so you can check). Here's the code (it's kinda long and complicated ^^):
Spoiler (Click to View)
Spoiler (Click to View)
In this code when ball hit's opponent, it stores in dark red hp damage it dealt, so when target has less hp than damage of ball, then it stores his all hp, but damage dealt is divided by 3, so you get 33% spellvamp (ofc you can change value). After that, the ball hits his owner, healing him, and then again it hits target with nothing, but it has to apply visual effect. :p
By the way, don't use injury in this itr, because injury is applied before all this code, so then I should heal him for the amount he was hit, which could cause him to revive, so use "respond" as injury (or change effect 74 to something like 74xxx).