Ejemplo n.º 1
0
        public void IncreaseHungerLevel(NWPlayer oPC, int amount, bool isTainted)
        {
            if (!oPC.IsPlayer)
            {
                return;
            }

            PlayerCharacter entity = _db.PlayerCharacters.Single(x => x.PlayerID == oPC.GlobalID);

            entity.CurrentHunger += amount;
            if (entity.CurrentHunger > entity.MaxHunger)
            {
                entity.CurrentHunger = entity.MaxHunger;
            }

            oPC.AssignCommand(() =>
            {
                _.ActionPlayAnimation(ANIMATION_FIREFORGET_SALUTE);
            });

            oPC.SendMessage("Hunger: " + _menu.BuildBar(entity.CurrentHunger, entity.MaxHunger, 100));
            _db.SaveChanges();

            if (isTainted)
            {
                if (_random.Random(100) + 1 <= 40)
                {
                    int ticks = 600 + _random.Random(300);

                    _customEffect.ApplyCustomEffect(oPC, oPC, CustomEffectType.FoodDisease, ticks, 0);
                }
            }
        }
Ejemplo n.º 2
0
        public void OnImpact(NWPlayer oPC, NWObject oTarget)
        {
            int level = _perk.GetPCPerkLevel(oPC, PerkType.FireBlast);
            int damage;
            int ticks = 0;

            switch (level)
            {
            case 1:
                damage = _random.Random(6) + 1;
                break;

            case 2:
                damage = _random.Random(6) + 1;
                ticks  = 3;
                break;

            case 3:
                damage  = _random.Random(6) + 1;
                damage += _random.Random(6) + 1;
                ticks   = 4;
                break;

            case 4:
                damage  = _random.Random(4) + 1;
                damage += _random.Random(4) + 1;
                damage += _random.Random(4) + 1;
                damage += _random.Random(4) + 1;
                ticks   = 4;
                break;

            case 5:
                damage  = _random.Random(8) + 1;
                damage += _random.Random(8) + 1;
                damage += _random.Random(8) + 1;
                ticks   = 5;
                break;

            default:
                return;
            }

            int wisdom       = oPC.WisdomModifier;
            int intelligence = oPC.IntelligenceModifier;

            float damageMultiplier = 1.0f + (intelligence * 0.2f) + (wisdom * 0.1f);

            damage = (int)(damage * damageMultiplier);

            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectVisualEffect(VFX_COM_HIT_FIRE), oTarget.Object);

            if (ticks > 0)
            {
                _customEffect.ApplyCustomEffect(oPC, (NWCreature)oTarget, CustomEffectType.Burning, ticks, level);
            }

            _skill.RegisterPCToNPCForSkill(oPC, (NWCreature)oTarget, SkillType.EvocationMagic);
            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectDamage(damage, DAMAGE_TYPE_FIRE), oTarget.Object);
        }
Ejemplo n.º 3
0
        public void OnImpact(NWPlayer player, NWObject target, int perkLevel)
        {
            NWCreature targetCreature = target.Object;

            int   duration;
            int   uses;
            float range;

            switch (perkLevel)
            {
            case 1:
                duration = 30;
                uses     = 1;
                range    = 10f;
                break;

            case 2:
                duration = 30;
                uses     = 2;
                range    = 10f;
                break;

            case 3:
                duration = 60;
                uses     = 2;
                range    = 20f;
                break;

            case 4:
                duration = 60;
                uses     = 3;
                range    = 20f;
                break;

            case 5:
                duration = 60;
                uses     = 4;
                range    = 20f;
                break;

            case 6:
                duration = 60;
                uses     = 5;
                range    = 20f;
                break;

            case 7:     // Only available with background bonus
                duration = 90;
                uses     = 5;
                range    = 20f;
                break;

            default: return;
            }
            _customEffect.ApplyCustomEffect(player, targetCreature, CustomEffectType.ForceSpread, duration, perkLevel, uses + "," + range);
        }
Ejemplo n.º 4
0
        public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
        {
            string type   = item.GetLocalString("BONUS_TYPE");
            int    length = item.GetLocalInt("BONUS_LENGTH") * 60;
            int    amount = item.GetLocalInt("BONUS_AMOUNT");

            string data = $"{type},{amount}";

            _customEffect.ApplyCustomEffect(user, target.Object, CustomEffectType.FoodEffect, length, item.RecommendedLevel, data);
        }
