Ejemplo n.º 1
0
            public CharacterCache()
            {
                lastUpdatedPlayer=DateTime.Today;
                          lastPreformedNonCombatAction=DateTime.Today;
                          bIsIncapacitated=false;
                          bIsRooted=false;
                          bIsInTown=false;
                          dcurrentHealthPct=0d;
                          dCurrentEnergy=0d;
                          dCurrentEnergyPct=0d;
                          dDiscipline=0d;
                          dDisciplinePct=0d;
                          //EnergyRegenerationRate=0;
                          bWaitingForReserveEnergy=false;
                          iMyDynamicID=0;
                          iMyLevel=1;
                          iMyParagonLevel=0;
                          iSceneID=-1;
                          iCurrentWorldID=-1;
                          BackPack=new Backpack();
                          PetData=new Pets();
                          PickupRadius=1;

                            LastCachedTarget=Funky.FakeCacheObject;
                          fCharacterRadius=0f;
                          //iCurrentGameDifficulty=GameDifficulty.Invalid;
                          IsRunningOOCBehavior=false;
                          ShouldBackTrack=false;
                          BackTrackVector=Vector3.Zero;
            }
Ejemplo n.º 2
0
 public Character(string name)
 {
     this.name = name;
     _backpack = new Backpack ();
     characterList.Add (name, this);
     characterBinding = new TextAdventure.IO.LuaSystem.LuaBinding (name);
     AddObserver (characterBinding);
 }
Ejemplo n.º 3
0
 public Player()
 {
     this.name = "Player";
     _backpack = new Backpack ();
     _player = this;
     Language.Processor.AddCommand ("say", SAY_HELP, Say);
     characterBinding = new TextAdventure.IO.LuaSystem.LuaBinding (name);
     AddObserver (characterBinding);
     characterList.Add (name, this);
 }
Ejemplo n.º 4
0
Archivo: person.cs Proyecto: tubitos/1
        public Person(IScreen screen, Vector3 position, Matrix rotation, float width, float height, Vector3 scale)
            : base(screen)
        {
            health = 0;
            mana = 0;
            strength = 0;
            stamina = 0;
            luck = 0;
            wisdom = 0;
            intelligence = 0;
            agility = 0;

            backpack = new Backpack ();
            charecter = new FullCharacterObject (position, rotation, height, width, scale, 0, 120);
        }
Ejemplo n.º 5
0
    public virtual void Init()
    {
        backpack = new Backpack(maxItemStack, maxItemWight);
        for(int i=0;i<maxItemStack && i<presetItems.Count; i++)
        {
            if (ItemDatabase.GetItem(presetItems[i].Get_Item_ID()) != null)
                backpack.Add(presetItems[i].Get_Item_ID(),presetItems[i].Get_Stack());
        }

        equipment = new Backpack(maxEqiupStack, maxEqiupWight);
        for(int i=0;i<maxEqiupStack && i<presetEqiup.Count; i++)
        {
            if (ItemDatabase.GetItem(presetEqiup[i].Get_Item_ID()) != null)
                equipment.Add(i, presetEqiup[i].Get_Item_ID(), 1);
        }
    }
Ejemplo n.º 6
0
	/**
	 * The Start method is called automatically by Monobehaviours,
	 * essentially becoming the constructor of the class.
	 * <p>
	 * See <a href="http://docs.unity3d.com/ScriptReference/MonoBehaviour.Start.html">docs.unity3d.com</a> for more information.
	 */
    private void Start() {
        itemDatabase = GetComponent<ItemDatabase>();

        shop = this.transform.FindChild("Shop").gameObject;
        backpack = this.transform.parent.FindChild("Inventory").FindChild("Backpack").GetComponent<Backpack>();

        for (int i = 0; i < Items_To_Sell.Count; i++) {
            Item item = itemDatabase.FetchItemByID(Items_To_Sell[i]);
            GameObject itemSlot = Instantiate(Shop_Item_Slot);
            itemSlot.transform.SetParent(shop.transform);
            itemSlot.name = "Shop Item Slot " + i;

            GameObject itemObject = Instantiate(Shop_Item);
            ShopItem shopItem = itemObject.GetComponent<ShopItem>();
            itemObject.transform.SetParent(itemSlot.transform);
            itemObject.GetComponent<Image>().sprite = item._Sprite;
            itemObject.transform.position = Vector2.zero;
            itemObject.name = item.Name;
            shopItem.item = item;
            shopItems.Add(shopItem);
        }
    }
Ejemplo n.º 7
0
        internal static bool SellOverlord(object ret)
        {
            townRunItemCache.SellItems.Clear();


            //Not doing Greater Rift?
            if (!ZetaDia.Me.IsParticipatingInTieredLootRun || (!FunkyGame.Bounty.ActiveQuests.ContainsKey(BountyCache.ADVENTUREMODE_RIFTID) || FunkyGame.Bounty.ActiveQuests[BountyCache.ADVENTUREMODE_RIFTID].Step == 34 || FunkyGame.Bounty.ActiveQuests[BountyCache.ADVENTUREMODE_RIFTID].Step == 10))
            {
                //Get new list of current backpack
                var potions = Backpack.ReturnRegularPotions();
                if (potions.Count > 0)
                {
                    Backpack.CurrentPotionACDGUID = potions.First().ACDGUID;
                }

                foreach (var thisitem in Backpack.CacheItemList.Values)
                {
                    if (thisitem.ACDItem.BaseAddress != IntPtr.Zero)
                    {
                        // Find out if this item's in a protected bag slot
                        if (!ItemManager.Current.ItemIsProtected(thisitem.ACDItem))
                        {
                            if (thisitem.ItemType == PluginItemTypes.HealthPotion || thisitem.ItemType == PluginItemTypes.LegendaryHealthPotion || thisitem.ItemType == PluginItemTypes.HoradricCache)
                            {
                                if (thisitem.IsRegularPotion)
                                {
                                    if ((thisitem.ACDGUID != Backpack.CurrentPotionACDGUID && Backpack.CurrentPotionACDGUID != -1) ||
                                        FunkyTownRunPlugin.PluginSettings.PotionsCount == 0)
                                    {
                                        townRunItemCache.SellItems.Add(thisitem);
                                        FunkyTownRunPlugin.DBLog.InfoFormat("Selling Potion -- Current PotionACDGUID=={0}", Backpack.CurrentPotionACDGUID);
                                    }
                                }

                                continue;
                            }

                            if (FunkyTownRunPlugin.PluginSettings.UseItemRules)
                            {
                                Interpreter.InterpreterAction action = FunkyTownRunPlugin.ItemRulesEval.checkItem(thisitem.ACDItem, ItemEvaluationType.Keep);
                                switch (action)
                                {
                                case Interpreter.InterpreterAction.SELL:
                                    townRunItemCache.SellItems.Add(thisitem);
                                    continue;

                                case Interpreter.InterpreterAction.TRASH:
                                    if (SalvageValidation(thisitem))
                                    {
                                        continue;
                                    }
                                    townRunItemCache.SellItems.Add(thisitem);
                                    continue;
                                }
                            }

                            bool bShouldSellThis = false;
                            if (FunkyTownRunPlugin.PluginSettings.UseItemManagerEvaluation)
                            {
                                bShouldSellThis = ItemManager.Current.ShouldSellItem(thisitem.ACDItem);
                            }
                            else
                            {
                                if (SalvageValidation(thisitem))
                                {
                                    continue;
                                }
                                if (thisitem.IsUnidentified)
                                {
                                    continue;
                                }


                                bShouldSellThis = SellValidation(thisitem.ThisInternalName, thisitem.ThisLevel, thisitem.ThisQuality, thisitem.ThisDBItemType, thisitem.ThisFollowerType);
                            }

                            if (bShouldSellThis)
                            {
                                townRunItemCache.SellItems.Add(thisitem);
                            }
                        }
                    }
                    else
                    {
                        FunkyTownRunPlugin.DBLog.DebugFormat("GSError: Diablo 3 memory read error, or item became invalid [StashOver-1]");
                    }
                }
            }

            bool bShouldVisitVendor = townRunItemCache.SellItems.Count > 0;

            if (bShouldVisitVendor)
            {
                FunkyTownRunPlugin.DBLog.InfoFormat("[Funky] Town Run Behavior Vendor Started (Selling Items)");
                townRunItemCache.sortSellList();
                foreach (var item in townRunItemCache.SellItems)
                {
                    FunkyTownRunPlugin.DBLog.DebugFormat("Selling Item: {0}({1}) Sno {2}", item.ThisRealName, item.ThisInternalName, item.SNO);
                }
            }


            if (!CheckedVendorActions)
            {
                CheckedVendorActions = true;

                // Check durability percentages
                bNeedsEquipmentRepairs = Equipment.ShouldRepairItems(CharacterSettings.Instance.RepairWhenDurabilityBelow);
                if (bNeedsEquipmentRepairs)
                {
                    FunkyTownRunPlugin.DBLog.InfoFormat("[Funky] Town Run Behavior Vendor Started (Repair Items)");
                }

                if (!bShouldVisitVendor)
                {
                    bShouldVisitVendor = bNeedsEquipmentRepairs;
                }

                // Check Buying Potions?
                if (FunkyTownRunPlugin.PluginSettings.BuyPotionsDuringTownRun && FunkyTownRunPlugin.PluginSettings.PotionsCount > Backpack.CurrentPotionCount)
                {
                    bBuyingPotions = true;
                    PotionCount    = Backpack.CurrentPotionCount;
                    FunkyTownRunPlugin.DBLog.InfoFormat("[Funky] Town Run Behavior Vendor Started (Buying Potions)");
                    if (!bShouldVisitVendor)
                    {
                        bShouldVisitVendor = true;
                    }
                }
            }


            return(bShouldVisitVendor);
        }
Ejemplo n.º 8
0
        public GrimmochDrummel()
            : base(AIType.AI_Archer, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            this.Title = "the Cursed";

            this.Hue  = 0x8596;
            this.Body = 0x190;
            this.Name = "Grimmoch Drummel";

            this.HairItemID = 0x204A;   //Krisna

            Bow bow = new Bow();

            bow.Movable = false;
            this.AddItem(bow);

            this.AddItem(new Boots(0x8A4));
            this.AddItem(new BodySash(0x8A4));

            Backpack backpack = new Backpack();

            backpack.Movable = false;
            this.AddItem(backpack);

            LeatherGloves gloves = new LeatherGloves();
            LeatherChest  chest  = new LeatherChest();

            gloves.Hue = 0x96F;
            chest.Hue  = 0x96F;

            this.AddItem(gloves);
            this.AddItem(chest);

            this.SetStr(111, 120);
            this.SetDex(151, 160);
            this.SetInt(41, 50);

            this.SetHits(180, 207);
            this.SetMana(0);

            this.SetDamage(13, 16);

            this.SetResistance(ResistanceType.Physical, 35, 45);
            this.SetResistance(ResistanceType.Fire, 25, 30);
            this.SetResistance(ResistanceType.Cold, 45, 55);
            this.SetResistance(ResistanceType.Poison, 30, 40);
            this.SetResistance(ResistanceType.Energy, 20, 25);

            this.SetSkill(SkillName.Archery, 90.1, 110.0);
            this.SetSkill(SkillName.Swords, 60.1, 70.0);
            this.SetSkill(SkillName.Tactics, 90.1, 100.0);
            this.SetSkill(SkillName.MagicResist, 60.1, 70.0);
            this.SetSkill(SkillName.Anatomy, 90.1, 100.0);

            this.Fame  = 5000;
            this.Karma = -1000;

            this.PackItem(new Arrow(40));

            if (3 > Utility.Random(100))
            {
                this.PackItem(new FireHorn());
            }

            // ERA BOOKS CHECK -Fraz

            /*
             * if (1 > Utility.Random(3))
             *  this.PackItem(Loot.RandomGrimmochJournal());
             */
        }
Ejemplo n.º 9
0
        public ArcherGuard(Mobile target) : base(target)
        {
            InitStats(100, 125, 25);


            SpeechHue = Utility.RandomDyedHue();

            Hue = Utility.RandomSkinHue();

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

            new Horse().Rider = this;

            AddItem(new StuddedChest());
            AddItem(new StuddedArms());
            AddItem(new StuddedGloves());
            AddItem(new StuddedGorget());
            AddItem(new StuddedLegs());
            AddItem(new Boots());
            AddItem(new SkullCap());

            Bow bow = new Bow();

            bow.Movable = false;
            bow.Crafter = this;
            bow.Quality = WeaponQuality.Exceptional;

            AddItem(bow);

            Container pack = new Backpack();

            pack.Movable = false;

            Arrow arrows = new Arrow(250);

            arrows.LootType = LootType.Newbied;

            pack.DropItem(arrows);
            pack.DropItem(new Gold(10, 25));

            AddItem(pack);

            Skills[SkillName.Anatomy].Base      = 120.0;
            Skills[SkillName.Tactics].Base      = 120.0;
            Skills[SkillName.Archery].Base      = 120.0;
            Skills[SkillName.MagicResist].Base  = 120.0;
            Skills[SkillName.DetectHidden].Base = 100.0;

            this.NextCombatTime = DateTime.Now + TimeSpan.FromSeconds(0.5);
            this.Focus          = target;
        }
