Example #1
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is EvolutionEgg && Controlled && from == ControlMaster)
            {
                Say("*Eats the dragon egg*");
                //Effects.SendFlashEffect(this, (FlashType)2);
                Hue = dropped.Hue;
                dropped.Consume();
            }
            PlayerMobile player = from as PlayerMobile;

            if (player != null)
            {
                if (dropped is DragonDust)
                {
                    DragonDust dust = ( DragonDust )dropped;

                    int amount = (dust.Amount * 5);

                    this.PlaySound(665);
                    this.EvolutionPoints += amount;
                    dust.Delete();
                    this.Say("*" + this.Name + " absorbs the dragon dust*");

                    return(false);
                }
                else
                {
                }
            }

            return(base.OnDragDrop(from, dropped));
        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            PlayerMobile player = from as PlayerMobile;

            if (player != null)
            {
                if (dropped is DragonDust)
                {
                    DragonDust dust = ( DragonDust )dropped;

                    int amount = (dust.Amount * 5);

                    this.PlaySound(665);
                    this.KP += amount;
                    dust.Delete();
                    this.Say("*" + this.Name + " absorbs the dragon dust*");

                    return(false);
                }
                else
                {
                }
            }
            return(base.OnDragDrop(from, dropped));
        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            PlayerMobile player = from as PlayerMobile;

            if (player != null)
            {
                #region Dragon Dust
                if (dropped is DragonDust)
                {
                    DragonDust dust = ( DragonDust )dropped;

                    int amount = (dust.Amount * Utility.Random(1, 5));
                    if ((KP + amount) > 999999999)                     // Dont allow to gain more than 1 level
                    {
                    }
                    else
                    {
                        this.PlaySound(665);
                        this.KP += amount;
                        dust.Delete();
                        this.Say("*" + this.Name + " absorbs the dragon dust*");
                        Evolve_Check();
                        return(false);
                    }
                }
                #endregion

                #region Gems
                else if (dropped is StarSapphire || dropped is Diamond || dropped is Amethyst || dropped is Emerald || dropped is Sapphire || dropped is Citrine || dropped is Ruby || dropped is Amber || dropped is Tourmaline)
                {
                    int amount = dropped.Amount;
                    if (dropped.ItemID == Fav_Gem || dropped.ItemID == Fav_Gem2)
                    {
                        amount = dropped.Amount * 3;
                    }

                    string end = "*";
                    if (Ability_Charges != Ability_ChargesMax)
                    {
                        this.PlaySound(723);
                        if (Ability_Charges + amount <= Ability_ChargesMax)
                        {
                            this.Ability_Charges += amount;
                            dropped.Delete();
                        }
                        else if ((Ability_ChargesMax - Ability_Charges) < amount)
                        {
                            amount = Ability_ChargesMax - Ability_Charges;
                            this.Ability_Charges += amount;
                            if (dropped.ItemID == Fav_Gem || dropped.ItemID == Fav_Gem2)
                            {
                                dropped.Amount -= (amount / 3);
                            }
                            else
                            {
                                dropped.Amount -= amount;
                            }
                        }
                        if (amount > 1)
                        {
                            end = "s*";
                        }
                        this.Say("*" + this.Name + " eats the gem" + end);

                        if (Ability_Charges == Ability_ChargesMax && this.Loyalty < PetLoyalty.WonderfullyHappy)
                        {
                            this.Loyalty += 1;
                        }

                        return(false);
                    }
                }
                #endregion
            }
            return(base.OnDragDrop(from, dropped));
        }