示例#1
0
        public void OnConcentrationTick(NWCreature creature, NWObject target, int spellTier, int tick)
        {
            int amount;

            switch (spellTier)
            {
            case 1:
                amount = 5;
                break;

            case 2:
                amount = 6;
                break;

            case 3:
                amount = 7;
                break;

            case 4:
                amount = 8;
                break;

            case 5:
                amount = 10;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(spellTier));
            }

            var result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Dark);

            // +/- percent change based on resistance
            float delta = 0.01f * result.Delta;

            amount = amount + (int)(amount * delta);

            if (target.GetLocalInt("FORCE_DRAIN_IMMUNITY") == 1)
            {
                amount = 0;
            }

            creature.AssignCommand(() =>
            {
                _.ApplyEffectToObject(DurationType.Instant, _.EffectDamage(amount, DamageType.Negative), target);
            });

            // Only apply a heal if caster is not at max HP. Otherwise they'll get unnecessary spam.
            if (creature.CurrentHP < creature.MaxHP)
            {
                _.ApplyEffectToObject(DurationType.Instant, _.EffectHeal(amount), creature);
            }

            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToNPCForSkill(creature.Object, target, SkillType.ForceAlter);
            }

            _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Com_Hit_Negative), target);
        }
示例#2
0
        public void OnImpact(NWCreature creature, NWObject target, int perkLevel, int spellTier)
        {
            int damage;
            int intMod = creature.IntelligenceModifier;

            switch (spellTier)
            {
            case 1:
                damage = 10 + intMod;
                break;

            case 2:
                damage = 15 + intMod;
                break;

            case 3:
                damage = 20 + ((intMod * 15) / 10);
                break;

            case 4:
                damage = 25 + ((intMod * 17) / 10);
                break;

            case 5:
                damage = 30 + (intMod * 2);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(spellTier));
            }

            var result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Universal, true);

            // +/- percent change based on resistance
            float delta = 0.01f * result.Delta;

            damage = damage + (int)(damage * delta);
            var targetLocation = _.GetLocation(creature);
            var delay          = _.GetDistanceBetweenLocations(creature.Location, targetLocation) / 18.0f + 0.35f;

            creature.AssignCommand(() =>
            {
                _.PlaySound("plr_force_blast");
                DoFireball(target);
            });

            creature.DelayAssignCommand(() =>
            {
                _.ApplyEffectToObject(DurationType.Instant, _.EffectDamage(damage), target);
                _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Imp_Silence), target);
                _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.VFX_IMP_KIN_L), target);
            }, delay);


            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToNPCForSkill(creature.Object, target, SkillType.ForceAlter);
            }
        }
示例#3
0
        public void OnImpact(NWCreature creature, NWObject target, int perkLevel, int spellTier)
        {
            int damage;
            int mod = creature.WisdomModifier;

            switch (spellTier)
            {
            case 1:
                damage = 5 + mod;
                break;

            case 2:
                damage = 10 + ((mod * 125) / 100);
                break;

            case 3:
                damage = 10 + ((mod * 15) / 10);
                break;

            case 4:
                damage = 15 + ((mod * 175) / 100);
                break;

            case 5:
                damage = 15 + (mod * 2);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(spellTier));
            }

            var result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Universal, true);

            // +/- percent change based on resistance
            var delta = 0.01f * result.Delta;

            damage = damage + (int)(damage * delta);
            var targetLocation = _.GetLocation(creature);
            var delay          = _.GetDistanceBetweenLocations(creature.Location, targetLocation) / 18.0f + 0.35f;

            creature.AssignCommand(() =>
            {
                DoRock(target);
                _.PlaySound("plr_force_throw");
            });

            creature.DelayAssignCommand(() =>
            {
                _.ApplyEffectToObject(DurationType.Instant, _.EffectDamage(damage, DamageType.Bludgeoning), target);
                _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Imp_Dust_Explosion), target);
            }, delay);

            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToNPCForSkill(creature.Object, target, SkillType.ForceAlter);
            }
        }
示例#4
0
        public void OnImpact(NWCreature creature, NWObject target, int perkLevel, int spellTier)
        {
            float duration = 0.0f;

            switch (spellTier)
            {
            case 1:
                duration = 6f;
                break;

            case 2:
                duration = 12f;
                break;

            case 3:
                duration = 18f;
                break;

            case 4:
                duration = 24f;
                break;
            }

            var result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Universal);


            // Resisted - Only apply slow for six seconds
            if (result.IsResisted)
            {
                _.ApplyEffectToObject(DurationType.Temporary, _.EffectSlow(), target, 6.0f);
            }

            // Not resisted - Apply knockdown for the specified duration
            else
            {
                // Check lucky chance.
                int luck = PerkService.GetCreaturePerkLevel(creature, PerkType.Lucky);
                if (RandomService.D100(1) <= luck)
                {
                    duration *= 2;
                    creature.SendMessage("Lucky Force Push!");
                }

                _.ApplyEffectToObject(DurationType.Temporary, AbilityService.EffectKnockdown(target, 3.0f), target, 3.0f);
                _.ApplyEffectToObject(DurationType.Temporary, _.EffectSlow(), target, duration);
            }

            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToAllCombatTargetsForSkill(creature.Object, SkillType.ForceAlter, target.Object);
            }

            _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Com_Blood_Spark_Small), target);
        }
示例#5
0
        public void OnConcentrationTick(NWCreature creature, NWObject target, int spellTier, int tick)
        {
            int amount;
            int mod = ((creature.WisdomModifier + creature.IntelligenceModifier) / 2);

            switch (spellTier)
            {
            case 1:
                amount = 2 + mod;
                break;

            case 2:
                amount = 3 + mod;
                break;

            case 3:
                amount = 4 + mod;
                break;

            case 4:
                amount = 5 + mod;
                break;

            case 5:
                amount = 6 + mod;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(spellTier));
            }

            var result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Dark);

            // +/- percent change based on resistance
            float delta = 0.01f * result.Delta;

            amount = amount + (int)(amount * delta);


            creature.AssignCommand(() =>
            {
                _.ApplyEffectToObject(DurationType.Instant, _.EffectDamage(amount, DamageType.Bludgeoning), target);
            });

            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToNPCForSkill(creature.Object, target, SkillType.ForceAlter);
            }
            _.PlaySound("plr_force_choke");
            _.ApplyEffectToObject(DurationType.Temporary, _.EffectVisualEffect(VisualEffect.Vfx_Fnf_Demon_Hand), target, 6.1f);
            _.ApplyEffectToObject(DurationType.Temporary, _.EffectVisualEffect(VisualEffect.Vfx_Imp_Starburst_Red), target, 6.1f);
        }
示例#6
0
        public void OnImpact(NWCreature creature, NWObject target, int perkLevel, int spellTier)
        {
            float duration = 0.0f;

            switch (spellTier)
            {
                case 1:
                    duration = 6f;
                    break;
                case 2:
                    duration = 12f;
                    break;
                case 3:
                    duration = 18f;
                    break;
                case 4:
                    duration = 24f;
                    break;
            }

            var result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Universal);


            // Resisted - Only apply slow for six seconds
            if (result.IsResisted)
            {
                _.ApplyEffectToObject(_.DURATION_TYPE_TEMPORARY, _.EffectSlow(), target, 6.0f);
            }

            // Not resisted - Apply knockdown for the specified duration
            else
            {
                // Check lucky chance.
                int luck = PerkService.GetCreaturePerkLevel(creature, PerkType.Lucky);
                if (RandomService.D100(1) <= luck)
                {
                    duration *= 2;
                    creature.SendMessage("Lucky Force Push!");
                }

                _.ApplyEffectToObject(_.DURATION_TYPE_TEMPORARY, _.EffectKnockdown(), target, duration);
            }

            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToAllCombatTargetsForSkill(creature.Object, SkillType.ForceAlter, target.Object);
            }
            
            _.ApplyEffectToObject(_.DURATION_TYPE_INSTANT, _.EffectVisualEffect(_.VFX_COM_BLOOD_SPARK_SMALL), target);
        }
示例#7
0
        public void OnImpact(NWCreature creature, NWObject target, int perkLevel, int spellTier)
        {
            int damage;
            int intMod = creature.IntelligenceModifier;

            switch (spellTier)
            {
            case 1:
                damage = 10 + intMod;
                break;

            case 2:
                damage = 15 + intMod;
                break;

            case 3:
                damage = 20 + ((intMod * 15) / 10);
                break;

            case 4:
                damage = 25 + ((intMod * 17) / 10);
                break;

            case 5:
                damage = 30 + (intMod * 2);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(spellTier));
            }

            var result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Dark, true);

            // +/- percent change based on resistance
            float delta = 0.01f * result.Delta;

            damage = damage + (int)(damage * delta);

            creature.AssignCommand(() =>
            {
                _.ApplyEffectToObject(DurationType.Instant, _.EffectDamage(damage), target);
            });

            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToNPCForSkill(creature.Object, target, SkillType.ForceAlter);
            }

            _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Imp_Silence), target);
        }
示例#8
0
        public void OnConcentrationTick(NWCreature creature, NWObject target, int spellTier, int tick)
        {
            int amount;

            switch (spellTier)
            {
            case 1:
                amount = 2 + (int)(creature.IntelligenceModifier);
                break;

            case 2:
                amount = 4 + (int)(creature.IntelligenceModifier * 1.15);
                break;

            case 3:
                amount = 6 + (int)(creature.IntelligenceModifier * 1.25);
                break;

            case 4:
                amount = 8 + (int)(creature.IntelligenceModifier * 1.5);
                break;

            case 5:
                amount = 10 + (int)(creature.IntelligenceModifier * 2);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(spellTier));
            }

            var result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Dark);

            // +/- percent change based on resistance
            float delta = 0.01f * result.Delta;

            amount = amount + (int)(amount * delta);

            creature.AssignCommand(() =>
            {
                _.PlaySound("plr_force_lightn");
                _.ApplyEffectToObject(DurationType.Instant, _.EffectDamage(amount, DamageType.Electrical), target);
                _.ApplyEffectToObject(DurationType.Temporary, _.EffectBeam(VisualEffect.Vfx_Beam_Silent_Lightning, creature, BodyNode.Hand), target, 1.0F);
            });

            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToNPCForSkill(creature.Object, target, SkillType.ForceAlter);
            }
        }
示例#9
0
        public void OnImpact(NWCreature creature, NWObject target, int perkLevel, int spellTier)
        {
            int damage;

            switch (spellTier)
            {
            case 1:
                damage = 100;
                break;

            case 2:
                damage = 125;
                break;

            case 3:
                damage = 160;
                break;

            case 4:
                damage = 200;
                break;

            case 5:
                damage = 250;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(spellTier));
            }

            var result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Dark, true);

            // +/- percent change based on resistance
            float delta = 0.01f * result.Delta;

            damage = damage + (int)(damage * delta);

            creature.AssignCommand(() =>
            {
                _.ApplyEffectToObject(_.DURATION_TYPE_INSTANT, _.EffectDamage(damage), target);
            });

            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToNPCForSkill(creature.Object, target, SkillType.ForceAlter);
            }

            _.ApplyEffectToObject(_.DURATION_TYPE_INSTANT, _.EffectVisualEffect(_.VFX_IMP_SILENCE), target);
        }
示例#10
0
        public void OnConcentrationTick(NWCreature creature, NWObject target, int spellTier, int tick)
        {
            int amount;

            switch (spellTier)
            {
            case 1:
                amount = 10;
                break;

            case 2:
                amount = 12;
                break;

            case 3:
                amount = 14;
                break;

            case 4:
                amount = 16;
                break;

            case 5:
                amount = 20;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(spellTier));
            }

            var result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Dark);

            // +/- percent change based on resistance
            float delta = 0.01f * result.Delta;

            amount = amount + (int)(amount * delta);

            creature.AssignCommand(() =>
            {
                _.ApplyEffectToObject(DurationType.Instant, _.EffectDamage(amount, DamageType.Electrical), target);
            });

            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToNPCForSkill(creature.Object, target, SkillType.ForceAlter);
            }

            _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Imp_Lightning_S), target);
        }
示例#11
0
        private void RunEffect(NWCreature creature, NWObject target)
        {
            var concentrationEffect = AbilityService.GetActiveConcentrationEffect(target.Object);

            if (concentrationEffect.Type == PerkType.MindShield)
            {
                creature.SendMessage("Your target is immune to tranquilization effects.");
                return;
            }

            AbilityResistanceResult result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Dark);

            // Tranquilization effect - Daze target(s). Occurs on succeeding the DC check.
            Effect successEffect = EffectDazed();

            successEffect = EffectLinkEffects(successEffect, EffectVisualEffect(VisualEffect.Vfx_Dur_Iounstone_Blue));
            successEffect = TagEffect(successEffect, "TRANQUILIZER_EFFECT");

            // AC & AB decrease effect - Occurs on failing the DC check.
            Effect failureEffect = EffectLinkEffects(EffectAttackDecrease(5), EffectACDecrease(5));



            if (!result.IsResisted)
            {
                creature.AssignCommand(() =>
                {
                    ApplyEffectToObject(DurationType.Temporary, successEffect, target, 6.1f);
                });
            }
            else
            {
                creature.AssignCommand(() =>
                {
                    ApplyEffectToObject(DurationType.Temporary, failureEffect, target, 6.1f);
                });
            }

            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToNPCForSkill(creature.Object, target, SkillType.ForceAlter);
            }

            EnmityService.AdjustEnmity(target.Object, creature, 1);
        }
示例#12
0
        public void OnImpact(NWCreature player, NWObject target, int perkLevel, int spellTier)
        {
            NWItem weapon = player.RightHand;
            int    iDamage;
            int    iRange = 15;
            int    iCount = 1;
            float  fDelay = 0;

            int saberDamage = player.RightHand.DamageBonus;

            if (saberDamage > 40)
            {
                saberDamage = 40;
            }

            if (weapon.CustomItemType == CustomItemType.Lightsaber ||
                weapon.CustomItemType == CustomItemType.Saberstaff)
            {
                iDamage = saberDamage + RandomService.D6(2) + player.StrengthModifier;
            }
            else
            {
                iDamage = (int)weapon.Weight + player.StrengthModifier + (saberDamage / 2);
            }

            NWObject oObject;

            // If player is in stealth mode, force them out of stealth mode.
            if (_.GetActionMode(player.Object, ActionMode.Stealth) == true)
            {
                _.SetActionMode(player.Object, ActionMode.Stealth, false);
            }

            // Make the player face their target.
            _.ClearAllActions();
            BiowarePosition.TurnToFaceObject(target, player);

            player.AssignCommand(() => _.ActionPlayAnimation(Animation.LoopingCustom10, 2));

            var   result = CombatService.CalculateAbilityResistance(player, target.Object, SkillType.ForceAlter, ForceBalanceType.Universal);
            float delta  = 0.01f * result.Delta;

            /*
             * // reset phenotype
             *  player.DelayAssignCommand(() =>
             *  {
             *      _.SetPhenoType(4, player);
             *  }, 2.0f);
             *
             *  player.DelayAssignCommand(() =>
             *  {
             *      _.SetPhenoType(iPheno, player);
             *  }, 2.5f);
             */

            // Handle effects for differing spellTier values
            switch (spellTier)
            {
            case 1:
                iDamage = (int)(iDamage * 1.0);
                iDamage = iDamage + (int)(iDamage * delta);

                fDelay = _.GetDistanceBetween(player, target) / 10.0f;

                player.DelayAssignCommand(() =>
                {
                    _.ApplyEffectToObject(DurationType.Instant, _.EffectLinkEffects(_.EffectVisualEffect(VisualEffect.Vfx_Imp_Sonic), _.EffectDamage(iDamage, DamageType.BaseWeapon)), target);
                }, fDelay);

                if (player.IsPlayer)
                {
                    SkillService.RegisterPCToNPCForSkill(player.Object, target, SkillType.ForceAlter);
                }

                break;

            case 2:
                iDamage = (int)(iDamage * 1.25);
                iDamage = iDamage + (int)(iDamage * delta);

                fDelay = _.GetDistanceBetween(player, target) / 10.0f;

                player.DelayAssignCommand(() =>
                {
                    _.ApplyEffectToObject(DurationType.Instant, _.EffectLinkEffects(_.EffectVisualEffect(VisualEffect.Vfx_Imp_Sonic), _.EffectDamage(iDamage, DamageType.BaseWeapon)), target);
                }, fDelay);

                if (player.IsPlayer)
                {
                    SkillService.RegisterPCToNPCForSkill(player.Object, target, SkillType.ForceAlter);
                }

                break;

            case 3:
                iDamage = (int)(iDamage * 1.5);
                iDamage = iDamage + (int)(iDamage * delta);

                fDelay = _.GetDistanceBetween(player, target) / 10.0f;

                player.DelayAssignCommand(() =>
                {
                    _.ApplyEffectToObject(DurationType.Instant, _.EffectLinkEffects(_.EffectVisualEffect(VisualEffect.Vfx_Imp_Sonic), _.EffectDamage(iDamage, DamageType.BaseWeapon)), target);
                }, fDelay);

                if (player.IsPlayer)
                {
                    SkillService.RegisterPCToNPCForSkill(player.Object, target, SkillType.ForceAlter);
                }

                break;

            case 4:
                iDamage = (int)(iDamage * 1.6);
                iDamage = iDamage + (int)(iDamage * delta);

                // apply to target
                fDelay = _.GetDistanceBetween(player, target) / 10.0f;

                player.DelayAssignCommand(() =>
                {
                    _.ApplyEffectToObject(DurationType.Instant, _.EffectLinkEffects(_.EffectVisualEffect(VisualEffect.Vfx_Imp_Sonic), _.EffectDamage(iDamage, DamageType.BaseWeapon)), target);
                }, fDelay);

                if (player.IsPlayer)
                {
                    SkillService.RegisterPCToNPCForSkill(player.Object, target, SkillType.ForceAlter);
                }

                iCount += 1;

                // apply to next nearest creature in the spellcylinder
                oObject = _.GetFirstObjectInShape(Shape.SpellCone, iRange, target.Location, true, ObjectType.Creature, _.GetPosition(player));
                while (oObject.IsValid && iCount < 3)
                {
                    if (oObject != target && oObject != player)
                    {
                        fDelay = _.GetDistanceBetween(player, oObject) / 10.0f;
                        var creature = oObject;
                        player.DelayAssignCommand(() =>
                        {
                            _.ApplyEffectToObject(DurationType.Instant, _.EffectLinkEffects(_.EffectVisualEffect(VisualEffect.Vfx_Imp_Sonic), _.EffectDamage(iDamage, DamageType.BaseWeapon)), creature);
                        }, fDelay);

                        if (player.IsPlayer)
                        {
                            SkillService.RegisterPCToNPCForSkill(player.Object, oObject, SkillType.ForceAlter);
                        }
                        iCount += 1;
                    }
                    oObject = _.GetNextObjectInShape(Shape.SpellCone, iRange, target.Location, true, ObjectType.Creature, _.GetPosition(player));
                }
                break;

            case 5:
                iDamage = (int)(iDamage * 1.75);
                iDamage = iDamage + (int)(iDamage * delta);

                // apply to target
                fDelay = _.GetDistanceBetween(player, target) / 10.0f;

                player.DelayAssignCommand(() =>
                {
                    _.ApplyEffectToObject(DurationType.Instant, _.EffectLinkEffects(_.EffectVisualEffect(VisualEffect.Vfx_Imp_Sonic), _.EffectDamage(iDamage, DamageType.BaseWeapon)), target);
                }, fDelay);

                if (player.IsPlayer)
                {
                    SkillService.RegisterPCToNPCForSkill(player.Object, target, SkillType.ForceAlter);
                }
                iCount += 1;

                // apply to next nearest creature in the spellcylinder
                oObject = _.GetFirstObjectInShape(Shape.SpellCylinder, iRange, target.Location, true, ObjectType.Creature, _.GetPosition(player));
                while (oObject.IsValid && iCount < 4)
                {
                    if (oObject != target && oObject != player)
                    {
                        fDelay = _.GetDistanceBetween(player, oObject) / 10.0f;
                        var creature = oObject;
                        player.DelayAssignCommand(() =>
                        {
                            _.ApplyEffectToObject(DurationType.Instant, _.EffectLinkEffects(_.EffectVisualEffect(VisualEffect.Vfx_Imp_Sonic), _.EffectDamage(iDamage, DamageType.BaseWeapon)), creature);
                        }, fDelay);

                        if (player.IsPlayer)
                        {
                            SkillService.RegisterPCToNPCForSkill(player.Object, oObject, SkillType.ForceAlter);
                        }
                        iCount += 1;
                    }
                    oObject = _.GetNextObjectInShape(Shape.SpellCylinder, iRange, target.Location, true, ObjectType.Creature, _.GetPosition(player));
                }
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(spellTier));
            }
        }
