Пример #1
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);
        }
Пример #2
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;
        }