Ejemplo n.º 5
0
        public void OnImpact(NWPlayer player, NWObject target, int perkLevel)
        {
            int duration = 60;

            var vfx = _.EffectVisualEffect(VFX_DUR_BLUR);

            vfx = _.TagEffect(vfx, "SHIELD_BOOST_VFX");

            _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, vfx, target, duration);
            _customEffect.ApplyCustomEffect(player, target.Object, CustomEffectType.ShieldBoost, duration, perkLevel, null);
        }
Ejemplo n.º 6
0
        public bool Run(params object[] args)
        {
            NWCreature oTarget = _.GetSpellTargetObject();

            if (_random.D100(1) > 5)
            {
                return(false);
            }

            _customEffect.ApplyCustomEffect(Object.OBJECT_SELF, oTarget, CustomEffectType.Bleeding, 12, 1, null);
            return(true);
        }
Ejemplo n.º 7
0
        public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
        {
            NWPlayer player               = (user.Object);
            var      effectiveStats       = _playerStat.GetPlayerItemEffectiveStats(player);
            int      rank                 = _skill.GetPCSkillRank(player, SkillType.Medicine);
            int      luck                 = _perk.GetPCPerkLevel(player, PerkType.Lucky);
            int      perkDurationBonus    = _perk.GetPCPerkLevel(player, PerkType.HealingKitExpert) * 6 + (luck * 2);
            float    duration             = 30.0f + (rank * 0.4f) + perkDurationBonus;
            int      restoreAmount        = 1 + item.GetLocalInt("HEALING_BONUS") + effectiveStats.Medicine + item.MedicineBonus;
            int      delta                = item.RecommendedLevel - rank;
            float    effectivenessPercent = 1.0f;

            if (delta > 0)
            {
                effectivenessPercent = effectivenessPercent - (delta * 0.1f);
            }

            restoreAmount = (int)(restoreAmount * effectivenessPercent);

            int perkBlastBonus = _perk.GetPCPerkLevel(player, PerkType.ImmediateForcePack);

            if (perkBlastBonus > 0)
            {
                int blastHeal = restoreAmount * perkBlastBonus;
                if (_random.Random(100) + 1 <= luck / 2)
                {
                    blastHeal *= 2;
                }

                _ability.RestoreFP(target.Object, blastHeal);
            }

            float          interval   = 6.0f;
            BackgroundType background = (BackgroundType)player.Class1;

            if (background == BackgroundType.Medic)
            {
                interval *= 0.5f;
            }

            string data = (int)interval + ", " + restoreAmount;

            _customEffect.ApplyCustomEffect(user, target.Object, CustomEffectType.ForcePack, (int)duration, restoreAmount, data);

            player.SendMessage("You successfully apply a force pack to " + target.Name + ". The force pack will expire in " + duration + " seconds.");

            _.DelayCommand(duration + 0.5f, () => { player.SendMessage("The force pack that you applied to " + target.Name + " has expired."); });

            int xp = (int)_skill.CalculateRegisteredSkillLevelAdjustedXP(300, item.RecommendedLevel, rank);

            _skill.GiveSkillXP(player, SkillType.Medicine, xp);
        }
Ejemplo n.º 8
0
        public void OnImpact(NWPlayer oPC, NWObject oTarget)
        {
            int perkLevel = _perk.GetPCPerkLevel(oPC, PerkType.Chainspell);
            int ticks     = 10; // 60 seconds base

            if (perkLevel >= 2)
            {
                ticks += 4; // +24 seconds (84 total)
            }
            if (perkLevel >= 3)
            {
                ticks += 4; // +24 seconds (108 total)
            }
            _customEffect.ApplyCustomEffect(oPC, oPC, CustomEffectType.Chainspell, ticks, perkLevel);

            _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, _.EffectVisualEffect(VFX_IMP_EVIL_HELP), oPC.Object, 6.1f);
        }
