As the title suggests, I have been trying to create a script for a melee weapon that damages a monster/player each turn, AND heals the user for a percentage of the damage dealt.
I've seen the different threads about "vampriric spell" and "vampiric touch" (Spell - +[Creaturescript] Vampiric touch(Lifesteal atk) Spell - Life steal / Life drain (for X seconds)) or whatever but I've read through those and they aren't what I'm looking for.
I want to be able to just change one club weapon so that it returns health to the user when you attack something with it.
I have a script that I've created, but I know I've done something wrong. I've tried to set up 2 different combats and I'm not good at that. Could someone point me in the right direction? Again, TFS 1.2.
Script:
I'm not getting any console errors with the script, but it doesn't quite work. Attacking a monster with the weapon will deal damage to the monster, but it will also "heal" the monster (that is, the monster will have the blue sparkle effect but wont actually gain any HP) instead of healing the player.
Any help is appreciated, I feel like it's really close but I'm making a silly mistake
Regards,
X X X
edit: I know my script I have isn't for a %, but I was trying to get it to heal PERIOD before I worked on healing at a %.
I've seen the different threads about "vampriric spell" and "vampiric touch" (Spell - +[Creaturescript] Vampiric touch(Lifesteal atk) Spell - Life steal / Life drain (for X seconds)) or whatever but I've read through those and they aren't what I'm looking for.
I want to be able to just change one club weapon so that it returns health to the user when you attack something with it.
I have a script that I've created, but I know I've done something wrong. I've tried to set up 2 different combats and I'm not good at that. Could someone point me in the right direction? Again, TFS 1.2.
Script:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat2, COMBAT_PARAM_AGGRESSIVE, FALSE)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -0.2, -0.2, -0.2, -0.2)
function onUseWeapon(cid, var, creature)
doCombat(cid, combat, var)
doCombat(creature, combat2, var)
return true
end
I'm not getting any console errors with the script, but it doesn't quite work. Attacking a monster with the weapon will deal damage to the monster, but it will also "heal" the monster (that is, the monster will have the blue sparkle effect but wont actually gain any HP) instead of healing the player.
Any help is appreciated, I feel like it's really close but I'm making a silly mistake
Regards,
X X X
edit: I know my script I have isn't for a %, but I was trying to get it to heal PERIOD before I worked on healing at a %.
Last edited: