Exemplo n.º 1
0
        public void GenerateROG(GamePlayer player, eObjectType objectType, eSlot slot)
        {
            player.RemoveBountyPoints(2000);
            GameNPC mob = new GameNPC();

            mob.Name            = "Unique Object";
            mob.CurrentRegionID = 1;
            mob.Level           = (byte)(player.Level);
            if (mob.Level > 50)
            {
                mob.Level = 51;
            }

            LootList   lootlist = new LootList();
            ItemUnique item     = null;

            item             = new ItemUnique();
            item.Object_Type = (int)objectType;
            item.Item_Type   = (int)slot;

            mob.Level           = 60;
            mob.Name            = "TOA Mob";
            mob.CurrentRegionID = 30;
            mob.Z = 9999;
            lootlist.AddFixed(LootGeneratorUniqueObject.GenerateUniqueItem(mob, player, item), 1);
            foreach (ItemUnique unique in lootlist.GetLoot())
            {
                unique.Price = 0;
                GameServer.Database.AddObject(unique);
                InventoryItem invitem = GameInventoryItem.Create <ItemUnique>(unique);
                player.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, invitem);
                player.Out.SendMessage("Generated: " + unique.Name, eChatType.CT_System, eChatLoc.CL_SystemWindow);
            }
        }
Exemplo n.º 2
0
 public BoxData(BasePlayer player, double time, string date, Vector3 pos)
 {
     x          = pos.x;
     y          = pos.y;
     z          = pos.z;
     lootList   = new LootList(player, date);
     lastAccess = time;
 }
Exemplo n.º 3
0
 void OnEnable()
 {
     this.tag     = "Enemy";
     isDead       = false;
     canMove      = true;
     canBeDamaged = true;
     lootlist     = FindObjectOfType <LootList>();
     player       = FindObjectOfType <PlayerBase>();
 }
Exemplo n.º 4
0
        public override void Start(ICoreAPI Api)
        {
            BlockLootVessel.lootLists.Clear();
            VesselDrops drops = Api.Assets.TryGet("config/vesseldrops.json").ToObject <VesselDrops>();

            foreach (var val in drops.vessels)
            {
                BlockLootVessel.lootLists[val.name] = LootList.Create(val.tries, val.drops.ToArray());
            }
        }
Exemplo n.º 5
0
    public virtual void OnEnable()
    {
        tag          = "Enemy";
        isDead       = false;
        canMove      = true;
        canBeDamaged = true;

        lootlist = FindObjectOfType <LootList>();
        player   = FindObjectOfType <PlayerBase>();
        InitializeEnemy();
    }
Exemplo n.º 6
0
        public ActionResult Index()
        {
            var       path     = Server.MapPath("~/loot.txt");
            CsvParser parser   = new CsvParser();
            var       list     = parser.ParseCsv(path);
            var       temp     = new List <LootEventViewModel>();
            var       lootList = new LootList();

            var lootTotalsDict = new Dictionary <string, int>();
            var lootTotalsList = new List <LootTotalsViewModel>();

            foreach (var item in list)
            {
                var playerName = TrimName(item.Player);
                if (lootTotalsDict.ContainsKey(playerName))
                {
                    lootTotalsDict[playerName]++;
                    var match = lootTotalsList.Where(p => p.Name == playerName).FirstOrDefault();
                    match.LootPieces++;
                }
                else
                {
                    lootTotalsDict.Add(playerName, 1);
                    lootTotalsList.Add(new LootTotalsViewModel()
                    {
                        Name       = playerName,
                        Class      = item.Class.ToLower(),
                        LootPieces = 1
                    });
                }
            }

            foreach (var item in list)
            {
                var loot = new LootEventViewModel()
                {
                    PlayerName    = TrimName(item.Player),
                    Date          = item.Date,
                    Item          = item.Item,
                    Boss          = item.Boss,
                    IsAwardReason = item.IsAwardReason,
                    ItemId        = item.ItemId,
                    Class         = item.Class.ToLower(),
                    ItemUrl       = "http://www.wowhead.com/item=" + item.ItemId
                };
                temp.Add(loot);
            }

            lootList.Loots      = temp;
            lootList.LootTotals = lootTotalsList;

            return(View(lootList));
        }
Exemplo n.º 7
0
    /// <summary>
    /// Calculate loot for a given loot list (can be defined at spawngroup / creature / spawn level)
    /// </summary>
    /// <param name="list"></param>
    /// <returns></returns>
    public static Loot CalculateLoot(LootList list)
    {
        var loot   = new Loot(0, 0);
        var tables = new List <LootTable>();

        if (list == null || list.IsEmpty)
        {
            return(loot);
        }

        foreach (var set in list.Set ?? new List <LootImport>())
        {
            // Is the set present?
            GameLog.SpawnInfo("Processing loot set {Name}", set.Name);
            if (Game.World.WorldData.TryGetValueByIndex(set.Name, out LootSet lootset))
            {
                loot += CalculateLoot(lootset, set.Rolls, set.Chance);
            }
            else
            {
                GameLog.Warning("Loot set {name} referenced in list, but could not be loaded", set.Name);
            }
        }

        // Now, calculate loot for any tables attached to the spawn
        foreach (var table in list.Table)
        {
            if (table.Rolls == 0)
            {
                tables.Add(table);
                continue;
            }
            for (var z = 0; z <= table.Rolls; z++)
            {
                if (Roll() <= table.Chance)
                {
                    tables.Add(table);
                }
            }
        }

        // Now that we have all tables that fired, we need to calculate actual loot

        foreach (var table in tables)
        {
            loot += CalculateTable(table);
        }

        return(loot);
    }
        public void Start(BaseCharacter bc)
        {
            lootTable = bc.lootList;

            listBox1.DataSource = null;
            listBox1.DataSource = lootTable.universalDrop;

            listBox2.Items.Clear();
            int level = 0;

            foreach (var item in lootTable.moneyDropPerLevel)
            {
                listBox2.Items.Add(level);
                level++;
            }


            Show();
        }
Exemplo n.º 9
0
 static void Postfix()
 {
     BlockLootVessel.lootLists["seed"] = LootList.Create(2,
                                                         LootItem.Item(1f, 5, 7, "seeds-carrot", "seeds-onion", "seeds-spelt", "seeds-turnip", "seeds-rice", "seeds-rye", "seeds-soybean", "seeds-pumpkin", "seeds-cabbage"),
                                                         LootItem.Item(1f, 5, 7, "wildfarming:wildseeds-herb-basil", "wildfarming:wildseeds-herb-thyme", "wildfarming:wildseeds-herb-sage", "wildfarming:wildseeds-herb-chamomile", "wildfarming:wildseeds-herb-mint", "wildfarming:wildseeds-herb-saffron", "wildfarming:wildseeds-herb-marjoram", "wildfarming:wildseeds-herb-cilantro", "wildfarming:wildseeds-herb-lavender")
                                                         );
     BlockLootVessel.lootLists["food"] = LootList.Create(1,
                                                         LootItem.Item(1.5f, 8, 15, "grain-spelt", "grain-rice", "grain-flax", "grain-rye"),
                                                         LootItem.Item(1, 8, 15, "redmeat-cured", "bushmeat-cured", "poultry-cured", "pickledlegume-soybean"),
                                                         LootItem.Item(1, 8, 15, "pickledvegetable-carrot", "pickledvegetable-parsnip", "pickledvegetable-turnip", "pickledvegetable-pumpkin", "pickledvegetable-onion", "pickledvegetable-cabbage"),
                                                         LootItem.Item(0.1f, 1, 1, "resonancearchive-1", "resonancearchive-2", "resonancearchive-3", "resonancearchive-4", "resonancearchive-5", "resonancearchive-6", "resonancearchive-7", "resonancearchive-8", "resonancearchive-9")
                                                         );
     BlockLootVessel.lootLists["forage"] = LootList.Create(2.5f,
                                                           LootItem.Item(1, 2, 6, "flint"),
                                                           LootItem.Item(1, 3, 9, "stick"),
                                                           LootItem.Item(1, 3, 16, "drygrass"),
                                                           LootItem.Item(1, 3, 24, "stone-chalk"),
                                                           LootItem.Item(1, 3, 24, "clay-blue", "clay-fire"),
                                                           LootItem.Item(1, 3, 24, "cattailtops"),
                                                           LootItem.Item(1, 1, 4, "poultice-linen-horsetail"),
                                                           LootItem.Item(0.5f, 1, 12, "flaxfibers"),
                                                           LootItem.Item(0.3f, 1, 3, "honeycomb"),
                                                           LootItem.Item(1f, 2, 6, "herbbundle-basil", "herbbundle-thyme", "herbbundle-sage", "herbbundle-saffron", "herbbundle-marjoram", "herbbundle-lavender", "herbbundle-chamomile", "herbbundle-cilantro", "herbbundle-mint"),
                                                           LootItem.Item(0.3f, 2, 6, "beenade-closed")
                                                           );
     BlockLootVessel.lootLists["farming"] = LootList.Create(2.5f,
                                                            LootItem.Item(0.5f, 5, 7, "seeds-carrot", "seeds-onion", "seeds-spelt", "seeds-turnip", "seeds-rice", "seeds-rye", "seeds-soybean", "seeds-pumpkin", "seeds-cabbage"),
                                                            LootItem.Item(0.5f, 5, 7, "wildfarming:wildseeds-herb-basil", "wildfarming:wildseeds-herb-thyme", "wildfarming:wildseeds-herb-sage", "wildfarming:wildseeds-herb-chamomile", "wildfarming:wildseeds-herb-mint", "wildfarming:wildseeds-herb-saffron", "wildfarming:wildseeds-herb-marjoram", "wildfarming:wildseeds-herb-cilantro", "wildfarming:wildseeds-herb-lavender"),
                                                            LootItem.Item(0.75f, 3, 10, "feather"),
                                                            LootItem.Item(0.75f, 2, 10, "flaxfibers"),
                                                            LootItem.Item(0.35f, 2, 10, "flaxtwine"),
                                                            LootItem.Item(0.5f, 2, 6, "herbbundle-basil", "herbbundle-thyme", "herbbundle-sage", "herbbundle-saffron", "herbbundle-marjoram", "herbbundle-lavender", "herbbundle-chamomile", "herbbundle-cilantro", "herbbundle-mint"),
                                                            LootItem.Item(0.75f, 5, 10, "cattailtops"),
                                                            LootItem.Item(0.1f, 1, 1, "scythe-copper", "scythe-tinbronze")
                                                            );
 }
Exemplo n.º 10
0
        /// <summary>
        /// Generate loot for given mob
        /// </summary>
        /// <param name="mob"></param>
        /// <param name="killer"></param>
        /// <returns></returns>
        public virtual LootList GenerateLoot(GameNPC mob, GameObject killer)
        {
            LootList loot = new LootList();

            return(loot);
        }
Exemplo n.º 11
0
 /// <summary>
 /// Generate loot for given mob
 /// </summary>
 /// <param name="mob"></param>
 /// <param name="killer"></param>
 /// <returns></returns>
 public virtual LootList GenerateLoot(GameNPC mob, GameObject killer)
 {
     LootList loot = new LootList();
     return loot;
 }
Exemplo n.º 12
0
 public PlayerData(BasePlayer player, double time, string date)
 {
     lootList   = new LootList(player, date);
     lastAccess = time;
 }