コード例 #1
0
        public void SendAbilities()
        {
            if (!HasPlayer())
                return;

            Log.Info("AbilityInterface", "Sending " + Abilities.Count + " Abilities");

            PacketOut Out = new PacketOut((byte)Opcodes.F_CHARACTER_INFO);
            Out.WriteByte(1); // Action
            Out.WriteByte((byte)Abilities.Count);
            Out.WriteUInt16(0x300);

            foreach (Ability_Info Info in Abilities)
            {
                Out.WriteUInt16(Info.Entry);
                Out.WriteByte(Info.Level);
            }

            GetPlayer().SendPacket(Out);

            PacketOut AutoAttack = new PacketOut((byte)Opcodes.F_CHARACTER_INFO);
            AutoAttack.WriteByte(1); // Action
            AutoAttack.WriteByte(1); // Count
            AutoAttack.WriteUInt16(0x300);
            AutoAttack.WriteUInt16(245);
            AutoAttack.WriteByte(1);
            GetPlayer().SendPacket(AutoAttack);
        }
コード例 #2
0
ファイル: Ability.cs プロジェクト: Necrosummon/WarEmu
        public void SendAbilityDone(ushort TargetOID)
        {
            Log.Success("Ability", "Send Done :" + Info.Entry);

            Player player = this.Caster.GetPlayer();
            PacketOut Out1 = new PacketOut((byte)Opcodes.F_USE_ABILITY);
            Out1.WriteUInt16(0);
            Out1.WriteUInt16(Info.Entry);
            Out1.WriteUInt16(Caster.Oid);
            Out1.WriteHexStringBytes("061022730601000001E601000000");
            player.DispatchPacket(Out1, true);

            PacketOut Out2 = new PacketOut((byte)Opcodes.F_USE_ABILITY);
            Out2.WriteUInt16(0);
            Out2.WriteUInt16(Info.Entry);
            Out2.WriteUInt16(Caster.Oid);
            Out2.WriteHexStringBytes("0610227302010000000001000000");
            player.DispatchPacket(Out2, true);

            PacketOut Out3 = new PacketOut((byte)Opcodes.F_SWITCH_ATTACK_MODE);
            Out3.WriteByte(1);
            Out3.Fill(0, 3);
            player.SendPacket(Out3);

            PacketOut Out4 = new PacketOut((byte)Opcodes.F_SET_ABILITY_TIMER);
            Out4.WriteUInt16(Info.Entry);
            Out4.Fill(0, 10);
            player.SendPacket(Out4);
        }
コード例 #3
0
ファイル: GameObject.cs プロジェクト: Necrosummon/WarEmu
        public override void SendMeTo(Player Plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_STATIC);
            Out.WriteUInt16(Oid);
            Out.WriteUInt16(0);

            Out.WriteUInt16((UInt16)Spawn.WorldO);
            Out.WriteUInt16((UInt16)Spawn.WorldZ);
            Out.WriteUInt32((UInt32)Spawn.WorldX);
            Out.WriteUInt32((UInt32)Spawn.WorldY);
            Out.WriteUInt16((ushort)Spawn.DisplayID);

            Out.WriteUInt16(Spawn.Proto.GetUnk(0));
            Out.WriteUInt16(Spawn.Proto.GetUnk(1));
            Out.WriteUInt16(Spawn.Proto.GetUnk(2));
            Out.WriteByte(0);
            Out.WriteUInt16(Spawn.Proto.GetUnk(3));
            Out.Fill(0, 5);
            Out.WriteUInt16(Spawn.Proto.GetUnk(4));
            Out.WriteUInt16(Spawn.Proto.GetUnk(5));

            Out.WriteUInt32(0);

            Out.WritePascalString(Name);
            Out.WriteByte(0);

            Plr.SendPacket(Out);

            base.SendMeTo(Plr);
        }
コード例 #4
0
ファイル: QuestsInterface.cs プロジェクト: Necrosummon/WarEmu
 public static void BuildQuestComplete(PacketOut Out, Quest Q, bool Particular)
 {
     Out.WritePascalString(Q.Name);
     Out.WriteUInt16((UInt16)Q.OnCompletionQuest.Length);
     Out.WriteStringBytes(Q.OnCompletionQuest);
     if (Particular)
     {
         Out.WriteUInt16((UInt16)Q.Particular.Length);
         Out.WriteStringBytes(Q.Particular);
     }
     Out.WriteByte(1);
     Out.WriteUInt32(Q.Gold);
     Out.WriteUInt32(Q.Xp);
 }
コード例 #5
0
ファイル: PQuestObject.cs プロジェクト: dzikun/WarEmu
 public void SendReinitTime(Player Plr, ushort Time)
 {
     PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_INFO);
     Out.WriteUInt32(Info.Entry);
     Out.WriteByte(1);
     Out.WriteByte(2);
     Out.WriteByte(1);
     Out.WriteUInt16(0);
     Out.WritePascalString(Info.Name);
     Out.WriteUInt16(0);
     Out.WriteUInt16(Time); // Time in seconds
     Out.WriteUInt16(0);
     Out.WriteUInt16(0);
     Plr.SendPacket(Out);
 }
コード例 #6
0
ファイル: TchatHandlers.cs プロジェクト: Necrosummon/WarEmu
        public static void F_EMOTE(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            if (cclient.Plr == null)
                return;

            UInt32 emote = packet.GetUint32();

            PacketOut Out = new PacketOut((byte)Opcodes.F_EMOTE);
            Out.WriteUInt16(cclient.Plr.Oid);
            Out.WriteUInt16((UInt16)emote);
            if (cclient.Plr.CbtInterface.HasTarget())
                Out.WriteUInt16(cclient.Plr.CbtInterface.CurrentTarget.Target.Oid);
            cclient.Plr.DispatchPacket(Out, false);
            cclient.Plr.SendPacket(Out);
        }
コード例 #7
0
ファイル: TchatHandlers.cs プロジェクト: dzikun/WarEmu
        static public void F_EMOTE(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            if (cclient.Plr == null)
                return;

            UInt32 emote = packet.GetUint32();

            PacketOut Out = new PacketOut((byte)Opcodes.F_EMOTE);
            Out.WriteUInt16(cclient.Plr.Oid);
            Out.WriteUInt16((UInt16)emote);
            if (cclient.Plr.CbtInterface.HasTarget(GameData.TargetTypes.TARGETTYPES_TARGET_ALLY))
                Out.WriteUInt16(cclient.Plr.CbtInterface.Targets[(int)GameData.TargetTypes.TARGETTYPES_TARGET_ALLY]);
            cclient.Plr.DispatchPacket(Out, false);
            cclient.Plr.SendPacket(Out);
        }
コード例 #8
0
ファイル: StatsInterface.cs プロジェクト: Necrosummon/WarEmu
 public void BuildStats(ref PacketOut Out)
 {
     Out.WriteByte(0);
     for (byte i = 0; i < _BaseStats.Length; ++i)
     {
         Out.WriteByte(i);
         Out.WriteUInt16(_BaseStats[i]);
     }
 }
コード例 #9
0
ファイル: TokInterface.cs プロジェクト: nalgol/WarEmu
 public void SendTok(ushort Entry, bool Print)
 {
     PacketOut Out = new PacketOut((byte)Opcodes.F_TOK_ENTRY_UPDATE);
     Out.WriteUInt32(1);
     Out.WriteUInt16((UInt16)Entry);
     Out.WriteByte(1);
     Out.WriteByte((byte)(Print ? 1 : 0));
     Out.WriteByte(1);
     GetPlayer().SendPacket(Out);
 }
コード例 #10
0
ファイル: SocialInterface.cs プロジェクト: Necrosummon/WarEmu
        public static void BuildPlayerInfo(ref PacketOut Out,uint CharId, string Name, bool Online, byte Level, UInt16 Career, UInt16 Zone)
        {
            Out.WriteUInt32(CharId);
            Out.WriteByte(0);
            Out.WritePascalString(Name);
            Out.WriteByte(0);

            Out.WriteByte((byte)(Online ? 1 : 0));
            Out.WriteByte((byte)(Online ? 1 : 0));

            if (!Online)
                return;

            Out.WriteByte(Level);
            Out.WriteUInt16(0);
            Out.WriteUInt16(Career);
            Out.WriteUInt16(Zone);
            Out.WriteUInt16(1); // Guild Size
            Out.WriteByte(0);
        }
コード例 #11
0
ファイル: QuestsInterface.cs プロジェクト: Necrosummon/WarEmu
        // Change "Character_Objectives" for "Character_InProgressObjectives" for show Quest Objectives in F_QUEST_LIST
        public static void BuildObjectives(PacketOut Out, List<Character_InProgressObjectives> Objs)
        {
            Out.WriteByte((byte)Objs.Count);

            foreach (Character_InProgressObjectives Objective in Objs)
            {
                Out.WriteByte((byte)Objective.Count);
                Out.WriteByte((byte)Objective.Objective.ObjCount);
                Out.WriteUInt16(0);
                Out.WritePascalString(Objective.Objective.Description);
            }
        }
コード例 #12
0
        static public void F_CONNECT(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            packet.Skip(8);
            UInt32 Tag = packet.GetUint32();
            string Token = packet.GetString(80);
            packet.Skip(21);
            string Username = packet.GetString(23);

            // TODO
            AuthResult Result = Program.AcctMgr.CheckToken(Username, Token);
            if (Result != AuthResult.AUTH_SUCCESS)
            {
                Log.Error("F_CONNECT", "Invalid Token =" + Username);
                cclient.Disconnect();
            }
            else
            {
                cclient._Account = Program.AcctMgr.GetAccount(Username);
                if (cclient._Account == null)
                {
                    Log.Error("F_CONNECT", "Invalid Account =" + Username);
                    cclient.Disconnect();
                }
                else
                {
                    //Log.Success("F_CONNECT", "MeId=" + cclient.Id);

                    GameClient Other = (cclient.Server as TCPServer).GetClientByAccount(cclient, cclient._Account.AccountId);
                    if (Other != null)
                        Other.Disconnect();

                    {
                        PacketOut Out = new PacketOut((byte)Opcodes.S_CONNECTED);
                        Out.WriteUInt32(0);
                        Out.WriteUInt32(Tag);
                        Out.WriteByte(Program.Rm.RealmId);
                        Out.WriteUInt32(1);
                        Out.WritePascalString(Username);
                        Out.WritePascalString(Program.Rm.Name);
                        Out.WriteByte(0);
                        Out.WriteUInt16(0);
                        cclient.SendPacket(Out);
                    }
                }
            }
        }
コード例 #13
0
ファイル: Mount.cs プロジェクト: dzikun/WarEmu
        public void SendMount(Player Plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_MOUNT_UPDATE);
            Out.WriteUInt16(Owner.Oid);

            if (CurrentMountInfo == null)
                Out.WriteUInt32(0);
            else
                Out.WriteUInt32(CurrentMountInfo.Entry);

            Out.Fill(0, 14);

            if (Plr == null)
                Owner.DispatchPacket(Out, true);
            else
                Plr.SendPacket(Out);
        }
コード例 #14
0
ファイル: GameObject.cs プロジェクト: dzikun/WarEmu
        /*
         * |00 3D 71 
06 90 
00 00 
00 00 
1F E3 
00 0C E3 29 
00 0E 59 90 
FF FF 
1E 00 00 00 35 F3 00 03 04 00 00
|00 00 64 8B 76 09 CD 00 00 00 00 0F 45 6D 70 69 |..d.v.......Empi|
|72 65 20 42 61 72 20 44 6F 6F 72 04 06 AB DD 00 |re Bar Door.....|                                                
-------------------------------------------------------------------
         * */

        public override void SendMeTo(Player Plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_STATIC);
            Out.WriteUInt16(Oid);
            Out.WriteUInt16(0);

            Out.WriteUInt16((UInt16)Spawn.WorldO);
            Out.WriteUInt16((UInt16)Spawn.WorldZ);
            Out.WriteUInt32((UInt32)Spawn.WorldX);
            Out.WriteUInt32((UInt32)Spawn.WorldY);
            Out.WriteUInt16((ushort)Spawn.DisplayID);

            Out.WriteUInt16(Spawn.GetUnk(0));
            Out.WriteUInt16(Spawn.GetUnk(1));
            Out.WriteUInt16(Spawn.GetUnk(2));
            Out.WriteByte(Spawn.Unk1);

            int flags = Spawn.GetUnk(3);
            Loot Loots = LootsMgr.GenerateLoot(this, Plr);
            if (Loots != null && Loots.IsLootable())
            {
                flags = flags | 4;
            }

            Out.WriteUInt16((ushort)flags);
            Out.WriteByte(Spawn.Unk2);
            Out.WriteUInt32(Spawn.Unk3);
            Out.WriteUInt16(Spawn.GetUnk(4));
            Out.WriteUInt16(Spawn.GetUnk(5));
            Out.WriteUInt32(Spawn.Unk4);

            Out.WritePascalString(Name);
            Out.WriteByte(0);

            Plr.SendPacket(Out);

            base.SendMeTo(Plr);
        }
コード例 #15
0
ファイル: Item.cs プロジェクト: dzikun/WarEmu
        static public void BuildItem(ref PacketOut Out,Item Itm,Item_Info Info,ushort SlotId,ushort Count)
        {
            SlotId = SlotId == 0 ? (Itm == null ? SlotId : Itm.SlotId ) : SlotId;
            Count = Count == 0 ? (Itm == null ? Count : Itm.Count) : Count;
            Info = Info == null ? (Itm == null ? null : Itm.Info) : Info;
            

            if(SlotId != 0)
                Out.WriteUInt16(SlotId);

            Out.WriteByte(0);
            Out.WriteUInt32((uint)(Info != null ? Info.Entry : 0));

            if (Info == null)
                return;

            Out.WriteUInt16((ushort)Info.ModelId);  // Valid 1.4.8
            Out.Fill(0, 7);  // Valid 1.4.8
            Out.WriteUInt16(Info.SlotId);  // Valid 1.4.8
            Out.WriteByte(Info.Type);  // Valid 1.4.8

            Out.WriteByte(Info.MinRank); // Min Level
            Out.WriteByte(Info.ObjectLevel); // 1.3.5, Object Level
            Out.WriteByte(Info.MinRenown); // 1.3.5, Min Renown
            Out.WriteByte(Info.MinRenown); // ?
            Out.WriteByte(Info.UniqueEquiped); // Unique - Equiped

            Out.WriteByte(Info.Rarity);
            Out.WriteByte(Info.Bind);
            Out.WriteByte(Info.Race);

            // Trophys have some extra bytes
            if (Info.Type == (byte)GameData.ItemTypes.ITEMTYPES_TROPHY)
            {
                Out.WriteUInt32(0);
                Out.WriteUInt16(0x0080);
            }

            Out.WriteUInt32(Info.Career);
            Out.WriteUInt32(0);
            Out.WriteUInt32(Info.SellPrice);

            Out.WriteUInt16((UInt16)(Count > 0 ? Count : 1));
            Out.WriteUInt16((UInt16)(Count > 0 ? Count : 1));

            Out.WriteUInt32(0);

            Out.WriteUInt32(Info.Skills);  // Valid 1.4.8
            Out.WriteUInt16(Info.Dps > 0 ? Info.Dps : Info.Armor);  // Valid 1.4.8
            Out.WriteUInt16(Info.Speed);  // Valid 1.4.8
            Out.WritePascalString(Info.Name);  // Valid 1.4.8

            Out.WriteByte((byte)Info._Stats.Count);  // Valid 1.4.8
            foreach (KeyValuePair<byte, UInt16> Key in Info._Stats)
            {
                Out.WriteByte(Key.Key);
                Out.WriteUInt16(Key.Value);
                Out.Fill(0, 5);
            }

            Out.WriteByte(0); // Equip Effects

            Out.WriteByte((byte)Info._Spells.Count); // OK
            foreach (KeyValuePair<UInt32, UInt32> Kp in Info._Spells)
            {
                Out.WriteUInt32(Kp.Key);
                Out.WriteUInt32(Kp.Value);
            }
            // (uint32)Entry, uint16 X, uint16 Y

            Out.WriteByte((byte)Info._Crafts.Count); // OK
            foreach (KeyValuePair<byte, ushort> Kp in Info._Crafts)
            {
                Out.WriteByte(Kp.Key);
                Out.WriteUInt16(Kp.Value);
            }

            Out.WriteByte(0); // ??

            Out.WriteByte(Info.TalismanSlots);
            Item_Info TalismanInfo = null;
            for (int i = 0; i < Info.TalismanSlots; ++i)
            {
                if (Itm != null)
                    TalismanInfo = Itm.GetTalisman((byte)i);
 
                if (TalismanInfo == null)
                    Out.WriteUInt32(0); // Entry;
                else
                {
                    Out.WriteUInt32(TalismanInfo.Entry);
                    Out.WritePascalString(TalismanInfo.Name);
                    Out.Fill(0, 15);
                }
            }

            Out.WritePascalString(Info.Description);

            Out.Write(Info.Unk27);

            /*Out.WriteByte(0);
            Out.WriteByte(0);
            Out.WriteByte(0);
            Out.WriteByte(0);

            Out.WriteUInt16(0x0302);

            Out.Fill(0, 8);
            Out.WriteByte(0); // Type , Culture, etc etc
            Out.WriteByte(0); // Type, Recipian , Soil , etc etc
            Out.Fill(0, 11);*/
        }
コード例 #16
0
ファイル: ItemsInterface.cs プロジェクト: dzikun/WarEmu
        public void SendEquiped(Player Plr, List<UInt16> Itms)
        {
            int Invalide = Itms.Count(slot => !IsEquipedSlot(slot));
            if (Invalide >= Itms.Count)
                return;

            PacketOut Out = new PacketOut((byte)Opcodes.F_PLAYER_INVENTORY);
            Out.WriteUInt16(_Owner.Oid);
            Out.WriteUInt16((UInt16)(Itms.Count - Invalide)); // Count
            foreach (UInt16 Slot in Itms)
            {
                if (!IsEquipedSlot(Slot))
                    continue;

                Out.WriteUInt16(Slot);
                Out.WriteUInt16((UInt16)(Items[Slot] != null ? Items[Slot].ModelId : 0));
            }
            Out.WriteByte(0);

            if (Plr != null)
                Plr.SendPacket(Out);
            else
                _Owner.DispatchPacket(Out, false);
        }
コード例 #17
0
ファイル: ItemsInterface.cs プロジェクト: dzikun/WarEmu
        public void SendInspect(Player Plr)
        {
            byte Count = 0;
            for (UInt16 i = 0; i < MAX_EQUIPED_SLOT; ++i)
                if (Items[i] != null)
                    ++Count;

            PacketOut Out = new PacketOut((byte)Opcodes.F_SOCIAL_NETWORK);
            Out.WriteUInt16(_Owner.Oid);
            Out.WriteByte(7); // Inspect Code
            Out.WriteByte(Count);

            for (UInt16 i = 0; i < MAX_EQUIPED_SLOT; ++i)
                if (Items[i] != null)
                    Item.BuildItem(ref Out, Items[i], null, 0, 0);
            Out.WriteByte(0);
            Plr.SendPacket(Out);
        }
コード例 #18
0
ファイル: ItemsInterface.cs プロジェクト: dzikun/WarEmu
        public void SendEquiped(Player Plr, UInt16 Slot)
        {
            if (!IsEquipedSlot(Slot))
                return;

            PacketOut Out = new PacketOut((byte)Opcodes.F_PLAYER_INVENTORY);
            Out.WriteUInt16(_Owner.Oid);
            Out.WriteUInt16(1); // Count
            Out.WriteUInt16(Slot);
            Out.WriteUInt16((UInt16)(Items[Slot] != null ? Items[Slot].ModelId : 0));
            Out.WriteByte(0);

            if (Plr != null)
                Plr.SendPacket(Out);
            else
                _Owner.DispatchPacket(Out, false);
        }
コード例 #19
0
ファイル: ItemsInterface.cs プロジェクト: dzikun/WarEmu
        public void SendEquiped(Player Plr, UInt16 To, UInt16 From)
        {
            int Invalide = !IsEquipedSlot(To) ? 1 : 0;
            Invalide += !IsEquipedSlot(From) ? 1 : 0;

            if (Invalide == 2)
                return;

            PacketOut Out = new PacketOut((byte)Opcodes.F_PLAYER_INVENTORY);
            Out.WriteUInt16(_Owner.Oid);
            Out.WriteUInt16((UInt16)(2 - Invalide)); // Count

            if (IsEquipedSlot(To))
            {
                Out.WriteUInt16(To);
                Out.WriteUInt16((UInt16)(Items[To] != null ? Items[To].ModelId : 0));

            }
            if (!IsEquipedSlot(From))
            {
                Out.WriteUInt16(From);
                Out.WriteUInt16((UInt16)(Items[To] != null ? Items[To].ModelId : 0));
            }

            Out.WriteByte(0);

            if (Plr != null)
                Plr.SendPacket(Out);
            else
                _Owner.DispatchPacket(Out, false);
        }
コード例 #20
0
ファイル: Ability.cs プロジェクト: Necrosummon/WarEmu
        public void SendStartCasting(ushort TargetOID)
        {
            PacketOut Out1 = new PacketOut((byte)Opcodes.F_UPDATE_STATE);
            Out1.WriteUInt16(TargetOID);
            Out1.WriteByte(0x1A);
            Out1.Fill(0, 7);
            Caster.DispatchPacket(Out1, true);

            if (Info.CastTime == 0)
                return;

            PacketOut Out2 = new PacketOut((byte)Opcodes.F_USE_ABILITY);
            Out2.WriteUInt16(0);
            Out2.WriteUInt16(Info.Entry);
            Out2.WriteUInt16(Caster.Oid);
            Out2.WriteByte(0x06);
            Out2.WriteByte(0x10);
            Out2.WriteUInt16(0x2273);
            Out2.WriteUInt32(0x1010000);
            Out2.WriteUInt16((ushort)this.Info.CastTime);
            Out2.WriteByte(1);
            Out2.Fill(0, 3);
            Caster.GetPlayer().DispatchPacket(Out2, true);
        }
コード例 #21
0
ファイル: Ability.cs プロジェクト: Necrosummon/WarEmu
 public void SendSpellDamage(ushort TargetOID, UInt32 Damage)
 {
     PacketOut Out = new PacketOut((byte)Opcodes.F_CAST_PLAYER_EFFECT);
     Out.WriteUInt16(Caster.Oid);
     Out.WriteUInt16(TargetOID);
     Out.WriteUInt16(Info.Entry);
     Out.WriteByte(2);
     Out.WriteUInt16(7);
     Out.WriteByte((byte)((Damage * 2) - 1));
     Out.WriteByte(1);
     Out.WriteUInt16(0x3E18);
     Caster.DispatchPacket(Out, true);
 }
コード例 #22
0
ファイル: Creature.cs プロジェクト: dzikun/WarEmu
        public override void SendMeTo(Player Plr)
        {
            //Log.Success("Creature", "SendMe " + Name);

            PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_MONSTER);
            Out.WriteUInt16(Oid);
            Out.WriteUInt16(0);

            Out.WriteUInt16((UInt16)Heading);
            Out.WriteUInt16((UInt16)WorldPosition.Z);
            Out.WriteUInt32((UInt32)WorldPosition.X);
            Out.WriteUInt32((UInt32)WorldPosition.Y);
            Out.WriteUInt16(0); // Speed Z
            // 18
            Out.WriteUInt16(Spawn.Proto.Model1);
            Out.WriteByte((byte)Spawn.Proto.MinScale);
            Out.WriteByte(Level);
            Out.WriteByte(Faction);

            Out.Fill(0, 4);
            Out.WriteByte(Spawn.Emote);
            Out.WriteByte(0); // ?
            Out.WriteUInt16(Spawn.Proto._Unks[1]);
            Out.WriteByte(0);
            Out.WriteUInt16(Spawn.Proto._Unks[2]);
            Out.WriteUInt16(Spawn.Proto._Unks[3]);
            Out.WriteUInt16(Spawn.Proto._Unks[4]);
            Out.WriteUInt16(Spawn.Proto._Unks[5]);
            Out.WriteUInt16(Spawn.Proto._Unks[6]);
            Out.WriteUInt16(Spawn.Title);

            long TempPos = Out.Position;
            byte TempLen = (byte)(Spawn.bBytes.Length + States.Count);
            Out.WriteByte(TempLen);
            Out.Write(Spawn.bBytes, 0, Spawn.bBytes.Length);
            Out.Write(States.ToArray(), 0, States.Count);
            if (QtsInterface.CreatureHasStartQuest(Plr))
            {
                Out.WriteByte(5);
                Out.Position = TempPos;
                Out.WriteByte((byte)(TempLen + 1));
            }
            else if (QtsInterface.CreatureHasQuestToAchieve(Plr))
            {
                Out.WriteByte(4);
                Out.Position = TempPos;
                Out.WriteByte((byte)(TempLen + 1));
            }
            else if (QtsInterface.CreatureHasQuestToComplete(Plr))
            {
                Out.WriteByte(7);
                Out.Position = TempPos;
                Out.WriteByte((byte)(TempLen + 1));
            }

            Out.Position = Out.Length;

            Out.WriteByte(0);

            Out.WriteStringBytes(Name);

            Out.Fill(0, 48);
            Plr.SendPacket(Out);

            base.SendMeTo(Plr);
        }
コード例 #23
0
ファイル: CharacterHandlers.cs プロジェクト: dzikun/WarEmu
        static public void F_DUMP_ARENAS_LARGE(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            if (!cclient.HasAccount())
            {
                cclient.Disconnect();
                return;
            }

            if (Program.Rm.OnlinePlayers >= Program.Rm.MaxPlayers)
            {
                PacketOut Out = new PacketOut((byte)Opcodes.F_LOGINQUEUE);
                client.SendPacket(Out);
                return;
            }

            byte CharacterSlot = packet.GetUint8();
            Character Char = CharMgr.GetAccountChar(cclient._Account.AccountId).GetCharacterBySlot(CharacterSlot);

            if (Char == null)
            {
                Log.Error("F_DUMP_ARENAS_LARGE", "Can not find character on slot : " + CharacterSlot);
                cclient.Disconnect();
                return;
            }

            {
                if (cclient.Plr == null)
                    cclient.Plr = Player.CreatePlayer(cclient, Char);

                PacketOut Out = new PacketOut((byte)Opcodes.F_WORLD_ENTER);
                Out.WriteUInt16(0x0608); // TODO
                Out.Fill(0, 20);
                Out.WriteString("38699", 5);
                Out.WriteString("38700", 5);
                Out.WriteString("0.0.0.0", 20);
                cclient.SendPacket(Out);
            }
        }
コード例 #24
0
ファイル: CharMgr.cs プロジェクト: oldSerge/WarEmu
        public static byte[] BuildCharacters(int AccountId)
        {
            Log.Debug("BuildCharacters", "AcocuntId = " + AccountId);

            Character[] Chars = GetAccountChar(AccountId)._Chars;
            UInt16 Count = 0;

            // On Compte le nombre de personnages existant du joueur
            for (UInt16 c = 0; c < Chars.Length; ++c)
                if (Chars[c] != null) ++Count;

            PacketOut Out = new PacketOut(0);
            Out.Position = 0;

            Out.WriteByte(MAX_SLOT);
            Out.WriteUInt32(0xFF);
            Out.WriteByte(0x14);

            Character Char = null;
            for (int i = 0; i < MAX_SLOT; ++i)
            {
                Char = Chars[i];

                if (Char == null)
                    Out.Fill(0, 284); // 284
                else
                {
                    List<Character_item> Items = CharMgr.GetItemChar(Char.CharacterId);

                    Out.FillString(Char.Name, 48);
                    Out.WriteByte(Char.Value.Level);
                    Out.WriteByte(Char.Career);
                    Out.WriteByte(Char.Realm);
                    Out.WriteByte(Char.Sex);
                    Out.WriteByte(Char.ModelId);
                    Out.WriteUInt16(Char.Value.ZoneId);
                    Out.Fill(0, 5);

                    Character_item Item = null;
                    for (UInt16 SlotId = 14; SlotId < 30; ++SlotId)
                    {
                        Item = Items.Find(item => item != null && item.SlotId == SlotId);
                        if (Item == null)
                            Out.WriteUInt32(0);
                        else
                            Out.WriteUInt32R(Item.ModelId);

                        Out.Fill(0, 4);
                    }

                    Out.Fill(0, 6);

                    for (int j = 0; j < 5; ++j)
                    {
                        Out.Fill(0, 6);
                        Out.WriteUInt16(0xFF00);
                    }

                    for (UInt16 SlotId = 10; SlotId < 13; ++SlotId)
                    {
                        Item = Items.Find(item => item != null && item.SlotId == SlotId);
                        Out.WriteUInt16(0);
                        if (Item == null)
                            Out.WriteUInt16(0);
                        else
                            Out.WriteUInt16R((ushort)Item.ModelId);
                    }

                    Out.Fill(0, 10);
                    Out.WriteUInt16(0xFF00);
                    Out.WriteByte(0);
                    Out.WriteByte(Char.Race);
                    Out.WriteUInt16(0);
                    Out.Write(Char.bTraits, 0, Char.bTraits.Length);
                    Out.Fill(0, 14);// 272
                }
            }
            return Out.ToArray();
        }
コード例 #25
0
ファイル: Creature.cs プロジェクト: dzikun/WarEmu
        public override void SendInteract(Player Plr, InteractMenu Menu)
        {
            Plr.QtsInterface.HandleEvent(Objective_Type.QUEST_SPEACK_TO, Spawn.Entry, 1);

            if (!IsDead)
            {
                switch (InteractType)
                {
                    case GameData.InteractType.INTERACTTYPE_DYEMERCHANT:
                        {
                            string Text = WorldMgr.GetCreatureText(Spawn.Entry);

                            if (Menu.Menu == 9) // List des objets a vendre
                                WorldMgr.SendVendor(Plr, Spawn.Entry);
                            else if (Menu.Menu == 11) // Achat d'un item
                                WorldMgr.BuyItemVendor(Plr, Menu, Spawn.Entry);
                            else if (Menu.Menu == 14) // Vend un Item
                                Plr.ItmInterface.SellItem(Menu);
                            else if (Menu.Menu == 36) // Rachette un item
                                Plr.ItmInterface.BuyBackItem(Menu);
                            else
                            {
                                PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                                Out.WriteByte(0);
                                Out.WriteUInt16(Oid);
                                Out.WriteUInt16(0);
                                Out.WriteByte(0x40); // Dye
                                Out.WriteByte(0x22); // Vendors
                                Out.WriteByte(0);
                                Out.WritePascalString(Text);
                                Out.WriteByte(0);
                                Plr.SendPacket(Out);
                            }
                        } break;

                    case GameData.InteractType.INTERACTTYPE_FLIGHT_MASTER:
                        {
                            byte[] data = new byte[62]
		                    {
			                    0x01,0xF4,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x42,0x39,0x00,0x00,0x00,0xC0,0xE3,
			                    0x03,0x39,0xA0,0xD1,0x6F,0x00,0xC8,0xA8,0x1D,0x37,0x28,0x94,0x79,0x33,0xB2,0x24,
			                    0x32,0x44,0xDB,0xD7,0x1C,0x5D,0x18,0x5D,0xDD,0x1C,0xA4,0x0D,0x00,0x00,0xA8,0x6B,
			                    0x21,0x36,0x11,0x00,0x00,0x00,0xC8,0xD0,0xAF,0x3A,0x78,0xD1,0x6F,0x00
		                    };

                            UInt16 Counts = 1;

                            PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                            Out.WriteUInt16(0x0A12);
                            foreach (Zone_Taxi Taxi in WorldMgr.GetTaxis(Plr))
                            {
                                Out.WriteUInt16(Counts);
                                Out.WriteByte(2);
                                Out.WriteUInt16(Taxi.Info.Price);
                                Out.WriteUInt16(Taxi.Info.ZoneId);
                                Out.WriteByte(1);
                                ++Counts;
                            }
                            Out.Write(data);
                            Plr.SendPacket(Out);
                        }break;

                    case GameData.InteractType.INTERACTTYPE_TRAINER:
                        {
                            if (Menu.Menu == 7)
                            {
                                PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                                Out.WriteByte(5);
                                Out.WriteByte(0x0F);
                                Out.WriteByte(6);
                                Out.WriteUInt16(0);
                                Plr.SendPacket(Out);
                            }
                            else
                            {
                                PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                                Out.WriteByte(0);
                                Out.WriteUInt16(Oid);

                                if (Plr.Realm == GameData.Realms.REALMS_REALM_ORDER)
                                {
                                    Out.WritePacketString(@"|00 00 00 21 00 94 48 61 69 6C |.........!..Hail|
|20 64 65 66 65 6E 64 65 72 20 6F 66 20 74 68 65 | defender of the|
|20 45 6D 70 69 72 65 21 20 20 59 6F 75 72 20 70 | Empire!  Your p|
|65 72 66 6F 72 6D 61 6E 63 65 20 69 6E 20 62 61 |erformance in ba|
|74 74 6C 65 20 69 73 20 74 68 65 20 6F 6E 6C 79 |ttle is the only|
|20 74 68 69 6E 67 20 74 68 61 74 20 6B 65 65 70 | thing that keep|
|73 20 74 68 65 20 68 6F 72 64 65 73 20 6F 66 20 |s the hordes of |
|43 68 61 6F 73 20 61 74 20 62 61 79 2E 20 4C 65 |Chaos at bay. Le|
|74 27 73 20 62 65 67 69 6E 20 79 6F 75 72 20 74 |t's begin your t|
|72 61 69 6E 69 6E 67 20 61 74 20 6F 6E 63 65 21 |raining at once!|
|00                                              |.               |");
                                }
                                else
                                {
                                    Out.WritePacketString(@"|00 00 00 21 00 AA 4C 65 61 72 |.........!..Lear|
|6E 20 74 68 65 73 65 20 6C 65 73 73 6F 6E 73 20 |n these lessons |
|77 65 6C 6C 2C 20 66 6F 72 20 67 61 69 6E 69 6E |well, for gainin|
|67 20 74 68 65 20 66 61 76 6F 72 20 6F 66 20 74 |g the favor of t|
|68 65 20 52 61 76 65 6E 20 67 6F 64 20 73 68 6F |he Raven god sho|
|75 6C 64 20 62 65 20 6F 66 20 75 74 6D 6F 73 74 |uld be of utmost|
|20 69 6D 70 6F 72 74 61 6E 63 65 20 74 6F 20 79 | importance to y|
|6F 75 2E 20 4F 74 68 65 72 77 69 73 65 2E 2E 2E |ou. Otherwise...|
|20 54 68 65 72 65 20 69 73 20 61 6C 77 61 79 73 | There is always|
|20 72 6F 6F 6D 20 66 6F 72 20 6D 6F 72 65 20 53 | room for more S|
|70 61 77 6E 20 77 69 74 68 69 6E 20 6F 75 72 20 |pawn within our |
|72 61 6E 6B 73 2E 00                            |.......         |");
                                }
                                Plr.SendPacket(Out);
                            }
                        } break;
                    case GameData.InteractType.INTERACTTYPE_BANKER:
                        {
                            PacketOut Out = new PacketOut((byte)Opcodes.F_INTERACT_RESPONSE);
                            Out.WriteByte(0x1D);
                            Out.WriteByte(0);
                            Plr.SendPacket(Out);
                        } break;
                    default:
                        QtsInterface.HandleInteract(Plr, this, Menu);
                        break;
                };
            }

            base.SendInteract(Plr, Menu);
        }
コード例 #26
0
ファイル: ItemsInterface.cs プロジェクト: dzikun/WarEmu
        public void SendTradeClose(UInt16 Oid)
        {   
            PacketOut Out = new PacketOut((byte)Opcodes.F_TRADE_STATUS);
            Out.WriteByte(3);
            Out.WriteByte(0);
            Out.WriteUInt16(Oid);
            Out.Fill(0, 24);
            _Owner.GetPlayer().SendPacket(Out);

            CloseTrade();
        }
コード例 #27
0
ファイル: WorldMgr.cs プロジェクト: Necrosummon/WarEmu
        public static void SendVendorPage(Player Plr, ref List<Creature_vendor> Vendors, byte Count,byte Page)
        {
            Count = (byte)Math.Min(Count, Vendors.Count);

            Log.Success("SendVendorPage", "Count=" + Count + ",Page=" + Page + ",ItmC=" + Vendors.Count);

            PacketOut Out = new PacketOut((byte)Opcodes.F_INIT_STORE);
            Out.WriteByte(3);
            Out.WriteByte(0);
            Out.WriteByte(Page);
            Out.WriteByte(Count);
            Out.WriteByte((byte)(Page > 0 ? 0 : 1));
            Out.WriteByte(1);
            Out.WriteUInt16(0);

            for (byte i = 0; i < Count; ++i)
            {
                Out.WriteByte(i);
                Out.WriteByte(3); // sometimes 1
                Out.WriteUInt32(Vendors[i].Price);
                Item.BuildItem(ref Out, null, Vendors[i].Info, 0, 1);

                Out.WriteByte((byte)Vendors[i].ItemsReqInfo.Count); // ReqItemSize
                foreach (KeyValuePair<UInt16, Item_Info> Kp in Vendors[i].ItemsReqInfo)
                {
                    Out.WriteUInt32(Kp.Value.Entry);
                    Out.WriteUInt16((UInt16)Kp.Value.ModelId);
                    Out.WritePascalString(Kp.Value.Name);
                    Out.WriteUInt16(Kp.Key);
                    Out.Fill(0, 18);
                }
            }

            Out.WriteByte(0);
            Plr.SendPacket(Out);

            Vendors.RemoveRange(0, Count);
        }
コード例 #28
0
ファイル: ItemsInterface.cs プロジェクト: dzikun/WarEmu
        public void SendMaxInventory(Player Plr) // 1.3.5
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_BAG_INFO);
            Out.WriteByte(0x0F);
            Out.WriteByte(GetTotalSlot()); // Nombre de slots disponibles
            Out.WriteUInt16((UInt16)INVENTORY_SLOT_COUNT);
            Out.WriteByte(0);
            Out.WriteUInt32R(GetBagPrice());

            Out.WriteUInt16(2);
            Out.WriteByte(0x50);
            Out.WriteUInt16(0x08);
            Out.WriteUInt16(0x60);
            Out.WriteByte(0xEA);
            Out.WriteUInt16(0);
            Plr.SendPacket(Out);
        }
コード例 #29
0
ファイル: CharacterHandlers.cs プロジェクト: dzikun/WarEmu
        static public void F_RANDOM_NAME_LIST_INFO(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;
            RandomNameInfo Info = BaseClient.ByteToType<RandomNameInfo>(packet);

            List<Random_name> Names = CharMgr.GetRandomNames();

            PacketOut Out = new PacketOut((byte)Opcodes.F_RANDOM_NAME_LIST_INFO);
            Out.WriteByte(0);
            Out.WriteByte(Info.Unk);
            Out.WriteByte(Info.Slot);
            Out.WriteUInt16(0);
            Out.WriteByte((byte)Names.Count);

            for (int i = Names.Count - 1; i >= 0; --i)
                Out.FillString(Names[i].Name, Names[i].Name.Length + 1);

            cclient.SendPacket(Out);
        }
コード例 #30
0
ファイル: ItemsInterface.cs プロジェクト: dzikun/WarEmu
        public void SendTradeInfo(ItemsInterface DistInterface)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_TRADE_STATUS);
            Out.WriteByte(DistInterface.TradingAccepted);
            Out.WriteByte(0);
            Out.WriteUInt16(DistInterface != this ? DistInterface._Owner.Oid : (ushort)0);

            if (DistInterface.TradingAccepted == 2)
                Out.Fill(0, 24);
            else
            {
                Out.WriteUInt32(DistInterface.TradingMoney);
                Out.WriteByte(TradingUpdate);
                Out.Fill(0, 2 * MAX_TRADE_SLOT);
            }

            _Owner.GetPlayer().SendPacket(Out);
        }