예제 #1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                if (Filled && from is ZombieAvatar)
                {
                    var avatar = from as ZombieAvatar;
                    PlayerZombieProfile profile = ZombieEvent.EnsureProfile(avatar.Owner);
                    from.SendMessage(61, "You drink the contents of the crystal flask.");
                    Consume();
                    if (Bad)
                    {
                        from.SendMessage(54, "Whatever was in the flask wasn't the cure.");
                        from.Poison = Poison.Lethal;
                        from.Hits   = 5;
                    }
                    else
                    {
                        from.SendMessage(61, "You are now immune to the Zombie Plague!");
                        from.Hue = 61;
                        ZombieInstance instance = ZombieEvent.GetInstance();
                        if (instance != null)
                        {
                            if (instance.CureWinner == null)
                            {
                                NetState.Instances.Where(ns => ns != null && ns.Mobile is PlayerMobile)
                                .ForEach(
                                    ns =>
                                    ns.Mobile.SendNotification <CureWinner>(
                                        profile.Owner.RawName +
                                        " was the first person to innoculate themselves against the Zombie Plague!",
                                        true, 1.0, 30.0, Color.LawnGreen));

                                instance.CureWinner      = avatar.Owner;
                                profile.OverallScore    += 1500;
                                profile.SpendablePoints += 1500;
                            }
                            else
                            {
                                instance.CureCompleters.Add(avatar.Owner);
                                profile.OverallScore    += 800;
                                profile.SpendablePoints += 800;
                            }
                        }
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
            base.OnDoubleClick(from);
        }
예제 #2
0
        public override void OnDamage(int amount, Mobile @from, bool willKill)
        {
            if (Owner != null)
            {
                PlayerZombieProfile profile = ZombieEvent.EnsureProfile(Owner);
                ZombieInstance      zevent  = ZombieEvent.GetInstance();

                if (zevent != null && profile.LeaveEventTimer != null && profile.LeaveEventTimer.Running)
                {
                    profile.LeaveEventTimer.Stop();
                    SendMessage(54,
                                "Your attempt to leave was interrupted.  Either initate another leave attempt or close and reopen your client to log instantly.");
                }
            }
            base.OnDamage(amount, @from, willKill);
        }
예제 #3
0
 public void AwardPoints()
 {
     if (Damagers != null)
     {
         foreach (ZombieAvatar avatar in Damagers.Keys)
         {
             if (avatar.Owner != null)
             {
                 PlayerZombieProfile profile = ZombieEvent.EnsureProfile(avatar.Owner);
                 if (Damagers.ContainsKey(avatar))
                 {
                     profile.DragonBossDamage += Damagers[avatar];
                 }
             }
         }
     }
 }
예제 #4
0
        public override bool OnBeforeDeath()
        {
            if (Owner != null)
            {
                PlayerZombieProfile profile = ZombieEvent.EnsureProfile(Owner);
                ZombieInstance      zevent  = ZombieEvent.GetInstance();

                if (NetState == null)
                {
                    Blessed                 = true;
                    Hidden                  = true;
                    CantWalk                = true;
                    IgnoreMobiles           = true;
                    profile.ZombieSavePoint = Point3D.Zero;
                }

                if (zevent != null)
                {
                    return(zevent.HandleAvatarDeath(profile, LastKiller));
                }
            }

            return(OnBeforeDeath());
        }