-
Couldn't load subscription status.
- Fork 6
PassiveBuff
Orden4 edited this page Mar 31, 2021
·
1 revision
PassiveBuff is the simplest buff. It is intended as a simple apply-expire buff that does nothing over its duration, and as such comes with no added baggage.
The below example is a simple aura that increases the targets armour by 5 when applied, and decreases it by 5 when it is disposed.
using WCSharp.Buffs;
using static War3Api.Common;
public class MyPassiveBuff : PassiveBuff
{
public MyBuff(unit caster, unit target) : base(caster, target)
{
Duration = 10.0f;
EffectString = @"Abilities\Spells\Human\DevotionAura\DevotionAura.mdl";
}
public override void OnApply()
{
BlzSetUnitArmor(Target, BlzGetUnitArmor(Target) + 5);
}
public override void OnDispose()
{
if (UnitAlive(Target))
{
BlzSetUnitArmor(Target, BlzGetUnitArmor(Target) - 5);
}
}
}- Home
- WCSharp template
- Release notes
- Desyncs
- Upgrading to War3Net v5.x
- WCSharp.Api
- WCSharp.Buffs
- WCSharp.ConstantGenerator
- WCSharp.DateTime
- WCSharp.Dummies
- WCSharp.Effects
- WCSharp.Events
- WCSharp.JsonConvert
- WCSharp.Knockbacks
- WCSharp.Lightnings
- WCSharp.Missiles
- WCSharp.SaveLoad v1.x
- WCSharp.SaveLoad v2.x
- WCSharp.Shared
- WCSharp.Sync
- WCSharp.W3MMD