Ejemplo n.º 10
0
        public void StockInventory()
        {
            if (Backpack == null)
            {
                AddItem(new Backpack());
            }

            foreach (CollectionItem item in VvVRewards.Rewards)
            {
                if (item.Tooltip == 0)
                {
                    if (Backpack.GetAmount(item.Type) > 0)
                    {
                        Item itm = Backpack.FindItemByType(item.Type);

                        if (itm is IVvVItem)
                        {
                            ((IVvVItem)itm).IsVvVItem = true;
                        }

                        continue;
                    }

                    Item i = Activator.CreateInstance(item.Type) as Item;

                    if (i != null)
                    {
                        if (i is IOwnerRestricted)
                        {
                            ((IOwnerRestricted)i).OwnerName = "Your Player Name";
                        }

                        if (i is IVvVItem)
                        {
                            ((IVvVItem)i).IsVvVItem = true;
                        }

                        if (i is VesperOrderShield)
                        {
                            i.Name = "Order Shield";
                            ((VesperOrderShield)i).Attributes.CastSpeed = 0;
                        }

                        NegativeAttributes neg = RunicReforging.GetNegativeAttributes(i);

                        if (neg != null)
                        {
                            neg.Antique = 1;

                            if (i is IDurability && ((IDurability)i).MaxHitPoints == 0)
                            {
                                ((IDurability)i).MaxHitPoints = 255;
                                ((IDurability)i).HitPoints    = 255;
                            }
                        }

                        Backpack.DropItem(i);
                    }
                }
            }
        }
Ejemplo n.º 11
0
 private void Start()
 {
     backpack = GameObject.FindWithTag("Backpack").GetComponent <Backpack>();
     ma       = new InteractiveItem("Daily/道具/玛", "玛");
 }
Ejemplo n.º 12
0
 void Start()
 {
     backpack = GameObject.FindWithTag("Backpack").GetComponent <Backpack>();
     wa       = new InteractiveItem("Daily/道具/哇", "哇");
 }
Ejemplo n.º 13
0
        public MeerCaptain() : base(AIType.AI_Archer, FightMode.Evil, 10, 1, 0.2, 0.4)
        {
            Name = "a meer captain";
            Body = 773;

            SetStr(96, 110);
            SetDex(186, 200);
            SetInt(96, 110);

            SetHits(58, 66);

            SetDamage(5, 15);

            SetDamageType(ResistanceType.Physical, 100);

            SetResistance(ResistanceType.Physical, 45, 55);
            SetResistance(ResistanceType.Fire, 10, 20);
            SetResistance(ResistanceType.Cold, 40, 50);
            SetResistance(ResistanceType.Poison, 35, 45);
            SetResistance(ResistanceType.Energy, 35, 45);

            SetSkill(SkillName.Archery, 90.1, 100.0);
            SetSkill(SkillName.MagicResist, 91.0, 100.0);
            SetSkill(SkillName.Swords, 90.1, 100.0);
            SetSkill(SkillName.Tactics, 91.0, 100.0);
            SetSkill(SkillName.Wrestling, 80.9, 89.9);

            Fame  = 2000;
            Karma = 5000;

            VirtualArmor = 28;

            Container pack = new Backpack();

            pack.DropItem(new Bolt(Utility.RandomMinMax(10, 20)));
            pack.DropItem(new Bolt(Utility.RandomMinMax(10, 20)));

            switch (Utility.Random(6))
            {
            case 0: pack.DropItem(new Broadsword()); break;

            case 1: pack.DropItem(new Cutlass()); break;

            case 2: pack.DropItem(new Katana()); break;

            case 3: pack.DropItem(new Longsword()); break;

            case 4: pack.DropItem(new Scimitar()); break;

            case 5: pack.DropItem(new VikingSword()); break;
            }

            Container bag = new Bag();

            int count = Utility.RandomMinMax(10, 20);

            for (int i = 0; i < count; ++i)
            {
                Item item = Loot.RandomReagent();

                if (item == null)
                {
                    continue;
                }

                if (!bag.TryDropItem(this, item, false))
                {
                    item.Delete();
                }
            }

            pack.DropItem(bag);

            AddItem(new Crossbow());
            PackItem(pack);

            m_NextAbilityTime = Core.Now + TimeSpan.FromSeconds(Utility.RandomMinMax(2, 5));
        }
Ejemplo n.º 14
0
 public void UnregisterAll()
 {
     controlledBackpack = null;
     //itemList.Items = null;
     descriptionList.Items.Clear();
 }
Ejemplo n.º 15
0
 public void Register(Backpack backpack)
 {
     controlledBackpack = backpack;
 }
Ejemplo n.º 16
0
        public override void OnCast()
        {
            if (CheckSequence())
            {
                Item   item = new Dagger();
                string msg  = "You conjure a dagger.";

                switch (Utility.RandomMinMax(1, 28))
                {
                case 1: item = new Apple(); item.Amount = Utility.RandomMinMax(1, 5); msg = "You conjure some apples."; break;

                case 2: item = new Arrow(); item.Amount = Utility.RandomMinMax(1, 10); msg = "You conjure some arrows."; break;

                case 3: item = new Backpack(); msg = "You conjure a backpack."; break;

                case 4: item = new Bag(); msg = "You conjure a bag."; break;

                case 5: item = new Bandage(); item.Amount = Utility.RandomMinMax(1, 10); msg = "You conjure some bandages."; break;

                case 6: item = new Bedroll(); msg = "You conjure a bedroll."; break;

                case 7: item = new Beeswax(); msg = "You conjure some beeswax."; break;

                case 8: item = new BlueBook(); msg = "You conjure a book."; break;

                case 9: item = new Bolt(); item.Amount = Utility.RandomMinMax(1, 10); msg = "You conjure some crossbow bolts."; break;

                case 10: item = new Bottle(); msg = "You conjure a bottle."; break;

                case 11: item = new BreadLoaf(); item.Amount = Utility.RandomMinMax(1, 5); msg = "You conjure some bread."; break;

                case 12: item = new Candle(); msg = "You conjure a candle."; break;

                case 13: item = new Club(); msg = "You conjure a club."; break;

                case 14: item = new Dagger(); msg = "You conjure a dagger."; break;

                case 15: item = new DarkYarn(); item.Amount = Utility.RandomMinMax(1, 5); msg = "You conjure some yarn."; break;

                case 16: item = new FloppyHat(); msg = "You conjure a hat."; break;

                case 17: item = new Jar(); msg = "You conjure a jar."; break;

                case 18: item = new Kindling(); item.Amount = Utility.RandomMinMax(1, 5); msg = "You conjure some kindling."; break;

                case 19: item = new Lantern(); msg = "You conjure a lantern."; break;

                case 20: item = new Lockpick(); msg = "You conjure a lockpick."; break;

                case 21: item = new OilCloth(); msg = "You conjure an oil cloth."; break;

                case 22: item = new Pouch(); msg = "You conjure a pouch."; break;

                case 23: item = new Robe(); msg = "You conjure a robe."; break;

                case 24: item = new Shoes(); msg = "You conjure some shoes."; break;

                case 25: item = new SpoolOfThread(); item.Amount = Utility.RandomMinMax(1, 5); msg = "You conjure some thread."; break;

                case 26: item = new TenFootPole(); msg = "You conjure a ten foot pole."; break;

                case 27: item = new Torch(); msg = "You conjure a torch."; break;

                case 28: item = new Waterskin(); msg = "You conjure a waterskin."; break;
                }

                Caster.SendMessage(msg);

                Caster.AddToBackpack(item);

                Caster.FixedParticles(0, 10, 5, 2003, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, EffectLayer.RightHand);
                Caster.PlaySound(0x1E2);

                Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, true);
            }

            FinishSequence();
        }
Ejemplo n.º 17
0
        public EvilMage() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            SpeechHue = Utility.RandomDyedHue();
            Title     = "the evil mage";
            Hue       = Utility.RandomSkinHue();

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

            SetStr(85, 105);
            SetDex(94, 114);
            SetInt(96, 120);

            SetMana(1150, 1200);

            SetDamage(1, 5);

            SetDamageType(ResistanceType.Physical, 100);

            SetResistance(ResistanceType.Physical, 16);
            SetResistance(ResistanceType.Fire, 5);
            SetResistance(ResistanceType.Poison, 5);
            SetResistance(ResistanceType.Energy, 5);

            SetSkill(SkillName.EvalInt, 76.7, 85.7);
            SetSkill(SkillName.Magery, 80.0, 98.0);
            SetSkill(SkillName.MagicResist, 83.2, 88.9);
            SetSkill(SkillName.Meditation, 99.2, 99.9);
            SetSkill(SkillName.Tactics, 74.6, 78.2);
            SetSkill(SkillName.Wrestling, 34.2, 58.7);

            MassFireballTimer.MassFireballList.Add(this);

            Fame  = 1700;
            Karma = -1700;

            AddItem(new Robe(Utility.RandomHairHue()));
            AddItem(new WizardsHat(Utility.RandomMetalHue()));
            AddItem(new Sandals(Utility.RandomBirdHue()));

            PackGold(205, 398);

            PackItem(new ArcaneStone(Utility.RandomMinMax(5, 8)));

            Container pack = new Backpack();

            pack.DropItem(new BlackPearl(Utility.RandomMinMax(9, 10)));
            pack.DropItem(new Bloodmoss(Utility.RandomMinMax(9, 10)));
            pack.DropItem(new Garlic(Utility.RandomMinMax(9, 10)));
            pack.DropItem(new Ginseng(Utility.RandomMinMax(9, 10)));
            pack.DropItem(new MandrakeRoot(Utility.RandomMinMax(9, 10)));
            pack.DropItem(new Nightshade(Utility.RandomMinMax(9, 10)));
            pack.DropItem(new SpidersSilk(Utility.RandomMinMax(9, 10)));
            pack.DropItem(new SulfurousAsh(Utility.RandomMinMax(9, 10)));
            PackItem(pack);

            switch (Utility.Random(32))
            {
            case 0: PackItem(new ClumsyScroll()); break;

            case 1: PackItem(new CreateFoodScroll()); break;

            case 2: PackItem(new FeeblemindScroll()); break;

            case 3: PackItem(new HealScroll()); break;

            case 4: PackItem(new MagicArrowScroll()); break;

            case 5: PackItem(new NightSightScroll()); break;

            case 6: PackItem(new ReactiveArmorScroll()); break;

            case 7: PackItem(new WeakenScroll()); break;

            case 8: PackItem(new AgilityScroll()); break;

            case 9: PackItem(new CunningScroll()); break;

            case 10: PackItem(new CureScroll()); break;

            case 11: PackItem(new HarmScroll()); break;

            case 12: PackItem(new MagicTrapScroll()); break;

            case 13: PackItem(new MagicUnTrapScroll()); break;

            case 14: PackItem(new ProtectionScroll()); break;

            case 15: PackItem(new StrengthScroll()); break;

            case 16: PackItem(new BlessScroll()); break;

            case 17: PackItem(new FireballScroll()); break;

            case 18: PackItem(new MagicLockScroll()); break;

            case 19: PackItem(new PoisonScroll()); break;

            case 20: PackItem(new TelekinisisScroll()); break;

            case 21: PackItem(new TeleportScroll()); break;

            case 22: PackItem(new UnlockScroll()); break;

            case 23: PackItem(new WallOfStoneScroll()); break;

            case 24: PackItem(new ArchCureScroll()); break;

            case 25: PackItem(new ArchProtectionScroll()); break;

            case 26: PackItem(new CurseScroll()); break;

            case 27: PackItem(new FireFieldScroll()); break;

            case 28: PackItem(new GreaterHealScroll()); break;

            case 29: PackItem(new LightningScroll()); break;

            case 30: PackItem(new ManaDrainScroll()); break;

            case 31: PackItem(new RecallScroll()); break;
            }
        }
Ejemplo n.º 18
0
 public AICharacter( string name, 
                     int currentPf,
                     int maximumPf,
                     int hunger,
                     AI intelligence, 
                     int perceptionDistance,
                     AI.SensingMethod sensingMethod = null,
                     Stats? stats = null,
                     Armor wornArmor = null,
                     Shield embracedShield = null,
                     Weapon handledWeapon = null,
                     Backpack backpack = null,
                     God god = null,
                     bool unblockable = false,
                     string symbol = "C",
                     Color? color = null,
                     string description = "A creature of the world", 
                     Coord position = new Coord(),
                     Allied hostile = Allied.Enemy)
     : base( name, 
             currentPf,
             maximumPf,
             hunger,
             stats == null ? new Stats(StatsBuilder.RandomStats()) : (Stats)stats,
             wornArmor,
             embracedShield, 
             handledWeapon, 
             backpack == null ? new Backpack() : backpack,
             god,
             unblockable,
             symbol,
             color == null 
                 ? (hostile == Allied.Enemy ? Color.Red : Color.Green)
                 : (Color)color,
             description,
             position)
 {
     this.intelligence = intelligence;
     this.SensePg = sensingMethod == null ? AI.SensingAlgorythms.AllAround : sensingMethod;
     this.intelligence.ControlledCharacter = this;
     this.PerceptionDistance = perceptionDistance;
     this.AlliedTo = hostile;
 }
Ejemplo n.º 19
0
        public Orc( string name,
                    int currentPf,
                    int maximumPf,
                    int hunger,
                    AI intelligence,
                    AI.SensingMethod sensingMethod,
                    int perceptionDistance,
                    Stats stats,
                    Armor wornArmor,
                    Shield embracedShield,
                    Weapon handledWeapon,
                    Backpack backpack,
                    God god,
                    string symbol,
                    Color color,
                    string description,
                    Coord position,
                    Allied hostile)
            : base( name,
                    currentPf,
                    maximumPf,
                    hunger,
                    intelligence,
                    perceptionDistance,
                    sensingMethod,
                    stats,
                    wornArmor,
                    embracedShield,
                    handledWeapon,
                    backpack,
                    god,
                    false,
                    symbol,
                    color,
                    description,
                    position,
                    hostile)
        {

        }
