Exemplo n.º 1
0
        public override void OnTrigger(Mobile from)
        {
            if (!IsEnemy(from))
            {
                return;
            }

            Conceal();

            DoVisibleEffect();
            Effects.PlaySound(Location, Map, EffectSound);
            DoAttackEffect(from);

            var silverToAward = from.Alive ? 20 : 40;

            if (silverToAward > 0 && Placer != null && Faction != null)
            {
                var victimState = PlayerState.Find(from);

                if (victimState?.CanGiveSilverTo(Placer) == true && victimState.KillPoints > 0)
                {
                    var silverGiven = Faction.AwardSilver(Placer, silverToAward);

                    if (silverGiven > 0)
                    {
                        // TODO: Get real message
                        if (from.Alive)
                        {
                            Placer.SendMessage(
                                "You have earned {0} silver pieces because {1} fell for your trap.",
                                silverGiven,
                                from.Name
                                );
                        }
                        else
                        {
                            Placer.SendLocalizedMessage(
                                1042736,
                                $"{silverGiven} silver\t{from.Name}"
                                ); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
                        }
                    }

                    victimState.OnGivenSilverTo(Placer);
                }
            }

            from.LocalOverheadMessage(MessageType.Regular, MessageHue, AttackMessage);
        }
Exemplo n.º 2
0
        public void Refund()
        {
            Gold toGive = new Gold(Price);

            if (Placer.BankBox.TryDropItem(Placer, toGive, false))
            {
                Delete();
                Placer.SendLocalizedMessage(1060397, toGive.Amount.ToString()); // ~1_AMOUNT~ gold has been deposited into your bank box.
            }
            else
            {
                toGive.Delete();
                Placer.SendMessage("Your bankbox is full!");
            }
        }