Ejemplo n.º 9
0
        public void OnImpact(NWPlayer oPC, NWObject oTarget)
        {
            int level = _perk.GetPCPerkLevel(oPC, PerkType.Aegis);
            int ticks;

            switch (level)
            {
            case 1:
            case 2:
                ticks = 10;
                break;

            case 3:
            case 4:
            case 5:
                ticks = 50;
                break;

            default: return;
            }

            int luck = _perk.GetPCPerkLevel(oPC, PerkType.Lucky) + oPC.EffectiveLuckBonus;

            if (_random.Random(100) + 1 <= luck)
            {
                ticks = ticks * 2;
            }

            int wisdom          = oPC.WisdomModifier;
            int intelligence    = oPC.IntelligenceModifier;
            int alterationBonus = oPC.EffectiveAlterationBonus / 2;

            ticks = ticks + intelligence + (wisdom * 2) + alterationBonus;

            _customEffect.ApplyCustomEffect(oPC, (NWPlayer)oTarget, CustomEffectType.Aegis, ticks, level);
            _skill.ApplyStatChanges((NWPlayer)oTarget, null);
            _skill.RegisterPCToAllCombatTargetsForSkill(oPC, SkillType.AlterationMagic);

            Effect vfx = _.EffectVisualEffect(VFX_IMP_AC_BONUS);

            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, vfx, oTarget.Object);
        }
Ejemplo n.º 10
0
        public void OnImpact(NWPlayer player, NWObject target, int level)
        {
            int ticks;

            switch (level)
            {
            default:
                ticks = 300;
                break;

            case 5:
            case 6:
                ticks = 600;
                break;
            }


            _customEffect.ApplyCustomEffect(player, target.Object, CustomEffectType.ForceAura, ticks, level, null);
            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectVisualEffect(VFX_IMP_AC_BONUS), target);
            _skill.RegisterPCToAllCombatTargetsForSkill(player, SkillType.LightSideAbilities, null);
        }
Ejemplo n.º 11
0
        public void OnImpact(NWPlayer player, NWObject target, int perkLevel)
        {
            int duration;

            switch (perkLevel)
            {
            case 1:
                duration = 24;
                break;

            case 2:
                duration = 48;
                break;

            case 3:
                duration = 72;
                break;

            default: throw new ArgumentOutOfRangeException();
            }

            _customEffect.ApplyCustomEffect(player, player, CustomEffectType.Chainspell, duration, perkLevel, null);
        }
Ejemplo n.º 12
0
 public void OnImpact(NWPlayer player, NWObject target, int perkLevel)
 {
     _customEffect.ApplyCustomEffect(player, player, CustomEffectType.Rest, -1, 0, null);
 }
Ejemplo n.º 13
0
        public void OnImpact(NWPlayer player, NWObject target, int perkLevel)
        {
            _customEffect.ApplyCustomEffect(player, player, CustomEffectType.AbsorptionField, 20, perkLevel, null);

            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectVisualEffect(VFX_IMP_GLOBE_USE), target);
        }
Ejemplo n.º 14
0
 public void OnImpact(NWPlayer player, NWObject target, int perkLevel)
 {
     _customEffect.ApplyCustomEffect(player, target.Object, CustomEffectType.PlasmaCell, 30, perkLevel, null);
 }
Ejemplo n.º 15
0
        public void OnImpact(NWPlayer player, NWObject target, int level)
        {
            var effectiveStats = _playerStat.GetPlayerItemEffectiveStats(player);
            int lightBonus     = effectiveStats.LightAbility;
            int amount;
            int length;
            int dotAmount;
            int min          = 1;
            int wisdom       = player.WisdomModifier;
            int intelligence = player.IntelligenceModifier;

            min += lightBonus / 3 + wisdom / 2 + intelligence / 3;

            switch (level)
            {
            case 1:
                amount    = _random.D6(2, min);
                length    = 0;
                dotAmount = 0;
                break;

            case 2:
                amount    = _random.D6(2, min);
                length    = 6;
                dotAmount = 1;
                break;

            case 3:
                amount    = _random.D12(2, min);
                length    = 6;
                dotAmount = 1;
                break;

            case 4:
                amount    = _random.D12(2, min);
                length    = 12;
                dotAmount = 1;
                break;

            case 5:
                amount    = _random.D12(2, min);
                length    = 6;
                dotAmount = 2;
                break;

            case 6:
                amount    = _random.D12(2, min);
                length    = 12;
                dotAmount = 2;
                break;

            case 7:
                amount    = _random.D12(3, min);
                length    = 12;
                dotAmount = 2;
                break;

            case 8:
                amount    = _random.D12(3, min);
                length    = 6;
                dotAmount = 4;
                break;

            case 9:
                amount    = _random.D12(4, min);
                length    = 6;
                dotAmount = 4;
                break;

            case 10:
                amount    = _random.D12(4, min);
                length    = 12;
                dotAmount = 4;
                break;

            case 11:     // Only attainable with background bonus
                amount    = _random.D12(5, min);
                length    = 12;
                dotAmount = 4;
                break;

            default: return;
            }

            int luck = _perk.GetPCPerkLevel(player, PerkType.Lucky) + effectiveStats.Luck;

            if (_random.Random(100) + 1 <= luck)
            {
                length = length * 2;
                player.SendMessage("Lucky force breach!");
            }

            Effect damage = _.EffectDamage(amount);

            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, damage, target.Object);

            if (length > 0.0f && dotAmount > 0)
            {
                _customEffect.ApplyCustomEffect(player, target.Object, CustomEffectType.ForceBreach, length, level, null);
            }

            _skill.RegisterPCToAllCombatTargetsForSkill(player, SkillType.LightSideAbilities, target.Object);

            Effect vfx = _.EffectVisualEffect(VFX_IMP_DOMINATE_S);

            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, vfx, target.Object);
        }
