Пример #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                Item iCrystal = targeted as Item;

                if (iCrystal is GolemPorterItem)
                {
                    GolemPorterItem xCrystal = (GolemPorterItem)iCrystal;

                    int myCharges = xCrystal.m_Charges;

                    if (!iCrystal.IsChildOf(from.Backpack))
                    {
                        from.SendMessage("You can only use this crystal on items in your pack.");
                    }
                    else if (myCharges < 100)
                    {
                        int UpMe = 5;
                        if (xCrystal.PorterType > 0)
                        {
                            UpMe = 1;
                        }

                        xCrystal.m_Charges = xCrystal.m_Charges + UpMe;

                        if (xCrystal.m_Charges > 100)
                        {
                            xCrystal.m_Charges = 100;
                        }

                        from.SendMessage("You charge your golem with the power crystal.");
                        from.RevealingAction();
                        from.PlaySound(0x652);

                        xCrystal.InvalidateProperties();

                        m_Crystal.Delete();
                    }
                    else
                    {
                        from.SendMessage("That golem is already fully charged.");
                    }
                }
                else
                {
                    from.SendMessage("You don't think that will really do anything.");
                }
            }
Пример #2
0
        public static bool ProcessGolemBook(Mobile m, Mobile tinker, Item dropped)
        {
            GolemManual book = (GolemManual)dropped;

            if (Server.Misc.Worlds.GetRegionName(tinker.Map, tinker.Location) != book.TinkerLocation)
            {
                return(false);
            }

            int tinkerSkill = (int)(m.Skills[SkillName.Tinkering].Value);

            if (tinkerSkill > 100)
            {
                tinkerSkill = 100;
            }

            int GoldReturn = 0;

            if (tinkerSkill > 0)
            {
                GoldReturn = (int)(book.NeedGold * (tinkerSkill * 0.005));
            }

            int HaveIngredients = 0;

            if (book.HaveClocks >= book.NeedClocks)
            {
                HaveIngredients++;
            }
            if (book.HaveCrystals >= book.NeedCrystals)
            {
                HaveIngredients++;
            }
            if (book.HaveGears >= book.NeedGears)
            {
                HaveIngredients++;
            }
            if (book.HaveGems >= book.NeedGems)
            {
                HaveIngredients++;
            }
            if (book.HaveGold >= book.NeedGold)
            {
                HaveIngredients++;
            }
            if (book.HaveOil >= book.NeedOil)
            {
                HaveIngredients++;
            }
            if (book.HaveMetalQty >= book.NeedMetalQty)
            {
                HaveIngredients++;
            }

            if (HaveIngredients < 7)
            {
                return(false);
            }

            int FighterGolem = 0;

            if (book.HaveSprings >= book.NeedSprings)
            {
                FighterGolem = 1;
            }

            int PortColor   = 0;
            int ExodusBoost = 0;

            if (GoldReturn > 0)
            {
                m.AddToBackpack(new Gold(GoldReturn)); tinker.Say("Here is " + GoldReturn.ToString() + " gold back for all of your help.");
            }

            if (book.GolemType == "a Valorite Golem")
            {
                PortColor = MaterialInfo.GetMaterialColor("valorite", "monster", 0); ExodusBoost = 9;
            }
            else if (book.GolemType == "a Verite Golem")
            {
                PortColor = MaterialInfo.GetMaterialColor("verite", "monster", 0); ExodusBoost = 8;
            }
            else if (book.GolemType == "an Agapite Golem")
            {
                PortColor = MaterialInfo.GetMaterialColor("agapite", "monster", 0); ExodusBoost = 7;
            }
            else if (book.GolemType == "a Golden Golem")
            {
                PortColor = MaterialInfo.GetMaterialColor("gold", "monster", 0); ExodusBoost = 6;
            }
            else if (book.GolemType == "a Bronze Golem")
            {
                PortColor = MaterialInfo.GetMaterialColor("bronze", "monster", 0); ExodusBoost = 5;
            }
            else if (book.GolemType == "a Copper Golem")
            {
                PortColor = MaterialInfo.GetMaterialColor("copper", "monster", 0); ExodusBoost = 4;
            }
            else if (book.GolemType == "a Shadow Iron Golem")
            {
                PortColor = MaterialInfo.GetMaterialColor("shadow iron", "monster", 0); ExodusBoost = 3;
            }
            else if (book.GolemType == "a Dull Copper Golem")
            {
                PortColor = MaterialInfo.GetMaterialColor("dull copper", "monster", 0); ExodusBoost = 2;
            }
            else if (book.GolemType == "an Iron Golem")
            {
                PortColor = 0x430; ExodusBoost = 1;
            }

            GolemPorterItem ball = new GolemPorterItem();

            string QuestLog = "had " + (book.GolemType).ToLower() + " built";

            if (book.HaveDarkCore > 0)
            {
                ball.PorterExodus = ExodusBoost; PortColor = 2118; QuestLog = QuestLog + " with the dark core of Exodus";
            }

            ball.PorterOwner = m.Serial;
            ball.PorterHue   = PortColor;
            ball.PorterType  = FighterGolem;
            ball.Hue         = PortColor;

            m.AddToBackpack(ball);

            LoggingFunctions.LogGenericQuest(m, QuestLog);

            m.PrivateOverheadMessage(MessageType.Regular, 1153, false, "My golem has been built.", m.NetState);
            m.PlaySound(0x5C3);

            dropped.Delete();

            return(true);
        }