コード例 #1
0
ファイル: CrushingEarth.cs プロジェクト: zunath/Freescape
        public void OnImpact(NWPlayer oPC, NWObject oTarget)
        {
            int   level = _perk.GetPCPerkLevel(oPC, PerkType.CrushingEarth);
            int   damage;
            float stunLength = 0.0f;

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

            case 2:
                damage     = _random.Random(6) + 1;
                stunLength = 3.0f;
                break;

            case 3:
                damage     = _random.Random(6) + 1;
                damage    += _random.Random(6) + 1;
                stunLength = 3.0f;
                break;

            case 4:
                damage     = _random.Random(4) + 1;
                damage    += _random.Random(4) + 1;
                damage    += _random.Random(4) + 1;
                damage    += _random.Random(4) + 1;
                stunLength = 3.0f;
                break;

            case 5:
                damage     = _random.Random(8) + 1;
                damage    += _random.Random(8) + 1;
                damage    += _random.Random(8) + 1;
                stunLength = 3.0f;
                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_CHUNK_STONE_SMALL), oTarget.Object);

            if (stunLength > 0.0f)
            {
                _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, _.EffectStunned(), oTarget.Object, stunLength + 0.1f);
            }

            _skill.RegisterPCToNPCForSkill(oPC, (NWCreature)oTarget, SkillType.EvocationMagic);
            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectDamage(damage), oTarget.Object);
        }
コード例 #2
0
        public void OnImpact(NWPlayer player, NWObject target, int perkLevel)
        {
            int   damage;
            float duration;

            switch (perkLevel)
            {
            case 1:
                damage   = _random.D8(1);
                duration = 3;
                break;

            case 2:
                damage   = _random.D8(2);
                duration = 3;
                break;

            case 3:
                damage   = _random.D8(3);
                duration = 3;
                break;

            case 4:
                damage   = _random.D8(3);
                duration = 6;
                break;

            case 5:
                damage   = _random.D8(4);
                duration = 6;
                break;

            case 6:
                damage   = _random.D8(5);
                duration = 6;
                break;

            case 7:
                damage   = _random.D8(6);
                duration = 6;
                break;

            case 8:
                damage   = _random.D8(7);
                duration = 6;
                break;

            case 9:
                damage   = _random.D8(7);
                duration = 9;
                break;

            case 10:
                damage   = _random.D8(8);
                duration = 9;
                break;

            default: return;
            }

            _.ApplyEffectToObject(DURATION_TYPE_TEMPORARY, _.EffectStunned(), target, duration);
            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectDamage(damage, DAMAGE_TYPE_ELECTRICAL), target);
            _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectVisualEffect(VFX_IMP_SUNSTRIKE), target);
        }