Ejemplo n.º 1
0
        public static ReturnTypes spell_sulfurous_spray(int sn, int level, CharacterInstance ch, object vo)
        {
            var victim = (CharacterInstance)vo;

            var lvl = 0.GetHighestOfTwoNumbers(level);

            lvl = 19.GetLowestOfTwoNumbers(lvl);
            var damage = (int)(1.3f * (2 * lvl * SmaugRandom.Roll(7, 1) + 11));

            if (victim.SavingThrows.CheckSaveVsSpellStaff(lvl, victim))
            {
                damage /= 4;
            }
            return(ch.CauseDamageTo(victim, damage, sn));
        }
Ejemplo n.º 2
0
        public static ReturnTypes spell_black_lightning(int sn, int level, CharacterInstance ch, object vo)
        {
            var lvl = 0.GetHighestOfTwoNumbers(level);

            lvl = 10.GetLowestOfTwoNumbers(lvl);

            var dam = (int)(1.3f * (lvl * SmaugRandom.Roll(1, 50) + 135));

            var victim = (CharacterInstance)vo;

            if (victim.SavingThrows.CheckSaveVsSpellStaff(lvl, victim))
            {
                dam /= 4;
            }

            return(ch.CauseDamageTo(victim, dam, sn));
        }
Ejemplo n.º 3
0
        public static ReturnTypes spell_dispel_evil(int sn, int level, CharacterInstance ch, object vo)
        {
            var victim = (CharacterInstance)vo;
            var skill  = RepositoryManager.Instance.GetEntity <SkillData>(sn);

            if (!ch.IsNpc() && ch.IsEvil())
            {
                victim = ch;
            }

            if (victim.IsGood())
            {
                comm.act(ATTypes.AT_MAGIC, "Thoric protects $N.", ch, null, victim, ToTypes.Room);
                return(ReturnTypes.SpellFailed);
            }

            if (victim.IsNeutral())
            {
                comm.act(ATTypes.AT_MAGIC, "$N does not seem to be affected.", ch, null, victim, ToTypes.Character);
                return(ReturnTypes.SpellFailed);
            }

            if (CheckFunctions.CheckIfTrueCasting(victim.IsImmune(ResistanceTypes.Magic), skill, ch,
                                                  CastingFunctionType.Immune, victim))
            {
                return(ReturnTypes.SpellFailed);
            }

            var damage = SmaugRandom.Roll(level, 4);

            if (victim.SavingThrows.CheckSaveVsSpellStaff(level, victim))
            {
                damage /= 2;
            }

            return(ch.CauseDamageTo(victim, damage, sn));
        }