Ejemplo n.º 20
0
        public Mordrid()
            : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            Name = ("Mordrid");
            Body = 184;
            Hue  = 0;

            SetStr(800, 950);
            SetDex(91, 115);
            SetInt(300, 320);

            SetHits(2820, 3225);

            SetDamage(20, 22);

            SetDamageType(ResistanceType.Physical, 100);

            SetResistance(ResistanceType.Physical, 0, 1);
            SetResistance(ResistanceType.Fire, 0, 1);
            SetResistance(ResistanceType.Poison, 0, 1);
            SetResistance(ResistanceType.Energy, 0, 1);
            SetResistance(ResistanceType.Cold, 0, 1);

            SetSkill(SkillName.EvalInt, 135.0, 100.0);
            SetSkill(SkillName.Tactics, 125.0, 130.0);
            SetSkill(SkillName.MagicResist, 75.0, 97.5);
            SetSkill(SkillName.Wrestling, 120.0, 135.0);
            SetSkill(SkillName.Meditation, 120.0);
            SetSkill(SkillName.Focus, 120.0);
            SetSkill(SkillName.Magery, 160.0, 180);

            Fame  = 2500;
            Karma = -2500;

            VirtualArmor = 70;

            int hairHue = 0;

            switch (Utility.Random(1))
            {
            case 0: AddItem(new LongHair(hairHue)); break;
            }

            AddItem(new Server.Items.HoodedShroudOfShadows(1109));
            AddItem(new Server.Items.Sandals(1157));
            AddItem(new Server.Items.FurCape(1109));

            GoldNecklace goldnecklace = new GoldNecklace();

            goldnecklace.Hue     = 1157;
            goldnecklace.Movable = false;
            AddItem(goldnecklace);

            GoldRing goldring = new GoldRing();

            goldring.Hue     = 1157;
            goldring.Movable = false;
            AddItem(goldring);

            Backpack backpack = new Backpack();

            backpack.Hue     = 1109;
            backpack.Movable = false;
            AddItem(backpack);

            ME me = new ME();

            me.Hue     = 1154;
            me.Movable = false;
            AddItem(me);
        }
Ejemplo n.º 21
0
    void Start()
    {
        _movementComp = gameObject.GetComponent<Movement>();
        _backpackComp = gameObject.GetComponent<Backpack>();
        _healthComp = gameObject.GetComponent<Health>();

        while (_lookTurns > 0)
        {
            if (finishedTurning == true)
            {
                _movementComp.Rotate(-1);
                finishedTurning = false;
            }
            else
            {
                if (_movementComp.rotation)
                {
                    CheckForTiles();
                    finishedTurning = true;
                    _lookTurns--;

                    if (_lookTurns <= 0)
                    {
                        readyToFind = true;
                    }
                }
            }
        }
    }
Ejemplo n.º 22
0
        public static void FillBankAOS(Mobile m)
        {
            BankBox bank = m.BankBox;

            // The new AOS bankboxes don't have powerscrolls, they are automatically 'applied':

            for (int i = 0; i < PowerScroll.Skills.Count; ++i)
            {
                m.Skills[PowerScroll.Skills[i]].Cap = 120.0;
            }

            m.StatCap = 250;

            Container cont;

            // Begin box of money
            cont        = new WoodenBox();
            cont.ItemID = 0xE7D;
            cont.Hue    = 0x489;

            PlaceItemIn(cont, 16, 51, new BankCheck(500000));
            PlaceItemIn(cont, 28, 51, new BankCheck(250000));
            PlaceItemIn(cont, 40, 51, new BankCheck(100000));
            PlaceItemIn(cont, 52, 51, new BankCheck(100000));
            PlaceItemIn(cont, 64, 51, new BankCheck(50000));

            PlaceItemIn(cont, 16, 115, new Silver(9000));
            PlaceItemIn(cont, 34, 115, new Gold(60000));

            PlaceItemIn(bank, 18, 169, cont);
            // End box of money

            // Begin bag of potion kegs
            cont      = new Backpack();
            cont.Name = "Various Potion Kegs";

            PlaceItemIn(cont, 45, 149, MakePotionKeg(PotionEffect.CureGreater, 0x2D));
            PlaceItemIn(cont, 69, 149, MakePotionKeg(PotionEffect.HealGreater, 0x499));
            PlaceItemIn(cont, 93, 149, MakePotionKeg(PotionEffect.PoisonDeadly, 0x46));
            PlaceItemIn(cont, 117, 149, MakePotionKeg(PotionEffect.RefreshTotal, 0x21));
            PlaceItemIn(cont, 141, 149, MakePotionKeg(PotionEffect.ExplosionGreater, 0x74));

            PlaceItemIn(cont, 93, 82, new Bottle(1000));

            PlaceItemIn(bank, 53, 169, cont);
            // End bag of potion kegs

            // Begin bag of tools
            cont      = new Bag();
            cont.Name = "Tool Bag";

            PlaceItemIn(cont, 30, 35, new TinkerTools(1000));
            PlaceItemIn(cont, 60, 35, new HousePlacementTool());
            PlaceItemIn(cont, 90, 35, new DovetailSaw(1000));
            PlaceItemIn(cont, 30, 68, new Scissors());
            PlaceItemIn(cont, 45, 68, new MortarPestle(1000));
            PlaceItemIn(cont, 75, 68, new ScribesPen(1000));
            PlaceItemIn(cont, 90, 68, new SmithHammer(1000));
            PlaceItemIn(cont, 30, 118, new TwoHandedAxe());
            PlaceItemIn(cont, 60, 118, new FletcherTools(1000));
            PlaceItemIn(cont, 90, 118, new SewingKit(1000));

            PlaceItemIn(bank, 118, 169, cont);
            // End bag of tools

            // Begin bag of archery ammo
            cont      = new Bag();
            cont.Name = "Bag Of Archery Ammo";

            PlaceItemIn(cont, 48, 76, new Arrow(5000));
            PlaceItemIn(cont, 72, 76, new Bolt(5000));

            PlaceItemIn(bank, 118, 124, cont);
            // End bag of archery ammo

            // Begin bag of treasure maps
            cont      = new Bag();
            cont.Name = "Bag Of Treasure Maps";

            PlaceItemIn(cont, 30, 35, new TreasureMap(1, Map.Trammel));
            PlaceItemIn(cont, 45, 35, new TreasureMap(2, Map.Trammel));
            PlaceItemIn(cont, 60, 35, new TreasureMap(3, Map.Trammel));
            PlaceItemIn(cont, 75, 35, new TreasureMap(4, Map.Trammel));
            PlaceItemIn(cont, 90, 35, new TreasureMap(5, Map.Trammel));
            PlaceItemIn(cont, 90, 35, new TreasureMap(6, Map.Trammel));

            PlaceItemIn(cont, 30, 50, new TreasureMap(1, Map.Trammel));
            PlaceItemIn(cont, 45, 50, new TreasureMap(2, Map.Trammel));
            PlaceItemIn(cont, 60, 50, new TreasureMap(3, Map.Trammel));
            PlaceItemIn(cont, 75, 50, new TreasureMap(4, Map.Trammel));
            PlaceItemIn(cont, 90, 50, new TreasureMap(5, Map.Trammel));
            PlaceItemIn(cont, 90, 50, new TreasureMap(6, Map.Trammel));

            PlaceItemIn(cont, 55, 100, new Lockpick(30));
            PlaceItemIn(cont, 60, 100, new Pickaxe());

            PlaceItemIn(bank, 98, 124, cont);
            // End bag of treasure maps

            // Begin bag of raw materials
            cont      = new Bag();
            cont.Hue  = 0x835;
            cont.Name = "Raw Materials Bag";

            PlaceItemIn(cont, 92, 60, new BarbedLeather(5000));
            PlaceItemIn(cont, 92, 68, new HornedLeather(5000));
            PlaceItemIn(cont, 92, 76, new SpinedLeather(5000));
            PlaceItemIn(cont, 92, 84, new Leather(5000));

            PlaceItemIn(cont, 30, 118, new Cloth(5000));
            PlaceItemIn(cont, 30, 84, new Board(5000));
            PlaceItemIn(cont, 57, 80, new BlankScroll(500));

            PlaceItemIn(cont, 30, 35, new DullCopperIngot(5000));
            PlaceItemIn(cont, 37, 35, new ShadowIronIngot(5000));
            PlaceItemIn(cont, 44, 35, new CopperIngot(5000));
            PlaceItemIn(cont, 51, 35, new BronzeIngot(5000));
            PlaceItemIn(cont, 58, 35, new GoldIngot(5000));
            PlaceItemIn(cont, 65, 35, new AgapiteIngot(5000));
            PlaceItemIn(cont, 72, 35, new VeriteIngot(5000));
            PlaceItemIn(cont, 79, 35, new ValoriteIngot(5000));
            PlaceItemIn(cont, 86, 35, new IronIngot(5000));

            PlaceItemIn(cont, 30, 59, new RedScales(5000));
            PlaceItemIn(cont, 36, 59, new YellowScales(5000));
            PlaceItemIn(cont, 42, 59, new BlackScales(5000));
            PlaceItemIn(cont, 48, 59, new GreenScales(5000));
            PlaceItemIn(cont, 54, 59, new WhiteScales(5000));
            PlaceItemIn(cont, 60, 59, new BlueScales(5000));

            PlaceItemIn(bank, 98, 169, cont);
            // End bag of raw materials

            // Begin bag of spell casting stuff
            cont      = new Backpack();
            cont.Hue  = 0x480;
            cont.Name = "Spell Casting Stuff";

            PlaceItemIn(cont, 45, 105, new Spellbook(UInt64.MaxValue));

            PlaceItemIn(cont, 140, 150, new BagOfReagents(500));

            for (int i = 0; i < 9; ++i)
            {
                PlaceItemIn(cont, 45 + (i * 10), 75, new RecallRune());
            }

            PlaceItemIn(cont, 141, 74, new FireHorn());

            PlaceItemIn(bank, 78, 169, cont);
            // End bag of spell casting stuff

            // Begin bag of ethereals
            cont      = new Backpack();
            cont.Hue  = 0x490;
            cont.Name = "Bag Of Ethy's!";

            PlaceItemIn(cont, 45, 66, new EtherealHorse());
            PlaceItemIn(cont, 69, 82, new EtherealOstard());
            PlaceItemIn(cont, 93, 99, new EtherealLlama());
            PlaceItemIn(cont, 117, 115, new EtherealKirin());
            PlaceItemIn(cont, 45, 132, new EtherealUnicorn());
            PlaceItemIn(cont, 69, 66, new EtherealRidgeback());
            PlaceItemIn(cont, 93, 82, new EtherealSwampDragon());
            PlaceItemIn(cont, 117, 99, new EtherealBeetle());

            PlaceItemIn(bank, 38, 124, cont);
            // End bag of ethereals
        }
Ejemplo n.º 23
0
        public ArcherGuard(Mobile target)
            : base(target)
        {
            InitStats(150, 150, 150);
            Title = "the guard";

            SpeechHue = Utility.RandomDyedHue();

            Hue = Utility.RandomSkinHue();

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

            new Horse().Rider = this;

            AddItem(new StuddedChest());
            AddItem(new StuddedArms());
            AddItem(new StuddedGloves());
            AddItem(new StuddedGorget());
            AddItem(new StuddedLegs());
            AddItem(new Boots());
            AddItem(new SkullCap());

            Bow bow = new Bow
            {
                Movable = false,
                Crafter = this,
                Quality = ItemQuality.Exceptional
            };

            AddItem(bow);

            Container pack = new Backpack
            {
                Movable = false
            };

            Arrow arrows = new Arrow(250)
            {
                LootType = LootType.Newbied
            };

            pack.DropItem(arrows);

            AddItem(pack);

            Skills[SkillName.Anatomy].Base      = 120.0;
            Skills[SkillName.Tactics].Base      = 120.0;
            Skills[SkillName.Archery].Base      = 120.0;
            Skills[SkillName.MagicResist].Base  = 120.0;
            Skills[SkillName.DetectHidden].Base = 100.0;

            NextCombatTime = Core.TickCount + 500;
            Focus          = target;
        }
Ejemplo n.º 24
0
        public BalzanMarcos() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            Name             = "Balzan Marcos";
            Title            = "the evil thief";
            Body             = 400;
            Female           = false;
            Race             = Race.Human;
            Hue              = Utility.RandomSkinHue();
            HairItemID       = 0;
            HairHue          = 0;
            FacialHairItemID = 0;
            FacialHairHue    = 0;

            SetStr(205, 245);
            SetDex(81, 95);
            SetInt(610, 1000);

            SetHits(1000, 1500);

            SetDamage(1, 5);

            SetDamageType(ResistanceType.Physical, 100);

            SetResistance(ResistanceType.Physical, 6);
            SetResistance(ResistanceType.Fire, 0);
            SetResistance(ResistanceType.Cold, 0);
            SetResistance(ResistanceType.Poison, 0);
            SetResistance(ResistanceType.Energy, 0);

            SetSkill(SkillName.Archery, 95.1, 100.0);
            SetSkill(SkillName.Bushido, 120.0);
            SetSkill(SkillName.Fencing, 95.0, 97.5);
            SetSkill(SkillName.Macing, 93.0, 98.5);
            SetSkill(SkillName.MagicResist, 0.0);
            SetSkill(SkillName.Ninjitsu, 50.0);
            SetSkill(SkillName.Parry, 120.0);
            SetSkill(SkillName.Swords, 98.0, 99.5);
            SetSkill(SkillName.Tactics, 89.0, 93.5);
            SetSkill(SkillName.Wrestling, 63.0, 81.5);

            Fame  = 2500;
            Karma = -2500;

            SpeechHue = Utility.RandomDyedHue();

            LeatherChest chest = new LeatherChest();

            chest.Hue = 0x966;
            AddItem(chest);

            LeatherArms arms = new LeatherArms();

            arms.Hue = 0x966;
            AddItem(arms);

            LeatherGloves gloves = new LeatherGloves();

            gloves.Hue = 0x966;
            AddItem(gloves);

            LeatherGorget gorget = new LeatherGorget();

            gorget.Hue = 0x966;
            AddItem(gorget);

            LeatherLegs legs = new LeatherLegs();

            legs.Hue = 0x966;
            AddItem(legs);

            Container pack = new Backpack();

            pack.DropItem(new OrderList());
            pack.DropItem(new Diamond());
            pack.DropItem(new Gold(Utility.RandomMinMax(11, 13)));
            pack.DropItem(new Lockpick(Utility.RandomMinMax(5, 10)));

            PackItem(pack);

            switch (Utility.Random(6))
            {
            case 0: AddItem(new Longsword()); break;

            case 1: AddItem(new Cutlass()); break;

            case 2: AddItem(new Axe()); break;

            case 3: AddItem(new Club()); break;

            case 4: AddItem(new Dagger()); break;

            case 5: AddItem(new Spear()); break;
            }

            PackItem(new Bow());
            PackItem(new Arrow(Utility.RandomMinMax(80, 90)));
        }
