A flask like flask of ichorWhat sort of flask?
making the buff, i already got the debuff but i need help to make the buff from the flask to inflict the debuff.What part do you need help with?
I tried experimenting with it a bit (like 30 minutes) But i still cant do it, can you maybe like make a example? Im sorry if im asking for too much lol, im still kinda new and coding is kinda confusing, aswell that there are no tutorials about it online : (You know he's asking how to code one, not craft one in game, right?
You can have the flask add the buff to the player on use, and the buff itself would enable a bool on your ModPlayer class. Then, in the OnHitNPC method, just check if the bool is true, apply the specific debuff to the target.
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (customBuff)
target.AddBuff(BuffID.OnFire, 3600);
}
0h I'm an idiotYou know he's asking how to code one, not craft one in game, right?
You can have the flask add the buff to the player on use, and the buff itself would enable a bool on your ModPlayer class. Then, in the OnHitNPC method, just check if the bool is true, apply the specific debuff to the target.
Experimented a bit more and still cant do itSo the exact thing you're asking for isn't in ExampleMod, but it has the necessary code in different places. For example
Example crate buff - shows how to set a bool on your ModPlayer class when the buff is active
So just create the bool itself in your ModPlayer class, then set it to true in the buff like above.
Then, in the ModPlayer class, you do the logic for what happens when you hit an NPC after using the flask.
For example, if you are setting them on fire, do this (This is 1.4.4 code btw)
C#:public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (customBuff) target.AddBuff(BuffID.OnFire, 3600); }