Пример #1
0
 public static void AnswerPvpRequestRequest(IRealmClient client, RealmPacketIn packet)
 {
     if (client.ActiveCharacter.IsAsda2Dueling)
     {
         client.ActiveCharacter.SendInfoMsg("You already dueling.");
     }
     else if (client.ActiveCharacter.Asda2DuelingOponent == null)
     {
         client.ActiveCharacter.YouAreFuckingCheater("Trying to answer pvp without oponent", 20);
     }
     else
     {
         packet.Position -= 4;
         if (packet.ReadByte() == (byte)1)
         {
             Asda2Pvp asda2Pvp =
                 new Asda2Pvp(client.ActiveCharacter.Asda2DuelingOponent, client.ActiveCharacter);
         }
         else
         {
             Asda2PvpHandler.SendPvpStartedResponse(Asda2PvpResponseStatus.Rejected,
                                                    client.ActiveCharacter.Asda2DuelingOponent, client.ActiveCharacter);
             client.ActiveCharacter.Asda2DuelingOponent = (Character)null;
         }
     }
 }
Пример #2
0
        public void StopPvp()
        {
            if (!IsActive)
            {
                return;
            }
            IsActive = false;
            if (Losser == null)
            {
                Losser = FirstCharacter;
            }
            FirstCharacter.EnemyCharacters.Remove(SecondCharacter);
            SecondCharacter.EnemyCharacters.Remove(FirstCharacter);
            FirstCharacter.CheckEnemysCount();
            SecondCharacter.CheckEnemysCount();
            Asda2PvpHandler.SendDuelEndedResponse(Winner, Losser);

            Asda2TitleChecker.OnWinDuel(Winner);

            FirstCharacter.Asda2Duel            = null;
            SecondCharacter.Asda2Duel           = null;
            FirstCharacter.Asda2DuelingOponent  = null;
            SecondCharacter.Asda2DuelingOponent = null;
            FirstCharacter  = null;
            SecondCharacter = null;
        }
Пример #3
0
 public Asda2Pvp(Character firstCharacter, Character secondCharacter)
 {
     firstCharacter.Asda2Duel            = this;
     secondCharacter.Asda2Duel           = this;
     firstCharacter.Asda2DuelingOponent  = secondCharacter;
     secondCharacter.Asda2DuelingOponent = firstCharacter;
     Asda2PvpHandler.SendPvpStartedResponse(Asda2PvpResponseStatus.Ok, firstCharacter, secondCharacter);
     Asda2PvpHandler.SendPvpStartedResponse(Asda2PvpResponseStatus.Ok, secondCharacter, firstCharacter);
     Asda2PvpHandler.SendPvpRoundEffectResponse(firstCharacter, secondCharacter);
     firstCharacter.Map.CallDelayed(10000, new Action(this.StartPvp));
     this.PvpTimeOuted    = Environment.TickCount + Asda2Pvp.PvpTimeSecs * 1000;
     this.IsActive        = true;
     this.FirstCharacter  = firstCharacter;
     this.SecondCharacter = secondCharacter;
     this.FirstCharacter.EnemyCharacters.Add(secondCharacter);
     this.SecondCharacter.EnemyCharacters.Add(firstCharacter);
 }
Пример #4
0
        public static void PvpRquestRequest(IRealmClient client, RealmPacketIn packet)
        {
            packet.Position += 22;
            Character characterBySessionId = World.GetCharacterBySessionId(packet.ReadUInt16());

            if (characterBySessionId == null)
            {
                client.ActiveCharacter.SendSystemMessage("The character you asking for duel is not found.");
            }
            else if (client.ActiveCharacter.IsAsda2Dueling || characterBySessionId.IsAsda2Dueling)
            {
                client.ActiveCharacter.SendInfoMsg("Already dueling.");
            }
            else
            {
                Asda2PvpHandler.SendPvpRequestToCharFromSrvResponse(client.ActiveCharacter, characterBySessionId);
                characterBySessionId.Asda2DuelingOponent = client.ActiveCharacter;
            }
        }
Пример #5
0
 public void StopPvp()
 {
     if (!this.IsActive)
     {
         return;
     }
     this.IsActive = false;
     if (this.Losser == null)
     {
         this.Losser = this.FirstCharacter;
     }
     this.FirstCharacter.EnemyCharacters.Remove(this.SecondCharacter);
     this.SecondCharacter.EnemyCharacters.Remove(this.FirstCharacter);
     this.FirstCharacter.CheckEnemysCount();
     this.SecondCharacter.CheckEnemysCount();
     Asda2PvpHandler.SendDuelEndedResponse(this.Winner, this.Losser);
     this.FirstCharacter.Asda2Duel            = (Asda2Pvp)null;
     this.SecondCharacter.Asda2Duel           = (Asda2Pvp)null;
     this.FirstCharacter.Asda2DuelingOponent  = (Character)null;
     this.SecondCharacter.Asda2DuelingOponent = (Character)null;
     this.FirstCharacter  = (Character)null;
     this.SecondCharacter = (Character)null;
 }