예제 #1
0
            protected override void OnTick()
            {
                foreach (var head in PendingStatloss.ToArray())
                {
                    if (DateTime.UtcNow > head.TimeTurnedIn)
                    {
                        BeginSkillLoss(head.HeadOwner);
                        PendingStatloss.Remove(head);
                    }
                    else
                    {
                        var nextuse = head.TimeTurnedIn - DateTime.UtcNow;
                        head.HeadOwner.SendMessage("You have " + nextuse.Minutes + " minutes left to buy back your head for 30k.  To do so, say I wish to buy my head.");
                    }
                }

                if (PendingStatloss.Count <= 0)
                {
                    Stop();
                }
            }
예제 #2
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            // trigger returns true if returnoverride
            if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) &&
                UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, dropped))
            {
                return(true);
            }

            bool bReturn = false;

            if (dropped is Head2)
            {
                var h = (Head2)dropped;

                if (h.Player == null || h.Player.Deleted)
                {
                    Say("This belonged to a nobody!");
                    h.Delete();
                    return(true);
                }

                if (h.Player != null)
                {
                    Mobile mob = h.Player;

                    from.CloseGump(typeof(HeadNegotiateGump));
                    mob.CloseGump(typeof(HeadOwnerListGump));

                    if (mob.Kills >= 5 && !h.Expired)
                    {
                        if (!h.Player.InStat)
                        {
                            LoggingCustom.Log("MurdererNegotiate.txt", DateTime.Now + "\t" + mob + "\t" + "STATTED by " + from.Name);

                            if (CentralGump.EnsureProfile(mob as PlayerMobile).BuyHead)
                            {
                                if (PendingStatloss == null)
                                {
                                    PendingStatloss = new List <HeadTurnInObj>();
                                }

                                if (PendingStatlossTimer == null || !PendingStatlossTimer.Running)
                                {
                                    PendingStatlossTimer = new InternalTimer();
                                    PendingStatlossTimer.Start();
                                }

                                if (!PendingStatloss.Exists(x => x.HeadOwner == mob as PlayerMobile))
                                {
                                    var headobject = new HeadTurnInObj(DateTime.UtcNow + TimeSpan.FromMinutes(5), from as PlayerMobile, mob as PlayerMobile);
                                    PendingStatloss.Add(headobject);

                                    Conquests.CheckProgress <ItemConquest>(from as PlayerMobile, h, "turnin");
                                    bReturn = true;
                                    h.Delete();
                                }
                                else
                                {
                                    from.SendMessage(61,
                                                     "This player is currently pending statloss.  Try to turn the head in again in 5 minutes.");
                                }
                            }
                            else
                            {
                                Conquests.CheckProgress <ItemConquest>(from as PlayerMobile, h, "turnin");
                                bReturn = true;
                                BeginSkillLoss(mob);
                                h.Delete();
                            }

                            if (mob.Kills <= 10)
                            {
                                Say("My thanks for slaying this vile person.");
                            }

                            if (mob.Kills > 10 && mob.Kills < 25)
                            {
                                Say("Thank you for ridding Brittania of this evil fiend.");
                            }

                            if (mob.Kills >= 25)
                            {
                                Say("Thank you for destroying " + mob.Name + ", Britannia is a much safer place with that scum gone.");
                            }
                        }
                        else                         //Owner of head is currently in statloss
                        {
                            Say("Begone.  This murderer has already met justice!");
                            Say("I'll take that head, you just run along now.");
                            bReturn = true;
                            h.Delete();
                        }
                    }
                    else if (h.Expired)                     //if head is decayed, set to true and change hue
                    {
                        Say("Why are you trying to give me this decayed piece of trash?");
                        h.Expire();
                    }
                    else
                    {
                        Say("You disgusting miscreant!  Why are you giving me an innocent person's head?");
                    }
                }
                else
                {
                    Say("I suspect treachery....");
                    Say("I'll take that head, you just run along now.");
                    bReturn = true;
                    h.Delete();
                }
            }

            return(bReturn);
        }