Exemple #1
0
        public virtual void Open(Hero hero)
        {
            switch (HeapType)
            {
            case Type.Tomb:
                Wraith.SpawnAround(hero.pos);
                break;

            case Type.Skeleton:
                CellEmitter.Center(Pos).Start(Speck.Factory(Speck.RATTLE), 0.1f, 3);
                if (Items.Any(item => item.cursed))
                {
                    if (Wraith.SpawnAt(Pos) == null)
                    {
                        hero.Sprite.Emitter().Burst(ShadowParticle.Curse, 6);
                        hero.Damage(hero.HP / 2, this);
                    }
                    Sample.Instance.Play(Assets.SND_CURSED);
                }
                break;
            }

            HeapType = Type.Heap;
            Sprite.Link();
            Sprite.Drop();
        }
Exemple #2
0
    public static Monster CreateMonster(MonsterList monster, Game game, int level)
    {
        Monster newMonster = null;

        switch (monster)
        {
        case MonsterList.Bat:
            newMonster          = Bat.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Banshee:
            newMonster          = Banshee.Create(level, game);
            newMonster.Behavior = new TeleportAroundPlayer();
            break;

        case MonsterList.Demon:
            newMonster          = Demon.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Doll:
            newMonster          = Doll.Create(level, game);
            newMonster.Behavior = new DontLookAway();
            break;

        case MonsterList.Ghoul:
            newMonster          = Ghoul.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.LivingArmor:
            newMonster          = LivingArmor.Create(level, game);
            newMonster.Behavior = new DontLookAway();
            break;

        case MonsterList.Spider:
            newMonster          = Spider.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Wraith:
            newMonster          = Wraith.Create(level, game);
            newMonster.Behavior = new TeleportAroundPlayer();
            break;
        }

        newMonster.Health = newMonster.Health + (level - 1);
        newMonster.Attack = newMonster.Attack + (level - 1);

        return(newMonster);
    }
Exemple #3
0
    public Enemies[] InitEnemies()
    {
        Enemies[] enemArr = new Enemies[6];

        enemArr[0] = new Goblin();
        enemArr[1] = new Giant_Bat();
        enemArr[2] = new Giant();
        enemArr[3] = new Wraith();
        enemArr[4] = new Skeleton();
        enemArr[5] = new Dragon();

        return(enemArr);
    }
 void Awake()
 {
     wraith             = GetComponentInParent <Wraith>();
     enemiesInLookRange = new List <Collider2D>();
     Collider2D[] allOverlappingColliders = Physics2D.OverlapCircleAll(transform.position, GetComponent <CircleCollider2D>().radius);
     foreach (Collider2D p in allOverlappingColliders)
     {
         if (p.tag == "Player")
         {
             enemiesInLookRange.Add(p);
         }
     }
     if (enemiesInLookRange.Count != 0)
     {
         wraith.target = enemiesInLookRange[0].GetComponent <Transform>();
     }
 }
Exemple #5
0
            protected override void OnTick()
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                Mobile spawn;

                switch (Utility.Random(13))
                {
                default:
                case 0: spawn = new Skeleton(); break;

                case 1: spawn = new Zombie(); break;

                case 2: spawn = new Wraith(); break;

                case 3: spawn = new Spectre(); break;

                case 4: spawn = new Ghoul(); break;

                case 5: spawn = new Mummy(); break;

                case 6: spawn = new Bogle(); break;

                case 7: spawn = new RottingCorpse(); break;

                case 8: spawn = new BoneKnight(); break;

                case 9: spawn = new SkeletalKnight(); break;

                case 10: spawn = new Lich(); break;

                case 11: spawn = new LichLord(); break;

                case 12: spawn = new SkeletalMage(); break;
                }

                spawn.MoveToWorld(m_Item.Location, m_Item.Map);

                m_Item.Delete();
            }
Exemple #6
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            // Use this.Content to load your game content here
            GameContent = new GameContent(Content);

            GraphicsManager.PreferredBackBufferWidth  = Constants.SCREEN_WIDTH;
            GraphicsManager.PreferredBackBufferHeight = Constants.SCREEN_HEIGHT;
            GraphicsManager.ApplyChanges();

            _player = Player.Instance();

            WraithOne   = new Wraith(2, "Bane Fang the Mad", 200, 200, Constants.PLAYER_WIDTH, Constants.PLAYER_HEIGHT, Constants.SPRITE_SCALE, new Direction(180.0f), 30);
            WraithTwo   = new Wraith(3, "Snot Maggot", 420, 300, Constants.PLAYER_WIDTH, Constants.PLAYER_HEIGHT, Constants.SPRITE_SCALE, new Direction(180.0f), 100);
            WraithThree = new Wraith(1, "Gore Rot the Quick", 820, 300, Constants.PLAYER_WIDTH, Constants.PLAYER_HEIGHT, Constants.SPRITE_SCALE, new Direction(180.0f), 20);
            WraithFour  = new Wraith(1, "Wraith Four", 2000, 2000, Constants.PLAYER_WIDTH, Constants.PLAYER_HEIGHT, Constants.SPRITE_SCALE, new Direction(180.0f), 20);

            WraithOne.SetAlignment(Actor.Alignment.NEUTRAL);
            WraithTwo.SetAlignment(Actor.Alignment.HOSTILE);
            WraithThree.SetAlignment(Actor.Alignment.FRIENDLY);
            WraithFour.SetAlignment(Actor.Alignment.HOSTILE);

            UserInterface   = UserInterface.Instance();
            TargetingSystem = TargetingSystem.Instance();

            EntityContainer.Add(_player);
            EntityContainer.Add(WraithOne);
            EntityContainer.Add(WraithTwo);
            EntityContainer.Add(WraithThree);
            EntityContainer.Add(WraithFour);

            //ObstacleTest = new CollisionBox(590, 390, 50, 50);
            //ObstacleTest.GetPrimRectangle().SetColor(Color.Red);

            WorldCamera = new OrthographicCamera(GraphicsDevice);

            TransformMatrix = WorldCamera.GetViewMatrix();
        }
Exemple #7
0
            protected override void OnTick()
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                Mobile spawn;

                switch (Utility.Random(8))
                {
                default:
                case 0: spawn = new PatchworkSkeleton(); break;

                case 1: spawn = new Zombie(); break;

                case 2: spawn = new Wraith(); break;

                case 3: spawn = new SkeletalMage(); break;

                case 4: spawn = new Mummy(); break;

                case 5: spawn = new BoneKnight(); break;

                case 6: spawn = new SkeletalKnight(); break;

                case 7: spawn = new Lich(); break;
                }

                spawn.MoveToWorld(m_Item.Location, m_Item.Map);

                //Effects.PlaySound( p, map, 0x1FB );
                //Effects.SendLocationParticles( EffectItem.Create( p, map, EffectItem.DefaultDuration ), 0x3789, 1, 40, 0x3F, 3, 9907, 0 );

                m_Item.Delete();
            }
Exemple #8
0
            protected override void OnTick()
            {
                Item gem = Loot.RandomGem();
                Item reg = Loot.RandomPossibleReagent();

                Item equip;

                equip = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

                if (m_Item != null)
                {
                    m_Item.IsDigging = false;
                }

                if (equip is BaseWeapon)
                {
                    BaseWeapon weapon = (BaseWeapon)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                }
                else if (equip is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                }
                else if (equip is BaseJewel)
                {
                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo((BaseJewel)equip, attributeCount, min, max);
                }

                if (Utility.Random(100) < 45)
                {
                    switch (Utility.Random(16))
                    {
                    case 0:
                        Skeleton skel = new Skeleton();
                        skel.Location  = m_From.Location;
                        skel.Map       = m_From.Map;
                        skel.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            skel.IsParagon = true;
                        }

                        World.AddMobile(skel);
                        break;

                    case 1:
                        Ghoul ghoul = new Ghoul();
                        ghoul.Location  = m_From.Location;
                        ghoul.Map       = m_From.Map;
                        ghoul.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            ghoul.IsParagon = true;
                        }

                        World.AddMobile(ghoul);
                        break;

                    case 2:
                        Wraith wraith = new Wraith();
                        wraith.Location  = m_From.Location;
                        wraith.Map       = m_From.Map;
                        wraith.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            wraith.IsParagon = true;
                        }

                        World.AddMobile(wraith);
                        break;

                    case 3:
                        Lich lich = new Lich();
                        lich.Location  = m_From.Location;
                        lich.Map       = m_From.Map;
                        lich.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            lich.IsParagon = true;
                        }

                        World.AddMobile(lich);
                        break;

                    case 4:
                        LichLord lichl = new LichLord();
                        lichl.Location  = m_From.Location;
                        lichl.Map       = m_From.Map;
                        lichl.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            lichl.IsParagon = true;
                        }

                        World.AddMobile(lichl);
                        break;

                    case 5:
                        AncientLich alich = new AncientLich();
                        alich.Location  = m_From.Location;
                        alich.Map       = m_From.Map;
                        alich.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            alich.IsParagon = true;
                        }

                        World.AddMobile(alich);
                        break;

                    case 6:
                        Mummy mum = new Mummy();
                        mum.Location  = m_From.Location;
                        mum.Map       = m_From.Map;
                        mum.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            mum.IsParagon = true;
                        }

                        World.AddMobile(mum);
                        break;

                    case 7:
                        Zombie zom = new Zombie();
                        zom.Location  = m_From.Location;
                        zom.Map       = m_From.Map;
                        zom.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            zom.IsParagon = true;
                        }

                        World.AddMobile(zom);
                        break;

                    case 8:
                        SkeletalKnight sk = new SkeletalKnight();
                        sk.Location  = m_From.Location;
                        sk.Map       = m_From.Map;
                        sk.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            sk.IsParagon = true;
                        }

                        World.AddMobile(sk);
                        break;

                    case 9:
                        SkeletalMage sm = new SkeletalMage();
                        sm.Location  = m_From.Location;
                        sm.Map       = m_From.Map;
                        sm.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            sm.IsParagon = true;
                        }

                        World.AddMobile(sm);
                        break;

                    case 10:
                        BoneKnight bk = new BoneKnight();
                        bk.Location  = m_From.Location;
                        bk.Map       = m_From.Map;
                        bk.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bk.IsParagon = true;
                        }

                        World.AddMobile(bk);
                        break;

                    case 11:
                        BoneMagi bm = new BoneMagi();
                        bm.Location  = m_From.Location;
                        bm.Map       = m_From.Map;
                        bm.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bm.IsParagon = true;
                        }

                        World.AddMobile(bm);
                        break;

                    case 12:
                        Spectre spec = new Spectre();
                        spec.Location  = m_From.Location;
                        spec.Map       = m_From.Map;
                        spec.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            spec.IsParagon = true;
                        }

                        World.AddMobile(spec);
                        break;

                    case 13:
                        Shade shade = new Shade();
                        shade.Location  = m_From.Location;
                        shade.Map       = m_From.Map;
                        shade.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            shade.IsParagon = true;
                        }

                        World.AddMobile(shade);
                        break;

                    case 14:
                        Bogle bog = new Bogle();
                        bog.Location  = m_From.Location;
                        bog.Map       = m_From.Map;
                        bog.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bog.IsParagon = true;
                        }

                        World.AddMobile(bog);
                        break;

                    case 15:
                        FrostDragon fDragon = new FrostDragon();
                        fDragon.PackGold(50000);
                        fDragon.Location  = m_From.Location;
                        fDragon.Map       = m_From.Map;
                        fDragon.Combatant = m_From;
                        if (Utility.Random(100) < 20)
                        {
                            fDragon.IsParagon = true;
                            fDragon.PackItem(new SoulweaponBox());
                        }
                        break;
                    }
                    m_From.SendMessage(6, "你驚醒了沉睡中的亡靈.");
                }
                else if (m_From.Skills[SkillName.Mining].Base < 15.0)
                {
                    if (Utility.Random(100) < 55)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        switch (Utility.Random(3))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 35.0)
                {
                    if (Utility.Random(100) < 45)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 4);
                        reg.Amount = Utility.RandomMinMax(2, 4);

                        switch (Utility.Random(5))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 20, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 5, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 50.0)
                {
                    if (Utility.Random(100) < 35)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 10);
                        reg.Amount = Utility.RandomMinMax(2, 10);

                        switch (Utility.Random(6))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 40, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 10, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 75.0)
                {
                    if (Utility.Random(100) < 25)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 20);
                        reg.Amount = Utility.RandomMinMax(2, 20);

                        switch (Utility.Random(7))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 50, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 13, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 90.0)
                {
                    if (Utility.Random(100) < 15)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 30);
                        reg.Amount = Utility.RandomMinMax(2, 30);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 7:
                            m_From.AddToBackpack(new GraveItem());
                            m_From.SendMessage("你挖到了一些前人留下的寶藏.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 150.0)
                {
                    if (Utility.Random(10) < 1)//概率 zp
                    {
                        Item i;
                        switch (Utility.Random(13))
                        {
                        case 0: { i = new ArmoredNinjaBelt(); break; }

                        case 1: { i = new ButchersResolve(); break; }

                        case 2: { i = new FollowerOfTheOldLord(); break; }

                        case 3: { i = new SkirtOfTheAmazon(); break; }

                        case 4: { i = new HolyHammerOfExorcism(); break; }

                        case 5: { i = new ArmoredCloak(); break; }

                        case 6: { i = new SoulweaponBox(); break; }

                        default:
                        case 7:
                        case 8:
                        case 9:
                        case 10:
                        case 11:
                        case 12: { i = new AutoResPotion(); break; }
                        }
                        m_From.SendMessage(25, "你挖到了一些很有價值的東西.");
                        m_From.PlaySound(0x41e);
                        m_From.AddToBackpack(i);
                        m_From.SendGump(new totGump(i));
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 40);
                        reg.Amount = Utility.RandomMinMax(2, 40);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 7:
                            m_From.AddToBackpack(new GraveItem());
                            m_From.SendMessage("你挖到了一些前人留下的寶藏.");
                            break;
                        }
                    }
                }
                else
                {
                    m_From.SendMessage("你什麽都沒有挖掘到.");
                }

                Stop();
            }
Exemple #9
0
        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            Map     map = from.Map;
            Point3D loc = from.Location;

            HarvestResource res = vein.PrimaryResource;

            if (res == resource)
            {
                try
                {
                    if (from.Karma > -2459)
                    {
                        Titles.AwardKarma(from, -50, true);
                    }

                    if (Utility.RandomMinMax(1, 100) < 3)                         // CHECK TO SEE IF THEY WERE WITNESSED DIGGING UP A GRAVE 2%
                    {
                        int caught = 1;
                        if (from.Skills[SkillName.Hiding].Value >= 30)
                        {
                            from.SendMessage("Someone passed by, but your stealthiness has avoided you from being seen.");
                            if (from.CheckSkill(SkillName.Stealth, 0, 100))
                            {
                                caught = 0;
                            }
                        }
                        if (caught > 0)
                        {
                            from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "Someone has spotted you in the distance!", from.NetState);
                            from.SendMessage("You have been reported as a criminal!");
                            from.Criminal = true;
                            Server.Items.DisguiseTimers.RemoveDisguise(from);
                        }
                    }

                    map = from.Map;

                    if (map == null)
                    {
                        return;
                    }

                    BaseCreature spawned = new Zombie();

                    switch (Utility.Random(19))
                    {
                    case 0: spawned = new Zombie(); break;

                    case 1: spawned = new Skeleton(); break;

                    case 2: spawned = new Ghoul(); break;

                    case 3: spawned = new Shade(); break;

                    case 4: spawned = new Spectre(); break;

                    case 5: spawned = new Wraith(); break;

                    case 6: spawned = new BoneKnight(); break;

                    case 7: spawned = new BoneMagi(); break;

                    case 8: spawned = new Ghostly(); break;

                    case 9: spawned = new Lich(); break;

                    case 10: spawned = new LichLord(); break;

                    case 11: spawned = new Mummy(); break;

                    case 12: spawned = new RottingCorpse(); break;

                    case 13: spawned = new Shade(); break;

                    case 14: spawned = new SkeletalKnight(); break;

                    case 15: spawned = new SkeletalWizard(); break;

                    case 16: spawned = new SkeletalMage(); break;

                    case 17: spawned = new Phantom(); break;

                    case 18: spawned = new Vampire(); break;
                    }

                    int nSpiritSpeak = (int)(from.Skills[SkillName.SpiritSpeak].Value / 10);

                    string sSaying = "";
                    switch (Utility.Random(9))
                    {
                    case 0: sSaying = "Who has disturbed me!"; break;

                    case 1: sSaying = "You dare steal from my grave?"; break;

                    case 2: sSaying = "Those that take from me will join me!"; break;

                    case 3: sSaying = "Your soul is now mine for the taking!"; break;

                    case 4: sSaying = "Who dares waken me?"; break;

                    case 5: sSaying = "Your life will be extinguished!"; break;

                    case 6: sSaying = "Do you have no respect for the dead?"; break;

                    case 7: sSaying = "I have been waiting to feast off the living!"; break;

                    case 8: sSaying = "Soon you will join my legion of the dead!"; break;
                    }

                    if ((spawned != null) && (Utility.Random(100) > (nSpiritSpeak + 85)))                             // 10% chance you will get a grave raiser
                    {
                        from.CheckSkill(SkillName.SpiritSpeak, 0, 100);
                        int offset = Utility.Random(8) * 2;

                        for (int i = 0; i < m_Offsets.Length; i += 2)
                        {
                            int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
                            int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];

                            if (map.CanSpawnMobile(x, y, from.Z))
                            {
                                spawned.OnBeforeSpawn(new Point3D(x, y, from.Z), map);
                                spawned.Home      = new Point3D(x, y, from.Z);
                                spawned.RangeHome = 5;
                                spawned.Title    += " [Awakened]";
                                spawned.MoveToWorld(new Point3D(x, y, from.Z), map);
                                spawned.Say(sSaying);
                                spawned.ControlSlots = 666;
                                spawned.Combatant    = from;
                                return;
                            }
                            else
                            {
                                int z = map.GetAverageZ(x, y);

                                if (map.CanSpawnMobile(x, y, z))
                                {
                                    spawned.OnBeforeSpawn(new Point3D(x, y, z), map);
                                    spawned.Home      = new Point3D(x, y, z);
                                    spawned.RangeHome = 5;
                                    spawned.Title    += " [Awakened]";
                                    spawned.MoveToWorld(new Point3D(x, y, z), map);
                                    spawned.Say(sSaying);
                                    spawned.ControlSlots = 666;
                                    spawned.Combatant    = from;
                                    return;
                                }
                            }
                        }
                        spawned.OnBeforeSpawn(from.Location, from.Map);
                        spawned.Home      = from.Location;
                        spawned.RangeHome = 5;
                        spawned.Title    += " [Awakened]";
                        spawned.MoveToWorld(from.Location, from.Map);
                        spawned.Say(sSaying);
                        spawned.ControlSlots = 666;
                        spawned.Combatant    = from;
                    }

                    int digger = (int)(from.Skills[SkillName.Forensics].Value / 10);
                    if ((2 + digger) > Utility.Random(100))                       // chance to dig up a box
                    {
                        if (from.CheckSkill(SkillName.Forensics, 0, 125))
                        {
                            Item chest = new GraveChest(6, from);
                            switch (Utility.Random(10 + digger))
                            {
                            case 0: chest = new GraveChest(1, from); break;

                            case 1: chest = new GraveChest(1, from); break;

                            case 2: chest = new GraveChest(1, from); break;

                            case 3: chest = new GraveChest(1, from); break;

                            case 4: chest = new GraveChest(1, from); break;

                            case 5: chest = new GraveChest(1, from); break;

                            case 6: chest = new GraveChest(2, from); break;

                            case 7: chest = new GraveChest(2, from); break;

                            case 8: chest = new GraveChest(2, from); break;

                            case 9: chest = new GraveChest(2, from); break;

                            case 10: chest = new GraveChest(2, from); break;

                            case 11: chest = new GraveChest(3, from); break;

                            case 12: chest = new GraveChest(3, from); break;

                            case 13: chest = new GraveChest(3, from); break;

                            case 14: chest = new GraveChest(3, from); break;

                            case 15: chest = new GraveChest(4, from); break;

                            case 16: chest = new GraveChest(4, from); break;

                            case 17: chest = new GraveChest(4, from); break;

                            case 18: chest = new GraveChest(5, from); break;

                            case 19: chest = new GraveChest(5, from); break;
                            }
                            if (chest != null)
                            {
                                chest.MoveToWorld(loc, map);
                                from.SendMessage("you dig up a graveyard chest.");
                            }
                        }
                    }
                }
                catch
                {
                }
            }
        }
