示例#1
0
 public void PulseRegen()
 {
     if (((m_Account.CharacterStats.lifePoints / m_Account.CharacterStats.maxLifePoints) * 100) < m_Account.RegenChoice.Value)
     {
         m_Account.SetStatus(Status.Regenerating);
         List <Item> items = GetRegenItems();
         if (items.Count > 0)
         {
             if (UseItems(items))
             {
                 m_Account.Wait(500, 1000);
                 PulseRegen();
                 return;
             }
         }
         int maxLife = Convert.ToInt32(m_Account.CharacterStats.maxLifePoints);
         int life    = Convert.ToInt32(m_Account.CharacterStats.lifePoints);
         int time    = Convert.ToInt32(Math.Round(Convert.ToDecimal(maxLife - life) / 2));
         BlueSheep.Common.Protocol.Messages.EmotePlayRequestMessage msg = new BlueSheep.Common.Protocol.Messages.EmotePlayRequestMessage(1);
         m_Account.SocketManager.Send(msg);
         m_Account.Log(new GeneralTextInformation(String.Format("Régénération pendant {0} secondes.", time)), 2);
         m_Account.Wait(time * 1000, (time + 1) * 1000);
         if (m_Account.Path != null && m_Account.Path.Launched)
         {
             m_Account.Path.ParsePath();
         }
     }
 }
示例#2
0
 public void PulseRegen()
 {
     if (((m_Account.CharacterStats.lifePoints / m_Account.CharacterStats.maxLifePoints) * 100) < m_Account.RegenChoice.Value)
     {
         m_Account.SetStatus(Status.Regenerating);
         List<Item> items = GetRegenItems();
         if (items.Count > 0)
         {
             if (UseItems(items))
             {
                 m_Account.Wait(500, 1000);
                 PulseRegen();
                 return;
             }
         }
         int maxLife = Convert.ToInt32(m_Account.CharacterStats.maxLifePoints);
         int life = Convert.ToInt32(m_Account.CharacterStats.lifePoints);
         int time = Convert.ToInt32(Math.Round(Convert.ToDecimal(maxLife - life) / 2));
         BlueSheep.Common.Protocol.Messages.EmotePlayRequestMessage msg = new BlueSheep.Common.Protocol.Messages.EmotePlayRequestMessage(1);
         m_Account.SocketManager.Send(msg);
         m_Account.Log(new GeneralTextInformation(String.Format("Régénération pendant {0} secondes.", time)), 2);
         m_Account.Wait(time * 1000, (time + 1) * 1000);
         if (m_Account.Path != null && m_Account.Path.Launched)
             m_Account.Path.ParsePath();
     }
 }