Ejemplo n.º 16
0
        public void OnImpact(NWPlayer player, NWObject target, int level)
        {
            var effectiveStats = _playerStat.GetPlayerItemEffectiveStats(player);
            int darkBonus      = effectiveStats.DarkAbility;
            int amount;
            int length;
            int dotAmount;
            int min = 1;

            int wisdom       = player.WisdomModifier;
            int intelligence = player.IntelligenceModifier;

            min += darkBonus / 3 + intelligence / 2 + wisdom / 3;

            switch (level)
            {
            case 1:
                amount    = _random.D6(2, min);
                length    = 0;
                dotAmount = 0;
                break;

            case 2:
                amount    = _random.D6(2, min);
                length    = 6;
                dotAmount = 1;
                break;

            case 3:
                amount    = _random.D12(2, min);
                length    = 6;
                dotAmount = 1;
                break;

            case 4:
                amount    = _random.D12(2, min);
                length    = 12;
                dotAmount = 1;
                break;

            case 5:
                amount    = _random.D12(2, min);
                length    = 6;
                dotAmount = 2;
                break;

            case 6:
                amount    = _random.D12(2, min);
                length    = 12;
                dotAmount = 2;
                break;

            case 7:
                amount    = _random.D12(3, min);
                length    = 12;
                dotAmount = 2;
                break;

            case 8:
                amount    = _random.D12(3, min);
                length    = 6;
                dotAmount = 4;
                break;

            case 9:
                amount    = _random.D12(4, min);
                length    = 6;
                dotAmount = 4;
                break;

            case 10:
                amount    = _random.D12(4, min);
                length    = 12;
                dotAmount = 4;
                break;

            case 11:     // Only attainable with background bonus
                amount    = _random.D12(5, min);
                length    = 12;
                dotAmount = 4;
                break;

            default: return;
            }

            int luck = _perk.GetPCPerkLevel(player, PerkType.Lucky) + effectiveStats.Luck;

            if (_random.Random(100) + 1 <= luck)
            {
                length = length * 2;
                player.SendMessage("Lucky force lightning!");
            }

            player.AssignCommand(() =>
            {
                Effect damage = _.EffectDamage(amount, DAMAGE_TYPE_ELECTRICAL);
                _.ApplyEffectToObject(DURATION_TYPE_INSTANT, damage, target);
            });

            if (length > 0.0f && dotAmount > 0)
            {
                _customEffect.ApplyCustomEffect(player, target.Object, CustomEffectType.ForceShock, length, level, dotAmount.ToString());
            }

            _skill.RegisterPCToAllCombatTargetsForSkill(player, SkillType.DarkSideAbilities, target.Object);

            player.AssignCommand(() =>
            {
                _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, _.EffectVisualEffect(VFX_BEAM_LIGHTNING), target, 1.0f);
            });
        }
