Example #1
0
        public void OnImpact(NWPlayer oPC, NWObject oTarget)
        {
            int level = _perk.GetPCPerkLevel(oPC, PerkType.HolyShot);
            int damage;
            int alterationBonus = oPC.EffectiveAlterationBonus;

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

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

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

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

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

            default:
                return;
            }

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

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

            damage = (int)(damage * damageMultiplier);

            Effect vfx = _.EffectBeam(VFX_BEAM_SILENT_HOLY, oPC.Object, BODY_NODE_CHEST);

            _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, vfx, oTarget.Object, 1.5f);

            _skill.RegisterPCToNPCForSkill(oPC, NWCreature.Wrap(oTarget.Object), SkillType.AlterationMagic);

            oPC.AssignCommand(() =>
            {
                _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectDamage(damage), oTarget.Object);
            });
        }