Пример #1
0
        private void ForceToZombie(IPlayer human)
        {
            human.SetMetadata("forcing", true);
            human.SetMetadata("zombieForcing", true);

            human.SetMetadata("ost.isZombie", true);
            human.SetMetadata("ost.health", (float)100);

            System.Threading.Tasks.Task task = new System.Threading.Tasks.Task(delegate
            {
                double oldX = human.BlockX;
                double oldY = human.BlockY;

                if (this.hologram != null)
                    bot.ChatSayer.Command("/teleport " + human.Name + " " + (int)(hologram.X + 1) + " " + (int)(hologram.Y - 1));

                System.Threading.Thread.Sleep(1000);
                bot.ChatSayer.Command("/kill " + human.Name);
                //bot.ChatSayer.Command("/teleport " + human.Name + " " + oldX + " " + oldY);
                System.Threading.Thread.Sleep(1000);
                bot.ChatSayer.Command("/teleport " + human.Name + " " + oldX + " " + oldY);

                System.Threading.Thread.Sleep(1000);
                human.RemoveMetadata("zombieForcing");
                human.RemoveMetadata("forcing");
            });
            task.Start();
        }
Пример #2
0
 private void EndRecord(IPlayer player)
 {
     List<IEditChange> record = (List<IEditChange>)recordingPlayer.GetMetadata("worldeditrecord");
     if (record.Count > 0)
     {
         if (!player.HasMetadata("worldedithistory"))
             player.SetMetadata("worldedithistory", new List<IEditChange>());
         List<IEditChange> history = (List<IEditChange>)player.GetMetadata("worldedithistory");
         history.Add(new EditChangeList((List<IEditChange>)record));
         if (!player.HasMetadata("worldedithistoryindex"))
             player.SetMetadata("worldedithistoryindex", 0);
         else
             player.SetMetadata("worldedithistoryindex", ((int)player.GetMetadata("worldedithistoryindex")) + 1);
     }
     player.RemoveMetadata("worldeditrecord");
     recordingPlayer = null;
 }
Пример #3
0
        private void ForceToNormal(IPlayer zombie)
        {
            zombie.SetMetadata("forcing", true);
            zombie.SetMetadata("humanForcing", true);

            zombie.RemoveMetadata("ost.isZombie");
            zombie.RemoveMetadata("ost.zombieCreationTime");
            zombie.SetMetadata("ost.health", (float)100);

            System.Threading.Tasks.Task task = new System.Threading.Tasks.Task(delegate
            {
                double oldX = zombie.X;
                double oldY = zombie.Y;

                if (this.cake != null)
                    bot.ChatSayer.Command("/teleport " + zombie.Name + " " + (int)(cake.X + 1) + " " + (int)(cake.Y - 1));

                System.Threading.Thread.Sleep(500);
                bot.ChatSayer.Command("/kill " + zombie.Name);
                //bot.ChatSayer.Command("/teleport " + zombie.Name + " " + oldX + " " + oldY);
                System.Threading.Thread.Sleep(500);
                bot.ChatSayer.Command("/teleport " + zombie.Name + " " + oldX + " " + oldY);

                System.Threading.Thread.Sleep(1000);
                zombie.RemoveMetadata("humanForcing");
                zombie.RemoveMetadata("forcing");
            });
            task.Start();
        }