Пример #1
0
        private static void _DoWindKnockdown(NWObject oCreature)
        {
            LoggingService.Trace(TraceComponent.Weather, "Checking whether " + GetName(oCreature) + " is blown over");
            int nDC         = (GetHitDice(oCreature) / 2) + 10;
            int nDiscipline = GetSkillRank(Skill.Discipline, oCreature);
            int nReflexSave = GetReflexSavingThrow(oCreature);
            int nSuccess;

            if (nDiscipline > nReflexSave)
            {
                nSuccess = GetIsSkillSuccessful(oCreature, Skill.Discipline, nDC) ? 1 : 0;
            }
            else
            {
                nSuccess = ReflexSave(oCreature, nDC) == SaveReturn.Success ? 1 : 0;
            }

            if (nSuccess == 0)
            {
                ApplyEffectToObject(DurationType.Temporary,
                                    AbilityService.EffectKnockdown(oCreature, 6.0f),
                                    oCreature,
                                    6.0f);
                FloatingTextStringOnCreature("*is unbalanced by a strong gust*", oCreature);
            }
        }
Пример #2
0
        private static void _Thunderstorm(NWLocation lLocation, int nPower)
        {
            float fRange = IntToFloat(nPower) * 0.1f;

            // Caps on sphere of influence
            if (fRange < 3.0)
            {
                fRange = 3.0f;
            }
            if (fRange > 6.0)
            {
                fRange = 6.0f;
            }

            //Effects
            Effect eEffBolt = EffectVisualEffect(VisualEffect.Vfx_Imp_Lightning_M);

            ApplyEffectAtLocation(DurationType.Instant, eEffBolt, lLocation);

            Effect     eEffDam;
            ObjectType nType;
            NWObject   oObject = GetFirstObjectInShape(Shape.Sphere, fRange, lLocation, false, ObjectType.Creature | ObjectType.Door | ObjectType.Placeable);

            while (GetIsObjectValid(oObject))
            {
                nType = GetObjectType(oObject);
                if (nType == ObjectType.Creature ||
                    nType == ObjectType.Door ||
                    nType == ObjectType.Placeable)
                {
                    eEffDam = EffectDamage(
                        FloatToInt(IntToFloat(nPower) - (GetDistanceBetweenLocations(lLocation, GetLocation(oObject)) * 10.0f)),
                        DamageType.Electrical);
                    ApplyEffectToObject(DurationType.Instant, eEffDam, oObject);

                    if (nType == ObjectType.Creature)
                    {
                        if (GetIsPC(oObject))
                        {
                            SendMessageToPC(oObject, FB_T_WEATHER_LIGHTNING);
                        }

                        PlayVoiceChat(VoiceChat.Pain1, oObject);
                        float duration = IntToFloat(d6(1));
                        ApplyEffectToObject(DurationType.Temporary, AbilityService.EffectKnockdown(oObject, duration), oObject, duration);
                    }
                }
                oObject = GetNextObjectInShape(Shape.Sphere, fRange, lLocation, false, ObjectType.Creature | ObjectType.Door | ObjectType.Placeable);
            }
        }
Пример #3
0
        private static void HandleGrenadeProficiency(NWPlayer oPC, NWObject target)
        {
            NWItem weapon = _.GetSpellCastItem();

            if (weapon.BaseItemType != BaseItem.Grenade)
            {
                return;
            }

            int   perkLevel = PerkService.GetCreaturePerkLevel(oPC, PerkType.GrenadeProficiency);
            int   chance    = 10 * perkLevel;
            float duration;

            switch (perkLevel)
            {
            case 1:
            case 2:
            case 3:
            case 4:
                duration = 6;
                break;

            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
                duration = 9;
                break;

            default: return;
            }


            if (RandomService.D100(1) <= chance)
            {
                _.ApplyEffectToObject(DurationType.Temporary, AbilityService.EffectKnockdown(target, duration), target, duration);
            }
        }