Ejemplo n.º 1
0
        public override void PreUpdate()
        {
            //Enabled = true;
            MaxWorldHP = 0;
            foreach (Player player in Main.player.Where(player => player.active))
            {
                MaxWorldHP += player.statLifeMax2;
            }

            if (Enabled && WorldHP < 0)
            {
                WorldHP = 0;
                LinkPlayer.sendpacket();
            }

            if (WorldHP > MaxWorldHP && MaxWorldHP != 0)
            {
                WorldHP = MaxWorldHP;
                LinkPlayer.sendpacket();
            }

            if (Main.player.Any(player => player.active && player.respawnTimer == 60))
            {
                WorldHP = MaxWorldHP / 2;
                LinkPlayer.sendpacket();
            }

            int heal = 0;

            foreach (Player player in Main.player.Where(player => player.active && player.lifeRegen / 2 > 0))
            {
                heal += (int)(player.lifeRegen / 2);
            }
            if (ticker++ >= 60 && heal > 0 && WorldHP < MaxWorldHP)
            {
                WorldHP += heal;
                LinkPlayer.sendpacket();
                ticker = 0;
            }
        }
Ejemplo n.º 2
0
 public override void Load(TagCompound tag)
 {
     Enabled = tag.GetBool(nameof(Enabled));
     LinkPlayer.sendpacket();
 }