Exemple #10
0
        public override void OnClick()
        {
            Race race = ((Player)pm).Race;

            switch (race)
            {
            case Race.Ogre:
            {
                pm.Target = new OgreTarget();
                pm.SendMessage("Target a creature to bash!");
                break;
            }

            case Race.Terathan:
            {
                mobList = new List <Mobile>();

                foreach (Mobile mobile in pm.GetMobilesInRange(8))
                {
                    if (mobile.AccessLevel > pm.AccessLevel)
                    {
                        continue;
                    }
                    else if (mobile.Blessed || !mobile.Alive)
                    {
                        continue;
                    }
                    else if (mobile == pm)
                    {
                        continue;
                    }
                    else
                    {
                        mobList.Add(mobile);
                    }
                }

                if (mobList != null)
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(8.0), new TimerCallback(FinishWebs));

                    pm.PublicOverheadMessage(MessageType.Regular, pm.EmoteHue, false, "*Begins hurling webs at nearby creatures*");

                    for (int i = 0; i < mobList.Count; i++)
                    {
                        Mobile m = mobList[i];

                        if (m is PlayerMobile && 0.51 > Utility.RandomDouble())
                        {
                            m.SendMessage("You've been struck by a terathan web!");
                        }

                        m.CantWalk = true;

                        Effects.SendMovingEffect(pm, m, 4308, 0, 10, false, false);
                    }

                    Effects.PlaySound(pm.Location, pm.Map, 0x027);

                    pm.NextRaceAbility = TimeSpan.FromMinutes(1);
                }

                break;
            }

            case Race.Liche:
            {
                if (pm.Followers >= pm.FollowersMax)
                {
                    pm.SendMessage("You already have too many followers to summon more.");
                }

                else
                {
                    do
                    {
                        BaseCreature bc = null;

                        switch (Utility.Random(3))
                        {
                        case 0: bc = new Skeleton(); break;

                        case 1: bc = new Zombie(); break;

                        case 2: bc = new Wraith(); break;
                        }

                        if (bc != null && BaseCreature.Summon(bc, true, pm, Point3D.Zero, 0x1E2, TimeSpan.FromMinutes(1.5)))
                        {
                            bc.MoveToWorld(new Point3D(pm.X + Utility.RandomMinMax(1, 3), pm.Y - Utility.RandomMinMax(0, 3), pm.Z), pm.Map);

                            Effects.SendLocationEffect(pm.Location, pm.Map, 0x3709, 15, 945, 0);
                        }
                    }while (pm.Followers < pm.FollowersMax);

                    pm.NextRaceAbility = TimeSpan.FromMinutes(2.0);
                }
                break;
            }

            case Race.HalfDaemon:
            {
                if (pm.AbilityActive)
                {
                    pm.RaceBody        = 0;
                    pm.BodyDamageBonus = 0;
                    pm.AdjustBody();

                    pm.Str -= 40;
                    pm.Dex -= 20;
                    pm.Int += 60;

                    pm.AbilityActive = false;

                    pm.PublicOverheadMessage(MessageType.Regular, pm.EmoteHue, false, String.Format("*{0} begins to shrink, taking the form of a human*", pm.Name));
                }

                else
                {
                    for (int x = 1; x <= 2; x++)
                    {
                        Item toDisarm = pm.FindItemOnLayer(Layer.OneHanded);

                        if (toDisarm == null || !toDisarm.Movable)
                        {
                            toDisarm = pm.FindItemOnLayer(Layer.TwoHanded);
                        }

                        Container pack = pm.Backpack;
                        pack.DropItem(toDisarm);
                    }

                    pm.RaceBody = 792;
                    pm.AdjustBody();
                    pm.BodyDamageBonus = 36;

                    pm.Str += 40;
                    pm.Dex += 20;
                    pm.Int -= 60;

                    pm.AbilityActive = true;

                    pm.PublicOverheadMessage(MessageType.Regular, pm.EmoteHue, false, String.Format("*{0}'s flesh begins to buldge and tear as something emerges from within*", pm.Name));
                }

                break;
            }

            case Race.Shapeshifter:
            {
                pm.Target = new ShapeshifterTarget();
                pm.SendMessage("Select a creature to assume their form.");
                break;
            }

            case Race.Marid:
            {
                if (pm.AbilityActive)
                {
                    pm.AbilityActive = false;
                    pm.CanSwim       = false;
                    Effects.SendLocationParticles(EffectItem.Create(pm.Location, pm.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);

                    try
                    {
                        IMount mount = pm.Mount;
                        mount.Rider = null;
                        ((EtherealMount)mount).Delete();
                    }

                    catch { }
                }

                else
                {
                    for (int x = 1; x <= 2; x++)
                    {
                        Item toDisarm = pm.FindItemOnLayer(Layer.OneHanded);

                        if (toDisarm == null || !toDisarm.Movable)
                        {
                            toDisarm = pm.FindItemOnLayer(Layer.TwoHanded);
                        }

                        Container pack = pm.Backpack;
                        pack.DropItem(toDisarm);
                    }

                    pm.AbilityActive = true;
                    pm.PublicOverheadMessage(MessageType.Regular, pm.EmoteHue, false, String.Format("*A mass of vapors condenses under {0}, forming a steed*", pm.Name));
                    pm.CanSwim = true;

                    bool isWater = false;

                    Map          map   = pm.Map;
                    LandTile     land  = map.Tiles.GetLandTile(pm.X, pm.Y);
                    StaticTile[] tiles = map.Tiles.GetStaticTiles(pm.X, pm.Y);

                    isWater = (land.Z == pm.Z && ((land.ID >= 168 && land.ID <= 171) || (land.ID >= 310 && land.ID <= 311)));

                    for (int i = 0; i < tiles.Length; ++i)
                    {
                        StaticTile tile = tiles[i];
                        isWater = (tile.ID >= 0x1796 && tile.ID <= 0x17B2);
                    }

                    try
                    {
                        if (isWater)
                        {
                            EtherealMount seaHorse = new EtherealSeaHorse();
                            seaHorse.MoveToWorld(pm.Location);
                            seaHorse.Rider = pm;
                        }

                        else
                        {
                            EtherealMount horse = new EtherealHorse();
                            horse.MoveToWorld(pm.Location);
                            horse.Rider = pm;
                        }
                    }

                    catch { }
                }

                break;
            }

            default: break;
            }
        }
        public static void OpenCoffin(Mobile from, int item, int level)
        {
            if (Utility.RandomMinMax(1, 10) == 1)                 // 10% CHANCE FOR RAISING DEAD IN COFFINS
            {
                if (item == 0x2800 || item == 0x2801 || item == 0x27E9 || item == 0x27EA || item == 0x27E0 || item == 0x280A || item == 0x2802 || item == 0x2803)
                {
                    int seance = (int)(from.Skills[SkillName.SpiritSpeak].Value);

                    if (!Server.Misc.GetPlayerInfo.LuckyPlayer(from.Luck) && Utility.RandomMinMax(1, 100) > seance)
                    {
                        if (level > 6)
                        {
                            level = 6;
                        }
                        level = level * 3;

                        from.RevealingAction();

                        BaseCreature spawned = new Zombie();

                        switch (Utility.Random(level))
                        {
                        case 0: spawned = new Skeleton(); break;

                        case 1: spawned = new Zombie(); break;

                        case 2: spawned = new Ghoul(); break;

                        case 3: spawned = new Shade(); break;

                        case 4: spawned = new Spectre(); break;

                        case 5: spawned = new Wraith(); break;

                        case 6: spawned = new Phantom(); break;

                        case 7: spawned = new SkeletalWizard(); break;

                        case 8: spawned = new BoneKnight(); break;

                        case 9: spawned = new BoneMagi(); break;

                        case 10: spawned = new SkeletalKnight(); break;

                        case 11: spawned = new SkeletalMage(); break;

                        case 12: spawned = new Mummy(); break;

                        case 13: spawned = new Vampire(); break;

                        case 14: spawned = new Ghostly(); break;

                        case 15: spawned = new Lich(); break;

                        case 16: spawned = new LichLord(); break;

                        case 17: spawned = new RottingCorpse(); break;
                        }

                        string sSaying = "";
                        switch (Utility.Random(9))
                        {
                        case 0: sSaying = "Who has disturbed me!"; break;

                        case 1: sSaying = "You dare steal from my grave?"; break;

                        case 2: sSaying = "Those that take from me will join me!"; break;

                        case 3: sSaying = "Your soul is now mine for the taking!"; break;

                        case 4: sSaying = "Who dares waken me?"; break;

                        case 5: sSaying = "Your life will be extinguished!"; break;

                        case 6: sSaying = "Do you have no respect for the dead?"; break;

                        case 7: sSaying = "I have been waiting to feast off the living!"; break;

                        case 8: sSaying = "Soon you will join my legion of the dead!"; break;
                        }

                        spawned.OnBeforeSpawn(from.Location, from.Map);
                        spawned.Home      = from.Location;
                        spawned.RangeHome = 5;
                        spawned.Title    += " [Awakened]";
                        spawned.MoveToWorld(from.Location, from.Map);
                        spawned.Say(sSaying);
                        spawned.ControlSlots = 666;
                        spawned.Combatant    = from;
                    }
                }
            }
        }
            protected override void OnTick()
            {
                Item gem = Loot.RandomGem();
                Item reg = Loot.RandomPossibleReagent();

                Item equip;

                equip = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

                if (m_Item != null)
                {
                    m_Item.IsDigging = false;
                }

                if (equip is BaseWeapon)
                {
                    BaseWeapon weapon = (BaseWeapon)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                }
                else if (equip is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                }
                else if (equip is BaseJewel)
                {
                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo((BaseJewel)equip, attributeCount, min, max);
                }

                if (Utility.Random(100) < 85)
                {
                    switch (Utility.Random(15))
                    {
                    case 0:
                        Skeleton skel = new Skeleton();
                        skel.Location  = m_From.Location;
                        skel.Map       = m_From.Map;
                        skel.Combatant = m_From;

                        World.AddMobile(skel);
                        break;

                    case 1:
                        Ghoul ghoul = new Ghoul();
                        ghoul.Location  = m_From.Location;
                        ghoul.Map       = m_From.Map;
                        ghoul.Combatant = m_From;

                        World.AddMobile(ghoul);
                        break;

                    case 2:
                        Wraith wraith = new Wraith();
                        wraith.Location  = m_From.Location;
                        wraith.Map       = m_From.Map;
                        wraith.Combatant = m_From;

                        World.AddMobile(wraith);
                        break;

                    case 3:
                        Lich lich = new Lich();
                        lich.Location  = m_From.Location;
                        lich.Map       = m_From.Map;
                        lich.Combatant = m_From;

                        World.AddMobile(lich);
                        break;

                    case 4:
                        LichLord lichl = new LichLord();
                        lichl.Location  = m_From.Location;
                        lichl.Map       = m_From.Map;
                        lichl.Combatant = m_From;

                        World.AddMobile(lichl);
                        break;

                    case 5:
                        AncientLich alich = new AncientLich();
                        alich.Location  = m_From.Location;
                        alich.Map       = m_From.Map;
                        alich.Combatant = m_From;

                        World.AddMobile(alich);
                        break;

                    case 6:
                        Mummy mum = new Mummy();
                        mum.Location  = m_From.Location;
                        mum.Map       = m_From.Map;
                        mum.Combatant = m_From;

                        World.AddMobile(mum);
                        break;

                    case 7:
                        Zombie zom = new Zombie();
                        zom.Location  = m_From.Location;
                        zom.Map       = m_From.Map;
                        zom.Combatant = m_From;

                        World.AddMobile(zom);
                        break;

                    case 8:
                        SkeletalKnight sk = new SkeletalKnight();
                        sk.Location  = m_From.Location;
                        sk.Map       = m_From.Map;
                        sk.Combatant = m_From;

                        World.AddMobile(sk);
                        break;

                    case 9:
                        SkeletalMage sm = new SkeletalMage();
                        sm.Location  = m_From.Location;
                        sm.Map       = m_From.Map;
                        sm.Combatant = m_From;

                        World.AddMobile(sm);
                        break;

                    case 10:
                        BoneKnight bk = new BoneKnight();
                        bk.Location  = m_From.Location;
                        bk.Map       = m_From.Map;
                        bk.Combatant = m_From;

                        World.AddMobile(bk);
                        break;

                    case 11:
                        BoneMagi bm = new BoneMagi();
                        bm.Location  = m_From.Location;
                        bm.Map       = m_From.Map;
                        bm.Combatant = m_From;

                        World.AddMobile(bm);
                        break;

                    case 12:
                        Spectre spec = new Spectre();
                        spec.Location  = m_From.Location;
                        spec.Map       = m_From.Map;
                        spec.Combatant = m_From;

                        World.AddMobile(spec);
                        break;

                    case 13:
                        Shade shade = new Shade();
                        shade.Location  = m_From.Location;
                        shade.Map       = m_From.Map;
                        shade.Combatant = m_From;

                        World.AddMobile(shade);
                        break;
                    }
                    m_From.SendMessage("The spirits have rose from the dead..");
                }
                else if (m_From.Skills[SkillName.Mining].Base < 15.0)
                {
                    if (Utility.Random(100) < 85)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        switch (Utility.Random(3))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up a gem.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up a reagent.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 35.0)
                {
                    if (Utility.Random(100) < 85)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 4);
                        reg.Amount = Utility.RandomMinMax(2, 4);

                        switch (Utility.Random(5))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 20, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 5, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 50.0)
                {
                    if (Utility.Random(100) < 85)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 10);
                        reg.Amount = Utility.RandomMinMax(2, 10);

                        switch (Utility.Random(6))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 40, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 10, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("You dig up a bones.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 75.0)
                {
                    if (Utility.Random(100) < 85)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 20);
                        reg.Amount = Utility.RandomMinMax(2, 20);

                        switch (Utility.Random(7))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 50, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 13, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("You dig up a bones.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 90.0)
                {
                    if (Utility.Random(100) < 85)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(10, 30);
                        reg.Amount = Utility.RandomMinMax(10, 30);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("You dig up a bones.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 150.0)
                {
                    if (Utility.Random(500) < 5)
                    {
                        m_From.SendMessage("You dig up and item of great value.");
                        switch (Utility.Random(5))
                        {
                        case 0:
                            m_From.AddToBackpack(new ArmoredRobe());
                            break;

                        case 1:
                            m_From.AddToBackpack(new ButchersResolve());
                            break;

                        case 2:
                            m_From.AddToBackpack(new FollowerOfTheOldLord());
                            break;

                        case 3:
                            m_From.AddToBackpack(new SkirtOfTheAmazon());
                            break;

                        case 4:
                            m_From.AddToBackpack(new HolyHammerOfExorcism());
                            break;
                        }
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 40);
                        reg.Amount = Utility.RandomMinMax(2, 40);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("You dig up a bones.");
                            break;
                        }
                    }
                }
                else
                {
                    m_From.SendMessage("You fail to dig anything up.");
                }

                Stop();
            }
Exemple #13
0
        public WalkingScene(SpellswordGame game, World thisWorld, WalkingPlayer player)
        {
            inputHandler = game.Services.GetService <InputHandler>();
            if (inputHandler == null)
            {
                inputHandler = new InputHandler(game);
                game.Components.Add(inputHandler);
            }

            this.game      = game;
            this.thisWorld = thisWorld;
            this.player    = player;

            string[] mapFile =
            {
                "11111110001111111",
                "11111110001111111",
                "11111110001111111",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "00010000000001000",
                "00000000000000000",
                "00010000000001000",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "00010000000001000",
                "00000000000000000",
                "00010000000001000",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "11111111011111111",
                "11111110001111111",
                "11111110001111111",
                "11111110001111111"
            };

            emptyTiles = new List <EmptyTile>();
            CreateEmptyTiles(game, mapFile);

            //Temp test
            Enemy welp   = new Welp("WelpSmall", "Welp");
            Enemy zombie = new Zombie("ZombieSmall", "Zombie");
            Enemy wraith = new Wraith("WraithSmall", "Wraith");
            Enemy ghost  = new Ghost("BackwardsStill", "Ghost");
            Enemy flower = new Flower("FlowerWorld", "FlowerBattle");
            Enemy dragon = new Dragon("Dragon", "Dragon", "DragonSpecial");

            enemies = new List <WorldEnemy>();
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(3, 7), welp));    // Welp
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(3, 13), zombie)); // Zombie
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(13, 7), wraith)); // Wraith
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(13, 13), ghost)); // Ghost
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(8, 19), flower)); // Flower
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(8, 1), dragon));  // Dragon Boss

            // More Temp Test
            swords = new List <WorldSword>();
            Weapon iceShield      = new IceShield("IceShield", 8, 15);
            Weapon iceSword       = new IceSword("IceSword", 20, 5);
            Weapon lightningSword = new LightningSword("LightningSword", 30, 5);
            Weapon focus          = new BasicFocus("SpellFocus");

            this.swords.Add(new WorldSword(game, thisWorld, new Point(1, 7), iceShield));       // Ice Shield
            this.swords.Add(new WorldSword(game, thisWorld, new Point(1, 13), iceSword));       // Ice Blade
            this.swords.Add(new WorldSword(game, thisWorld, new Point(15, 7), lightningSword)); // Lightning Blade
            this.swords.Add(new WorldSword(game, thisWorld, new Point(15, 13), focus));         // Spell/Power Focus

            InitializePlayerToMiddle();
        }