示例#13
0
        public void OnConcentrationTick(NWCreature creature, NWObject target, int spellTier, int tick)
        {
            int amount;

            switch (spellTier)
            {
            case 1:
                amount = 5;
                break;

            case 2:
                amount = 6;
                break;

            case 3:
                amount = 7;
                break;

            case 4:
                amount = 8;
                break;

            case 5:
                amount = 10;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(spellTier));
            }

            var result = CombatService.CalculateAbilityResistance(creature, target.Object, SkillType.ForceAlter, ForceBalanceType.Dark);

            // +/- percent change based on resistance
            float delta = 0.01f * result.Delta;

            amount = amount + (int)(amount * delta);

            if (target.GetLocalInt("FORCE_DRAIN_IMMUNITY") == 1)
            {
                amount = 0;
            }

            var targetLocation = _.GetLocation(creature);
            var delay          = _.GetDistanceBetweenLocations(creature.Location, targetLocation) / 18.0f + 0.35f;

            creature.AssignCommand(() =>
            {
                _.PlaySound("plr_force_absorb");
                _.ApplyEffectToObject(DurationType.Temporary, _.EffectBeam(VisualEffect.Vfx_Beam_Drain, target, BodyNode.Hand), creature, 2.0F);
                _.ApplyEffectToObject(DurationType.Temporary, _.EffectBeam(VisualEffect.Vfx_Beam_Drain, creature, BodyNode.Hand), target, 2.0F);
                _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Imp_Negative_Energy), target);
                _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Imp_Reduce_Ability_Score), target);
            });



            // Only apply a heal if caster is not at max HP. Otherwise they'll get unnecessary spam.
            if (creature.CurrentHP < creature.MaxHP)
            {
                _.ApplyEffectToObject(DurationType.Instant, _.EffectHeal(amount), creature);
            }

            _.ApplyEffectToObject(DurationType.Instant, _.EffectDamage(amount, DamageType.Negative), target);

            if (creature.IsPlayer)
            {
                SkillService.RegisterPCToNPCForSkill(creature.Object, target, SkillType.ForceAlter);
            }
        }