Пример #1
0
        public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
        {
            NWPlayer player = NWPlayer.Wrap(user.Object);

            target.RemoveEffect(EFFECT_TYPE_REGENERATE);
            PCSkill skill             = _skill.GetPCSkill(player, SkillType.FirstAid);
            int     luck              = _perk.GetPCPerkLevel(player, PerkType.Lucky);
            int     perkDurationBonus = _perk.GetPCPerkLevel(player, PerkType.HealingKitExpert) * 6 + (luck * 2);
            float   duration          = 30.0f + (skill.Rank * 0.4f) + perkDurationBonus;
            int     restoreAmount     = 1 + item.GetLocalInt("HEALING_BONUS") + player.EffectiveFirstAidBonus;

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

            if (perkBlastBonus > 0)
            {
                int blastHeal = restoreAmount * perkBlastBonus;
                if (_random.Random(100) + 1 <= luck / 2)
                {
                    blastHeal *= 2;
                }
                _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(blastHeal), target.Object);
            }

            Effect regeneration = _.EffectRegenerate(restoreAmount, 6.0f);

            _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, regeneration, target.Object, duration);
            player.SendMessage("You successfully treat " + target.Name + "'s wounds.");

            int xp = (int)_skill.CalculateRegisteredSkillLevelAdjustedXP(100, item.RecommendedLevel, skill.Rank);

            _skill.GiveSkillXP(player, SkillType.FirstAid, xp);
        }
Пример #2
0
        public void ApplyEffects(NWCreature user, NWItem item, NWObject target, Location targetLocation, CustomData customData)
        {
            NWPlayer player         = (user.Object);
            var      effectiveStats = _playerStat.GetPlayerItemEffectiveStats(player);

            target.RemoveEffect(EFFECT_TYPE_REGENERATE);
            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.ImmediateImprovement);

            if (perkBlastBonus > 0)
            {
                int blastHeal = restoreAmount * perkBlastBonus;
                if (_random.Random(100) + 1 <= luck / 2)
                {
                    blastHeal *= 2;
                }
                _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(blastHeal), target.Object);
            }

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

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

            Effect regeneration = _.EffectRegenerate(restoreAmount, interval);

            _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, regeneration, target.Object, duration);
            player.SendMessage("You successfully treat " + target.Name + "'s wounds. The healing kit will expire in " + duration + " seconds.");

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

            if (target.IsPlayer)
            {
                int xp = (int)_skill.CalculateRegisteredSkillLevelAdjustedXP(300, item.RecommendedLevel, rank);
                _skill.GiveSkillXP(player, SkillType.Medicine, xp);
            }
        }
Пример #3
0
        private void HealTarget(NWPlayer oPC, NWObject oTarget, int lightBonus, int level)
        {
            var   effectiveStats = _playerStat.GetPlayerItemEffectiveStats(oPC);
            int   amount;
            float length;
            int   regenAmount;
            int   min = 1;

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

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

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

            case 2:
                amount      = _random.D6(2, min);
                length      = 6.0f;
                regenAmount = 1;
                break;

            case 3:
                amount      = _random.D12(2, min);
                length      = 6.0f;
                regenAmount = 1;
                break;

            case 4:
                amount      = _random.D12(2, min);
                length      = 12.0f;
                regenAmount = 1;
                break;

            case 5:
                amount      = _random.D12(2, min);
                length      = 6.0f;
                regenAmount = 2;
                break;

            case 6:
                amount      = _random.D12(2, min);
                length      = 12.0f;
                regenAmount = 2;
                break;

            case 7:
                amount      = _random.D12(3, min);
                length      = 12.0f;
                regenAmount = 2;
                break;

            case 8:
                amount      = _random.D12(3, min);
                length      = 6.0f;
                regenAmount = 4;
                break;

            case 9:
                amount      = _random.D12(4, min);
                length      = 6.0f;
                regenAmount = 4;
                break;

            case 10:
                amount      = _random.D12(4, min);
                length      = 12.0f;
                regenAmount = 4;
                break;

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

            default: return;
            }

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

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

            Effect heal = _.EffectHeal(amount);

            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, heal, oTarget.Object);

            if (length > 0.0f && regenAmount > 0)
            {
                Effect regen = _.EffectRegenerate(regenAmount, 1.0f);
                _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, regen, oTarget.Object, length + 0.1f);
            }

            Effect vfx = _.EffectVisualEffect(VFX_IMP_HEALING_M);

            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, vfx, oTarget.Object);
        }
Пример #4
0
        public void OnImpact(NWPlayer oPC, NWObject oTarget)
        {
            int   level           = _perk.GetPCPerkLevel(oPC, PerkType.Recover);
            int   alterationBonus = oPC.EffectiveAlterationBonus;
            int   amountMin;
            int   amountMax;
            float length;
            int   regenAmount;

            switch (level)
            {
            case 1:
                amountMin   = 3;
                amountMax   = 5;
                length      = 18.0f;
                regenAmount = 1;
                break;

            case 2:
                amountMin   = 3;
                amountMax   = 5;
                length      = 30.0f;
                regenAmount = 1;
                break;

            case 3:
                amountMin   = 7;
                amountMax   = 10;
                length      = 30.0f;
                regenAmount = 1;
                break;

            case 4:
                amountMin   = 7;
                amountMax   = 10;
                length      = 30.0f;
                regenAmount = 2;
                break;

            case 5:
                amountMin   = 10;
                amountMax   = 13;
                length      = 30.0f;
                regenAmount = 2;
                break;

            case 6:
                amountMin   = 10;
                amountMax   = 13;
                length      = 30.0f;
                regenAmount = 3;
                break;

            default: return;
            }

            amountMin   += alterationBonus * 2;
            amountMax   += alterationBonus * 3;
            length      += alterationBonus;
            regenAmount += alterationBonus / 3;

            int healAmount = _random.Random(amountMin, amountMax) + 1;

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

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

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

            length = length + (wisdom * 4) + (intelligence * 2);

            Effect heal  = _.EffectHeal(healAmount);
            Effect regen = _.EffectRegenerate(regenAmount, 6.0f);

            _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, regen, oTarget.Object, length + 0.1f);
            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, heal, oTarget.Object);

            _skill.RegisterPCToAllCombatTargetsForSkill(oPC, SkillType.AlterationMagic);

            Effect vfx = _.EffectVisualEffect(VFX_IMP_HEALING_M);

            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, vfx, oTarget.Object);
        }