public Monster GenerateOneMonster()
        {
            Monster monster = new Monster();

            monster.Model       = GameModel.ModelGeometryCompiler.LoadModel("default");
            monster.DisplayName = "monster. kill me please.";
            Vector3 pos = new Vector3(RNG.NextInt(63), 0, RNG.NextInt(63));

            monster.Position             = pos;
            monster.LeashRadius          = 30;
            monster.PrimaryLootRollCount = 2;
            monster.PrimaryLootTable     = new List <Tuple <int, Item> >();
            ItemConsumable potA = new ItemConsumable
            {
                Colour = new Color(200, 50, 0),
                Name   = "HP potion"
            };
            ItemConsumable potB = new ItemConsumable
            {
                Colour = new Color(0, 100, 200),
                Name   = "MP potion"
            };
            Material  matA  = Material.MaterialTemplates.GetRandomMaterial();
            ItemEquip weapA = new ItemEquip();

            BonusPool p = BonusPool.Load("heavy_0_10");

            weapA.Bonuses.Add(p.PickBonus());
            weapA.Bonuses.Add(p.PickBonus());
            weapA.SubType           = RNG.NextInt(0, 1) * 4;
            weapA.PrimaryMaterial   = Material.MaterialTemplates.GetRandomMaterial();
            weapA.SecondaryMaterial = Material.MaterialTemplates.GetRandomMaterial();
            monster.PrimaryLootTable.Add(new Tuple <int, Item>(5, potA));
            monster.PrimaryLootTable.Add(new Tuple <int, Item>(5, potB));
            monster.PrimaryLootTable.Add(new Tuple <int, Item>(1, matA));
            monster.PrimaryLootTable.Add(new Tuple <int, Item>(3, null));
            monster.PrimaryLootTable.Add(new Tuple <int, Item>(10, weapA));

            return(monster);
        }
Beispiel #2
0
        GameObject.Item MakeRandomEquip()
        {
            ItemEquip eq = new ItemEquip();
            BonusPool p  = BonusPool.Load("heavy_0_10");

            eq.Bonuses.Add(p.PickBonus());
            eq.Bonuses.Add(p.PickBonus());
            eq.ResetSockets(1);
            eq.Sockets[0] = new ItemGemstone("HP", 4);
            Enchantment enc     = new Enchantment();
            int         enctype = GameObject.RNG.Next(0, 3);

            switch (enctype)
            {
            case 0:
            {
                enc = new Enchantment()
                {
                    Effecttext = "Fire damage +{0}%", Type = "dmg_scale_fire"
                };
                enc.LineColour = new Color(255, 50, 30);
                enc.Multiplier = 0.15f;
                break;
            }

            case 1:
            {
                enc = new Enchantment()
                {
                    Effecttext = "Water resistance +{0}%", Type = "element_multiplier_water"
                };
                enc.LineColour = new Color(0, 50, 200);
                enc.Multiplier = 0.05f;
                break;
            }

            case 2:
            {
                enc = new Enchantment()
                {
                    Effecttext = "Reduces poisoning duration by +{0}%", Type = "element_dot_time_poison"
                };
                enc.LineColour = new Color(0, 150, 20);
                enc.Multiplier = 0.33f;
                break;
            }
            }
            eq.Enchant = enc;
            eq.SubType = GameObject.RNG.Next(0, 10);
            if (eq.SubType == 7)
            {
                eq.SubType = 18;
            }
            if (eq.SubType == 8)
            {
                eq.SubType = 27;
            }
            if (eq.SubType == 9)
            {
                eq.SubType = 15;
            }
            eq.PrimaryMaterial   = Material.MaterialTemplates.GetRandomMaterial();
            eq.SecondaryMaterial = Material.MaterialTemplates.GetRandomMaterial();
            eq.StackSize         = 1;
            return(eq);
        }
Beispiel #3
0
        private void OKButton_Clicked(object sender, EventArgs e)
        {
            GameObject.Item Item;
            Item                = GameObject.Items.Material.MaterialTemplates.GetRandomMaterial();
            Item.SubType        = GameObject.RNG.Next(GameObject.Items.Material.MaterialType.Max);
            Item.Description    = "A " + GameObject.Items.Material.MaterialType.GetTypeName(Item.SubType) + " made from " + Item.Name + ". Used in crafting equipment.";
            this.OKButton.Title = Item.GetName();
            this.slot.Item      = Item;
            ItemEquip eq = new ItemEquip();
            BonusPool p  = BonusPool.Load("heavy_0_10");

            eq.Bonuses.Add(p.PickBonus());
            eq.Bonuses.Add(p.PickBonus());
            Enchantment enc     = new Enchantment();
            int         enctype = GameObject.RNG.Next(0, 3);

            switch (enctype)
            {
            case 0:
            {
                enc = new Enchantment()
                {
                    Effecttext = "Fire damage +{0}%", Type = "dmg_scale_fire"
                };
                enc.LineColour = new Color(255, 50, 30);
                enc.Multiplier = 0.15f;
                break;
            }

            case 1:
            {
                enc = new Enchantment()
                {
                    Effecttext = "Water resistance +{0}%", Type = "element_multiplier_water"
                };
                enc.LineColour = new Color(0, 50, 200);
                enc.Multiplier = 0.05f;
                break;
            }

            case 2:
            {
                enc = new Enchantment()
                {
                    Effecttext = "Reduces poisoning duration by +{0}%", Type = "element_dot_time_poison"
                };
                enc.LineColour = new Color(0, 150, 20);
                enc.Multiplier = 0.33f;
                break;
            }
            }
            eq.Enchant = enc;
            eq.SubType = GameObject.RNG.Next(0, 10);
            if (eq.SubType == 7)
            {
                eq.SubType = 18;
            }
            if (eq.SubType == 8)
            {
                eq.SubType = 27;
            }
            if (eq.SubType == 9)
            {
                eq.SubType = 15;
            }
            eq.PrimaryMaterial   = Material.MaterialTemplates.GetRandomMaterial();
            eq.SecondaryMaterial = Material.MaterialTemplates.GetRandomMaterial();
            List <string> ToolTip = eq.GetTooltip();

            this.slot.Item = eq;
            Console.WriteEx("New item is ^BEGINLINK " + Renderer.ColourToCode(eq.NameColour) + "[" + eq.GetName() + "] ^ENDLINK .^FFFFFF Click name to see more.", new List <Action> {
                new Action(() => { ToolTipWindow tip = new ToolTipWindow(this.WM, ToolTip, WM.MouseX, WM.MouseY, false);
                                   WM.Add(tip); })
            });
            //this.Player.EquipItem(eq);
            this.Title = this.Player.CalculateStat("HP").ToString();
        }