I'm trying to make a prefix that gives the weapon lifesteal
I want a weapon that has this prefix to have lifesteal.
I tried things like writing OnHitNPC in the file but it gives error.
Can anyone tell me what change to make to the code so it works as intended please.
using Terraria;
using...
I had this issue before and someone helped me on that, change ur code to :
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
Player player = Main.player[projectile.owner];
int amountToHeal = damage / 10; // Heal tenth...
Tysm it worked!
now the next thing I'm trying to make is an accessory that gives life steal on all your damages when equipped, like the spectre hood set bonus, but I want it to work on all damage types and I want to customize the percentage of lifesteal, I tried ghostheal but idk if there are...
I'm trying to make a projectile that does lifesteal, but it says no suitable method found to override, if I remove the player player and the statlife line it works fine and the projectile inflicts ichor, but how can i make it do lifesteal as well?
public override void OnHitNPC(Player Player...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.