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; } } }
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); }