public static void SendChatRoomVisibleResponse(Character owner, ChatRoomVisibilityStatus status, Asda2Chatroom room, Character character = null) { if (character != null) { using (var packet = new RealmPacketOut(RealmServerOpCode.ChatRoomVisible)) //6248 { packet.WriteByte((byte)status); //{status}default value : 2 Len : 1 packet.WriteInt32(owner.AccId); //{initerAccId}default value : 361343 Len : 4 packet.WriteByte(room == null ? 0 : room.IsPrivate ? 1 : 0); //{zeroPublicOnePrivate}default value : 1 Len : 1 packet.WriteInt16(room == null ? 0 : room.MaxMembersCount); //{maxMemberCount}default value : 15 Len : 1 packet.WriteFixedAsciiString(room == null ? "" : room.Name, 28); //{roomName}default value : Len : 28 packet.WriteInt16(0); //value name : unk11 default value : 0Len : 2 packet.WriteByte(0); //value name : unk1 default value : 0Len : 1 character.Send(packet, addEnd: true); } return; } using (var packet = new RealmPacketOut(RealmServerOpCode.ChatRoomVisible)) //6248 { packet.WriteByte((byte)status); //{status}default value : 2 Len : 1 packet.WriteInt32(owner.AccId); //{initerAccId}default value : 361343 Len : 4 packet.WriteByte(room == null ? 0 : room.IsPrivate ? 1 : 0); //{zeroPublicOnePrivate}default value : 1 Len : 1 packet.WriteInt16(room == null ? 0 : room.MaxMembersCount); //{maxMemberCount}default value : 15 Len : 1 packet.WriteFixedAsciiString(room == null ? "" : room.Name, 28); //{roomName}default value : Len : 28 packet.WriteInt16(0); //value name : unk11 default value : 0Len : 2 packet.WriteByte(0); //value name : unk1 default value : 0Len : 1 owner.SendPacketToArea(packet); } }
public static void SendRegisterItemToAukCancelWindowResponse(IRealmClient client, List <Asda2ItemTradeRef> items = null) { using (var packet = new RealmPacketOut(RealmServerOpCode.RegisterItemToAukCancelWindow))//9902 { if (items != null) { foreach (var item in items) { packet.WriteByte(0); //{status}default value : 0 Len : 1 packet.WriteInt32(item.Item.ItemId); //{itemId}default value : 31855 Len : 4 packet.WriteByte((byte)item.Item.InventoryType); //{invNum}default value : 2 Len : 1 packet.WriteInt16(item.Item.Slot); //{cell}default value : 5 Len : 2 packet.WriteSkip(stab15); //value name : stab15 default value : stab15Len : 12 packet.WriteInt32(item.Amount); //{registeredAmount}default value : 250 Len : 4 packet.WriteInt32(item.Item.Amount); //{beforeAmount}default value : 250 Len : 4 packet.WriteInt16(item.Item.Weight); //{weight}default value : 0 Len : 2 packet.WriteSkip(stab37); //value name : stab37 default value : stab37Len : 21 packet.WriteInt32(client.ActiveCharacter.Asda2Inventory.Weight); //{invWeight}default value : 315 Len : 4 packet.WriteInt32(client.ActiveCharacter.Money); //{money}default value : 8503216 Len : 4 packet.WriteInt64(-1); //value name : unk8 default value : -1Len : 8 } } client.Send(packet); } }
public static void SendRegularTradeCompleteResponse(IRealmClient client, Asda2Item[] items) { using (var packet = new RealmPacketOut(RealmServerOpCode.RegularTradeComplete)) //5295 { packet.WriteByte(5); //{status}default value : 5 Len : 1 packet.WriteInt32(client.ActiveCharacter.Asda2Inventory.Weight); //{invWeight}default value : 2381 Len : 4 for (int i = 0; i < 5; i += 1) { var item = items[i]; if (item == null) { packet.WriteInt32(-1); //{itemId}default value : 31850 Len : 4 packet.WriteByte(0); //{invNum}default value : 2 Len : 1 packet.WriteInt16(-1); //{slot}default value : 1 Len : 2 packet.WriteInt32(0); //{amount}default value : 5 Len : 4 packet.WriteInt16(0); //{weight}default value : 60 Len : 2 } else { packet.WriteInt32(item.ItemId); //{itemId}default value : 31850 Len : 4 packet.WriteByte((byte)item.InventoryType); //{invNum}default value : 2 Len : 1 packet.WriteInt16(item.Slot); //{slot}default value : 1 Len : 2 packet.WriteInt32(item.Amount); //{amount}default value : 5 Len : 4 packet.WriteInt16(item.Weight); //{weight}default value : 60 Len : 2 } } client.Send(packet, addEnd: false); } }
public static void SendRegisterItemToAukCancelWindowResponse(IRealmClient client, List <Asda2ItemTradeRef> items = null) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.RegisterItemToAukCancelWindow)) { if (items != null) { foreach (Asda2ItemTradeRef asda2ItemTradeRef in items) { packet.WriteByte(0); packet.WriteInt32(asda2ItemTradeRef.Item.ItemId); packet.WriteByte((byte)asda2ItemTradeRef.Item.InventoryType); packet.WriteInt16(asda2ItemTradeRef.Item.Slot); packet.WriteSkip(Asda2AuctionHandler.stab15); packet.WriteInt32(asda2ItemTradeRef.Amount); packet.WriteInt32(asda2ItemTradeRef.Item.Amount); packet.WriteInt16(asda2ItemTradeRef.Item.Weight); packet.WriteSkip(Asda2AuctionHandler.stab37); packet.WriteInt32(client.ActiveCharacter.Asda2Inventory.Weight); packet.WriteInt32(client.ActiveCharacter.Money); packet.WriteInt64(-1L); } } client.Send(packet, false); } }
public static void SendRegularTradeCompleteResponse(IRealmClient client, Asda2Item[] items) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.RegularTradeComplete)) { packet.WriteByte(5); packet.WriteInt32(client.ActiveCharacter.Asda2Inventory.Weight); for (int index = 0; index < 5; ++index) { Asda2Item asda2Item = items[index]; if (asda2Item == null) { packet.WriteInt32(-1); packet.WriteByte(0); packet.WriteInt16(-1); packet.WriteInt32(0); packet.WriteInt16(0); } else { packet.WriteInt32(asda2Item.ItemId); packet.WriteByte((byte)asda2Item.InventoryType); packet.WriteInt16(asda2Item.Slot); packet.WriteInt32(asda2Item.Amount); packet.WriteInt16(asda2Item.Weight); } } client.Send(packet, false); } }
public static void SendInitPetInfoOnLoginResponse(IRealmClient client, Asda2PetRecord pet) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.InitPetInfoOnLogin)) { packet.WriteInt32(client.ActiveCharacter.AccId); packet.WriteByte(0); packet.WriteInt32(pet.Guid); packet.WriteInt16(pet.Id); packet.WriteFixedAsciiString(pet.Name, 16, Locale.Start); packet.WriteByte(pet.HungerPrc); packet.WriteByte(pet.Level); packet.WriteByte(pet.MaxLevel); packet.WriteInt16(pet.Expirience); packet.WriteByte(pet.Level); packet.WriteInt16((short)pet.Stat1Type); packet.WriteInt32(pet.Stat1Value); packet.WriteInt16((short)pet.Stat2Type); packet.WriteInt32(pet.Stat2Value); packet.WriteInt16((short)pet.Stat3Type); packet.WriteInt32(pet.Stat3Value); packet.WriteByte(client.ActiveCharacter.Asda2Pet == null ? 0 : (client.ActiveCharacter.Asda2Pet.Guid == pet.Guid ? 1 : 0)); client.Send(packet, false); } }
public static void GuildWaveoOnResponse(IRealmClient client, int guildid) { using (var packet = new RealmPacketOut(RealmServerOpCode.GuildWaveoOnResponse)) //4401 { Asda2GuildWave guildWave = Asda2GuildWaveMgr.GetGuildWaveForId(guildid); packet.WriteInt16(guildid); //{GuildId}default value : 3 Len : 2 if (guildWave != null) { packet.WriteByte((byte)GuildWaveOnSRS.Show); //{GuildWaveOnSRS} packet.WriteByte(guildWave.Difficulty); //{GuildWaveOnDifficulty} packet.WriteInt16(guildWave.PlayersRegisteredCount); //{Count Player} } else { packet.WriteByte((byte)GuildWaveOnSRS.Select); //{GuildWaveOnSRS} packet.WriteByte(0); //{GuildWaveOnDifficulty} packet.WriteInt16(0); //{Count Player} } //Asda2GuildWave.GetDiffeclity(guildWave.Difficulty); client.ActiveCharacter.Send(packet, addEnd: true); } }
public static void SendMonstrStateChangedResponse(NPC npc, Asda2NpcState state) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.MonstrStateChanged)) { packet.WriteSkip(Asda2CombatHandler.stab6); packet.WriteInt16(npc.UniqIdOnMap); packet.WriteInt32((int)state); for (int index = 0; index < 28; ++index) { Aura aura = (Aura)null; if (npc.Auras.ActiveAuras.Length > index) { aura = npc.Auras.ActiveAuras[index].TicksLeft == 0 ? (Aura)null : npc.Auras.ActiveAuras[index]; } packet.WriteInt16(aura == null ? -1 : (int)aura.Spell.RealId); } for (int index = 0; index < 28; ++index) { Aura aura = (Aura)null; if (npc.Auras.ActiveAuras.Length > index) { aura = npc.Auras.ActiveAuras[index]; } packet.WriteByte(aura == null ? 0 : 1); } packet.WriteInt32(npc.Health); packet.WriteInt16((short)npc.Position.X); packet.WriteInt16((short)npc.Position.Y); npc.SendPacketToArea(packet, false, true, Locale.Any, new float?()); } }
public static void SendMonstrStateChangedResponse(NPC npc, Asda2NpcState state) { using (var packet = new RealmPacketOut(RealmServerOpCode.MonstrStateChanged)) //4017 { packet.WriteSkip(stab6); //value name : stab6 default value : stab6Len : 2 packet.WriteInt16(npc.UniqIdOnMap); //{mobId}default value : 253 Len : 2 packet.WriteInt32((int)state); //{status}default value : 0 Len : 4 for (int i = 0; i < 28; i += 1) { Spells.Auras.Aura aura = null; if (npc.Auras.ActiveAuras.Length > i) { aura = npc.Auras.ActiveAuras[i].TicksLeft == 0 ? null : npc.Auras.ActiveAuras[i]; //npc.Auras.VisibleAuras[i]; } packet.WriteInt16(aura == null?-1:aura.Spell.RealId); //{effect}default value : -1 Len : 2 } for (int i = 0; i < 28; i += 1) { Spells.Auras.Aura aura = null; if (npc.Auras.ActiveAuras.Length > i) { aura = npc.Auras.ActiveAuras[i]; //npc.Auras.VisibleAuras[i]; } packet.WriteByte(aura == null?0:1); //{effectExist}default value : 0 Len : 1 } packet.WriteInt32(npc.Health); //{hp}default value : 0 Len : 4 packet.WriteInt16((short)npc.Position.X); //{x}default value : 74 Len : 2 packet.WriteInt16((short)npc.Position.Y); //{y}default value : 246 Len : 2 npc.SendPacketToArea(packet, false, true); } }
public static void SendFishingBooksInfoResponse(IRealmClient client, Asda2FishingBook book) { using (var packet = new RealmPacketOut(RealmServerOpCode.FishingBooksInfo)) //6174 { packet.WriteByte(book.Num); //{fishBookNum}default value : 0 Len : 1 packet.WriteInt32(0); //value name : unk4 default value : 0Len : 4 for (int i = 0; i < 30; i += 1) { packet.WriteInt32(book.FishIds[i]); //{fishId}default value : 0 Len : 4 } for (int i = 0; i < 30; i += 1) { packet.WriteInt16(book.Amounts[i]); //{amounts}default value : 0 Len : 2 } for (int i = 0; i < 30; i += 1) { packet.WriteInt16(book.MaxLength[i]); //{maxLength}default value : 0 Len : 2 } for (int i = 0; i < 30; i += 1) { packet.WriteInt16(book.MinLengths[i]); //{minLength}default value : 0 Len : 2 } client.Send(packet, addEnd: true); } }
public static void SendMonstrTakesDamageSecondaryResponse(Character chr, Character targetChr, NPC targetNpc, int damage) { if (targetChr == null && targetNpc == null) { return; } using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.MonstrTakesDamageSecondary)) { packet.WriteByte(targetNpc != null ? 0 : 1); packet.WriteInt16(targetNpc != null ? (short)targetNpc.UniqIdOnMap : targetChr.SessionId); packet.WriteInt16(160); packet.WriteInt32(damage); packet.WriteInt32(450); packet.WriteByte(1); packet.WriteInt16(66); packet.WriteByte(0); if (targetChr != null) { targetChr.SendPacketToArea(packet, true, true, Locale.Any, new float?()); } else { targetNpc.SendPacketToArea(packet, true, true, Locale.Any, new float?()); } } }
public static void SendBuffEndedResponse(Character chr, short buffId) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.BuffEnded)) { packet.WriteInt16(chr.SessionId); packet.WriteInt16(buffId); chr.SendPacketToArea(packet, true, true, Locale.Any, new float?()); } }
public static void SendWarRemainingTimeResponse(IRealmClient client) { using (var packet = new RealmPacketOut(RealmServerOpCode.WarRemainingTime)) //6736 { packet.WriteInt16(DateTime.Now.Hour); //{hour}default value : 4 Len : 2 packet.WriteInt16(DateTime.Now.Minute); //{min}default value : 0 Len : 2 packet.WriteInt16(DateTime.Now.Second); //{sec}default value : 13 Len : 2 client.Send(packet); } }
public static void SendTitleDiscoveredResponse(IRealmClient client, short titleId) { using (var packet = new RealmPacketOut(RealmServerOpCode.TitleDiscovered)) //6085 { packet.WriteInt32(client.ActiveCharacter.AccId); //{accId}default value : 340701 Len : 4 packet.WriteInt16(client.ActiveCharacter.SessionId); //{sessId}default value : 33 Len : 2 packet.WriteInt16(titleId); //{titleId}default value : 219 Len : 2 client.ActiveCharacter.SendPacketToArea(packet, true, true); } }
public static void SendWarRemainingTimeResponse(IRealmClient client) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.WarRemainingTime)) { packet.WriteInt16(DateTime.Now.Hour); packet.WriteInt16(DateTime.Now.Minute); packet.WriteInt16(DateTime.Now.Second); client.Send(packet, false); } }
public static void SendYouCanEnterWarResponse(IRealmClient client) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.YouCanEnterWar)) { packet.WriteByte(0); packet.WriteInt16(client.ActiveCharacter.Asda2FactionId); packet.WriteInt16(0); client.Send(packet, false); } }
public static void SendTitleDiscoveredResponse(IRealmClient client, short titleId) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.TitleDiscovered)) { packet.WriteInt32(client.ActiveCharacter.AccId); packet.WriteInt16(client.ActiveCharacter.SessionId); packet.WriteInt16(titleId); client.ActiveCharacter.SendPacketToArea(packet, true, true, Locale.Any, new float?()); } }
public static void SendYouCanEnterWarResponse(IRealmClient client) { using (var packet = new RealmPacketOut(RealmServerOpCode.YouCanEnterWar)) //6711 { packet.WriteByte(0); //{status}default value : 0 Len : 1 packet.WriteInt16(client.ActiveCharacter.Asda2FactionId); //{faction}default value : 1 Len : 2 packet.WriteInt16(0); //{charsAmount}default value : 14 Len : 2 client.Send(packet); } }
public static void SendQuestsListResponse(IRealmClient client) { using (var packet = new RealmPacketOut(RealmServerOpCode.QuestsList))//5047 { for (int i = 0; i < 12; i += 1) { packet.WriteInt32(-1); //{questId}default value : -1 Len : 4 packet.WriteByte(0); //value name : unk1 default value : 0Len : 1 packet.WriteInt16(-1); //{questSlot}default value : -1 Len : 2 packet.WriteByte(0); //{questStage}default value : 0 Len : 1 2 - in progress 1 - completed packet.WriteInt16(-1); //{oneMoreQuestId}default value : -1 Len : 2 packet.WriteInt16(0); //{IsCompleted}default value : 2 Len : 2 0 or 1 packet.WriteInt16(-1); //value name : unk2 default value : -1Len : 2 packet.WriteInt32(-1); //{questItemId}default value : -1 Len : 4 packet.WriteInt16(0); //{questItemAmount}default value : 0 Len : 2 packet.WriteInt32(-1); //{questItemId}default value : -1 Len : 4 packet.WriteInt16(0); //{questItemAmount}default value : 0 Len : 2 packet.WriteInt32(-1); //{questItemId}default value : -1 Len : 4 packet.WriteInt16(0); //{questItemAmount}default value : 0 Len : 2 packet.WriteInt32(-1); //{questItemId}default value : -1 Len : 4 packet.WriteInt16(0); //{questItemAmount}default value : 0 Len : 2 packet.WriteInt32(-1); //{questItemId}default value : -1 Len : 4 packet.WriteInt16(0); //{questItemAmount}default value : 0 Len : 2*/ } for (int i = 0; i < 1; i++) { packet.WriteByte(254); } for (int i = 0; i < 149; i++) { packet.WriteByte(255); } client.Send(packet, addEnd: false); } }
public static void GuildWaveUpdate(Asda2GuildWave guildWave, GuildWaveUpdateStatus status, int wave, int time) { using (var packet = new RealmPacketOut(RealmServerOpCode.GuildWaveUpdate)) //4409 { packet.WriteInt16(guildWave.GuildId); //{GuildId} packet.WriteByte((byte)status); // {type} 0 - подготовка(время - подготовка к 1 волне). 1 старт волны (время волны) .2 конец волны (время - подготовка к след волне) packet.WriteInt16(wave); // {wave} packet.WriteInt32(time); //{time} 5мин = 300000, 300*1000 guildWave.SendPacketToRegisteredOnGuildWavePlayers(packet); } }
public static void GuildWaveUpdateEnter(IRealmClient client, int remainingTime) { using (var packet = new RealmPacketOut(RealmServerOpCode.GuildWaveUpdate)) //4409 { packet.WriteInt16(client.ActiveCharacter.GuildId); //{GuildId} packet.WriteByte(0); // {type} 0 - подготовка(время - подготовка к 1 волне). 1 старт волны (время волны) .2 конец волны (время - подготовка к след волне) packet.WriteInt16(0); // {wave} packet.WriteInt32(remainingTime); //{time} 5мин = 300000, 300*1000 client.ActiveCharacter.Send(packet, addEnd: true); } }
public static void SendRegisteredToWarResponse(IRealmClient client, RegisterToBattlegroundStatus status) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.RegisteredToWar)) { packet.WriteByte((byte)status); packet.WriteInt16(client.ActiveCharacter.Asda2FactionId); packet.WriteInt16(0); packet.WriteInt16(6); client.Send(packet, false); } }
public static void SendQuestionDismissPlayerOrNotResponse(Asda2Battleground client, Character initer, Character target) { using (var packet = new RealmPacketOut(RealmServerOpCode.QuestionDismissPlayerOrNot)) //6188 { packet.WriteInt16(initer.SessionId); //{initerSessId}default value : 0 Len : 2 packet.WriteInt16(initer.Asda2FactionId); //{factionId}default value : 1 Len : 2 packet.WriteInt16(target.SessionId); //{targetSessId}default value : 15 Len : 2 packet.WriteInt32(target.AccId); //{dismissTargetAccId}default value : 361343 Len : 4 client.Send(packet, true, initer.Asda2FactionId); } }
public static void SendRegisteredToWarResponse(IRealmClient client, RegisterToBattlegroundStatus status) { using (var packet = new RealmPacketOut(RealmServerOpCode.RegisteredToWar)) //6707 { packet.WriteByte((byte)status); //{status}default value : 1 Len : 1 packet.WriteInt16(client.ActiveCharacter.Asda2FactionId); //{factionId}default value : 1 Len : 2 packet.WriteInt16(0); //{place}default value : 3 Len : 2 packet.WriteInt16(6); //{battleField}default value : 1 Len : 2 client.Send(packet); } }
public static void SendStartAtackCharacterResponseResponse(Character atacker, Character victim) { using (var packet = new RealmPacketOut(RealmServerOpCode.StartAtackCharacterResponse)) //4202 { packet.WriteByte(1); //{status}default value : 1 Len : 1 packet.WriteInt16(atacker.SessionId); //{atackerSessId}default value : 11 Len : 2 packet.WriteInt16(victim.SessionId); //{victimSessId}default value : 105 Len : 2 packet.WriteFloat(victim.Asda2X); //{x}default value : 0 Len : 4 packet.WriteFloat(victim.Asda2Y); //{y}default value : 0 Len : 4 atacker.SendPacketToArea(packet, true, true); } }
/* public static void SendMonstrDeadToOneClientRespone(NPC npc,IRealmClient client) * { * using (var packet = CreateMonstrDeadPacket(npc)) * client.Send(packet); * }*/ static RealmPacketOut CreateMonstrDeadPacket(short npc, short x, short y) { var packet = new RealmPacketOut(RealmServerOpCode.MonstrStateChanged); //4017 packet.WriteSkip(stab6); //value name : stab6 default value : stab6Len : 2 packet.WriteInt16(npc); //{monstrMapId}default value : 128 Len : 2 packet.WriteSkip(stab10); //value name : stab10 default value : stab10Len : 92 packet.WriteInt16(x); //{x}default value : 74 Len : 2 packet.WriteInt16(y); //{y}default value : 246 Len : 2 packet.WriteInt16(8557); //value name : unk2 default value : 8557Len : 2 return(packet); }
public static void SendPvpRoundEffectResponse(Character firstDueler, Character secondDueler) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.PvpRoundEffect)) { packet.WriteSkip(Asda2PvpHandler.stab6); packet.WriteInt32(firstDueler.AccId); packet.WriteInt32(secondDueler.AccId); packet.WriteInt16((short)(((double)firstDueler.Asda2X + (double)secondDueler.Asda2X) / 2.0)); packet.WriteInt16((short)(((double)firstDueler.Asda2Y + (double)secondDueler.Asda2Y) / 2.0)); firstDueler.SendPacketToArea(packet, true, false, Locale.Any, new float?()); } }
public static RealmPacketOut SendTalkMessage(string msg, Color c) { using (var packet = new RealmPacketOut(RealmServerOpCode.MessageServerAboutWarStarts)) //3113 { packet.WriteInt16(0); //value name : unk4 default value : 0Len : 2 packet.WriteInt16(0); //value name : unk5 default value : 100Len : 2 packet.WriteFixedAsciiString(msg, 36); //{Message}default value : 48 Len : 36 packet.WriteSkip(unk80); //value name : unk80 default value : unk80Len : 107 World.Broadcast(packet, true, Locale.Any); return(packet); } }
private static RealmPacketOut CreateMonstrDeadPacket(short npc, short x, short y) { RealmPacketOut realmPacketOut = new RealmPacketOut(RealmServerOpCode.MonstrStateChanged); realmPacketOut.WriteSkip(Asda2CombatHandler.stab6); realmPacketOut.WriteInt16(npc); realmPacketOut.WriteSkip(Asda2CombatHandler.stab10); realmPacketOut.WriteInt16(x); realmPacketOut.WriteInt16(y); realmPacketOut.WriteInt16(8557); return(realmPacketOut); }
public static void SendStartAtackCharacterResponseResponse(Character atacker, Character victim) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.StartAtackCharacterResponse)) { packet.WriteByte(1); packet.WriteInt16(atacker.SessionId); packet.WriteInt16(victim.SessionId); packet.WriteFloat(victim.Asda2X); packet.WriteFloat(victim.Asda2Y); atacker.SendPacketToArea(packet, true, true, Locale.Any, new float?()); } }