Пример #1
0
        public void Deactivate(bool direct = false, bool destroyed = false)
        {
            if (Activated)
            {
                if (LastCombatTime.AddSeconds(10) < DateTime.Now || direct)
                {
                    if (destroyed)
                    {
                        Owner.SendPacket("0|A|STM|msg_pet_is_dead");
                        CurrentHitPoints    = 1000;
                        CurrentShieldPoints = 0;
                        UpdateStatus();
                    }
                    else
                    {
                        Owner.SendPacket("0|A|STM|msg_pet_deactivated");
                    }

                    Owner.SendPacket("0|PET|D");
                    Activated = false;

                    InRangeCharacters.Clear();
                    Spacemap.RemoveCharacter(this);
                    Program.TickManager.RemoveTick(this);
                }
                else
                {
                    Owner.SendPacket("0|A|STM|msg_pet_in_combat");
                }
            }
        }
Пример #2
0
        private void CheckShieldPointsRepair()
        {
            if (LastCombatTime.AddSeconds(10) >= DateTime.Now || lastShieldRepairTime.AddSeconds(1) >= DateTime.Now || CurrentShieldPoints == MaxShieldPoints)
            {
                return;
            }

            int repairShield = MaxShieldPoints / 25;

            CurrentShieldPoints += repairShield;
            UpdateStatus();

            lastShieldRepairTime = DateTime.Now;
        }
Пример #3
0
        public void Deactivate(bool direct = false, bool destroyed = false)
        {
            if (Activated)
            {
                if (LastCombatTime.AddSeconds(10) < DateTime.Now || direct)
                {
                    Owner.SendPacket("0|PET|D");

                    if (destroyed)
                    {
                        Owner.Settings.InGameSettings.petDestroyed = true;
                        QueryManager.SavePlayer.Settings(Owner, "inGameSettings", Owner.Settings.InGameSettings);

                        Owner.SendPacket("0|PET|Z");
                        CurrentShieldPoints = 0;
                        UpdateStatus();

                        Owner.SendCommand(PetInitializationCommand.write(true, true, false));
                        Owner.SendCommand(PetUIRepairButtonCommand.write(true, 250));
                    }
                    else
                    {
                        Owner.SendPacket("0|A|STM|msg_pet_deactivated");
                    }

                    Activated = false;

                    Deselection();
                    Spacemap.RemoveCharacter(this);
                    InRangeCharacters.Clear();
                    Program.TickManager.RemoveTick(this);
                }
                else
                {
                    Owner.SendPacket("0|A|STM|msg_pet_in_combat");
                }
            }
        }
Пример #4
0
 public bool IsNigga(Character n***a) => n***a.Controller.Active && n***a.Controller.Attack.Attacking &&
 n***a.Selected == this && LastCombatTime.AddSeconds(2) > DateTime.Now;