示例#1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 2:
            {
                m_Bait   = (Bait)reader.ReadInt();
                m_Charge = reader.ReadInt();
                break;
            }

            case 1:
            {
                reader.ReadItem();
                goto case 0;
            }

            case 0:
            {
                break;
            }
            }

            Name = "canne à pêche";
        }
示例#2
0
        public static BaseBait CreateBait(Bait bait, int charge)
        {
            switch (bait)
            {
            case Bait.Truite: return(new BaitTruite(charge));

            case Bait.Dore: return(new BaitDore(charge));

            case Bait.Carpe: return(new BaitCarpe(charge));

            case Bait.Anguille: return(new BaitAnguille(charge));

            case Bait.Esturgeon: return(new BaitEsturgeon(charge));

            case Bait.Brochet: return(new BaitBrochet(charge));

            case Bait.Morue: return(new BaitMorue(charge));

            case Bait.Fletan: return(new BaitFletan(charge));

            case Bait.Maquereau: return(new BaitMaquereau(charge));

            case Bait.Sole: return(new BaitSole(charge));

            case Bait.Thon: return(new BaitThon(charge));

            case Bait.Saumon: return(new BaitSaumon(charge));

            case Bait.Raie: return(new BaitRaie(charge));

            case Bait.Espadon: return(new BaitEspadon(charge));

            default: return(null);
            }
        }
示例#3
0
        public BaseBait(Bait bait, int charge) : base(0xDCE)
        {
            Name   = "appât";
            Weight = 0.5;

            m_Bait    = bait;
            m_Charge  = charge;
            Stackable = true;
        }
示例#4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_Bait   = (Bait)reader.ReadInt();
                m_Charge = reader.ReadInt();
                break;
            }
            }
        }
示例#5
0
文件: Bait.cs 项目: Crome696/ServUO
 public InternalTarget(Bait bait, int amount)
     : base(0, false, TargetFlags.None)
 {
     m_Bait = bait;
     m_Amount = amount;
 }
示例#6
0
文件: Bait.cs 项目: Crome696/ServUO
 public InternalPrompt(Bait bait)
 {
     m_Bait = bait;
 }
示例#7
0
文件: Bait.cs 项目: Evad-lab/ServUOX
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted == m_Bait)
                {
                    return;
                }

                if (targeted is FishingPole)
                {
                    if (!m_Bait.IsFishBait())
                    {
                        from.SendMessage("Think again before applying lobster or crab bait to a fishing pole!");
                        return;
                    }

                    FishingPole pole = (FishingPole)targeted;

                    bool hasBait = pole.BaitType != null;

                    if (hasBait && pole.BaitType != m_Bait.BaitType)
                    {
                        from.SendMessage("You swap out the old bait for new.");
                    }

                    if (pole.BaitType == m_Bait.BaitType)
                    {
                        pole.BaitUses += m_Amount;
                    }
                    else
                    {
                        pole.BaitType  = m_Bait.BaitType;
                        pole.BaitUses += m_Amount;
                    }

                    if (m_Bait.Enhanced)
                    {
                        pole.EnhancedBait = true;
                    }

                    from.SendLocalizedMessage(1149759);  //You bait the hook.
                    m_Bait.UsesRemaining -= m_Amount;
                }
                else if (targeted is LobsterTrap)
                {
                    if (m_Bait.IsFishBait())
                    {
                        from.SendMessage("Think again before applying fish bait to a lobster trap!");
                        return;
                    }

                    LobsterTrap trap = (LobsterTrap)targeted;

                    bool hasBait = trap.BaitType != null;

                    trap.BaitType = m_Bait.BaitType;
                    //trap.Hue = m_Bait.Hue;

                    if (hasBait && trap.BaitType != m_Bait.BaitType)
                    {
                        from.SendMessage("You swap out the old bait for new.");
                    }

                    if (trap.BaitType == m_Bait.BaitType)
                    {
                        trap.BaitUses += m_Amount;
                    }
                    else
                    {
                        trap.BaitType  = m_Bait.BaitType;
                        trap.BaitUses += m_Amount;
                    }

                    if (m_Bait.Enhanced)
                    {
                        trap.EnhancedBait = true;
                    }

                    from.SendLocalizedMessage(1149760); //You bait the trap.
                    m_Bait.UsesRemaining -= m_Amount;
                }
                else if (targeted is Bait && ((Bait)targeted).IsChildOf(from.Backpack) && ((Bait)targeted).BaitType == m_Bait.BaitType)
                {
                    Bait bait = (Bait)targeted;

                    bait.UsesRemaining   += m_Amount;
                    m_Bait.UsesRemaining -= m_Amount;

                    if (m_Bait.UsesRemaining <= 0)
                    {
                        m_Bait.Delete();
                        from.SendLocalizedMessage(1116469); //You combine these baits into one cup and destroy the other cup.
                    }
                    else
                    {
                        from.SendMessage("You combine these baits into one cup.");
                    }

                    return;
                }

                if (m_Bait.UsesRemaining <= 0)
                {
                    m_Bait.Delete();
                    from.SendLocalizedMessage(1116467); //Your bait is used up so you destroy the container.
                }
            }
示例#8
0
文件: Bait.cs 项目: Evad-lab/ServUOX
 public InternalTarget(Bait bait, int amount)
     : base(0, false, TargetFlags.None)
 {
     m_Bait   = bait;
     m_Amount = amount;
 }
示例#9
0
文件: Bait.cs 项目: Evad-lab/ServUOX
 public InternalPrompt(Bait bait)
 {
     m_Bait = bait;
 }