Forum > Serverside Modding

[LUA] My spell script doesn't show the damage done

(1/1)

Kobiesan:
Hi. I recently made a dummy script for a spell that does 150 damage to a target but if they are knocked down it does 300 damage instead. It works perfect HOWEVER it doesn't show the damage dealt when you cast it. The target's health changes but no numbers pop up on the screen showing the damage done. Can anyone crack the code?


--- Code: ---function Tenderizer(effectIndex, spell)
if (spell:GetTarget():HasAuraWithMechanic(12)) then
spell:GetCaster():DealDamage(spell:GetTarget(), 300, 80914)
else
spell:GetCaster():DealDamage(spell:GetTarget(), 150, 80914)
end
end

RegisterDummySpell(80914, Tenderizer)
--- End code ---

Ascathos:
It only deals damage, it's not actually casting the spells... That's what I'd assume. Does DealDamage() take the spell variable as parameter for cast ?

Kobiesan:

--- Quote from: "Ascathos" ---It only deals damage, it's not actually casting the spells... That's what I'd assume. Does DealDamage() take the spell variable as parameter for cast ?
--- End quote ---

What do you mean? DealDamage deals damage to target with specified spell. I think the problem might be that it deals damage to the target with the spell value of itself but the spell doesn't do anything other than do this script. But I don't know how to fix that.

Kobiesan:
Bump.

Ascathos:
Somehow I just doubt that DealDamage() is actually the function you are looking for. Something like CastSpell or similar seems far more plausible. But, I never worked too much with LUA.

Navigation

[0] Message Index

Go to full version