예제 #1
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile    from = state.Mobile;
            Container pack = from.Backpack;

            SailTimer waitTime;
            int       travelTime = 5;

            switch (info.ButtonID)
            {
            default:
            {
                from.SendMessage("Another time, perhaps.");
                break;
            }

            case 1:
            {
                if (pack.ConsumeTotal(typeof(Copper), m_Cost))
                {
                    if (from.Map != m_SailMap)
                    {
                        travelTime += 30;
                    }

                    travelTime += (m_Cost / 10);

                    if (travelTime > 90 && from.Map == m_SailMap)
                    {
                        travelTime = Utility.RandomMinMax(75, 90);
                    }
                    else if (travelTime > 120 && from.Map != m_SailMap)
                    {
                        travelTime = Utility.RandomMinMax(110, 120);
                    }

                    from.Location = m_SendTo;
                    from.Map      = Map.Backtrol;

                    BaseCreature.TeleportPets(from, m_SendTo, Map.Backtrol);

                    waitTime = new SailTimer(from, m_SailTo, m_SailMap, TimeSpan.FromSeconds(travelTime));
                    waitTime.Start();

                    from.AddToBackpack(new SailTimerCheck());

                    //from.SendMessage( "Cost: {0} | Travel Time: {1}", m_Cost, TimeSpan.FromSeconds(travelTime) );
                }
                else
                {
                    from.SendMessage("Please come back with the fare price.");
                }

                break;
            }

            case 2:
            {
                if (pack.ConsumeTotal(typeof(SailingMembershipCard), 0))
                {
                    if (from.Map != m_SailMap)
                    {
                        travelTime += 30;
                    }

                    travelTime += (m_Cost / 10);

                    if (travelTime > 90 && from.Map == m_SailMap)
                    {
                        travelTime = Utility.RandomMinMax(75, 90);
                    }
                    else if (travelTime > 120 && from.Map != m_SailMap)
                    {
                        travelTime = Utility.RandomMinMax(110, 120);
                    }

                    from.Location = m_SendTo;
                    from.Map      = Map.Backtrol;

                    BaseCreature.TeleportPets(from, m_SendTo, Map.Backtrol);

                    waitTime = new SailTimer(from, m_SailTo, m_SailMap, TimeSpan.FromSeconds(travelTime));
                    waitTime.Start();

                    from.AddToBackpack(new SailTimerCheck());

                    //from.SendMessage( "Cost: {0} | Travel Time: {1}", m_Cost, TimeSpan.FromSeconds(travelTime) );
                }
                else
                {
                    from.SendMessage("That's not a membership card!");
                }

                break;
            }

            case 3:
            {
                from.SendMessage("Another time, perhaps.");
                break;
            }
            }
        }
예제 #2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile    from = state.Mobile;
            Container pack = from.Backpack;

            if (pack == null)
            {
                return;
            }

            SailTimer waitTime;
            int       travelTime = 5;

            switch (info.ButtonID)
            {
            default:
            {
                from.SendMessage("Another time, perhaps.");
                break;
            }

            case 1:
            {
                if (pack.ConsumeTotal(typeof(Gold), m_Cost))
                {
                    if (from.Map != m_SailMap)
                    {
                        travelTime += 30;
                    }

                    travelTime += (int)(m_Cost / Math.PI);

                    if (travelTime > 90 && from.Map == m_SailMap)
                    {
                        travelTime = Utility.RandomMinMax(75, 90);
                    }
                    else if (travelTime > 120 && from.Map != m_SailMap)
                    {
                        travelTime = Utility.RandomMinMax(110, 120);
                    }



                    foreach (Mobile m in from.GetMobilesInRange(3))
                    {
                        if (m is BaseCreature)
                        {
                            BaseCreature pet = (BaseCreature)m;

                            if (pet.Controlled && pet.ControlMaster == from)
                            {
                                pet.Blessed = true;
                            }
                        }
                    }

                    BaseCreature.TeleportPets(from, m_SendTo, from.Map);
                    from.Location = m_SendTo;
                    from.Blessed  = true;

                    waitTime = new SailTimer(from, m_SailTo, m_SailMap, TimeSpan.FromSeconds(travelTime));
                    waitTime.Start();

                    from.AddToBackpack(new SailTimerCheck());
                }
                else
                {
                    from.SendMessage("Please come back with the fare price in copper.");
                }

                break;
            }

            case 2:
            {
                if (pack.ConsumeTotal(typeof(SailingMembershipCard), 0))
                {
                    if (from.Map != m_SailMap)
                    {
                        travelTime += 30;
                    }

                    travelTime += (m_Cost / 15);

                    if (travelTime > 90 && from.Map == m_SailMap)
                    {
                        travelTime = Utility.RandomMinMax(75, 90);
                    }
                    else if (travelTime > 120 && from.Map != m_SailMap)
                    {
                        travelTime = Utility.RandomMinMax(110, 120);
                    }

                    foreach (Mobile m in from.GetMobilesInRange(3))
                    {
                        if (m is BaseCreature)
                        {
                            BaseCreature pet = (BaseCreature)m;

                            if (pet.Controlled && pet.ControlMaster == from)
                            {
                                pet.Blessed = true;
                            }
                        }
                    }

                    BaseCreature.TeleportPets(from, m_SendTo, from.Map);

                    from.Location = m_SendTo;
                    from.Blessed  = true;

                    waitTime = new SailTimer(from, m_SailTo, m_SailMap, TimeSpan.FromSeconds(travelTime));
                    waitTime.Start();

                    from.AddToBackpack(new SailTimerCheck());
                }
                else
                {
                    from.SendMessage("That's not a membership card!");
                }

                break;
            }

            case 3:
            {
                from.SendMessage("Another time, perhaps.");
                break;
            }
            }
        }