private Unit SelectReferer(SpellExplicitTargets explicitTargets, Unit caster)
        {
            switch (referenceType)
            {
            case SpellTargetReferences.Source:
            case SpellTargetReferences.Dest:
            case SpellTargetReferences.Caster:
                return(caster);

            case SpellTargetReferences.Target:
                return(explicitTargets.Target);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
        public override void AuraApplicationRemoved(AuraApplication application)
        {
            base.AuraApplicationRemoved(application);

            if (application.Aura.Caster == null)
            {
                return;
            }

            if (application.RemoveMode == AuraRemoveMode.Death || application.RemoveMode == AuraRemoveMode.Expired)
            {
                var explicitTargets = new SpellExplicitTargets {
                    Target = application.Aura.Owner
                };
                var castingOptions = new SpellCastingOptions(explicitTargets, SpellCastFlags.TriggeredByAura);
                application.Aura.Caster.Spells.CastSpell(livingBombExplosion, castingOptions);
            }
        }
示例#3
0
        private Vector3 SelectSource(SpellExplicitTargets explicitTargets, Unit caster)
        {
            switch (referenceType)
            {
            case SpellTargetReferences.Destination:
                return(explicitTargets.Destination ?? caster.Position);

            case SpellTargetReferences.Source:
            case SpellTargetReferences.Caster:
                return(caster.Position);

            case SpellTargetReferences.Target:
                return(explicitTargets.Target.Position);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }