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 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); } }
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 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 SendPetSyntesResultResponse(IRealmClient client, PetSynethisResult result, Asda2PetRecord resultPet = null, Asda2Item rankPotion = null, Asda2Item classSupliment = null, Asda2Item syntesSupliment = null, int removedPet1Guid = 0, int removedPet2Guid = 0) { client.ActiveCharacter.Map.CallDelayed(500, (Action)(() => client.ActiveCharacter.GetTitle(Asda2TitleId.Evolved367))); Asda2Item[] asda2ItemArray = new Asda2Item[3] { rankPotion, classSupliment, syntesSupliment }; using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.PetSyntesResult)) { packet.WriteByte((byte)result); packet.WriteInt32(client.ActiveCharacter.AccId); packet.WriteInt32(resultPet == null ? 0 : resultPet.Guid); packet.WriteInt16(resultPet == null ? 0 : (int)resultPet.Id); packet.WriteFixedAsciiString(resultPet == null ? "" : resultPet.Name, 16, Locale.Start); packet.WriteByte(resultPet == null ? 0 : (int)resultPet.HungerPrc); packet.WriteByte(resultPet == null ? 0 : (int)resultPet.Level); packet.WriteByte(resultPet == null ? 0 : (int)resultPet.MaxLevel); packet.WriteSkip(Asda2PetHandler.unk13); packet.WriteInt16(resultPet == null ? (byte)0 : (byte)resultPet.Stat1Type); packet.WriteInt32(resultPet == null ? 0 : resultPet.Stat1Value); packet.WriteInt16(resultPet == null ? (byte)0 : (byte)resultPet.Stat2Type); packet.WriteInt32(resultPet == null ? 0 : resultPet.Stat2Value); packet.WriteInt16(resultPet == null ? (byte)0 : (byte)resultPet.Stat3Type); packet.WriteInt32(resultPet == null ? 0 : resultPet.Stat3Value); packet.WriteInt32(removedPet1Guid); packet.WriteInt32(removedPet2Guid); packet.WriteInt32(client.ActiveCharacter.Asda2Inventory.Weight); for (int index = 0; index < 3; ++index) { Asda2Item asda2Item = asda2ItemArray[index]; packet.WriteInt32(asda2Item == null ? 0 : asda2Item.ItemId); packet.WriteByte(asda2Item == null ? (byte)0 : (byte)asda2Item.InventoryType); packet.WriteInt16(asda2Item == null ? -1 : (int)asda2Item.Slot); packet.WriteInt16(asda2Item == null ? -1 : (asda2Item.IsDeleted ? -1 : 0)); packet.WriteInt32(asda2Item == null ? 0 : asda2Item.Amount); packet.WriteSkip(Asda2PetHandler.stab25); packet.WriteInt16(asda2Item == null ? 0 : asda2Item.Amount); packet.WriteSkip(Asda2PetHandler.stab28); } client.Send(packet, false); } }
public static void SendSkillLearnedResponse(SkillLearnStatus status, Character ownerChar, uint id, int level) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SkillLearned)) { packet.WriteByte((byte)status); packet.WriteInt16(ownerChar.Spells.AvalibleSkillPoints); packet.WriteInt32(ownerChar.Money); packet.WriteInt16(id); packet.WriteByte(level); packet.WriteSkip(stab16); packet.WriteInt16(ownerChar.Asda2Strength); packet.WriteInt16(ownerChar.Asda2Agility); packet.WriteInt16(ownerChar.Asda2Stamina); packet.WriteInt16(ownerChar.Asda2Spirit); packet.WriteInt16(ownerChar.Asda2Intellect); packet.WriteInt16(ownerChar.Asda2Luck); packet.WriteInt16(0); packet.WriteInt16(0); packet.WriteInt16(0); packet.WriteInt16(0); packet.WriteInt16(0); packet.WriteInt16(0); packet.WriteInt16(ownerChar.Asda2Strength); packet.WriteInt16(ownerChar.Asda2Agility); packet.WriteInt16(ownerChar.Asda2Stamina); packet.WriteInt16(ownerChar.Asda2Spirit); packet.WriteInt16(ownerChar.Asda2Intellect); packet.WriteInt16(ownerChar.Asda2Luck); packet.WriteInt32(ownerChar.MaxHealth); packet.WriteInt16(ownerChar.MaxPower); packet.WriteInt32(ownerChar.Health); packet.WriteInt16(ownerChar.Power); packet.WriteInt16((short)ownerChar.MinDamage); packet.WriteInt16((short)ownerChar.MaxDamage); packet.WriteInt16(ownerChar.MinMagicDamage); packet.WriteInt16(ownerChar.MaxMagicDamage); packet.WriteInt16((short)ownerChar.Asda2MagicDefence); packet.WriteInt16((short)ownerChar.Asda2Defence); packet.WriteInt16((short)ownerChar.Asda2Defence); packet.WriteFloat(ownerChar.BlockChance); packet.WriteFloat(ownerChar.BlockValue); packet.WriteInt16(15); packet.WriteInt16(7); packet.WriteInt16(4); packet.WriteSkip(stub87); ownerChar.Send(packet, false); } }
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 SendMonstMoveOrAtackResponse(short sessIdTarget, NPC movingNpc, int dmg, Vector3 toPos, bool isAtack) { if (!movingNpc.IsAreaActive) { return; } using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.MonstMove)) { packet.WriteInt16(sessIdTarget); packet.WriteInt16((short)movingNpc.Entry.NPCId); packet.WriteInt16(movingNpc.UniqIdOnMap); packet.WriteByte(isAtack ? 3 : (movingNpc.Movement.MoveType == AIMoveType.Walk ? 2 : 5)); packet.WriteInt16((short)movingNpc.Asda2X); packet.WriteInt16((short)movingNpc.Asda2Y); packet.WriteInt16(isAtack ? 0 : (int)(short)toPos.X); packet.WriteInt16(isAtack ? 0 : (int)(short)toPos.Y); float num = movingNpc.Movement.MoveType == AIMoveType.Walk ? movingNpc.WalkSpeed : movingNpc.RunSpeed; packet.WriteInt16(isAtack ? 0 : (int)(short)(1000.0 / (double)num)); packet.WriteInt16(isAtack ? 0 : 10000); packet.WriteInt16(10000); packet.WriteInt32(dmg); packet.WriteInt16(movingNpc.Health); packet.WriteInt16(movingNpc.Health <= 0 ? -1 : 0); packet.WriteSkip(Asda2MovmentHandler.Stab35); movingNpc.SendPacketToArea(packet, false, true, Locale.Any, new float?()); } }
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 SendPetResurectedResponse(IRealmClient client, Asda2PetRecord pet, Asda2Item resurectPetItem) { using (var packet = new RealmPacketOut(RealmServerOpCode.PetResurected)) //6109 { packet.WriteInt32(client.ActiveCharacter.AccId); //{accId}default value : 361343 Len : 4 packet.WriteInt32(pet.Guid); //{petGuid}default value : 68412 Len : 4 packet.WriteInt32(resurectPetItem.ItemId); //{itemId}default value : 31981 Len : 4 packet.WriteByte(2); //{inv}default value : 2 Len : 1 packet.WriteInt16(resurectPetItem.Slot); //{slot}default value : 8 Len : 2 packet.WriteInt16(resurectPetItem.IsDeleted ? -1 : 0); //{minusOneIfDelete}default value : -1 Len : 2 packet.WriteInt32(resurectPetItem.Amount); //{amount}default value : 0 Len : 4 packet.WriteByte(0); //value name : stab25 default value : stab25Len : 1 packet.WriteInt16(resurectPetItem.Amount); //{amount0}default value : 0 Len : 2 packet.WriteSkip(stab28); //value name : stab28 default value : stab28Len : 41 packet.WriteByte(1); //value name : unk1 default value : 1Len : 1 packet.WriteByte(pet.HungerPrc); //{HungerPrc}default value : 58 Len : 1 packet.WriteInt32(client.ActiveCharacter.Asda2Inventory.Weight); //{invWeight}default value : 0 Len : 4 packet.WriteInt16((short)pet.Stat1Type); //{stat1Type}default value : 2 Len : 2 packet.WriteInt32(pet.Stat1Value); //{stat1Value}default value : 31 Len : 4 packet.WriteInt16((short)pet.Stat2Type); //{stat1Type}default value : 2 Len : 2 packet.WriteInt32(pet.Stat2Value); //{stat1Value}default value : 31 Len : 4 packet.WriteInt16((short)pet.Stat2Type); //{stat1Type}default value : 2 Len : 2 packet.WriteInt32(pet.Stat2Value); //{stat1Value}default value : 31 Len : 4 client.Send(packet, addEnd: true); } }
public static void SendMonstMoveOrAtackResponse(Int16 sessIdTarget, NPC movingNpc, Int32 dmg, Vector3 toPos, bool isAtack) { if (!movingNpc.IsAreaActive) { return; } using (var packet = new RealmPacketOut(RealmServerOpCode.MonstMove)) //4015 { packet.WriteInt16(sessIdTarget); //{sessIdTarget}default value : 29 Len : 2 packet.WriteInt16((short)movingNpc.Entry.NPCId); // packet.WriteSkip(Stab8); //value name : stab8 default value : stab8Len : 2 packet.WriteInt16(movingNpc.UniqIdOnMap); //{monstrId}default value : 129 Len : 2 packet.WriteByte(isAtack ? 3 : movingNpc.Movement.MoveType == Constants.NPCs.AIMoveType.Walk ? 2 : 5); //{setPositionMode}default value : 2 Len : 1 2 - run 1 - instant 3 - atack packet.WriteInt16((short)movingNpc.Asda2X); //{xStart}default value : 91 Len : 2 packet.WriteInt16((short)movingNpc.Asda2Y); //{yStart}default value : 255 Len : 2 packet.WriteInt16(isAtack ? 0 : (short)toPos.X); //{xStop}default value : 0 Len : 2 packet.WriteInt16(isAtack ? 0 : (short)toPos.Y); //{yStop}default value : 0 Len : 2 var speed = movingNpc.Movement.MoveType == Constants.NPCs.AIMoveType.Walk ? movingNpc.WalkSpeed : movingNpc.RunSpeed; packet.WriteInt16(isAtack ? 0 : (short)(1000f / speed)); //{movingSpeed}default value : 0 Len : 2 //Todo Asda2 calc animation speed packet.WriteInt16(isAtack ? 0 : 10000); //{animationSpeed}default value : 0 Len : 2 packet.WriteInt16(10000); //{animationSpeedOfAtack}default value : 10000 Len : 2 packet.WriteInt32(dmg); //{dmg}default value : -2 Len : 4 packet.WriteInt16(movingNpc.Health); //{hp}default value : 10 Len : 2 packet.WriteInt16(movingNpc.Health <= 0 ? -1 : 0); //{isAlive}default value : 0 Len : 2 monstr dead = -1; alive = 0 packet.WriteSkip(Stab35); //value name : stab35 default value : stab35Len : 8 movingNpc.SendPacketToArea(packet, false, true); } }
public static void SendWarEndedResponse(IRealmClient client, byte winingFaction, int winingFactionPoints, int losserFactionPoints, int honorPoints, short honorCoin, long expReward, string mvpName) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.WarEnded)) { packet.WriteInt16(winingFaction); packet.WriteSkip(Asda2BattlegroundHandler.stab9); packet.WriteInt32(winingFactionPoints); packet.WriteInt32(losserFactionPoints); packet.WriteInt32(honorPoints); packet.WriteInt16(honorCoin); packet.WriteSkip(Asda2BattlegroundHandler.stab35); packet.WriteInt64(expReward); packet.WriteSkip(Asda2BattlegroundHandler.stab46); packet.WriteFixedAsciiString(mvpName, 20, Locale.Start); client.Send(packet, true); } }
public static void SendSkillLearnedFirstTimeResponse(IRealmClient client, short skillId, int cooldownSecs) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SkillLearnedFirstTime)) { packet.WriteInt16(skillId); packet.WriteByte(1); packet.WriteByte(1); packet.WriteInt16(cooldownSecs); packet.WriteSkip(stab12); packet.WriteInt16(271); packet.WriteInt32(28); packet.WriteByte(100); packet.WriteByte(100); packet.WriteInt16(8); packet.WriteSkip(stab24); client.Send(packet, true); } }
public static void SendFishingBookRewardRecivedResponse(IRealmClient client, GetFishingBookRewardStatus status, Asda2Item rewardItem, byte fishingBookNum) { using (var packet = new RealmPacketOut(RealmServerOpCode.FishingBookRewardRecived)) //6183 { packet.WriteByte((byte)status); //{status}default value : 1 Len : 1 packet.WriteInt32(fishingBookNum); //{fishBookNum}default value : 0 Len : 4 packet.WriteInt16(client.ActiveCharacter.Asda2Inventory.Weight); //{invWeight}default value : 9020 Len : 2 packet.WriteInt32(rewardItem == null ? 0 : rewardItem.ItemId); //{itemId}default value : 31824 Len : 4 packet.WriteByte((byte)(rewardItem == null ? 0 : rewardItem.InventoryType)); //{invType}default value : 2 Len : 1 packet.WriteInt16(rewardItem == null ? 0 : rewardItem.Slot); //{cell}default value : 17 Len : 2 packet.WriteSkip(stab21); //value name : stab21 default value : stab21Len : 2 packet.WriteInt32(rewardItem == null ? 0 : rewardItem.Amount); //{amount}default value : 0 Len : 4 packet.WriteSkip(stab27); //value name : stab27 default value : stab27Len : 1 packet.WriteInt16(rewardItem == null ? 0 : rewardItem.Weight); //{weight}default value : 40 Len : 2 packet.WriteSkip(stub23); //{stub23}default value : stub23 Len : 41 client.Send(packet, addEnd: true); } }
public static void SendWarEndedResponse(IRealmClient client, byte winingFaction, int winingFactionPoints, int losserFactionPoints, int honorPoints, short honorCoin, long expReward, string mvpName) { using (var packet = new RealmPacketOut(RealmServerOpCode.WarEnded)) //6732 { packet.WriteInt16(winingFaction); //{winingFaction}default value : 1 Len : 2 packet.WriteSkip(stab9); //value name : stab9 default value : stab9Len : 12 packet.WriteInt32(winingFactionPoints); //{winingFactionPoints}default value : 911 Len : 4 packet.WriteInt32(losserFactionPoints); //{losserFactionPoints}default value : 120 Len : 4 packet.WriteInt32(honorPoints); //{HonorPoints}default value : 353 Len : 4 packet.WriteInt16(honorCoin); //{honorCoin}default value : 17 Len : 2 packet.WriteSkip(stab35); //value name : stab35 default value : stab35Len : 3 packet.WriteInt64(expReward); //{expReward}default value : 10000 Len : 8 packet.WriteSkip(stab46); //value name : stab46 default value : stab46Len : 16 packet.WriteFixedAsciiString(mvpName, 20); //{mvpName}default value : Len : 20 client.Send(packet, addEnd: true); } }
public static RealmPacketOut CreateCloseCharacterTradeShopToOwnerResponse( Asda2PrivateShopClosedToOwnerResult status) { RealmPacketOut realmPacketOut = new RealmPacketOut(RealmServerOpCode.CloseCharacterTradeShopResponseToOwner); realmPacketOut.WriteByte((byte)status); realmPacketOut.WriteSkip(Asda2PrivateShopHandler.stub1); return(realmPacketOut); }
public static void SendPetLevelLimitBreakedResponse(IRealmClient client, PetLimitBreakStatus status, Asda2PetRecord pet = null, Asda2Item lvlBreakItem = null, Asda2Item suplItem = null) { Asda2Item[] asda2ItemArray = new Asda2Item[2] { lvlBreakItem, suplItem }; using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.PetLevelLimitBreaked)) { packet.WriteByte((byte)status); packet.WriteInt32(pet == null ? 0 : pet.Guid); packet.WriteInt16(pet == null ? 0 : (int)pet.Id); packet.WriteFixedAsciiString(pet == null ? "" : pet.Name, 16, Locale.Start); packet.WriteByte(pet == null ? 0 : (int)pet.HungerPrc); packet.WriteByte(pet == null ? 0 : (int)pet.Level); packet.WriteByte(pet == null ? 0 : (int)pet.MaxLevel); packet.WriteInt16(pet == null ? 0 : (int)pet.Expirience); packet.WriteByte(1); packet.WriteInt16(pet == null ? (short)0 : (short)pet.Stat1Type); packet.WriteInt32(pet == null ? 0 : pet.Stat1Value); packet.WriteInt16(pet == null ? (short)0 : (short)pet.Stat2Type); packet.WriteInt32(pet == null ? 0 : pet.Stat2Value); packet.WriteInt16(pet == null ? (short)0 : (short)pet.Stat3Type); packet.WriteInt32(pet == null ? 0 : pet.Stat3Value); packet.WriteInt32(client.ActiveCharacter.Asda2Inventory.Weight); for (int index = 0; index < 2; ++index) { Asda2Item asda2Item = asda2ItemArray[index]; packet.WriteInt32(asda2Item == null ? 0 : asda2Item.ItemId); packet.WriteByte(asda2Item == null ? (byte)0 : (byte)asda2Item.InventoryType); packet.WriteInt16(asda2Item == null ? -1 : (int)asda2Item.Slot); packet.WriteInt16(asda2Item == null ? -1 : (asda2Item.IsDeleted ? -1 : 0)); packet.WriteInt32(asda2Item == null ? 0 : asda2Item.Amount); packet.WriteSkip(Asda2PetHandler.stab25); packet.WriteInt16(asda2Item == null ? 0 : asda2Item.Amount); packet.WriteSkip(Asda2PetHandler.stab28); } client.Send(packet, false); } }
public static void SendPetSyntesResultResponse(IRealmClient client, PetSynethisResult result, Asda2PetRecord resultPet = null, Asda2Item rankPotion = null, Asda2Item classSupliment = null, Asda2Item syntesSupliment = null, int removedPet1Guid = 0, int removedPet2Guid = 0) { var items = new Asda2Item[3]; items[0] = rankPotion; items[1] = classSupliment; items[2] = syntesSupliment; using (var packet = new RealmPacketOut(RealmServerOpCode.PetSyntesResult)) //6113 { packet.WriteByte((byte)result); //{result}default value : 1 Len : 1 packet.WriteInt32(client.ActiveCharacter.AccId); //{accId}default value : 361343 Len : 4 packet.WriteInt32(resultPet == null ? 0 : resultPet.Guid); //{resultPetGuid}default value : 69819 Len : 4 packet.WriteInt16(resultPet == null ? 0 : resultPet.Id); //{resultPetId}default value : 2118 Len : 2 packet.WriteFixedAsciiString(resultPet == null ? "" : resultPet.Name, 16); //{resultPetName}default value : Len : 16 packet.WriteByte(resultPet == null ? 0 : resultPet.HungerPrc); //{resultPetHunger}default value : 100 Len : 1 packet.WriteByte(resultPet == null ? 0 : resultPet.Level); //{rpCurLvl}default value : 1 Len : 1 packet.WriteByte(resultPet == null ? 0 : resultPet.MaxLevel); //{rpMaxLvl}default value : 3 Len : 1 packet.WriteSkip(unk13); //value name : unk13 default value : unk13Len : 3 packet.WriteInt16((byte)(resultPet == null ? 0 : resultPet.Stat1Type)); //{rpStat1Type}default value : 16 Len : 2 packet.WriteInt32(resultPet == null ? 0 : resultPet.Stat1Value); //{rpStat1Val}default value : 32 Len : 4 packet.WriteInt16((byte)(resultPet == null ? 0 : resultPet.Stat2Type)); //{rpStat1Type}default value : 16 Len : 2 packet.WriteInt32(resultPet == null ? 0 : resultPet.Stat2Value); //{rpStat1Val}default value : 32 Len : 4 packet.WriteInt16((byte)(resultPet == null ? 0 : resultPet.Stat3Type)); //{rpStat1Type}default value : 16 Len : 2 packet.WriteInt32(resultPet == null ? 0 : resultPet.Stat3Value); //{rpStat1Val}default value : 32 Len : 4 packet.WriteInt32(removedPet1Guid); //{removedPet1Guid}default value : 68367 Len : 4 packet.WriteInt32(removedPet2Guid); //{removedPet2Guid}default value : 68412 Len : 4 packet.WriteInt32(client.ActiveCharacter.Asda2Inventory.Weight); //{weight}default value : 10788 Len : 4 for (int i = 0; i < 3; i += 1) { var item = items[i]; packet.WriteInt32(item == null ? 0 : item.ItemId); //{itemId}default value : 31981 Len : 4 packet.WriteByte((byte)(item == null ? 0 : item.InventoryType)); //{inv}default value : 2 Len : 1 packet.WriteInt16(item == null ? -1 : item.Slot); //{slot}default value : 8 Len : 2 packet.WriteInt16(item == null ? -1 : item.IsDeleted ? -1 : 0); //{minusOneIfDelete}default value : -1 Len : 2 packet.WriteInt32(item == null ? 0 : item.Amount); //{amount}default value : 0 Len : 4 packet.WriteSkip(stab25); //value name : stab25 default value : stab25Len : 1 packet.WriteInt16(item == null ? 0 : item.Amount); //{amount0}default value : 0 Len : 2 packet.WriteSkip(stab28); //value name : stab28 default value : stab28Len : 41 } client.Send(packet); } }
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); } }
public static void SendPvpRoundEffectResponse(Character firstDueler, Character secondDueler) { using (var packet = new RealmPacketOut(RealmServerOpCode.PvpRoundEffect)) //4305 { packet.WriteSkip(stab6); //value name : stab6 default value : stab6Len : 2 packet.WriteInt32(firstDueler.AccId); //{fisrtDuelerAccId}default value : 354889 Len : 4 packet.WriteInt32(secondDueler.AccId); //{secondDuelerAccId}default value : 340701 Len : 4 packet.WriteInt16((short)((firstDueler.Asda2X + secondDueler.Asda2X) / 2)); //{x}default value : 156 Len : 2 packet.WriteInt16((short)((firstDueler.Asda2Y + secondDueler.Asda2Y) / 2)); //{y}default value : 365 Len : 2 firstDueler.SendPacketToArea(packet, true, false); } }
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 void SendPetLevelLimitBreakedResponse(IRealmClient client, PetLimitBreakStatus status, Asda2PetRecord pet = null, Asda2Item lvlBreakItem = null, Asda2Item suplItem = null) { var items = new Asda2Item[2]; items[0] = lvlBreakItem; items[1] = suplItem; using (var packet = new RealmPacketOut(RealmServerOpCode.PetLevelLimitBreaked)) //6149 { packet.WriteByte((byte)status); //{curstatus}default value : 1 Len : 1 packet.WriteInt32(pet == null ? 0 : pet.Guid); //{petGuid}default value : 68412 Len : 4 packet.WriteInt16(pet == null ? 0 : pet.Id); //{petId}default value : 2759 Len : 2 packet.WriteFixedAsciiString(pet == null ? "" : pet.Name, 16); //{petName}default value : Len : 16 packet.WriteByte(pet == null ? 0 : pet.HungerPrc); //{hunger}default value : 97 Len : 1 packet.WriteByte(pet == null ? 0 : pet.Level); //{curLvl}default value : 5 Len : 1 packet.WriteByte(pet == null ? 0 : pet.MaxLevel); //{maxLvl}default value : 5 Len : 1 packet.WriteInt16(pet == null ? 0 : pet.Expirience); //{exp}default value : 2000 Len : 2 packet.WriteByte(1); //value name : unk13 default value : 1Len : 1 packet.WriteInt16((short)(pet == null ? 0 : pet.Stat1Type)); //{stat1Type}default value : 2 Len : 2 packet.WriteInt32(pet == null ? 0 : pet.Stat1Value); //{stat1Value}default value : 77 Len : 4 packet.WriteInt16((short)(pet == null ? 0 : pet.Stat2Type)); //{stat1Type}default value : 2 Len : 2 packet.WriteInt32(pet == null ? 0 : pet.Stat2Value); //{stat1Value}default value : 77 Len : 4 packet.WriteInt16((short)(pet == null ? 0 : pet.Stat3Type)); //{stat1Type}default value : 2 Len : 2 packet.WriteInt32(pet == null ? 0 : pet.Stat3Value); //{stat1Value}default value : 77 Len : 4 packet.WriteInt32(client.ActiveCharacter.Asda2Inventory.Weight); //{inwWeight}default value : 9988 Len : 4 for (int i = 0; i < 2; i += 1) { var item = items[i]; packet.WriteInt32(item == null ? 0 : item.ItemId); //{itemId}default value : 31981 Len : 4 packet.WriteByte((byte)(item == null ? 0 : item.InventoryType)); //{inv}default value : 2 Len : 1 packet.WriteInt16(item == null ? -1 : item.Slot); //{slot}default value : 8 Len : 2 packet.WriteInt16(item == null ? -1 : item.IsDeleted ? -1 : 0); //{minusOneIfDelete}default value : -1 Len : 2 packet.WriteInt32(item == null ? 0 : item.Amount); //{amount}default value : 0 Len : 4 packet.WriteSkip(stab25); //value name : stab25 default value : stab25Len : 1 packet.WriteInt16(item == null ? 0 : item.Amount); //{amount0}default value : 0 Len : 2 packet.WriteSkip(stab28); //value name : stab28 default value : stab28Len : 41 } client.Send(packet); } }
public static void SendItemsBuyedFromAukResponse(IRealmClient client, List <Asda2ItemTradeRef> items) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.ItemsBuyedFromAuk)) { int num = 0; foreach (Asda2ItemTradeRef asda2ItemTradeRef in items) { Asda2Item asda2Item = asda2ItemTradeRef.Item; if (num < 7) { packet.WriteInt32(asda2ItemTradeRef.Price); packet.WriteSkip(Asda2AuctionHandler.stub4); packet.WriteInt32(asda2Item.ItemId); packet.WriteInt32(asda2ItemTradeRef.Amount); packet.WriteByte((byte)asda2Item.InventoryType); packet.WriteInt16(asda2Item.Slot); packet.WriteInt16(asda2Item.Weight); packet.WriteByte(asda2Item.Durability); packet.WriteInt32(asda2Item.Enchant); packet.WriteByte(0); packet.WriteInt32(0); packet.WriteInt16(0); packet.WriteInt16(asda2Item.Record.Parametr1Type); packet.WriteInt16(asda2Item.Parametr1Value); packet.WriteInt16(asda2Item.Record.Parametr2Type); packet.WriteInt16(asda2Item.Parametr2Value); packet.WriteInt16(asda2Item.Record.Parametr3Type); packet.WriteInt16(asda2Item.Parametr3Value); packet.WriteInt16(asda2Item.Record.Parametr4Type); packet.WriteInt16(asda2Item.Parametr4Value); packet.WriteInt16(asda2Item.Record.Parametr5Type); packet.WriteInt16(asda2Item.Parametr5Value); packet.WriteByte(0); packet.WriteInt32(asda2Item.AuctionPrice); packet.WriteFixedAsciiString(client.ActiveCharacter.Name, 20, Locale.Start); packet.WriteInt16(asda2Item.Soul1Id); packet.WriteInt16(asda2Item.Soul2Id); packet.WriteInt16(asda2Item.Soul3Id); packet.WriteInt16(asda2Item.Soul4Id); ++num; } else { break; } } client.Send(packet, false); } }
public static void SendMessageServerAboutWarStartsResponse(byte mins) { int num1 = (int)mins / 10; int num2 = (int)mins % 10; using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.MessageServerAboutWarStarts)) { packet.WriteInt16(0); packet.WriteInt16(100); packet.WriteByte(48 + num1); packet.WriteByte(48 + num2); packet.WriteSkip(Asda2BattlegroundHandler.unk80); WCell.RealmServer.Global.World.Broadcast(packet, true, Locale.Any); } }
public static void SendMessageServerAboutWarStartsResponse(byte mins) { var tenMins = mins / 10; var m = mins % 10; using (var packet = new RealmPacketOut(RealmServerOpCode.MessageServerAboutWarStarts)) //3113 { packet.WriteInt16(0); //value name : unk4 default value : 0Len : 2 packet.WriteInt16(100); //value name : unk5 default value : 100Len : 2 packet.WriteByte(48 + tenMins); //{mins10StartsFrom48}default value : 49 Len : 1 packet.WriteByte(48 + m); //{minsOneStartFrom48}default value : 48 Len : 1 packet.WriteSkip(unk80); //value name : unk80 default value : unk80Len : 107 World.Broadcast(packet, true, Locale.Any); } }
public static void SendItemFromAukRemovedResponse(IRealmClient client, List <Asda2ItemTradeRef> asda2Items) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.ItemFromAukRemoved)) { int num = 0; foreach (Asda2ItemTradeRef asda2Item1 in asda2Items) { Asda2Item asda2Item2 = asda2Item1.Item; if (num < 8) { packet.WriteInt32(asda2Item1.Price); packet.WriteSkip(Asda2AuctionHandler.stub4); packet.WriteInt32(asda2Item2.ItemId); packet.WriteInt32(asda2Item1.Amount); packet.WriteByte((byte)asda2Item2.InventoryType); packet.WriteInt16(asda2Item2.Slot); packet.WriteInt16(asda2Item2.Weight); packet.WriteByte(asda2Item2.Durability); packet.WriteInt32(asda2Item2.Enchant); packet.WriteByte(0); packet.WriteInt32(0); packet.WriteInt16(0); packet.WriteInt16(asda2Item2.Record.Parametr1Type); packet.WriteInt16(asda2Item2.Parametr1Value); packet.WriteInt16(asda2Item2.Record.Parametr2Type); packet.WriteInt16(asda2Item2.Parametr2Value); packet.WriteInt16(asda2Item2.Record.Parametr3Type); packet.WriteInt16(asda2Item2.Parametr3Value); packet.WriteInt16(asda2Item2.Record.Parametr4Type); packet.WriteInt16(asda2Item2.Parametr4Value); packet.WriteInt16(asda2Item2.Record.Parametr5Type); packet.WriteInt16(asda2Item2.Parametr5Value); packet.WriteByte(0); packet.WriteInt16(asda2Item2.Soul1Id); packet.WriteInt16(asda2Item2.Soul2Id); packet.WriteInt16(asda2Item2.Soul3Id); packet.WriteInt16(asda2Item2.Soul4Id); ++num; } else { break; } } client.Send(packet, false); } }
public static void SendItemsBuyedFromAukResponse(IRealmClient client, List <Asda2ItemTradeRef> items) { using (var packet = new RealmPacketOut(RealmServerOpCode.ItemsBuyedFromAuk)) //9906 { var i = 0; foreach (var itemRef in items) { var item = itemRef.Item; if (i >= 7) { break; } packet.WriteInt32(itemRef.Price); //{aukId}default value : 1179 Len : 4 packet.WriteSkip(stub4); //{stub4}default value : stub4 Len : 3 packet.WriteInt32(item.ItemId); //{itemId%}default value : 0 Len : 4 packet.WriteInt32(itemRef.Amount); //{quantity}default value : 0 Len : 4 packet.WriteByte((byte)item.InventoryType); //{invNum}default value : 0 Len : 1 packet.WriteInt16(item.Slot); //{slot%}default value : -1 Len : 2 packet.WriteInt16(item.Weight); //{weight%}default value : 0 Len : 2 packet.WriteByte(item.Durability); //{durability%}default value : 0 Len : 1 packet.WriteInt32(item.Enchant); //{enchant}default value : 0 Len : 4 packet.WriteByte(0); //value name : unk1 default value : 0Len : 1 packet.WriteInt32(0); //value name : unk4 default value : 0Len : 4 packet.WriteInt16(0); //value name : unk2 default value : 0Len : 2 packet.WriteInt16(item.Record.Parametr1Type); packet.WriteInt16(item.Parametr1Value); //{stat1Value}default value : 9 Len : 2 packet.WriteInt16(item.Record.Parametr2Type); packet.WriteInt16(item.Parametr2Value); //{stat1Value}default value : 9 Len : 2 packet.WriteInt16(item.Record.Parametr3Type); //{stat1Type}default value : 1 Len : 2 packet.WriteInt16(item.Parametr3Value); //{stat1Value}default value : 9 Len : 2 packet.WriteInt16(item.Record.Parametr4Type); //{stat1Type}default value : 1 Len : 2 packet.WriteInt16(item.Parametr4Value); //{stat1Value}default value : 9 Len : 2 packet.WriteInt16(item.Record.Parametr5Type); //{stat1Type}default value : 1 Len : 2 packet.WriteInt16(item.Parametr5Value); //{stat1Value}default value : 9 Len : 2 packet.WriteByte(0); //value name : unk1 default value : 0Len : 1 packet.WriteInt32(item.AuctionPrice); //{price}default value : 0 Len : 4 packet.WriteFixedAsciiString(client.ActiveCharacter.Name, 20); //{name}default value : Len : 20 packet.WriteInt16(item.Soul1Id); //{soul1Id}default value : -1 Len : 2 packet.WriteInt16(item.Soul2Id); //{soul2id}default value : -1 Len : 2 packet.WriteInt16(item.Soul3Id); //{soul3Id}default value : -1 Len : 2 packet.WriteInt16(item.Soul4Id); //{soul4Id}default value : -1 Len : 2 i++; } client.Send(packet); } }
public static void SendMonstrUsedSkillResponse(NPC caster, short skillId, Unit initialTarget, DamageAction[] actions) { if (caster == null) { return; } using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.MonstrUsedSkill)) { Character character = initialTarget as Character; packet.WriteByte(0); packet.WriteInt16(skillId); packet.WriteInt16(caster.UniqIdOnMap); packet.WriteByte(0); packet.WriteByte(1); packet.WriteInt16(character == null ? 0 : character.SessionId); int num1 = 0; if (actions != null) { foreach (DamageAction action in actions) { if (num1 <= 16 && action != null) { Character victim = action.Victim as Character; packet.WriteByte(1); packet.WriteInt16(victim == null ? 0 : victim.SessionId); int num2 = action.ActualDamage; if (num2 < 0 || num2 > 200000000) { num2 = 0; } packet.WriteInt32(actions.Length == 0 ? 0 : num2); packet.WriteByte(actions.Length == 0 ? 3 : 1); packet.WriteSkip(unk14); ++num1; } else { break; } } } caster.SendPacketToArea(packet, false, true, Locale.Any, new float?()); } }
public static void SendRecipeLeadnedResponse(IRealmClient client, bool success, short recipeId, Asda2Item recipeItem) { using (var packet = new RealmPacketOut(RealmServerOpCode.RecipeLeadned)) //6599 { packet.WriteByte(success ? 1 : 0); //{status}default value : 1 Len : 1 packet.WriteInt32(client.ActiveCharacter.Asda2Inventory.Weight); //{weight}default value : 2080 Len : 4 packet.WriteInt32(recipeItem == null ? 0 : recipeItem.ItemId); //{itemId}default value : 31981 Len : 4 packet.WriteByte(2); //{inv}default value : 2 Len : 1 packet.WriteInt16(recipeItem == null ? 0 : recipeItem.Slot); //{slot}default value : 8 Len : 2 packet.WriteInt16(recipeItem == null ? 0 : recipeItem.IsDeleted ? -1 : 0); //{minusOneIfDelete}default value : -1 Len : 2 packet.WriteInt32(recipeItem == null ? 0 : recipeItem.Amount); //{amount}default value : 0 Len : 4 packet.WriteByte(0); //value name : stab25 default value : stab25Len : 1 packet.WriteInt16(recipeItem == null ? 0 : recipeItem.Amount); //{amount0}default value : 0 Len : 2 packet.WriteSkip(stab28); //value name : stab28 default value : stab28Len : 41 packet.WriteInt16(recipeId); //{reciepeId}default value : 2 Len : 2 client.Send(packet, addEnd: true); } }
public static void SendRecipeLeadnedResponse(IRealmClient client, bool success, short recipeId, Asda2Item recipeItem) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.RecipeLeadned)) { packet.WriteByte(success ? 1 : 0); packet.WriteInt32(client.ActiveCharacter.Asda2Inventory.Weight); packet.WriteInt32(recipeItem == null ? 0 : recipeItem.ItemId); packet.WriteByte(2); packet.WriteInt16(recipeItem == null ? 0 : (int)recipeItem.Slot); packet.WriteInt16(recipeItem == null ? 0 : (recipeItem.IsDeleted ? -1 : 0)); packet.WriteInt32(recipeItem == null ? 0 : recipeItem.Amount); packet.WriteByte(0); packet.WriteInt16(recipeItem == null ? 0 : recipeItem.Amount); packet.WriteSkip(Asda2CraftingHandler.stab28); packet.WriteInt16(recipeId); client.Send(packet, true); } }