Exemple #1
0
        private void ToggleQuestItem_Callback(Mobile from, object obj)
        {
            if (from is PlayerMobile)
            {
                PlayerMobile player = (PlayerMobile)from;

                if (obj is Item)
                {
                    Item item = (Item)obj;

                    if (item.IsChildOf(player.Backpack))
                    {
                        if (!QuestHelper.CheckItem(player, item))
                        {
                            player.SendLocalizedMessage(1072355, null, 0x23);                               // That item does not match any of your quest criteria
                        }
                    }
                }
                else
                {
                    player.SendLocalizedMessage(1074769);                       // An item must be in your backpack (and not in a container within) to be toggled as a quest item.
                }
                player.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(ToggleQuestItem_Callback));
            }
        }
Exemple #2
0
 public static void AttemptShoot(PlayerMobile from, INinjaWeapon weapon)
 {
     if (CanUseWeapon(from, weapon))
     {
         from.BeginTarget(weapon.WeaponMaxRange, false, TargetFlags.Harmful, new TargetStateCallback <INinjaWeapon>(OnTarget), weapon);
     }
 }
Exemple #3
0
        public override void OnDoubleClick(Mobile from)
        {
            base.OnDoubleClick(from);

            if (from is PlayerMobile)
            {
                PlayerMobile m = (PlayerMobile)from;

                m.SendMessage("Choisissez un pot (Botanique) ou le sol (Agriculture).");
                m.BeginTarget(1, true, TargetFlags.None, new TargetCallback(this.ChooseTarget_OnTarget));
            }
        }
Exemple #4
0
        public static void QSL_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            if (from is PlayerMobile)
            {
                PlayerMobile m = (PlayerMobile)from;

                if (m != null)
                {
                    m.SendMessage("Choisissez le livre ou instrument a utiliser.");
                    m.BeginTarget(12, false, TargetFlags.None, new TargetCallback(QSL_OnTarget));
                }
            }
        }
Exemple #5
0
        public static void OnVirtueUsed(Mobile from)
        {
            if (!from.CheckAlive())
            {
                return;
            }

            PlayerMobile protector = from as PlayerMobile;

            if (protector == null)
            {
                return;
            }

            Account acc = protector.Account as Account;

            if (acc == null || acc.Trial)
            {
                protector.SendLocalizedMessage(1111860);                   // Trial account players cannot offer protection to another player.
            }
            else if (!VirtueHelper.IsSeeker(protector, VirtueName.Justice))
            {
                protector.SendLocalizedMessage(1049610);                   // You must reach the first path in this virtue to invoke it.
            }
            else if (!protector.CanBeginAction(typeof(JusticeVirtue)))
            {
                protector.SendLocalizedMessage(1049370);                   // You must wait a while before offering your protection again.
            }
            else if (protector.JusticeProtectors.Count > 0)
            {
                protector.SendLocalizedMessage(1049542);                   // You cannot protect someone while being protected.
            }
            else if (protector.Map != Map.Felucca)
            {
                protector.SendLocalizedMessage(1049372);                   // You cannot use this ability here.
            }
            else
            {
                protector.BeginTarget(14, false, TargetFlags.None, new TargetCallback(OnVirtueTargeted));
                protector.SendLocalizedMessage(1049366);                   // Choose the player you wish to protect.
            }
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Town.Owner != m_Faction || !m_Faction.IsCommander(m_From))
            {
                m_From.SendLocalizedMessage(1010339); // You no longer control this city
                return;
            }

            switch (info.ButtonID)
            {
            case 1: // hire sheriff
            {
                if (m_Town.Sheriff != null)
                {
                    m_From.SendLocalizedMessage(1010342); // You must fire your Sheriff before you can elect a new one
                }
                else
                {
                    m_From.SendLocalizedMessage(1010347); // Who shall be your new sheriff
                    m_From.BeginTarget(12, false, TargetFlags.None, HireSheriff_OnTarget);
                }

                break;
            }

            case 2: // hire finance minister
            {
                if (m_Town.Finance != null)
                {
                    m_From.SendLocalizedMessage(
                        1010345); // You must fire your finance minister before you can elect a new one
                }
                else
                {
                    m_From.SendLocalizedMessage(1010348); // Who shall be your new Minister of Finances?
                    m_From.BeginTarget(12, false, TargetFlags.None, HireFinanceMinister_OnTarget);
                }

                break;
            }

            case 3: // fire sheriff
            {
                if (m_Town.Sheriff == null)
                {
                    m_From.SendLocalizedMessage(1010350); // You need to elect a sheriff before you can fire one
                }
                else
                {
                    m_From.SendLocalizedMessage(1010349);         // You have fired your sheriff
                    m_Town.Sheriff.SendLocalizedMessage(1010270); // You have been fired as Sheriff
                    m_Town.Sheriff = null;
                }

                break;
            }

            case 4: // fire finance minister
            {
                if (m_Town.Finance == null)
                {
                    m_From.SendLocalizedMessage(
                        1010352); // You need to elect a financial minister before you can fire one
                }
                else
                {
                    m_From.SendLocalizedMessage(1010351);         // You have fired your financial Minister
                    m_Town.Finance.SendLocalizedMessage(1010151); // You have been fired as Finance Minister
                    m_Town.Finance = null;
                }

                break;
            }
            }
        }
 private void CraftEnhancedSpellbook(PlayerMobile pm)
 {
     pm.SendMessage("Select an empty spellbook to enhance with this tome");
     pm.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(CraftEnhancedSpellbook_Callback));
 }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Town.Owner != m_Faction || !m_Faction.IsCommander(m_From))
            {
                m_From.SendAsciiMessage("You no longer control this city.");
                return;
            }

            switch (info.ButtonID)
            {
            case 1:                     // hire sheriff
            {
                if (m_Town.Sheriff != null)
                {
                    m_From.SendAsciiMessage("You must fire your Sheriff before you can elect a new one.");
                }
                else
                {
                    m_From.SendAsciiMessage("Who shall be your new sheriff.");
                    m_From.BeginTarget(12, false, TargetFlags.None, new TargetCallback(HireSheriff_OnTarget));
                }

                break;
            }

            case 2:                     // hire finance minister
            {
                if (m_Town.Finance != null)
                {
                    m_From.SendAsciiMessage("You must fire your finance minister before you can elect a new one.");
                }
                else
                {
                    m_From.SendAsciiMessage("Who shall be your new Minister of Finances?");
                    m_From.BeginTarget(12, false, TargetFlags.None, new TargetCallback(HireFinanceMinister_OnTarget));
                }

                break;
            }

            case 3:                     // fire sheriff
            {
                if (m_Town.Sheriff == null)
                {
                    m_From.SendAsciiMessage("You need to elect a sheriff before you can fire one.");
                }
                else
                {
                    m_From.SendAsciiMessage("You have fired your sheriff.");
                    m_Town.Sheriff.SendAsciiMessage("You have been fired as Sheriff.");
                    m_Town.Sheriff = null;
                }

                break;
            }

            case 4:                     // fire finance minister
            {
                if (m_Town.Finance == null)
                {
                    m_From.SendAsciiMessage("You need to elect a financial minister before you can fire one.");
                }
                else
                {
                    m_From.SendAsciiMessage("You have fired your financial Minister.");
                    m_Town.Finance.SendAsciiMessage("You have been fired as Finance Minister.");
                    m_Town.Finance = null;
                }

                break;
            }
            }
        }