Ejemplo n.º 25
0
        public GuardVer2()
            : base()
        {
            m_ReactsToSnoop        = true;
            m_ReactsToSteal        = true;
            m_ReactsToHit          = true;
            m_ReactsToDeath        = true;
            m_ReactsToHarmfulSpell = true;

            Blessed = true;
            Frozen  = true;

            // Choppé de la classe WarriorGuard, probablement à ajuster.

            InitStats(1000, 1000, 1000);
            Title = "the guard";

            SpeechHue = Utility.RandomDyedHue();

            Hue = Utility.RandomSkinHue();

            if (Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");

                switch (Utility.Random(2))
                {
                case 0: AddItem(new LeatherSkirt()); break;

                case 1: AddItem(new LeatherShorts()); break;
                }

                switch (Utility.Random(5))
                {
                case 0: AddItem(new FemaleLeatherChest()); break;

                case 1: AddItem(new FemaleStuddedChest()); break;

                case 2: AddItem(new LeatherBustierArms()); break;

                case 3: AddItem(new StuddedBustierArms()); break;

                case 4: AddItem(new FemalePlateChest()); break;
                }
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");

                AddItem(new PlateChest());
                AddItem(new PlateArms());
                AddItem(new PlateLegs());

                switch (Utility.Random(3))
                {
                case 0: AddItem(new Doublet(Utility.RandomNondyedHue())); break;

                case 1: AddItem(new Tunic(Utility.RandomNondyedHue())); break;

                case 2: AddItem(new BodySash(Utility.RandomNondyedHue())); break;
                }
            }
            Utility.AssignRandomHair(this);

            if (Utility.RandomBool())
            {
                Utility.AssignRandomFacialHair(this, HairHue);
            }

            Halberd weapon = new Halberd();

            weapon.Movable = false;
            weapon.Crafter = this;
            weapon.Quality = WeaponQuality.Exceptional;

            AddItem(weapon);

            Container pack = new Backpack();

            pack.Movable = false;

            pack.DropItem(new Gold(10, 25));

            AddItem(pack);

            //Skills[SkillName.Anatomy].Base = 120.0;
            Skills[SkillName.Tactiques].Base     = 120.0;
            Skills[SkillName.Epee].Base          = 120.0;
            Skills[SkillName.Concentration].Base = 120.0;
            Skills[SkillName.Detection].Base     = 100.0;

            Blessed = true;
            Frozen  = true;
        }
Ejemplo n.º 26
0
        public static void RestoreState(
            PlayerMobile m,
            Serial serial,
            bool moveExisting,
            bool logging,
            out int created,
            out int deleted,
            out int ignored,
            out int moved)
        {
            var pack = m.Backpack;

            if (pack == null || pack.Deleted)
            {
                m.AddItem(
                    pack = new Backpack
                {
                    Movable = false
                });
            }

            var bank = m.BankBox;

            if (bank == null || bank.Deleted)
            {
                m.AddItem(
                    bank = new BankBox(m)
                {
                    Movable = false
                });
            }

            if (serial == Serial.MinusOne)
            {
                serial = m.Serial;
            }

            var root = VitaNexCore.DataDirectory + "/PlayerBackup/" + m.Account.Username + "/" + serial;

            var idxFile = IOUtility.EnsureFile(root + ".idx");
            var binFile = IOUtility.EnsureFile(root + ".bin");

            var logFile = logging ? IOUtility.EnsureFile(root + ".log") : null;
            var log     = logging ? new StringBuilder() : null;

            if (log != null)
            {
                log.AppendLine();
                log.AppendLine(new String('*', 10));
                log.AppendLine();
                log.AppendLine("RESTORE:\tDate[{0}]\tMobile[{1}]", DateTime.UtcNow, m);
                log.AppendLine();
            }

            int idxCreated = 0, idxDeleted = 0, idxIgnored = 0, idxMoved = 0;

            idxFile.Deserialize(
                idx =>
            {
                idx.GetVersion();

                var ser = idx.ReadInt();

                if (ser != m.Serial.Value)
                {
                    if (log != null)
                    {
                        log.AppendLine("INVALID:\tSerial[{0:X8}]", ser);
                    }

                    return;
                }

                long idxLength;
                int idxCount;

                ReadLength(idx, false, out idxLength, out idxCount);

                if (log != null)
                {
                    log.AppendLine("INDEX:\tCount[{0}]\tLength[{1}]", idxCount, idxLength);
                }

                var items = new Tuple <Item, Serial, long, long, string> [idxCount];

                binFile.Deserialize(
                    bin =>
                {
                    bin.GetVersion();

                    var restored = new Dictionary <Item, Serial>();

                    Backpack oldPack = null;
                    BankBox oldBank  = null;

                    for (var i = 0; i < idxCount; i++)
                    {
                        Type type;
                        Serial s, parent;
                        long binIndex, binLength;

                        ReadIndex(idx, out type, out s, out parent, out binIndex, out binLength);

                        var valid  = s.IsValid && s.IsItem;
                        var exists = World.Items.ContainsKey(s);

                        Item item = null;

                        if (exists)
                        {
                            item = World.Items[s];

                            if (item == null || item.Deleted)
                            {
                                World.Items.Remove(s);
                                exists = false;
                            }
                        }

                        object logItem;
                        string status;

                        if (!exists && valid && type.IsEqualOrChildOf <Item>())
                        {
                            item = type.CreateInstanceSafe <Item>(s);

                            if (item == null)
                            {
                                ++idxIgnored;

                                logItem = s;
                                status  = "NULL";
                            }
                            else if (item.Deleted)
                            {
                                ++idxDeleted;

                                item    = null;
                                logItem = s;
                                status  = "DELETED";
                            }
                            else
                            {
                                ++idxCreated;

                                World.AddItem(item);

                                logItem = item;
                                status  = "CREATED";
                            }
                        }
                        else if (exists && valid && moveExisting && item.RootParent != m)
                        {
                            ++idxMoved;

                            logItem = item;
                            status  = "MOVE";
                        }
                        else
                        {
                            ++idxIgnored;

                            item    = null;
                            logItem = s;
                            status  = exists ? "EXISTS" : "INVALID";
                        }

                        if (log != null)
                        {
                            log.AppendLine(
                                "DATA:\tIndex[{0}]\t\tLength[{1}]\tStatus[{2}]\tItem[{3}]\t\t\tParent[{4}]",
                                //
                                binIndex,
                                binLength,
                                status,
                                logItem,
                                parent);
                        }

                        items[i] = Tuple.Create(item, parent, binIndex, binLength, status);
                    }

                    foreach (var t in items)
                    {
                        var item   = t.Item1;
                        var parent = t.Item2;
                        var index  = t.Item3;
                        var length = t.Item4;
                        var status = t.Item5;

                        bin.Seek(index, SeekOrigin.Begin);

                        if (item == null)
                        {
                            bin.Seek(index + length, SeekOrigin.Begin);
                            continue;
                        }

                        Exception x = null;

                        if (status == "MOVE")
                        {
                            bin.Seek(index + length, SeekOrigin.Begin);

                            status = "IGNORED";
                        }
                        else
                        {
                            try
                            {
                                item.Deserialize(bin);

                                status = "LOADED";
                            }
                            catch (Exception e)
                            {
                                --idxCreated;
                                ++idxDeleted;

                                item.Delete();
                                x = e;

                                status = "ERROR";
                            }
                        }

                        if (log != null)
                        {
                            log.AppendLine(
                                "READ:\tIndex[{0}]\tLength[{1}]\tStatus[{2}]\tItem[{3}]\t\t\tParent[{4}]",
                                index,
                                length,
                                status,
                                item,
                                parent);

                            if (x != null)
                            {
                                log.AppendLine();
                                log.AppendLine(new String('*', 10));
                                log.AppendLine(x.ToString());
                                log.AppendLine(new String('*', 10));
                                log.AppendLine();
                            }
                        }

                        if (parent == m.Serial)
                        {
                            if (item is BankBox)
                            {
                                oldBank = (BankBox)item;
                            }
                            else if (item is Backpack)
                            {
                                oldPack = (Backpack)item;
                            }
                        }

                        restored.Add(item, parent);
                    }

                    if (log != null)
                    {
                        log.AppendLine();
                    }

                    Point3D p;

                    foreach (var kv in restored.Where(kv => !kv.Key.Deleted).OrderBy(kv => kv.Value))
                    {
                        var item = kv.Key;

                        if ((item == oldPack || item == oldBank) && item != pack && item != bank)
                        {
                            if (item.Parent is Item)
                            {
                                ((Item)item.Parent).RemoveItem(item);
                            }
                            else if (item.Parent is Mobile)
                            {
                                ((Mobile)item.Parent).RemoveItem(item);
                            }

                            item.Parent = null;
                            continue;
                        }

                        var parent = World.FindEntity(kv.Value);

                        if (item != pack && item != bank && (item.Parent == oldPack || item.Parent == oldBank))
                        {
                            ((Item)item.Parent).RemoveItem(item);
                        }

                        if (parent != null)
                        {
                            if (item == pack || item == bank)
                            {
                                m.AddItem(item);
                            }
                            else if (parent == pack || parent == oldPack)
                            {
                                p = item.Location;
                                pack.DropItem(item);
                                item.Location = p;
                            }
                            else if (parent == bank || parent == oldBank)
                            {
                                p = item.Location;
                                bank.DropItem(item);
                                item.Location = p;
                            }
                            else if (parent is Container)
                            {
                                if (parent.Deleted)
                                {
                                    bank.DropItem(item);
                                }
                                else
                                {
                                    p = item.Location;
                                    ((Container)parent).DropItem(item);
                                    item.Location = p;
                                }
                            }
                            else if (parent is Mobile)
                            {
                                if (!m.EquipItem(item))
                                {
                                    pack.DropItem(item);
                                }
                            }
                            else
                            {
                                bank.DropItem(item);
                            }

                            item.SetLastMoved();
                            item.UpdateTotals();
                            item.Delta(ItemDelta.Update);
                        }
                        else if (Cleanup.IsBuggable(item))
                        {
                            --idxCreated;
                            ++idxDeleted;

                            item.Delete();
                        }
                        else
                        {
                            item.Internalize();
                        }
                    }

                    if (oldPack != null && oldPack != pack && !restored.ContainsKey(oldPack))
                    {
                        oldPack.Delete();
                    }

                    if (oldBank != null && oldBank != bank && !restored.ContainsKey(oldBank))
                    {
                        oldBank.Delete();
                    }

                    if (log != null)
                    {
                        log.AppendLine();
                    }

                    foreach (var kv in restored)
                    {
                        if (kv.Key.Deleted)
                        {
                            if (log != null)
                            {
                                log.AppendLine("DELETED:\tItem[{0}]\t\tParent[{1}]", kv.Key, kv.Value);
                            }
                        }
                        else if (kv.Key.RootParent == m && kv.Key.Map == Map.Internal && kv.Key.Location == Point3D.Zero)
                        {
                            if (log != null)
                            {
                                log.AppendLine("INTERNAL:\tItem[{0}]\t\tParent[{1}]", kv.Key, kv.Value);
                            }
                        }
                        else if (kv.Key.RootParent != m)
                        {
                            if (log != null)
                            {
                                log.AppendLine("IGNORED:\tItem[{0}]\t\tParent[{1}]", kv.Key, kv.Value);
                            }
                        }
                        else
                        {
                            if (log != null)
                            {
                                log.AppendLine("RESTORED:\tItem[{0}]\t\tParent[{1}]", kv.Key, kv.Key.Parent);
                            }
                        }
                    }

                    restored.Clear();

                    m.SendEverything();
                });
            });

            created = idxCreated;
            deleted = idxDeleted;
            ignored = idxIgnored;
            moved   = idxMoved;

            if (log == null)
            {
                return;
            }

            log.AppendLine();
            log.AppendLine(
                "RESULT:\tCreated[{0}]\t\tDeleted[{1}]\t\tIgnored[{2}]\t\tMoved[{3}]",
                created,
                deleted,
                ignored,
                moved);

            logFile.AppendText(false, log.ToString());
        }