Ejemplo n.º 17
0
        public void HandlePlasmaCellPerk(NWPlayer player, NWObject target)
        {
            if (!player.IsPlayer)
            {
                return;
            }
            if (player.RightHand.CustomItemType != CustomItemType.BlasterPistol)
            {
                return;
            }

            PCCustomEffect pcEffect = _data.GetAll <PCCustomEffect>().SingleOrDefault(x => x.PlayerID == player.GlobalID && x.CustomEffectID == (int)CustomEffectType.PlasmaCell);

            if (pcEffect == null)
            {
                return;
            }

            int chance;

            CustomEffectType[] damageTypes;
            switch (pcEffect.EffectiveLevel)
            {
            case 1:
                chance      = 10;
                damageTypes = new[] { CustomEffectType.FireCell };
                break;

            case 2:
                chance      = 10;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell };
                break;

            case 3:
                chance      = 20;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell };
                break;

            case 4:
                chance      = 20;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell };
                break;

            case 5:
                chance      = 30;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell };
                break;

            case 6:
                chance      = 30;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell, CustomEffectType.AcidCell };
                break;

            case 7:
                chance      = 40;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell, CustomEffectType.AcidCell };
                break;

            case 8:
                chance      = 40;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell, CustomEffectType.AcidCell, CustomEffectType.IceCell };
                break;

            case 9:
                chance      = 50;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell, CustomEffectType.AcidCell, CustomEffectType.IceCell };
                break;

            case 10:
                chance      = 50;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell, CustomEffectType.AcidCell, CustomEffectType.IceCell, CustomEffectType.DivineCell };
                break;

            default: return;
            }

            foreach (var effect in damageTypes)
            {
                if (_random.D100(1) <= chance)
                {
                    _customEffect.ApplyCustomEffect(player, target.Object, effect, _random.D6(1), pcEffect.EffectiveLevel, null);
                }
            }
        }
Ejemplo n.º 18
0
        public void OnImpact(NWPlayer player, NWObject target, int level)
        {
            int damage;
            int seconds;
            int dotDamage;

            switch (level)
            {
            case 1:
                damage    = _random.D4(1);
                seconds   = 6;
                dotDamage = 1;
                break;

            case 2:
                damage    = _random.D8(1);
                seconds   = 6;
                dotDamage = 1;
                break;

            case 3:
                damage    = _random.D8(2);
                seconds   = 6;
                dotDamage = 1;
                break;

            case 4:
                damage    = _random.D8(2);
                seconds   = 12;
                dotDamage = 2;
                break;

            case 5:
                damage    = _random.D8(3);
                seconds   = 12;
                dotDamage = 2;
                break;

            case 6:
                damage    = _random.D8(4);
                seconds   = 12;
                dotDamage = 2;
                break;

            case 7:
                damage    = _random.D8(5);
                seconds   = 12;
                dotDamage = 3;
                break;

            case 8:
                damage    = _random.D8(5);
                seconds   = 18;
                dotDamage = 3;
                break;

            case 9:
                damage    = _random.D8(6);
                seconds   = 24;
                dotDamage = 3;
                break;

            default: return;
            }

            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectDamage(damage, DAMAGE_TYPE_PIERCING), target);
            _customEffect.ApplyCustomEffect(player, target.Object, CustomEffectType.Bleeding, seconds, level, Convert.ToString(dotDamage));
        }
Ejemplo n.º 19
0
        public void HandlePlasmaCellPerk(NWPlayer player, NWObject target)
        {
            if (!player.IsPlayer)
            {
                return;
            }
            if (_.GetHasFeat((int)CustomFeatType.PlasmaCell, player) == FALSE)
            {
                return;
            }
            if (player.RightHand.CustomItemType != CustomItemType.BlasterPistol &&
                player.RightHand.CustomItemType != CustomItemType.BlasterRifle)
            {
                return;
            }

            int perkLevel = _perk.GetPCPerkLevel(player, PerkType.PlasmaCell);
            int chance;

            CustomEffectType[] damageTypes;
            switch (perkLevel)
            {
            case 1:
                chance      = 10;
                damageTypes = new[] { CustomEffectType.FireCell };
                break;

            case 2:
                chance      = 10;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell };
                break;

            case 3:
                chance      = 20;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell };
                break;

            case 4:
                chance      = 20;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell };
                break;

            case 5:
                chance      = 30;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell };
                break;

            case 6:
                chance      = 30;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell, CustomEffectType.AcidCell };
                break;

            case 7:
                chance      = 40;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell, CustomEffectType.AcidCell };
                break;

            case 8:
                chance      = 40;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell, CustomEffectType.AcidCell, CustomEffectType.IceCell };
                break;

            case 9:
                chance      = 50;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell, CustomEffectType.AcidCell, CustomEffectType.IceCell };
                break;

            case 10:
                chance      = 50;
                damageTypes = new[] { CustomEffectType.FireCell, CustomEffectType.ElectricCell, CustomEffectType.SonicCell, CustomEffectType.AcidCell, CustomEffectType.IceCell, CustomEffectType.DivineCell };
                break;

            default: return;
            }

            foreach (var effect in damageTypes)
            {
                if (_random.D100(1) <= chance)
                {
                    _customEffect.ApplyCustomEffect(player, target.Object, effect, _random.D6(1), perkLevel, null);
                }
            }
        }