Exemple #1
0
        public Invader(SkillName specialty, InvasionType type)
            : base(GetAI(specialty), FightMode.Closest, 10, 1, .2, .1)
        {
            _Specialty = specialty;
            _InvasionType = type;

            if (_Specialty == SkillName.Bushido && Utility.RandomBool())
                _Sampire = true;

            if (Female = Utility.RandomBool())
            {
                //Body = 0x191;
                Name = NameList.RandomName("female");
            }
            else
            {
                //Body = 0x190;
                Name = NameList.RandomName("male");
            }

            SetBody();

            string title;

            if (_Sampire)
            {
                title = "the sampire";
            }
            else if (specialty == SkillName.Magery)
            {
                title = "the wizard";
            }
            else
            {
                title = String.Format("the {0}", Skills[specialty].Info.Title);
                if (Female && title.EndsWith("man"))
                    title = title.Substring(0, title.Length - 3) + "woman";
            }

            Title = title;

            SetStr(120, 170);
            SetDex(SpellCaster ? 75 : 150);
            SetInt(SpellCaster ? 1800 : 500);

            SetHits(800, 1250);

            if (AI == AIType.AI_Melee)
                SetDamage(15, 28);
            else if (!SpellCaster)
                SetDamage(12, 22);
            else
                SetDamage(8, 18);

            Fame = 8000;
            Karma = -8000;  

            SetResists();
            SetSkills();
            EquipSpecialty();

            _NextSpecial = DateTime.UtcNow;

            if (_Sampire)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
                    {
                        VampiricEmbraceSpell spell = new VampiricEmbraceSpell(this, null);
                        spell.Cast();
                    });
            }
        }
Exemple #2
0
        public override void OnThink()
        {
            base.OnThink();

            if (Combatant == null)
                return;

            if (CanDoSpecial && InRange(Combatant, 4) && 0.1 > Utility.RandomDouble() && _NextSpecial < DateTime.UtcNow)
            {
                DoSpecial();

                _NextSpecial = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(30, 60));
            }
            else if (_Sampire)
            {
                if (0.1 > Utility.RandomDouble() && Weapon is BaseWeapon && !(Weapon is Fists) && !((BaseWeapon)Weapon).Cursed)
                {
                    CurseWeaponSpell spell = new CurseWeaponSpell(this, null);
                    spell.Cast();
                }
                else if (!TransformationSpellHelper.UnderTransformation(this, typeof(VampiricEmbraceSpell)))
                {
                    VampiricEmbraceSpell spell = new VampiricEmbraceSpell(this, null);
                    spell.Cast();
                }
            }
        }