Ejemplo n.º 27
0
		public BaseAIGuard() : base( AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.6, 0.8 )
		{
			InitStats( 400, 100, 100 );
			Title = "the guard";

			SpeechHue = Utility.RandomDyedHue();

			Hue = Utility.RandomSkinHue();

			if ( Female = Utility.RandomBool() )
			{
				Body = 0x191;
				Name = NameList.RandomName( "female" );

				switch( Utility.Random( 2 ) )
				{
					case 0: AddItem( new LeatherSkirt() ); break;
					case 1: AddItem( new LeatherShorts() ); break;
				}

				switch( Utility.Random( 5 ) )
				{
					case 0: AddItem( new FemaleLeatherChest() ); break;
					case 1: AddItem( new FemaleStuddedChest() ); break;
					case 2: AddItem( new LeatherBustierArms() ); break;
					case 3: AddItem( new StuddedBustierArms() ); break;
					case 4: AddItem( new FemalePlateChest() ); break;
				}
			}
			else
			{
				Body = 0x190;
				Name = NameList.RandomName( "male" );

				AddItem( new PlateChest() );
				AddItem( new PlateArms() );
				AddItem( new PlateGorget() );
				AddItem( new PlateLegs() );
			}

			Item hair = new Item( Utility.RandomList( 0x203B, 0x203C, 0x203D, 0x2044, 0x2045, 0x2047, 0x2049, 0x204A ) );

			hair.Hue = Utility.RandomHairHue();
			hair.Layer = Layer.Hair;
			hair.Movable = false;

			AddItem( hair );

			if( Utility.RandomBool() && !this.Female )
			{
				Item beard = new Item( Utility.RandomList( 0x203E, 0x203F, 0x2040, 0x2041, 0x204B, 0x204C, 0x204D ) );

				beard.Hue = hair.Hue;
				beard.Layer = Layer.FacialHair;
				beard.Movable = false;

				AddItem( beard );
			}

			Broadsword weapon = new Broadsword();

			weapon.Movable = false;
			weapon.Crafter = this;
			weapon.Quality = WeaponQuality.Exceptional;

			AddItem( weapon );

			Container pack = new Backpack();

			pack.Movable = false;

			pack.DropItem( new Gold( 10, 25 ) );

			AddItem( pack );

			SetSkill( SkillName.Anatomy, 70.1, 80.0 );
			SetSkill( SkillName.Tactics, 70.1, 80.0 );
			SetSkill( SkillName.Swords, 70.1, 80.0 );
			SetSkill( SkillName.MagicResist, 70.1, 80.0 );
		}
        public DragonianZealot() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            Name        = NameList.RandomName("dragon");
            Title       = "the dragonian zealot";
            Body        = 454;
            BaseSoundID = 362;

            SetStr(792, 825);
            SetDex(88, 110);
            SetInt(437, 475);

            SetHits(956, 990);
            SetMana(2185, 2375);

            SetDamage(16, 22);

            SetDamageType(ResistanceType.Physical, 100);

            SetResistance(ResistanceType.Physical, 60);
            SetResistance(ResistanceType.Fire, 60);
            SetResistance(ResistanceType.Cold, 30);
            SetResistance(ResistanceType.Poison, 25);
            SetResistance(ResistanceType.Energy, 35);

            SetSkill(SkillName.EvalInt, 58.0, 80.4);
            SetSkill(SkillName.Magery, 87.5, 99.4);
            SetSkill(SkillName.MagicResist, 99.2, 100.0);
            SetSkill(SkillName.Tactics, 97.6, 100.0);
            SetSkill(SkillName.Wrestling, 91.0, 93.2);

            Fame  = 88000;
            Karma = -88000;

////////////////////////////////Main Pack////////////////////////////////

            PackGold(75, 92);
            PackReg(25, 35);

////////////////////////////////1st Backpack////////////////////////////////

            Container pack1 = new Backpack();

            pack1.DropItem(new Cloak(532));
            pack1.DropItem(new Circlet());

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor1 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor1, 5, 15, 30);

                pack1.DropItem(armor1);
            }

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor2 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor2, 5, 15, 30);

                pack1.DropItem(armor2);
            }

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor3 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor3, 5, 15, 30);

                pack1.DropItem(armor3);
            }

            if (Utility.RandomDouble() < 0.25)
            {
                BaseArmor armor4 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor4, 5, 15, 30);

                pack1.DropItem(armor4);
            }

            if (Utility.RandomDouble() < 0.20)
            {
                BaseArmor armor5 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor5, 5, 15, 30);

                pack1.DropItem(armor5);
            }

            if (Utility.RandomDouble() < 0.50)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                BaseRunicTool.ApplyAttributesTo(weapon, 5, 25, 30);

                pack1.DropItem(weapon);
            }

            Container bag1 = new Bag();

            bag1.DropItem(new Gold(Utility.RandomMinMax(50, 100)));
            bag1.DropItem(new Bandage(Utility.RandomMinMax(9, 18)));
            bag1.DropItem(Loot.RandomGem());
            bag1.DropItem(Loot.RandomGem());
            pack1.DropItem(bag1);

            PackItem(pack1);

////////////////////////////////2nd Backpack////////////////////////////////

            Container pack2 = new Backpack();

            if (Utility.RandomDouble() < 0.10)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                BaseRunicTool.ApplyAttributesTo(weapon, 5, 15, 30);

                pack2.DropItem(weapon);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseArmor armor1 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor1, 5, 15, 30);

                pack2.DropItem(armor1);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseArmor armor2 = Loot.RandomArmor(true);
                BaseRunicTool.ApplyAttributesTo(armor2, 5, 15, 30);

                pack2.DropItem(armor2);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel earrings = new GoldEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 5, 15, 30);
                }

                pack2.DropItem(earrings);
            }

            Container bag2 = new Bag();

            bag2.DropItem(new Gold(Utility.RandomMinMax(100, 250)));
            bag2.DropItem(new DragonScale(Utility.RandomMinMax(15, 25)));
            bag2.DropItem(Loot.RandomPotion());
            bag2.DropItem(new GreaterCurePotion());
            bag2.DropItem(new GreaterStrengthPotion());
            bag2.DropItem(new HealPotion());
            bag2.DropItem(Loot.RandomGem());
            bag2.DropItem(Loot.RandomGem());
            pack2.DropItem(bag2);

            PackItem(pack2);

////////////////////////////////3rd Backpack////////////////////////////////

            Container pack3 = new Backpack();

            pack3.DropItem(new Spellbook());
            pack3.DropItem(Loot.RandomWand());
            pack3.DropItem(Loot.RandomClothing());
            pack3.DropItem(Loot.RandomClothing());

            if (Utility.RandomDouble() < 0.10)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 3, 15, 30);

                pack3.DropItem(clothing);
            }

            if (Utility.RandomDouble() < 0.05)
            {
                BaseJewel necklace = new GoldNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 3, 15, 30);
                }

                pack3.DropItem(necklace);
            }

            Container bag3 = new Bag();

            bag3.DropItem(new Gold(Utility.RandomMinMax(25, 50)));
            bag3.DropItem(new Bandage(Utility.RandomMinMax(5, 15)));
            bag3.DropItem(Loot.RandomGem());

            Item ScrollLoot1 = Loot.RandomScroll(0, 50, SpellbookType.Regular);

            ScrollLoot1.Amount = Utility.Random(2, 5);
            bag3.DropItem(ScrollLoot1);

            Item ScrollLoot2 = Loot.RandomScroll(0, 50, SpellbookType.Regular);

            ScrollLoot2.Amount = Utility.Random(2, 5);
            bag3.DropItem(ScrollLoot2);

            Item ScrollLoot3 = Loot.RandomScroll(0, 50, SpellbookType.Regular);

            ScrollLoot3.Amount = Utility.Random(2, 5);
            bag3.DropItem(ScrollLoot3);

            pack3.DropItem(bag3);

            PackItem(pack3);
        }
Ejemplo n.º 29
0
        internal static RunStatus SellMovement(object ret)
        {
            if (FunkyGame.GameIsInvalid)
            {
                ActionsChecked = false;
                FunkyTownRunPlugin.DBLog.InfoFormat("[Funky] Town Run Behavior Failed! (Not In Game/Invalid Actor/misc)");
                return(RunStatus.Failure);
            }

            BotMain.StatusText = "Town run: Vendor Routine Movement";



            DiaUnit objSellNavigation    = ZetaDia.Actors.GetActorsOfType <DiaUnit>(true).FirstOrDefault <DiaUnit>(u => u.Name.ToLower().StartsWith(VendorName));
            Vector3 vectorPlayerPosition = ZetaDia.Me.Position;
            Vector3 vectorSellLocation   = Vector3.Zero;

            if (objSellNavigation == null)
            {
                vectorSellLocation = SafetyVendorLocation;
            }
            else
            {
                vectorSellLocation = objSellNavigation.Position;
            }



            //Out-Of-Range...
            if (objSellNavigation == null)
            {
                FunkyTownRunPlugin.DBLog.InfoFormat("Vendor Obj is Null or Raycast Failed.. using Navigator to move!");
                Navigator.PlayerMover.MoveTowards(vectorSellLocation);
                return(RunStatus.Running);
            }

            float iDistanceFromSell = Vector3.Distance(vectorPlayerPosition, vectorSellLocation);

            if (FunkyGame.Hero.IsMoving)
            {
                return(RunStatus.Running);
            }

            if (iDistanceFromSell > 40f)
            {
                Navigator.MoveTo(vectorSellLocation, "Vendor");
                return(RunStatus.Running);
            }

            if (iDistanceFromSell > 7.5f && !UIElements.VendorWindow.IsValid)
            {
                objSellNavigation.Interact();
                return(RunStatus.Running);
            }

            if (!UIElements.VendorWindow.IsVisible)
            {
                objSellNavigation.Interact();
                return(RunStatus.Running);
            }

            if (!UIElements.InventoryWindow.IsVisible)
            {
                Backpack.InventoryBackPackToggle(true);
                return(RunStatus.Running);
            }

            return(RunStatus.Success);
        }
Ejemplo n.º 30
0
        public RatmanFighter() : base(AIType.AI_Melee, FightMode.Closest, 5, 1, 0.3, 0.6)
        {
            Name        = NameList.RandomName("ratman");
            Title       = "the Ratman Fighter";
            Body        = Utility.RandomList(42, 44, 45);
            BaseSoundID = 437;

            if (Body == 44)             //Axe
            {
                DamageMin += 2;
                DamageMax += 6;
                RawStr    += 10;
                RawDex    -= 10;
                Skills.Lumberjacking.Base += 75;
            }

            if (Body == 45)             //Sword
            {
                DamageMin          += 2;
                DamageMax          += 8;
                RawStr             += 10;
                RawDex             -= 10;
                Skills.Swords.Base += 75;
            }

            SetStr(150, 175);
            SetDex(105, 135);
            SetInt(87, 92);

            SetHits(125, 165);

            SetDamage(8, 12);

            SetDamageType(ResistanceType.Physical, 100);

            SetResistance(ResistanceType.Physical, 40);
            SetResistance(ResistanceType.Fire, 10);
            SetResistance(ResistanceType.Cold, 10);
            SetResistance(ResistanceType.Poison, 10);
            SetResistance(ResistanceType.Energy, 10);

            SetSkill(SkillName.Anatomy, 73.2, 89.1);
            SetSkill(SkillName.MagicResist, 73.8, 82.3);
            SetSkill(SkillName.Tactics, 66.3, 79.2);
            SetSkill(SkillName.Wrestling, 69.1, 82.1);

            Fame  = 2500;
            Karma = -2500;

            PackGold(12, 16);

            PackItem(new FishScale(Utility.RandomMinMax(12, 16)));

            switch (Utility.Random(6))
            {
            case 0: PackItem(new ChickenLeg()); break;

            case 1: PackItem(new CookedBird()); break;

            case 2: PackItem(new FishSteak()); break;

            case 3: PackItem(new LambLeg()); break;

            case 4: PackItem(new Ribs()); break;

            case 5: PackItem(new Sausage()); break;
            }

            switch (Utility.Random(6))
            {
            case 0: PackItem(new LeatherArms()); break;

            case 1: PackItem(new LeatherCap()); break;

            case 2: PackItem(new LeatherChest()); break;

            case 3: PackItem(new LeatherGloves()); break;

            case 4: PackItem(new LeatherGorget()); break;

            case 5: PackItem(new LeatherLegs()); break;
            }

            Container pack = new Backpack();

            pack.DropItem(new Gold(Utility.RandomMinMax(11, 13)));
            pack.DropItem(new Lockpick(Utility.RandomMinMax(5, 10)));
            pack.DropItem(new BeverageBottle(BeverageType.Wine));

            PackItem(pack);
        }
Ejemplo n.º 31
0
        public WarriorGuard(Mobile target = null) : base(target)
        {
            InitStats(1000, 1000, 1000);
            Title = "the guard";

            SpeechHue = Utility.RandomDyedHue();

            Hue = Race.Human.RandomSkinHue();

            if (Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");

                switch (Utility.Random(2))
                {
                case 0:
                    AddItem(new LeatherSkirt());
                    break;

                case 1:
                    AddItem(new LeatherShorts());
                    break;
                }

                switch (Utility.Random(5))
                {
                case 0:
                    AddItem(new FemaleLeatherChest());
                    break;

                case 1:
                    AddItem(new FemaleStuddedChest());
                    break;

                case 2:
                    AddItem(new LeatherBustierArms());
                    break;

                case 3:
                    AddItem(new StuddedBustierArms());
                    break;

                case 4:
                    AddItem(new FemalePlateChest());
                    break;
                }
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");

                AddItem(new PlateChest());
                AddItem(new PlateArms());
                AddItem(new PlateLegs());

                switch (Utility.Random(3))
                {
                case 0:
                    AddItem(new Doublet(Utility.RandomNondyedHue()));
                    break;

                case 1:
                    AddItem(new Tunic(Utility.RandomNondyedHue()));
                    break;

                case 2:
                    AddItem(new BodySash(Utility.RandomNondyedHue()));
                    break;
                }
            }

            Utility.AssignRandomHair(this);

            if (Utility.RandomBool())
            {
                Utility.AssignRandomFacialHair(this, HairHue);
            }

            Halberd weapon = new Halberd();

            weapon.Movable = false;
            weapon.Crafter = this;
            weapon.Quality = WeaponQuality.Exceptional;

            AddItem(weapon);

            Container pack = new Backpack();

            pack.Movable = false;

            pack.DropItem(new Gold(10, 25));

            AddItem(pack);

            Skills.Anatomy.Base      = 120.0;
            Skills.Tactics.Base      = 120.0;
            Skills.Swords.Base       = 120.0;
            Skills.MagicResist.Base  = 120.0;
            Skills.DetectHidden.Base = 100.0;

            NextCombatTime = Core.TickCount + 500;
            Focus          = target;
        }
 public Backpack_State_Aiming(Backpack _backpack)
 {
     backpack     = _backpack;
     inputActions = InputManager.Instance.InputActions;
 }
Ejemplo n.º 33
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    Mobile targ = (Mobile)targeted;
                    if (from != targ)
                    {
                        from.SendMessage("You may only set your own body to GM style.");
                    }

                    else
                    {
                        m_Mobile = from;

                        if (Config.Get("Staff.Staffbody", true))
                        {
                            m_Mobile.BodyValue = 987;

                            if (Config.Get("Staff.UseColoring", true))
                            {
                                switch (m_Mobile.AccessLevel)
                                {
                                case AccessLevel.Owner: m_Mobile.Hue = Config.Get("Staff.Owner", 1001); break;

                                case AccessLevel.Developer: m_Mobile.Hue = Config.Get("Staff.Developer", 1001); break;

                                case AccessLevel.Administrator: m_Mobile.Hue = Config.Get("Staff.Administrator", 1001); break;

                                case AccessLevel.Seer: m_Mobile.Hue = Config.Get("Staff.Seer", 467); break;

                                case AccessLevel.GameMaster: m_Mobile.Hue = Config.Get("Staff.GameMaster", 39); break;

                                case AccessLevel.Counselor: m_Mobile.Hue = Config.Get("Staff.Counselor", 3); break;
                                }
                            }
                        }

                        if (Config.Get("Staff.CutHair", true))
                        {
                            m_Mobile.HairItemID = 0;
                        }

                        if (Config.Get("Staff.CutFacialHair", true))
                        {
                            m_Mobile.FacialHairItemID = 0;
                        }

                        CommandLogging.WriteLine(from, "{0} {1} is assuming a GM body", from.AccessLevel, CommandLogging.Format(from));

                        Container pack = from.Backpack;

                        ArrayList ItemsToDelete = new ArrayList();

                        foreach (Item item in from.Items)
                        {
                            if (item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack)
                            {
                                ItemsToDelete.Add(item);
                            }
                        }
                        foreach (Item item in ItemsToDelete)
                        {
                            item.Delete();
                        }

                        if (pack == null)
                        {
                            pack         = new Backpack();
                            pack.Movable = false;

                            from.AddItem(pack);
                        }
                        else
                        {
                            pack.Delete();
                            pack         = new Backpack();
                            pack.Movable = false;

                            from.AddItem(pack);
                        }

                        from.Hunger  = 20;
                        from.Thirst  = 20;
                        from.Fame    = 0;
                        from.Karma   = 0;
                        from.Kills   = 0;
                        from.Hidden  = true;
                        from.Blessed = true;
                        from.Hits    = from.HitsMax;
                        from.Mana    = from.ManaMax;
                        from.Stam    = from.StamMax;

                        if (from.IsStaff())
                        {
                            EquipItem(new StaffRobe());

                            PackItem(new GMHidingStone());
                            PackItem(new GMEthereal());
                            PackItem(new StaffOrb(from));

                            PackItem(new Spellbook((ulong)18446744073709551615));

                            from.RawStr = 100;
                            from.RawDex = 100;
                            from.RawInt = 100;

                            from.Hits = from.HitsMax;
                            from.Mana = from.ManaMax;
                            from.Stam = from.StamMax;

                            for (int i = 0; i < targ.Skills.Length; ++i)
                            {
                                targ.Skills[i].Base = 120;
                            }
                        }

                        if (Config.Get("Staff.GiveBoots", true))
                        {
                            int color = 0;
                            if (Config.Get("Staff.UseColoring", true))
                            {
                                switch (m_Mobile.AccessLevel)
                                {
                                case AccessLevel.Owner: color = Config.Get("Staff.Owner", 1001); break;

                                case AccessLevel.Developer: color = Config.Get("Staff.Developer", 1001); break;

                                case AccessLevel.Administrator: color = Config.Get("Staff.Administrator", 1001); break;

                                case AccessLevel.Seer: color = Config.Get("Staff.Seer", 467); break;

                                case AccessLevel.GameMaster: color = Config.Get("Staff.GameMaster", 39); break;

                                case AccessLevel.Counselor: color = Config.Get("Staff.Counselor", 3); break;
                                }
                            }

                            if (from.IsStaff() && from.AccessLevel <= AccessLevel.Spawner)
                            {
                                EquipItem(new FurBoots(color));
                            }
                            else if (from.AccessLevel == AccessLevel.GameMaster)
                            {
                                EquipItem(new FurBoots(color));
                            }
                            if (from.AccessLevel == AccessLevel.Seer)
                            {
                                EquipItem(new FurBoots(color));
                            }
                            if (from.AccessLevel == AccessLevel.Administrator)
                            {
                                EquipItem(new FurBoots(color));
                            }
                            if (from.AccessLevel == AccessLevel.Developer)
                            {
                                EquipItem(new FurBoots(color));
                            }
                            if (from.AccessLevel >= AccessLevel.CoOwner)
                            {
                                EquipItem(new FurBoots(color));
                            }
                        }
                    }
                }
            }
Ejemplo n.º 34
0
        public WarriorGuard(Mobile target)
            : base(target)
        {
            InitStats(150, 150, 150);
            Title = "the guard";

            SpeechHue = Utility.RandomDyedHue();

            Hue = Utility.RandomSkinHue();

            if (Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");

                switch (Utility.Random(2))
                {
                case 0:
                    AddItem(new LeatherSkirt());
                    break;

                case 1:
                    AddItem(new LeatherShorts());
                    break;
                }

                switch (Utility.Random(5))
                {
                case 0:
                    AddItem(new FemaleLeatherChest());
                    break;

                case 1:
                    AddItem(new FemaleStuddedChest());
                    break;

                case 2:
                    AddItem(new LeatherBustierArms());
                    break;

                case 3:
                    AddItem(new StuddedBustierArms());
                    break;

                case 4:
                    AddItem(new FemalePlateChest());
                    break;
                }
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");

                AddItem(new PlateChest());
                AddItem(new PlateArms());
                AddItem(new PlateLegs());

                switch (Utility.Random(3))
                {
                case 0:
                    AddItem(new Doublet(Utility.RandomNondyedHue()));
                    break;

                case 1:
                    AddItem(new Tunic(Utility.RandomNondyedHue()));
                    break;

                case 2:
                    AddItem(new BodySash(Utility.RandomNondyedHue()));
                    break;
                }
            }
            Utility.AssignRandomHair(this);

            if (Utility.RandomBool())
            {
                Utility.AssignRandomFacialHair(this, HairHue);
            }

            AddItem(new Halberd());

            Container pack = new Backpack
            {
                Movable = false
            };

            AddItem(pack);

            Skills[SkillName.Anatomy].Base      = 120.0;
            Skills[SkillName.Tactics].Base      = 120.0;
            Skills[SkillName.Swords].Base       = 120.0;
            Skills[SkillName.MagicResist].Base  = 120.0;
            Skills[SkillName.DetectHidden].Base = 100.0;

            NextCombatTime = Core.TickCount + 500;
            Focus          = target;
        }
Ejemplo n.º 35
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Mobile)
                {
                    Mobile targ = (Mobile)targeted;
                    if (from != targ)
                    {
                        from.SendMessage("You may only set your own body to GM style.");
                    }

                    else
                    {
                        m_Mobile = from;

                        CommandLogging.WriteLine(from, "{0} {1} is assuming a GM body", from.AccessLevel, CommandLogging.Format(from));

                        Container pack = from.Backpack;

                        ArrayList ItemsToDelete = new ArrayList();

                        foreach (Item item in from.Items)
                        {
                            if (item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack)
                            {
                                ItemsToDelete.Add(item);
                            }
                        }
                        foreach (Item item in ItemsToDelete)
                        {
                            item.Delete();
                        }

                        if (pack == null)
                        {
                            pack         = new Backpack();
                            pack.Movable = false;

                            from.AddItem(pack);
                        }
                        else
                        {
                            pack.Delete();
                            pack         = new Backpack();
                            pack.Movable = false;

                            from.AddItem(pack);
                        }

                        from.Hunger  = 20;
                        from.Thirst  = 20;
                        from.Fame    = 0;
                        from.Karma   = 0;
                        from.Kills   = 0;
                        from.Hidden  = true;
                        from.Blessed = true;
                        from.Hits    = from.HitsMax;
                        from.Mana    = from.ManaMax;
                        from.Stam    = from.StamMax;

                        if (from.AccessLevel >= AccessLevel.Counselor)
                        {
                            EquipItem(new StaffRing());
                            Spellbook book1 = new Spellbook((ulong)18446744073709551615);
                            Spellbook book2 = new NecromancerSpellbook((ulong)0xffff);
                            Spellbook book3 = new BookOfChivalry();
                            Spellbook book4 = new BookOfBushido();
                            Spellbook book5 = new BookOfNinjitsu();

                            PackItem(new GMHidingStone());

                            PackItem(book1);
                            PackItem(book2);
                            PackItem(book3);
                            PackItem(book4);
                            PackItem(book5);
                            from.RawStr = 100;
                            from.RawDex = 100;
                            from.RawInt = 100;
                            from.Hits   = from.HitsMax;
                            from.Mana   = from.ManaMax;
                            from.Stam   = from.StamMax;

                            for (int i = 0; i < targ.Skills.Length; ++i)
                            {
                                targ.Skills[i].Base = 120;
                            }
                        }

                        if (from.AccessLevel == AccessLevel.Counselor)
                        {
                            EquipItem(new CounselorRobe());
                            EquipItem(new ThighBoots(3));
                            from.Title = "[Counselor]";
                        }

                        if (from.AccessLevel == AccessLevel.GameMaster)
                        {
                            EquipItem(new GMRobe());
                            EquipItem(new ThighBoots(39));
                            from.Title = "[GM]";
                        }

                        if (from.AccessLevel == AccessLevel.Seer)
                        {
                            EquipItem(new SeerRobe());
                            EquipItem(new ThighBoots(467));
                            from.Title = "[Seer]";
                        }

                        if (from.AccessLevel == AccessLevel.Administrator)
                        {
                            EquipItem(new AdminRobe());
                            EquipItem(new ThighBoots(1001));
                            from.Title = "[Admin]";
                        }

                        if (from.AccessLevel == AccessLevel.Developer)
                        {
                            EquipItem(new AdminRobe());
                            EquipItem(new ThighBoots(1001));
                            from.Title = "[Developer]";
                        }

                        if (from.AccessLevel == AccessLevel.Owner)
                        {
                            EquipItem(new AdminRobe());
                            EquipItem(new ThighBoots(1001));
                            from.Title = "[Owner]";
                        }
                    }
                }
            }
Ejemplo n.º 36
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (Inventory.Count == 0)
            {
                return;
            }
            Inventory.RemoveAt(0);
            ItemsInPackText.text = "Items:";
            foreach (var item in Inventory)
            {
                AdditionalItem.Invoke(item);
            }
        }

        if (Input.GetKeyDown(KeyCode.W))
        {
            var position = this.transform.position;
            position.y++;
            this.transform.position = position;
        }

        if (Input.GetKeyDown(KeyCode.A))
        {
            var position = this.transform.position;
            position.x--;
            this.transform.position = position;
        }

        if (Input.GetKeyDown(KeyCode.S))
        {
            var position = this.transform.position;
            position.y--;
            this.transform.position = position;
        }

        if (Input.GetKeyDown(KeyCode.D))
        {
            var position = this.transform.position;
            position.x++;
            this.transform.position = position;
        }

        if (Input.GetKeyDown(KeyCode.T))
        {
            PlaceItem();
        }

        if (Input.GetKeyDown(KeyCode.P))
        {
            saveNum += 1;
            Backpack saveBackpack = ScriptableObject.CreateInstance <Backpack>();
            saveBackpack.Inventory = Inventory;
            BackPackSaver.Instance.SaveBackPack(saveBackpack, "Current Backpack");
            SaveText.text = "Saved " + saveNum;
        }

        if (Input.GetKeyDown(KeyCode.L))
        {
            Inventory            = BackPackLoader.Instance.LoadBackPack("Current Backpack").Inventory;
            ItemsInPackText.text = "Items:";
            foreach (var item in Inventory)
            {
                AdditionalItem.Invoke(item);
            }
        }
    }
Ejemplo n.º 37
0
        private void DoRestock()
        {
            List <Item> list = new List <Item>(Backpack.Items);

            m_ItemTable.Clear();

            InternalGump.Clear();

            foreach (Item item in list)
            {
                item.Delete();
            }

            int count = Utility.RandomMinMax(m_ItemCountMin, m_ItemCountMax);

            for (int i = 0; i < count; i++)
            {
                Item item;

                switch (Utility.Random(3))
                {
                default:
                case 0: item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(false, false, true); break;

                case 1: item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(false, true, false); break;

                case 2: item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(true, false, false); break;
                }

                int weight = 0;

                if (0.10 > Utility.RandomDouble())
                {
                    int budget = Utility.RandomMinMax(500, 860);
                    RunicReforging.GenerateRandomItem(item, null, Utility.RandomMinMax(500, 860), 0, ReforgedPrefix.None, ReforgedSuffix.None);
                    weight += budget / 3;
                }
                else
                {
                    int props = Utility.RandomMinMax(3, 5);

                    if (props == 5 && 0.05 > Utility.RandomDouble())
                    {
                        props++;
                        weight += 100;
                    }

                    if (item is BaseWeapon)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, false, 0, props, m_IntensityMin, m_IntensityMax);
                    }
                    else if (item is BaseArmor)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseArmor)item, false, 0, props, m_IntensityMin, m_IntensityMax);
                    }
                    else if (item is BaseJewel)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseJewel)item, false, 0, props, m_IntensityMin, m_IntensityMax);
                    }
                    else if (item is BaseHat)
                    {
                        BaseRunicTool.ApplyAttributesTo((BaseHat)item, false, 0, props, m_IntensityMin, m_IntensityMax);
                    }
                }

                m_ItemTable[item] = (int)((weight + Server.SkillHandlers.Imbuing.GetTotalWeight(item, -1, false, true)) * 31.5);
                item.Movable      = false;
                Backpack.DropItem(item);
            }

            m_NextRestock = DateTime.UtcNow + TimeSpan.FromMinutes(Utility.RandomMinMax(m_RestockMin, m_RestockMax));
        }
Ejemplo n.º 38
0
        public static void FillBankAOS(Mobile m)
        {
            BankBox bank = m.BankBox;

            // The new AOS bankboxes don't have powerscrolls, they are automatically 'applied':

            for (int i = 0; i < PowerScroll.Skills.Count; ++i)
            {
                m.Skills[PowerScroll.Skills[i]].Cap = 120.0;
            }

            m.StatCap = 250;

            Container cont;

            // Begin box of money
            cont        = new WoodenBox();
            cont.ItemID = 0xE7D;
            cont.Hue    = 0x489;

            PlaceItemIn(cont, 16, 51, new BankCheck(500000));
            PlaceItemIn(cont, 28, 51, new BankCheck(250000));
            PlaceItemIn(cont, 40, 51, new BankCheck(100000));
            PlaceItemIn(cont, 52, 51, new BankCheck(100000));
            PlaceItemIn(cont, 64, 51, new BankCheck(50000));

            PlaceItemIn(cont, 16, 115, new Silver(9000));
            PlaceItemIn(cont, 34, 115, new Gold(60000));

            PlaceItemIn(bank, 18, 169, cont);
            // End box of money

            // Begin bag of potion kegs
            cont      = new Backpack();
            cont.Name = "Various Potion Kegs";

            PlaceItemIn(cont, 45, 149, MakePotionKeg(PotionEffect.CureGreater, 0x2D));
            PlaceItemIn(cont, 69, 149, MakePotionKeg(PotionEffect.HealGreater, 0x499));
            PlaceItemIn(cont, 93, 149, MakePotionKeg(PotionEffect.PoisonDeadly, 0x46));
            PlaceItemIn(cont, 117, 149, MakePotionKeg(PotionEffect.RefreshTotal, 0x21));
            PlaceItemIn(cont, 141, 149, MakePotionKeg(PotionEffect.ExplosionGreater, 0x74));

            PlaceItemIn(cont, 93, 82, new EmptyBottle(1000));

            PlaceItemIn(bank, 53, 169, cont);
            // End bag of potion kegs

            // Begin bag of tools
            cont      = new Bag();
            cont.Name = "Tool Bag";

            PlaceItemIn(cont, 30, 35, new TinkerTools(1000));
            PlaceItemIn(cont, 60, 35, new HousePlacementTool());
            PlaceItemIn(cont, 90, 35, new DovetailSaw(1000));
            PlaceItemIn(cont, 30, 68, new Scissors());
            PlaceItemIn(cont, 45, 68, new MortarPestle(1000));
            PlaceItemIn(cont, 75, 68, new ScribesPen(1000));
            PlaceItemIn(cont, 90, 68, new SmithHammer(1000));
            PlaceItemIn(cont, 30, 118, new TwoHandedAxe());
            PlaceItemIn(cont, 60, 118, new FletcherTools(1000));
            PlaceItemIn(cont, 90, 118, new SewingKit(1000));

            PlaceItemIn(cont, 36, 51, new RunicHammer(CraftResource.DullCopper, 1000));
            PlaceItemIn(cont, 42, 51, new RunicHammer(CraftResource.ShadowIron, 1000));
            PlaceItemIn(cont, 48, 51, new RunicHammer(CraftResource.Copper, 1000));
            PlaceItemIn(cont, 54, 51, new RunicHammer(CraftResource.Bronze, 1000));
            PlaceItemIn(cont, 61, 51, new RunicHammer(CraftResource.Gold, 1000));
            PlaceItemIn(cont, 67, 51, new RunicHammer(CraftResource.Agapite, 1000));
            PlaceItemIn(cont, 73, 51, new RunicHammer(CraftResource.Verite, 1000));
            PlaceItemIn(cont, 79, 51, new RunicHammer(CraftResource.Valorite, 1000));

            PlaceItemIn(cont, 36, 55, new RunicSewingKit(CraftResource.SpinedLeather, 1000));
            PlaceItemIn(cont, 42, 55, new RunicSewingKit(CraftResource.HornedLeather, 1000));
            PlaceItemIn(cont, 48, 55, new RunicSewingKit(CraftResource.BarbedLeather, 1000));

            PlaceItemIn(bank, 118, 169, cont);
            // End bag of tools

            // Begin bag of archery ammo
            cont      = new Bag();
            cont.Name = "Bag Of Archery Ammo";

            PlaceItemIn(cont, 48, 76, new Arrow(5000));
            PlaceItemIn(cont, 72, 76, new Bolt(5000));

            PlaceItemIn(bank, 118, 124, cont);
            // End bag of archery ammo

            // Begin bag of treasure maps
            cont      = new Bag();
            cont.Name = "Bag Of Treasure Maps";

            PlaceItemIn(cont, 30, 35, new TreasureMap(1, Map.Trammel));
            PlaceItemIn(cont, 45, 35, new TreasureMap(2, Map.Trammel));
            PlaceItemIn(cont, 60, 35, new TreasureMap(3, Map.Trammel));
            PlaceItemIn(cont, 75, 35, new TreasureMap(4, Map.Trammel));
            PlaceItemIn(cont, 90, 35, new TreasureMap(5, Map.Trammel));
            PlaceItemIn(cont, 90, 35, new TreasureMap(6, Map.Trammel));

            PlaceItemIn(cont, 30, 50, new TreasureMap(1, Map.Trammel));
            PlaceItemIn(cont, 45, 50, new TreasureMap(2, Map.Trammel));
            PlaceItemIn(cont, 60, 50, new TreasureMap(3, Map.Trammel));
            PlaceItemIn(cont, 75, 50, new TreasureMap(4, Map.Trammel));
            PlaceItemIn(cont, 90, 50, new TreasureMap(5, Map.Trammel));
            PlaceItemIn(cont, 90, 50, new TreasureMap(6, Map.Trammel));

            PlaceItemIn(cont, 55, 100, new Lockpick(30));
            PlaceItemIn(cont, 60, 100, new Pickaxe());

            PlaceItemIn(bank, 98, 124, cont);
            // End bag of treasure maps

            // Begin bag of raw materials
            cont      = new Bag();
            cont.Hue  = 0x835;
            cont.Name = "Raw Materials Bag";

            PlaceItemIn(cont, 92, 60, new BarbedLeather(5000));
            PlaceItemIn(cont, 92, 68, new HornedLeather(5000));
            PlaceItemIn(cont, 92, 76, new SpinedLeather(5000));
            PlaceItemIn(cont, 92, 84, new Leather(5000));

            PlaceItemIn(cont, 30, 118, new Cloth(5000));
            PlaceItemIn(cont, 30, 84, new Board(5000));
            PlaceItemIn(cont, 57, 80, new BlankScroll(500));

            PlaceItemIn(cont, 30, 35, new DullCopperIngot(5000));
            PlaceItemIn(cont, 37, 35, new ShadowIronIngot(5000));
            PlaceItemIn(cont, 44, 35, new CopperIngot(5000));
            PlaceItemIn(cont, 51, 35, new BronzeIngot(5000));
            PlaceItemIn(cont, 58, 35, new GoldIngot(5000));
            PlaceItemIn(cont, 65, 35, new AgapiteIngot(5000));
            PlaceItemIn(cont, 72, 35, new VeriteIngot(5000));
            PlaceItemIn(cont, 79, 35, new ValoriteIngot(5000));
            PlaceItemIn(cont, 86, 35, new IronIngot(5000));

            PlaceItemIn(cont, 30, 59, new RedScales(5000));
            PlaceItemIn(cont, 36, 59, new YellowScales(5000));
            PlaceItemIn(cont, 42, 59, new BlackScales(5000));
            PlaceItemIn(cont, 48, 59, new GreenScales(5000));
            PlaceItemIn(cont, 54, 59, new WhiteScales(5000));
            PlaceItemIn(cont, 60, 59, new BlueScales(5000));

            PlaceItemIn(bank, 98, 169, cont);
            // End bag of raw materials

            // Begin bag of spell casting stuff
            cont      = new Backpack();
            cont.Hue  = 0x480;
            cont.Name = "Spell Casting Stuff";

            PlaceItemIn(cont, 45, 105, new Spellbook(ulong.MaxValue));
            PlaceItemIn(cont, 65, 105, new NecromancerSpellbook((ulong)0xFFFF));
            PlaceItemIn(cont, 85, 105, new BookOfChivalry((ulong)0x3FF));
            PlaceItemIn(cont, 105, 105, new BookOfBushido());  //Default ctor = full
            PlaceItemIn(cont, 125, 105, new BookOfNinjitsu()); //Default ctor = full

            Runebook runebook = new Runebook(10);

            runebook.CurCharges = runebook.MaxCharges;
            PlaceItemIn(cont, 145, 105, runebook);

            Item toHue = new BagOfAllReagents(150);

            toHue.Hue = 0x2D;
            PlaceItemIn(cont, 45, 150, toHue);

            toHue     = new BagOfNecroReagents(150);
            toHue.Hue = 0x488;
            PlaceItemIn(cont, 65, 150, toHue);

            PlaceItemIn(cont, 140, 150, new BagOfAllReagents(500));

            for (int i = 0; i < 9; ++i)
            {
                PlaceItemIn(cont, 45 + (i * 10), 75, new RecallRune());
            }

            PlaceItemIn(cont, 141, 74, new FireHorn());

            PlaceItemIn(bank, 78, 169, cont);
            // End bag of spell casting stuff

            // Begin bag of ethereals
            cont      = new Backpack();
            cont.Hue  = 0x490;
            cont.Name = "Bag Of Ethy's!";

            PlaceItemIn(cont, 45, 66, new EtherealHorse());
            PlaceItemIn(cont, 69, 82, new EtherealOstard());
            PlaceItemIn(cont, 93, 99, new EtherealLlama());
            PlaceItemIn(cont, 117, 115, new EtherealKirin());
            PlaceItemIn(cont, 45, 132, new EtherealUnicorn());
            PlaceItemIn(cont, 69, 66, new EtherealRidgeback());
            PlaceItemIn(cont, 93, 82, new EtherealSwampDragon());
            PlaceItemIn(cont, 117, 99, new EtherealBeetle());

            PlaceItemIn(bank, 38, 124, cont);
            // End bag of ethereals

            // Begin first bag of artifacts
            cont      = new Backpack();
            cont.Hue  = 0x48F;
            cont.Name = "Bag of Artifacts";

            PlaceItemIn(cont, 45, 66, new TitansHammer());
            PlaceItemIn(cont, 69, 82, new InquisitorsResolution());
            PlaceItemIn(cont, 93, 99, new BladeOfTheRighteous());
            PlaceItemIn(cont, 117, 115, new ZyronicClaw());

            PlaceItemIn(bank, 58, 124, cont);
            // End first bag of artifacts

            // Begin second bag of artifacts
            cont      = new Backpack();
            cont.Hue  = 0x48F;
            cont.Name = "Bag of Artifacts";

            PlaceItemIn(cont, 45, 66, new GauntletsOfNobility());
            PlaceItemIn(cont, 69, 82, new MidnightBracers());
            PlaceItemIn(cont, 93, 99, new VoiceOfTheFallenKing());
            PlaceItemIn(cont, 117, 115, new OrnateCrownOfTheHarrower());
            PlaceItemIn(cont, 45, 132, new HelmOfInsight());
            PlaceItemIn(cont, 69, 66, new HolyKnightsBreastplate());
            PlaceItemIn(cont, 93, 82, new ArmorOfFortune());
            PlaceItemIn(cont, 117, 99, new TunicOfFire());
            PlaceItemIn(cont, 45, 115, new LeggingsOfBane());
            PlaceItemIn(cont, 69, 132, new ArcaneShield());
            PlaceItemIn(cont, 93, 66, new Aegis());
            PlaceItemIn(cont, 117, 82, new RingOfTheVile());
            PlaceItemIn(cont, 45, 99, new BraceletOfHealth());
            PlaceItemIn(cont, 69, 115, new RingOfTheElements());
            PlaceItemIn(cont, 93, 132, new OrnamentOfTheMagician());
            PlaceItemIn(cont, 117, 66, new DivineCountenance());
            PlaceItemIn(cont, 45, 82, new JackalsCollar());
            PlaceItemIn(cont, 69, 99, new HuntersHeaddress());
            PlaceItemIn(cont, 93, 115, new HatOfTheMagi());
            PlaceItemIn(cont, 117, 132, new ShadowDancerLeggings());
            PlaceItemIn(cont, 45, 66, new SpiritOfTheTotem());
            PlaceItemIn(cont, 69, 82, new BladeOfInsanity());
            PlaceItemIn(cont, 93, 99, new AxeOfTheHeavens());
            PlaceItemIn(cont, 117, 115, new TheBeserkersMaul());
            PlaceItemIn(cont, 45, 132, new Frostbringer());
            PlaceItemIn(cont, 69, 66, new BreathOfTheDead());
            PlaceItemIn(cont, 93, 82, new TheDragonSlayer());
            PlaceItemIn(cont, 117, 99, new BoneCrusher());
            PlaceItemIn(cont, 45, 115, new StaffOfTheMagi());
            PlaceItemIn(cont, 69, 132, new SerpentsFang());
            PlaceItemIn(cont, 93, 66, new LegacyOfTheDreadLord());
            PlaceItemIn(cont, 117, 82, new TheTaskmaster());
            PlaceItemIn(cont, 45, 99, new TheDryadBow());

            PlaceItemIn(bank, 78, 124, cont);
            // End second bag of artifacts

            // Begin bag of minor artifacts
            cont      = new Backpack();
            cont.Hue  = 0x48F;
            cont.Name = "Bag of Minor Artifacts";

            PlaceItemIn(cont, 45, 66, new LunaLance());
            PlaceItemIn(cont, 69, 82, new VioletCourage());
            PlaceItemIn(cont, 93, 99, new CavortingClub());
            PlaceItemIn(cont, 117, 115, new CaptainQuacklebushsCutlass());
            PlaceItemIn(cont, 45, 132, new NightsKiss());
            PlaceItemIn(cont, 69, 66, new ShipModelOfTheHMSCape());
            PlaceItemIn(cont, 93, 82, new AdmiralsHeartyRum());
            PlaceItemIn(cont, 117, 99, new CandelabraOfSouls());
            PlaceItemIn(cont, 45, 115, new IolosLute());
            PlaceItemIn(cont, 69, 132, new GwennosHarp());
            PlaceItemIn(cont, 93, 66, new ArcticDeathDealer());
            PlaceItemIn(cont, 117, 82, new EnchantedTitanLegBone());
            PlaceItemIn(cont, 45, 99, new NoxRangersHeavyCrossbow());
            PlaceItemIn(cont, 69, 115, new BlazeOfDeath());
            PlaceItemIn(cont, 93, 132, new DreadPirateHat());
            PlaceItemIn(cont, 117, 66, new BurglarsBandana());
            PlaceItemIn(cont, 45, 82, new GoldBricks());
            PlaceItemIn(cont, 69, 99, new AlchemistsBauble());
            PlaceItemIn(cont, 93, 115, new PhillipsWoodenSteed());
            PlaceItemIn(cont, 117, 132, new PolarBearMask());
            PlaceItemIn(cont, 45, 66, new BowOfTheJukaKing());
            PlaceItemIn(cont, 69, 82, new GlovesOfThePugilist());
            PlaceItemIn(cont, 93, 99, new OrcishVisage());
            PlaceItemIn(cont, 117, 115, new StaffOfPower());
            PlaceItemIn(cont, 45, 132, new ShieldOfInvulnerability());
            PlaceItemIn(cont, 69, 66, new HeartOfTheLion());
            PlaceItemIn(cont, 93, 82, new ColdBlood());
            PlaceItemIn(cont, 117, 99, new GhostShipAnchor());
            PlaceItemIn(cont, 45, 115, new SeahorseStatuette());
            PlaceItemIn(cont, 69, 132, new WrathOfTheDryad());
            PlaceItemIn(cont, 93, 66, new PixieSwatter());

            for (int i = 0; i < 10; i++)
            {
                PlaceItemIn(cont, 117, 128, new MessageInABottle(Utility.RandomBool() ? Map.Trammel : Map.Felucca, 4));
            }

            PlaceItemIn(bank, 18, 124, cont);

            if (Core.SE)
            {
                cont      = new Bag();
                cont.Hue  = 0x501;
                cont.Name = "Tokuno Minor Artifacts";

                PlaceItemIn(cont, 42, 70, new Exiler());
                PlaceItemIn(cont, 38, 53, new HanzosBow());
                PlaceItemIn(cont, 45, 40, new TheDestroyer());
                PlaceItemIn(cont, 92, 80, new DragonNunchaku());
                PlaceItemIn(cont, 42, 56, new PeasantsBokuto());
                PlaceItemIn(cont, 44, 71, new TomeOfEnlightenment());
                PlaceItemIn(cont, 35, 35, new ChestOfHeirlooms());
                PlaceItemIn(cont, 29, 0, new HonorableSwords());
                PlaceItemIn(cont, 49, 85, new AncientUrn());
                PlaceItemIn(cont, 51, 58, new FluteOfRenewal());
                PlaceItemIn(cont, 70, 51, new PigmentsOfTokuno());
                PlaceItemIn(cont, 40, 79, new AncientSamuraiDo());
                PlaceItemIn(cont, 51, 61, new LegsOfStability());
                PlaceItemIn(cont, 88, 78, new GlovesOfTheSun());
                PlaceItemIn(cont, 55, 62, new AncientFarmersKasa());
                PlaceItemIn(cont, 55, 83, new ArmsOfTacticalExcellence());
                PlaceItemIn(cont, 50, 85, new DaimyosHelm());
                PlaceItemIn(cont, 52, 78, new BlackLotusHood());
                PlaceItemIn(cont, 52, 79, new DemonForks());
                PlaceItemIn(cont, 33, 49, new PilferedDancerFans());

                PlaceItemIn(bank, 58, 124, cont);
            }

            if (Core.SE)        //This bag came only after SE.
            {
                cont      = new Bag();
                cont.Name = "Bag of Bows";

                PlaceItemIn(cont, 31, 84, new Bow());
                PlaceItemIn(cont, 78, 74, new CompositeBow());
                PlaceItemIn(cont, 53, 71, new Crossbow());
                PlaceItemIn(cont, 56, 39, new HeavyCrossbow());
                PlaceItemIn(cont, 82, 72, new RepeatingCrossbow());
                PlaceItemIn(cont, 49, 45, new Yumi());

                for (int i = 0; i < cont.Items.Count; i++)
                {
                    BaseRanged bow = cont.Items[i] as BaseRanged;

                    if (bow != null)
                    {
                        bow.Attributes.WeaponSpeed  = 35;
                        bow.Attributes.WeaponDamage = 35;
                    }
                }

                PlaceItemIn(bank, 108, 135, cont);
            }
        }
Ejemplo n.º 39
0
        public WarriorGuard(Mobile target) : base(target)
        {
            InitStats(1000, 1000, 1000);
            Title = "the guard";

            SpeechHue = Utility.RandomDyedHue();

            Hue = Utility.RandomSkinHue();

            if (Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");

                switch (Utility.Random(2))
                {
                case 0: AddItem(new LeatherSkirt()); break;

                case 1: AddItem(new LeatherShorts()); break;
                }

                switch (Utility.Random(5))
                {
                case 0: AddItem(new FemaleLeatherChest()); break;

                case 1: AddItem(new FemaleStuddedChest()); break;

                case 2: AddItem(new LeatherBustier()); break;

                case 3: AddItem(new StuddedBustier()); break;

                case 4: AddItem(new FemalePlateChest()); break;
                }
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");

                AddItem(new PlateChest());
                AddItem(new PlateArms());
                AddItem(new PlateGorget());
                AddItem(new PlateLegs());

                switch (Utility.Random(3))
                {
                case 0: AddItem(new Doublet(Utility.RandomNondyedHue())); break;

                case 1: AddItem(new Tunic(Utility.RandomNondyedHue())); break;

                case 2: AddItem(new BodySash(Utility.RandomNondyedHue())); break;
                }
            }
            Utility.AssignRandomHair(this);

            if (Utility.RandomBool())
            {
                Utility.AssignRandomFacialHair(this, HairHue);
            }

            Halberd weapon = new Halberd();

            weapon.Movable = false;

            AddItem(weapon);

            Container pack = new Backpack();

            pack.Movable = false;

            //pack.DropItem( new Gold( 250, 500 ) );

            AddItem(pack);

            Skills[SkillName.Anatomy].Base      = 120.0;
            Skills[SkillName.Tactics].Base      = 120.0;
            Skills[SkillName.Swords].Base       = 120.0;
            Skills[SkillName.MagicResist].Base  = 120.0;
            Skills[SkillName.DetectHidden].Base = 100.0;

            this.LastSwingTime = DateTime.UtcNow + TimeSpan.FromMilliseconds(500); // Core.TickCount + 500;
            this.Focus         = target;
        }
Ejemplo n.º 40
0
        public Gambler()
            : base(AIType.AI_Melee, FightMode.None, 10, 1, 0.8, 3.0)
        {
            SetStr(10, 30);
            SetDex(10, 30);
            SetInt(10, 30);
            Fame      = 50;
            Karma     = 50;
            SpeechHue = Utility.RandomDyedHue();
            Title     = "the gambler";
            Hue       = Utility.RandomSkinHue();
            Blessed   = true;
            NameHue   = 0x35;

            if (this.Female = Utility.RandomBool())
            {
                this.Body = 0x191;
                this.Name = NameList.RandomName("female");

                HairItemID = Utility.RandomList(0x203B, 0x203C, 0x203D, 0x2045, 0x204A, 0x2046, 0x2049);
                HairHue    = Utility.RandomHairHue();

                Item hat = null;
                switch (Utility.Random(5))
                {
                case 0: hat = new FloppyHat(Utility.RandomNeutralHue());              break;

                case 1: hat = new FeatheredHat(Utility.RandomNeutralHue());   break;

                case 2: hat = new Bonnet();                                             break;

                case 3: hat = new Cap(Utility.RandomNeutralHue());            break;
                }
                AddItem(hat);
            }
            else
            {
                this.Body = 0x190;
                this.Name = NameList.RandomName("male");

                HairItemID = Utility.RandomList(0x203B, 0x203C, 0x203D, 0x2044, 0x2045, 0x2047, 0x2048);
                HairHue    = Utility.RandomHairHue();

                FacialHairItemID = Utility.RandomList(0x0000, 0x203E, 0x203F, 0x2040, 0x2041, 0x2067, 0x2068, 0x2069);
                FacialHairHue    = HairHue;

                Item hat = null;
                switch (Utility.Random(7))
                {
                case 0: hat = new SkullCap(GetRandomHue());                   break;

                case 1: hat = new Bandana(GetRandomHue());                    break;

                case 2: hat = new WideBrimHat();                                        break;

                case 3: hat = new TallStrawHat(Utility.RandomNeutralHue());   break;

                case 4: hat = new StrawHat(Utility.RandomNeutralHue());               break;

                case 5: hat = new TricorneHat(Utility.RandomNeutralHue());    break;
                }
                AddItem(hat);
            }
            AddItem(new LongPants(GetRandomHue()));
            AddItem(new FancyShirt(GetRandomHue()));
            AddItem(new Boots(Utility.RandomNeutralHue()));
            AddItem(new Cloak(GetRandomHue()));
            AddItem(new BodySash(GetRandomHue()));

            Container pack = new Backpack();

            pack.Movable = false;
            pack.Visible = false;

            AddItem(pack);

            //reset stats
            for (int i = 0; i <= 5; ++i)
            {
                gamestats[i] = 0;
            }
        }
Ejemplo n.º 41
0
        private static void HarvestBonusEffect(Mobile harvester, Item tool)
        {
            if (Utility.Random(70) >= 5)
            {
                return;
            }

            if (Utility.Random(100) < 2 && harvester.ShilCheckSkill(SkillName.Fishing, 110, 200))
            {
                var sosBottle = new MessageInABottle();
                harvester.AddToBackpack(sosBottle);
                return;
            }

            var chance = Utility.Random(1, 10);

            Item item    = null;
            var  message = "";

            switch (chance)
            {
            case 1:
            {
                item    = new SpecialFishingNet();
                message = "You just found a special fishing net.";
                break;
            }

            case 2:
            {
                if (Utility.Random(10) < 4 && !Region.Find(harvester.Location, harvester.Map)
                    .GetRegion <GuardedRegion>()?.IsDisabled() == false)
                {
                    SpawnCreature(harvester, typeof(WaterElemental));
                    message = "You attract the attention of a water elemental";
                }
                break;
            }

            case 3:
            {
                if (Utility.Random(10) < 4)
                {
                    SpawnCreature(harvester, typeof(Walrus));
                    message = "A walrus comes by to see what you're doing";
                }
                break;
            }

            case 4:
            {
                item    = new TreasureMap(2, Map.Felucca);
                message = "You find a tattered old map!";
                break;
            }

            case 5:
            {
                item = new Backpack();
                item.AddItem(new Gold(Utility.Random(300) + 100));
                message = "You find an old backpack!";
                break;
            }

            case 6:
            {
                item    = new Seaweed();
                message = "You find some seaweed!";
                break;
            }

            case 8:
            {
                item    = GetRandomShell(harvester);
                message = "You find something valuable!";
                break;
            }
            }

            if (item != null)
            {
                var cont = harvester.Backpack;
                if (cont.TryDropItem(harvester, item, false))
                {
                    if (message.Length > 0)
                    {
                        harvester.SendSuccessMessage(message);
                    }
                }
                else if (message.Length > 0)
                {
                    harvester.SendFailureMessage(message);
                }
            }
            else if (message.Length > 0)
            {
                harvester.SendSuccessMessage(message);
            }
        }
 void Start()
 {
     movementcomp = GetComponent<Movement>();
     backpackComp = GetComponent<Backpack>();
     healthComp = GetComponent<Health>();
 }