Exemple #1
0
        public ZombieEventUI(PlayerMobile user, ZombieAvatar avatar, ZombieInstance zevent = null, PlayerZombieProfile zprofile = null,
                             Action <GumpButton> onAccept = null, Action <GumpButton> onCancel = null)
            : base(user, null, 0, 0)
        {
            CanDispose     = true;
            CanMove        = true;
            Modal          = false;
            ForceRecompile = true;

            AcceptHandler = onAccept;
            CancelHandler = onCancel;

            CanSearch = true;

            EntriesPerPage = 11;

            SelectedProfile = zprofile;
            ZEvent          = zevent;
            Avatar          = avatar;

            UserProfile = ZombieEvent.EnsureProfile(user);

            AutoRefreshRate = TimeSpan.FromSeconds(60);
            AutoRefresh     = true;
        }
Exemple #2
0
        public void HandleMobDeath(BaseCreature mob, ZombieAvatar avatar)
        {
            if (mob is ZombieZEvent)
            {
                _ZombiesLoc1.Remove(mob);
                _ZombiesLoc2.Remove(mob);
                _ZombiesLoc3.Remove(mob);
                _ZombiesLoc4.Remove(mob);
            }
            else if (mob is DaemonZombieEvent)
            {
                Daemons.Remove(mob);
            }
            else if (mob is TreeFellow)
            {
                TreeFellows.Remove(mob);
            }
            else if (mob is ZombieSpider)
            {
                ZombieSpiders.Remove(mob);
            }
            else if (mob is FeyWarrior)
            {
                FeyWarriors.Remove(mob);
            }
            else if (mob is Vitriol)
            {
                FeyWarriors.Remove(mob);
            }
            else if (mob is Bird)
            {
                FeyWarriors.Remove(mob);
            }
            else if (mob is HorrifyingTentacle)
            {
                HorrifyingTentacles.Remove(mob);
            }
            else if (mob is GoreFiendZombieEvent)
            {
                GoreFiends.Remove(mob);
            }

            if (avatar.Owner != null)
            {
                PlayerZombieProfile profile = ZombieEvent.EnsureProfile(avatar.Owner);
                profile.AddKill(mob);
            }
        }
Exemple #3
0
        public bool HandleAvatarDeath(PlayerZombieProfile profile, Mobile lastkiller)
        {
            ZombieAvatar avatar = profile.ZombieAvatar;

            profile.Deaths++;

            if (lastkiller is ZombieAvatar)
            {
                var enemyavatar = lastkiller as ZombieAvatar;
                if (enemyavatar.Owner != null)
                {
                    PlayerZombieProfile enemyprofile = ZombieEvent.EnsureProfile(enemyavatar.Owner);
                    enemyprofile.Kills++;
                }
            }

            Effects.SendIndividualFlashEffect(avatar, FlashType.LightFlash);
            avatar.DropHolding();

            var corpse = CreatePlayerCorpse(avatar) as Corpse;

            if (corpse != null)
            {
                Effects.PlaySound(avatar, avatar.Map, avatar.GetDeathSound());
                ZombieEvent.ZombieDeathAnim(avatar, corpse);
                corpse.MoveToWorld(avatar.Location, Map.ZombieLand);
            }

            avatar.MoveToWorld(GetRandomLocation(), Map.ZombieLand);

            if (avatar.Backpack != null)
            {
                avatar.EquipItem(new Dagger {
                    Speed = 1
                });
                avatar.Backpack.DropItem(new Bandage(7));
                ZombieEvent.RandomClothing(avatar);
            }
            avatar.Hits   = avatar.HitsMax;
            avatar.Stam   = avatar.StamMax;
            avatar.Poison = null;

            return(false);
        }
Exemple #4
0
        public void JoinZombieInstance(PlayerMobile player)
        {
            PlayerZombieProfile profile = ZombieEvent.EnsureProfile(player);
            ZombieAvatar        avatar  = profile.ZombieAvatar;

            profile.Active = true;
            if (avatar == null)
            {
                avatar = profile.CreateAvatar();
            }

            if (profile.ZombieSavePoint == Point3D.Zero && avatar != null &&
                DateTime.UtcNow > (profile.DisconnectTime + TimeSpan.FromMinutes(2)))
            {
                if (avatar.Backpack != null && avatar.Items.Count <= 1)
                {
                    avatar.EquipItem(new Dagger {
                        Speed = 1
                    });
                    avatar.Backpack.DropItem(new Bandage(7));
                    ZombieEvent.RandomClothing(avatar);
                }
                avatar.MoveToWorld(GetRandomLocation(), Map.ZombieLand);
            }

            CreaturePossession.ForcePossessCreature(null, player, avatar);

            if (avatar != null)
            {
                avatar.Blessed       = false;
                avatar.Hidden        = false;
                avatar.IgnoreMobiles = false;
                avatar.CantWalk      = false;
            }

            player.LogoutLocation = player.Location;
            player.Map            = Map.Internal;
            player.LogoutMap      = Map.Felucca;
        }