قديم 2019-11-11, 03:02 AM
المشاركة 2
zezonever
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: Redeem Equipment
هتفتح السورس بتاعك برجيكت هتبحث عن الملف ده Equipment.cs بعدين تمسح ال فيه كله وضيف دول


كود:
using System;
using System.Collections.Generic;
using BlackBlock.Network.GamePackets;
using BlackBlock.Interfaces;
using BlackBlock.Network;

namespace 
BlackBlock.Game.ConquerStructures
{
    public class 
Equipment
    
{
        public 
bool IsWearingItemID(uint ItemID)
        {
            foreach (var 
obj in Objects)
            {
                if (
obj == null) continue;
                if (
obj.ID == ItemID) return true;
            }
            return 
false;
        }
        public 
short GetTPL()
        {
            
short value 0;
            foreach (var 
item in objects)
                if (
item != null)
                    
value += (short)item.Stars;
            return 
value;
        }
        public 
bool IsWearingItemUID(uint ItemUID)
        {
            foreach (var 
obj in Objects)
            {
                if (
obj == null) continue;
                if (
obj.UID == ItemUID) return true;
            }
            return 
false;
        }
        public 
uint GetFullEquipmentPlusPoints
        
{
            
get
            
{
                
uint val 0;
                foreach (
Network.GamePackets.ConquerItem item in Objects)
                {
                    if (
item == null) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    if (!
Network.PacketHandler.IsTwoHand(item.ID))
                    {
                        if (
item.Plus == 1val += 200;
                        if (
item.Plus == 2val += 600;
                        if (
item.Plus == 3val += 1200;
                        if (
item.Plus == 4val += 1800;
                        if (
item.Plus == 5val += 2600;
                        if (
item.Plus == 6val += 3500;
                        if (
item.Plus == 7val += 4800;
                        if (
item.Plus == 8val += 5800;
                        if (
item.Plus == 9val += 6800;
                        if (
item.Plus == 10val += 7800;
                        if (
item.Plus == 11val += 8800;
                        if (
item.Plus == 12val += 10000;
                    }
                    else
                    {
                        if (
item.Plus == 1val += 400;
                        if (
item.Plus == 2val += 1200;
                        if (
item.Plus == 3val += 2400;
                        if (
item.Plus == 4val += 3600;
                        if (
item.Plus == 5val += 5200;
                        if (
item.Plus == 6val += 7000;
                        if (
item.Plus == 7val += 9600;
                        if (
item.Plus == 8val += 11600;
                        if (
item.Plus == 9val += 13600;
                        if (
item.Plus == 10val += 15600;
                        if (
item.Plus == 11val += 17600;
                        if (
item.Plus == 12val += 20000;
                    }
                }
                return 
val;
            }
        }
        public 
uint GetFullEquipmentEnumPoints
        
{
            
get
            
{
                
uint Points 0;
                foreach (
Network.GamePackets.ConquerItem item in Objects)
                {
                    if (
item == null) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    if (!
Network.PacketHandler.IsTwoHand(item.ID))
                    {
                        if (
item.ID 10 == 9Points += 500;
                        if (
item.ID 10 == 8Points += 300;
                        if (
item.ID 10 == 7Points += 200;
                        if (
item.ID 10 == 6Points += 100;
                        if (
item.ID 10 && item.ID 10 6Points += 50;
                    }
                    else
                    {
                        if (
item.ID 10 == 9Points += 1000;
                        if (
item.ID 10 == 8Points += 600;
                        if (
item.ID 10 == 7Points += 400;
                        if (
item.ID 10 == 6Points += 200;
                        if (
item.ID 10 && item.ID 10 6Points += 100;
                    }
                }
                return 
Points;
            }
        }
        public 
uint GetFullEquipmentSoulPoints
        
{
            
get
            
{
                
uint Points 0;
                foreach (
Network.GamePackets.ConquerItem item in Objects)
                {
                    if (
item == null || !item.Purification.Available) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    if (!
Network.PacketHandler.IsTwoHand(item.ID))
                    {
                        if (
item.Purification.PurificationLevel == 1Points += 100;
                        if (
item.Purification.PurificationLevel == 2Points += 300;
                        if (
item.Purification.PurificationLevel == 3Points += 500;
                        if (
item.Purification.PurificationLevel == 4Points += 800;
                        if (
item.Purification.PurificationLevel == 5Points += 1200;
                        if (
item.Purification.PurificationLevel == 6Points += 1600;
                        if (
item.Purification.PurificationLevel == 7Points += 2000;
                    }
                    else
                    {
                        if (
item.Purification.PurificationLevel == 1Points += 200;
                        if (
item.Purification.PurificationLevel == 2Points += 600;
                        if (
item.Purification.PurificationLevel == 3Points += 1000;
                        if (
item.Purification.PurificationLevel == 4Points += 1600;
                        if (
item.Purification.PurificationLevel == 5Points += 2400;
                        if (
item.Purification.PurificationLevel == 6Points += 3200;
                        if (
item.Purification.PurificationLevel == 7Points += 4000;
                    }
                }
                return 
Points;
            }
        }
        public 
uint GetFullEquipmentEnchantPoints
        
{
            
get
            
{
                
uint val 0;
                foreach (
Network.GamePackets.ConquerItem item in Objects)
                {
                    if (
item == null) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    if (!
Network.PacketHandler.IsTwoHand(item.ID))
                    {
                        var 
enc = (uint)(item.Enchant);
                        if (
enc != 0)
                        {
                            if (
enc <= 200val += enc 1;
                            if (
enc <= 240val += (uint)(enc 1.3);
                            if (
enc <= 254val += (uint)(enc 1.6);
                            if (
enc <= 255val += enc 2;
                        }
                    }
                    else
                    {
                        var 
enc = (uint)(item.Enchant);
                        if (
enc != 0)
                        {
                            if (
enc <= 200val += enc 2;
                            if (
enc <= 240val += (uint)(enc 2.6);
                            if (
enc <= 254val += (uint)(enc 3.2);
                            if (
enc <= 255val += enc 4;
                        }
                    }
                }
                return 
val;
            }
        }
        public 
uint GetFullEquipmentLevelPoints
        
{
            
get
            
{
                
uint val 0;
                foreach (
Network.GamePackets.ConquerItem item in Objects)
                {
                    if (
item == null || !Database.ConquerItemInformation.BaseInformations.ContainsKey(item.ID)) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    if (!
Network.PacketHandler.IsTwoHand(item.ID))
                    {
                        var 
lvl = (uint)Database.ConquerItemInformation.BaseInformations[item.ID].Level;
                        if (
lvl <= 120)
                            
val += lvl 3;
                        else if (
lvl <= 130)
                            
val += lvl 5;
                        else if (
lvl <= 140)
                            
val += lvl 6;
                    }
                    else
                    {
                        var 
lvl = (uint)Database.ConquerItemInformation.BaseInformations[item.ID].Level;
                        if (
lvl <= 120)
                            
val += lvl 6;
                        else if (
lvl <= 130)
                            
val += lvl 10;
                        else if (
lvl <= 140)
                            
val += lvl 12;
                    }
                }
                return 
val;
            }
        }
        public 
uint GetFullEquipmentGemPoints
        
{
            
get
            
{
                
uint val 0;
                foreach (
Network.GamePackets.ConquerItem item in Objects)
                {
                    if (
item == null) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    if (!
Network.PacketHandler.IsTwoHand(item.ID))
                    {
                        if (
item.SocketOne != (Game.Enums.Gem)0)
                        {
                            if (
item.SocketOne2 10 == 1val += 200;
                            if (
item.SocketOne2 10 == 2val += 500;
                            if (
item.SocketOne2 10 == 3val += 800;
                        }
                        if (
item.SocketTwo != (Game.Enums.Gem)0)
                        {
                            if (
item.SocketTwo2 10 == 1val += 200;
                            if (
item.SocketTwo2 10 == 2val += 500;
                            if (
item.SocketTwo2 10 == 3val += 800;
                        }
                    }
                    else
                    {
                        if (
item.SocketOne != (Game.Enums.Gem)0)
                        {
                            if (
item.SocketOne2 10 == 1val += 400;
                            if (
item.SocketOne2 10 == 2val += 1000;
                            if (
item.SocketOne2 10 == 3val += 1600;
                        }
                        if (
item.SocketTwo != (Game.Enums.Gem)0)
                        {
                            if (
item.SocketTwo2 10 == 1val += 400;
                            if (
item.SocketTwo2 10 == 2val += 1000;
                            if (
item.SocketTwo2 10 == 3val += 1600;
                        }
                    }
                }
                return 
val;
            }
        }
        public 
uint GetFullEquipmentPerfecetionLevelPoints
        
{
            
get
            
{
                
uint Points 0;
                foreach (
Network.GamePackets.ConquerItem item in Objects)
                {
                    if (
item == null) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    if (
item.Stars >= 1Points += 180;
                    if (
item.Stars >= 2Points += 180;
                    if (
item.Stars >= 3Points += 180;
                    if (
item.Stars >= 4Points += 180;
                    if (
item.Stars >= 5Points += 180;
                    if (
item.Stars >= 6Points += 180;
                    if (
item.Stars >= 7Points += 180;
                    if (
item.Stars >= 8Points += 180;
                    if (
item.Stars >= 9Points += 180;
                    if (
item.Stars >= 10Points += 2380;
                    if (
item.Stars >= 11Points += 400;
                    if (
item.Stars >= 12Points += 400;
                    if (
item.Stars >= 13Points += 400;
                    if (
item.Stars >= 14Points += 400;
                    if (
item.Stars >= 15Points += 400;
                    if (
item.Stars >= 16Points += 400;
                    if (
item.Stars >= 17Points += 400;
                    if (
item.Stars >= 18Points += 400;
                    if (
item.Stars >= 19Points += 5150;
                    if (
item.Stars >= 20Points += 650;
                    if (
item.Stars >= 21Points += 650;
                    if (
item.Stars >= 22Points += 650;
                    if (
item.Stars >= 23Points += 650;
                    if (
item.Stars >= 24Points += 650;
                    if (
item.Stars >= 25Points += 650;
                    if (
item.Stars >= 26Points += 650;
                    if (
item.Stars >= 27Points += 650;
                    if (
item.Stars >= 28Points += 100;
                    if (
item.Stars >= 29Points += 100;
                    if (
item.Stars >= 30Points += 100;
                    if (
item.Stars >= 31Points += 100;
                    if (
item.Stars >= 32Points += 100;
                    if (
item.Stars >= 33Points += 100;
                    if (
item.Stars >= 34Points += 100;
                    if (
item.Stars >= 35Points += 100;
                    if (
item.Stars >= 36Points += 100;
                    if (
item.Stars >= 37Points += 100;
                    if (
item.Stars >= 38Points += 100;
                    if (
item.Stars >= 39Points += 100;
                    if (
item.Stars >= 40Points += 100;
                    if (
item.Stars >= 41Points += 100;
                    if (
item.Stars >= 42Points += 100;
                    if (
item.Stars >= 43Points += 100;
                    if (
item.Stars >= 44Points += 100;
                    if (
item.Stars >= 45Points += 100;
                    if (
item.Stars >= 46Points += 100;
                    if (
item.Stars >= 47Points += 100;
                    if (
item.Stars >= 48Points += 100;
                    if (
item.Stars >= 49Points += 100;
                    if (
item.Stars >= 50Points += 100;
                    if (
item.Stars >= 51Points += 100;
                    if (
item.Stars >= 52Points += 100;
                    if (
item.Stars >= 53Points += 100;
                    if (
item.Stars >= 54Points += 100;
                    if (
Network.PacketHandler.IsTwoHand(item.ID))
                    {
                        if (
item.Stars >= 1Points += 180;
                        if (
item.Stars >= 2Points += 180;
                        if (
item.Stars >= 3Points += 180;
                        if (
item.Stars >= 4Points += 180;
                        if (
item.Stars >= 5Points += 180;
                        if (
item.Stars >= 6Points += 180;
                        if (
item.Stars >= 7Points += 180;
                        if (
item.Stars >= 8Points += 180;
                        if (
item.Stars >= 9Points += 180;
                        if (
item.Stars >= 10Points += 2380;
                        if (
item.Stars >= 11Points += 400;
                        if (
item.Stars >= 12Points += 400;
                        if (
item.Stars >= 13Points += 400;
                        if (
item.Stars >= 14Points += 400;
                        if (
item.Stars >= 15Points += 400;
                        if (
item.Stars >= 16Points += 400;
                        if (
item.Stars >= 17Points += 400;
                        if (
item.Stars >= 18Points += 400;
                        if (
item.Stars >= 19Points += 5150;
                        if (
item.Stars >= 20Points += 650;
                        if (
item.Stars >= 21Points += 650;
                        if (
item.Stars >= 22Points += 650;
                        if (
item.Stars >= 23Points += 650;
                        if (
item.Stars >= 24Points += 650;
                        if (
item.Stars >= 25Points += 650;
                        if (
item.Stars >= 26Points += 650;
                        if (
item.Stars >= 27Points += 650;
                        if (
item.Stars >= 28Points += 100;
                        if (
item.Stars >= 29Points += 100;
                        if (
item.Stars >= 30Points += 100;
                        if (
item.Stars >= 31Points += 100;
                        if (
item.Stars >= 32Points += 100;
                        if (
item.Stars >= 33Points += 100;
                        if (
item.Stars >= 34Points += 100;
                        if (
item.Stars >= 35Points += 100;
                        if (
item.Stars >= 36Points += 100;
                        if (
item.Stars >= 37Points += 100;
                        if (
item.Stars >= 38Points += 100;
                        if (
item.Stars >= 39Points += 100;
                        if (
item.Stars >= 40Points += 100;
                        if (
item.Stars >= 41Points += 100;
                        if (
item.Stars >= 42Points += 100;
                        if (
item.Stars >= 43Points += 100;
                        if (
item.Stars >= 44Points += 100;
                        if (
item.Stars >= 45Points += 100;
                        if (
item.Stars >= 46Points += 100;
                        if (
item.Stars >= 47Points += 100;
                        if (
item.Stars >= 48Points += 100;
                        if (
item.Stars >= 49Points += 100;
                        if (
item.Stars >= 50Points += 100;
                        if (
item.Stars >= 51Points += 100;
                        if (
item.Stars >= 52Points += 100;
                        if (
item.Stars >= 53Points += 100;
                        if (
item.Stars >= 54Points += 100;
                    }
                }
                return 
Points;
            }
        }
        public 
uint GetFullEquipmentSocketPoints
        
{
            
get
            
{
                
uint val 0;
                foreach (
Network.GamePackets.ConquerItem item in Objects)
                {
                    if (
item == null) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    if (!
Network.PacketHandler.IsTwoHand(item.ID))
                    {
                        if (
item.SocketOne != (Game.Enums.Gem)0val += 1000;
                        if (
item.SocketTwo != (Game.Enums.Gem)0val += 2500;
                    }
                    else
                    {
                        if (
item.SocketOne != (Game.Enums.Gem)0val += 2000;
                        if (
item.SocketTwo != (Game.Enums.Gem)0val += 5000;
                    }
                }
                return 
val;
            }
        }
        public 
uint GetFullEquipmentBlessPoints
        
{
            
get
            
{
                
uint val 0;
                foreach (
Network.GamePackets.ConquerItem item in Objects)
                {
                    if (
item == null) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    if (!
Network.PacketHandler.IsTwoHand(item.ID))
                    {
                        
val += (uint)(item.Bless 100);
                    }
                    else
                    {
                        
val += (uint)(item.Bless 200);
                    }
                }
                return 
val;
            }
        }
        public 
uint GetFullEquipmentRefinePoints
        
{
            
get
            
{
                
uint val 0;
                foreach (
Network.GamePackets.ConquerItem item in Objects)
                {
                    if (
item == null || !item.ExtraEffect.Available) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    if (!
Network.PacketHandler.IsTwoHand(item.ID))
                    {
                        if (
item.ExtraEffect.EffectLevel == 1val += 100;
                        if (
item.ExtraEffect.EffectLevel == 2val += 400;
                        if (
item.ExtraEffect.EffectLevel == 3val += 800;
                        if (
item.ExtraEffect.EffectLevel == 4val += 1200;
                        if (
item.ExtraEffect.EffectLevel == 5val += 1600;
                        if (
item.ExtraEffect.EffectLevel == 6val += 2000;
                    }
                    else
                    {
                        if (
item.ExtraEffect.EffectLevel == 1val += 200;
                        if (
item.ExtraEffect.EffectLevel == 2val += 800;
                        if (
item.ExtraEffect.EffectLevel == 3val += 1600;
                        if (
item.ExtraEffect.EffectLevel == 4val += 2400;
                        if (
item.ExtraEffect.EffectLevel == 5val += 3200;
                        if (
item.ExtraEffect.EffectLevel == 6val += 4000;
                    }
                }
                return 
val;
            }
        }
        public 
ushort TotalStars
        
{
            
get
            
{
                
ushort Count 0;
                foreach (
Network.GamePackets.ConquerItem item in Objects)
                {
                    if (
item == null) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    
Count += (ushort)(Network.PacketHandler.IsTwoHand(item.ID) ? item.Stars item.Stars);
                }
                return 
Count;
            }
        }
        
ConquerItem[] objects;
        
Client.GameState Owner;       
        public 
Equipment(Client.GameState client)
        {
            
Owner client;
            
objects = new ConquerItem[29];
        }

        public 
void UpdateEntityPacket()
        {
            for (
byte Position 1Position 30Position++)
            {
                if (
Free(Position))
                {
                    
ClearItemview(Position);
                  
//  ClearItemview2(Position);
                    /////////////////////////////Cpu//////////////////////////////
                     
                     
                     
                     
                    /////////////////////////////Cpu//////////////////////////////
                
}
                else
                {
                    var 
item TryGetItem(Position);
                    
UpdateItemview(item);
                    
/////////////////////////////Cpu//////////////////////////////
                     
                     
                     
                     
                    /////////////////////////////Cpu//////////////////////////////
                
}
            }           
            if (
Owner.ArmorLook != 0)
            {
                
Network.Writer.WriteUInt32(0ArmorSoulOwner.Player.SpawnPacket);
                
Network.Writer.WriteUInt32(Owner.ArmorLookArmorOwner.Player.SpawnPacket);
            }
            if (
Owner.HeadgearLook 0)
            {
                
Network.Writer.WriteUInt32(0HeadSoulOwner.Player.SpawnPacket);
                
Network.Writer.WriteUInt32(Owner.HeadgearLookHeadOwner.Player.SpawnPacket);
            }
            if (
Owner.WeaponLook 0)
            {
                
Network.Writer.WriteUInt32(0RightWeaponSoulOwner.Player.SpawnPacket);
                
Network.Writer.WriteUInt32(Owner.WeaponLookRightWeaponOwner.Player.SpawnPacket);
            }
            if (
Owner.WeaponLook2 0)
            {
                
Network.Writer.WriteUInt32(0LeftWeaponSoulOwner.Player.SpawnPacket);
                
Network.Writer.WriteUInt32(Owner.WeaponLook2LeftWeaponOwner.Player.SpawnPacket);
            }

            
Owner.SendScreen(Owner.Player.SpawnPacketfalse);
        }
        public 
uint GetGear(byte PositionClient.GameState C)
        {
            
ConquerItem I C.Equipment.TryGetItem(Position);
            if (
== null)
            {
                return 
0;
            }
            return 
I.UID;
        }
        public 
bool Add(ConquerItem item)
        {
            if (
objects.Length item.Position) return false;
            if (
item.Position >= objects.Length) return false;
            if (
item.Position 0) return false;
            if (
objects[item.Position 1] == null)
            {
                
item.IsWorn true;
                
UpdateItemview(item);
                
objects[item.Position 1] = item;
                
item.Position item.Position;
                
item.Send(Owner);
                
Owner.LoadItemStats();
                
Owner.SendScreenSpawn(Owner.Playerfalse);
                return 
true;
            }
            else return 
false;
        }
       
        public 
bool Add(ConquerItem itemEnums.ItemUse use)
        {
            if (
objects[item.Position 1] == null)
            {
                
objects[item.Position 1] = item;
                
item.Mode Enums.ItemMode.Default;

                if (use != 
Enums.ItemUse.None)
                {
                    
item.IsWorn true;
                    
UpdateItemview(item);

                    
item.Send(Owner);
                    
Owner.LoadItemStats();
                }
                return 
true;
            }
            else return 
false;
        }


        
#region Offsets

        
public const int
        Head 
56,
        
Garment 60,
        
Armor 64,
        
LeftWeapon 68,
        
RightWeapon 72,
        
LeftWeaponAccessory 76,
        
RightWeaponAccessory 80,
        
Steed 84,
        
MountArmor 88,
        
Wing 92,
        
WingPlus 96,
        
WingProgress 97,
        
ArmorColor 162,
        
LeftWeaponColor 164,
        
HeadColor 166,
        
SteedPlus 172,
        
SteedColor 174,
        
HeadSoul 221,
        
ArmorSoul 225,
        
LeftWeaponSoul 229,
        
RightWeaponSoul 233;

        
#endregion Offsets

        
public void ClearItemview(uint Position)
        {
            switch ((
ushort)Position)
            {
                case 
Network.GamePackets.ConquerItem.Head:
                    
Writer.Write(0HeadSoulOwner.Player.SpawnPacket);
                    
Writer.Write(0HeadOwner.Player.SpawnPacket);
                    
Writer.Write(0HeadColorOwner.Player.SpawnPacket);

                    break;

                case 
Network.GamePackets.ConquerItem.Garment:
                    if (
Owner.Player.MapID != 1081)
                        
Writer.Write(0GarmentOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.Armor:
                    
Writer.Write(0ArmorSoulOwner.Player.SpawnPacket);
                    
Writer.Write(0ArmorOwner.Player.SpawnPacket);
                    
Writer.Write(0ArmorColorOwner.Player.SpawnPacket);

                    break;

                case 
Network.GamePackets.ConquerItem.RightWeapon:
                    
Writer.Write(0RightWeaponSoulOwner.Player.SpawnPacket);
                    
Writer.Write(0RightWeaponOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.LeftWeapon:
                    
Writer.Write(0LeftWeaponSoulOwner.Player.SpawnPacket);
                    
Writer.Write(0LeftWeaponOwner.Player.SpawnPacket);
                    
Writer.Write(0LeftWeaponColorOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.RightWeaponAccessory:
                    
Writer.Write(0RightWeaponAccessoryOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.LeftWeaponAccessory:
                    
Writer.Write(0LeftWeaponAccessoryOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.Steed:
                    
Writer.Write(0SteedOwner.Player.SpawnPacket);
                    
Writer.Write(0SteedPlusOwner.Player.SpawnPacket);
                    
Writer.Write(0SteedColorOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.SteedArmor:
                    
Writer.Write(0MountArmorOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.Wing:
                    
Writer.Write(0WingOwner.Player.SpawnPacket);
                    
Writer.Write(0WingPlusOwner.Player.SpawnPacket);
                    
Writer.Write(0WingProgressOwner.Player.SpawnPacket);
                    break;
            }
        }

        public 
void UpdateItemview(ConquerItem item)
        {
            if (
item == null) return;
            if (!
item.IsWorn) return;
            switch ((
ushort)item.Position)
            {
                case 
Network.GamePackets.ConquerItem.AlternateHead:
                case 
Network.GamePackets.ConquerItem.Head:
                    if (
item.Purification.Available)
                        
Writer.Write(item.Purification.PurificationItemIDHeadSoulOwner.Player.SpawnPacket);
                    else 
Writer.Write(0HeadSoulOwner.Player.SpawnPacket);
                    
Writer.Write(item.IDHeadOwner.Player.SpawnPacket);

                    
Writer.Write((byte)item.ColorHeadColorOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.AlternateGarment:
                case 
Network.GamePackets.ConquerItem.Garment:
                    
Writer.Write(item.IDGarmentOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.AlternateArmor:
                case 
Network.GamePackets.ConquerItem.Armor:
                    if (
item.Purification.Available)
                        
Writer.Write(item.Purification.PurificationItemIDArmorSoulOwner.Player.SpawnPacket);
                    else 
Writer.Write(0ArmorSoulOwner.Player.SpawnPacket);
                    
Writer.Write(item.IDArmorOwner.Player.SpawnPacket);

                    
Writer.Write((byte)item.ColorArmorColorOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.AlternateRightWeapon:
                case 
Network.GamePackets.ConquerItem.RightWeapon:
                    if (
item.Purification.Available)
                        
Writer.Write(item.Purification.PurificationItemIDRightWeaponSoulOwner.Player.SpawnPacket);
                    else 
Writer.Write(0RightWeaponSoulOwner.Player.SpawnPacket);
                    
Writer.Write(item.IDRightWeaponOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.RightWeaponAccessory:
                    
Writer.Write(item.IDRightWeaponAccessoryOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.AlternateLeftWeapon:
                case 
Network.GamePackets.ConquerItem.LeftWeapon:
                    if (
item.Purification.Available)
                        
Writer.Write(item.Purification.PurificationItemIDLeftWeaponSoulOwner.Player.SpawnPacket);
                    else 
Writer.Write(0LeftWeaponSoulOwner.Player.SpawnPacket);
                    
Writer.Write((byte)item.ColorLeftWeaponColorOwner.Player.SpawnPacket);
                    
Writer.Write(item.IDLeftWeaponOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.LeftWeaponAccessory:
                    
Writer.Write(item.IDLeftWeaponAccessoryOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.Steed:
                    
Writer.Write(item.IDSteedOwner.Player.SpawnPacket);
                    
Writer.Write((byte)item.PlusSteedPlusOwner.Player.SpawnPacket);
                    
Writer.Write(item.SocketProgressSteedColorOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.SteedArmor:
                    
Writer.Write(item.IDMountArmorOwner.Player.SpawnPacket);
                    break;

                case 
Network.GamePackets.ConquerItem.Wing:
                    
Writer.Write(item.IDWingOwner.Player.SpawnPacket);
                    
Writer.Write(item.PlusWingPlusOwner.Player.SpawnPacket);
                    
Writer.Write(item.PlusProgressWingProgressOwner.Player.SpawnPacket);
                    break;
            }
        }

        public 
bool TryGetItem(uint itemGuidout ConquerItem myItem)
        {
            for (
int i 0Objects.Lengthi++)
            {
                var 
item Objects[i];
                if (
item != null)
                {
                    if (
item.UID == itemGuid)
                    {
                        
myItem item;
                        return 
true;
                    }
                }
            }
            
myItem null;
            return 
false;
        }

        public 
bool Remove(byte Positionbool dontAdd false)
        {
            if (
objects == null || objects[Position 1] == null)
                return 
false;

            if (
objects[Position 1] != null)
            {
                if (
Owner.Inventory.Count <= 39)
                {
                    if (
dontAdd true Owner.Inventory.Add(objects[Position 1], Enums.ItemUse.Move))
                    {
                        
objects[Position 1].Position Position;
                        
objects[Position 1].IsWorn false;
                        
objects[Position 1].Position 0;
                        if (
Position == 12)
                            
Owner.Player.RemoveFlag((ulong)Update.Flags.Ride);
                        if (
Position == 4)
                            
Owner.Player.RemoveFlag((ulong)Update.Flags.Fly);
                        
ItemUsage iu = new ItemUsage(true);
                        
iu.UID objects[Position 1].UID;
                        
iu.dwParam Position;
                        
iu.ID ItemUsage.UnequipItem;
                        
Owner.Send(iu.ToArray());
                        
ClearItemview(Position);
                        
objects[Position 1] = null;
                        
Owner.SendScreenSpawn(Owner.Playerfalse);
                        return 
true;
                    }
                }
                else
                {
                    
Owner.Send("Not enough room in your inventory.");
                }
            }
            return 
false;
        }
        public 
bool DestroyArrow(uint Position)
        {
            if (
objects[Position 1] != null)
            {
                
objects[Position 1].Position = (ushort)Position;
                if (
objects[Position 1].ID == 0)
                {
                    
objects[Position 1].Position 0;
                    
Database.ConquerItemTable.DeleteItem(objects[Position 1].UID);
                    
objects[Position 1] = null;
                    return 
true;
                }
                if (!
Network.PacketHandler.IsArrow(objects[Position 1].ID))
                    return 
false;

                
//Owner.UnloadItemStats(objects[Position - 1], false);
                
objects[Position 1].IsWorn false;
                
Database.ConquerItemTable.DeleteItem(objects[Position 1].UID);
                
Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
                
iu.UID objects[Position 1].UID;
                
iu.dwParam Position;
                
iu.ID Network.GamePackets.ItemUsage.UnequipItem;
                
Owner.Send(iu);
                
iu.dwParam 0;
                
iu.ID Network.GamePackets.ItemUsage.RemoveInventory;
                
Owner.Send(iu);
                
ClearItemview(Position);
                
objects[Position 1].Position 0;
                
objects[Position 1] = null;
                return 
true;
            }
            return 
false;
        }
        public 
bool RemoveToGround(uint Position)
        {
            if (
Position == || Position 29)
                return 
true;
            if (
objects[Position 1] != null)
            {
                
objects[Position 1].Position = (ushort)Position;
                
objects[Position 1].IsWorn false;
                
//Owner.UnloadItemStats(objects[Position - 1], false);
                
objects[Position 1].Position 0;
                
Database.ConquerItemTable.RemoveItem(objects[Position 1].UID);
                
Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
                
iu.UID objects[Position 1].UID;
                
iu.dwParam Position;
                
iu.ID Network.GamePackets.ItemUsage.UnequipItem;
                
Owner.Send(iu);
                
iu.dwParam 0;
                
iu.ID Network.GamePackets.ItemUsage.RemoveInventory;
                
Owner.Send(iu);

                
ClearItemview(Position);
                
objects[Position 1] = null;
                return 
true;
            }
            return 
false;
        }
        public 
ConquerItem[] Objects
        
{
            
get
            
{
                return 
objects;
            }
        }
        public 
byte Count
        
{
            
get
            
{
                
byte count 0; foreach (ConquerItem i in objects)
                    if (
!= null)
                        
count++; return count;
            }
        }
        public 
bool Free(byte Position)
        {
            return 
TryGetItem(Position) == null;
        }
        public 
bool Free(uint Position)
        {
            return 
TryGetItem((byte)Position) == null;
        }
        public 
ConquerItem TryGetItem(byte Position)
        {
            
ConquerItem item null;
            if (
Position || Position 29)
                return 
item;
            
item objects[Position 1];
            return 
item;
        }
        public 
ConquerItem TryGetItem(uint uid)
        {
            try
            {
                foreach (
ConquerItem item in objects)
                {
                    if (
item != null)
                        if (
item.UID == uid)
                            return 
item;
                }
            }
            catch (
Exception e)
            {
                
Program.SaveException(e);
                
Console.WriteLine(e);
            }
            return 
TryGetItem((byte)uid);
        }

        public 
bool IsArmorSuper()
        {
            if (
TryGetItem(3) != null)
                return 
TryGetItem(3).ID 10 == 9;
            return 
false;
        }
        public 
bool IsAllSuper()
        {
            for (
byte count 1count 12count++)
            {
                if (
count == 5)
                {
                    if (
Owner.Player.Class > 100)
                        continue;
                    if (
TryGetItem(count) != null)
                    {
                        if (
Network.PacketHandler.IsArrow(TryGetItem(count).ID))
                            continue;
                        if (
Network.PacketHandler.IsTwoHand(TryGetItem(4).ID))
                            continue;
                        if (
TryGetItem(count).ID 10 != 9)
                            return 
false;
                    }
                }
                else
                {
                    if (
TryGetItem(count) != null)
                    {
                        if (
count != Network.GamePackets.ConquerItem.Bottle && count != Network.GamePackets.ConquerItem.Garment)
                            if (
TryGetItem(count).ID 10 != 9)
                                return 
false;
                    }
                    else
                        if (
count != Network.GamePackets.ConquerItem.Bottle && count != Network.GamePackets.ConquerItem.Garment)
                            return 
false;
                }
            }
            return 
true;
        }

        public 
void ForceEquipments(Equipment equips)
        {
            
objects equips.objects;
        }

        public 
IEnumerable<ConquerItemGetCollection()
        {
            foreach (var 
it in objects)
            {
                if (
it != null)
                    yield return 
it;
            }
        }
    }


وغيرت اسم السورس باسم السورس بتاعك وجرب وياريت تجاوبني في اسرع وقت تقول تم الحل ولا لا

قديم 2019-11-11, 01:56 PM
المشاركة 3
Adel Abd El Hay
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: Redeem Equipment
لسه نفس المشكله موجوده !!

قديم 2019-11-11, 03:23 PM
المشاركة 4
zezonever
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: Redeem Equipment
تمام ركز معايا طيب افتح البرجيكت وبعدين نفتح ملف GameStats.ce هنددور ع الكود ده


كود:
Inventory = new Game.ConquerStructures.Inventory(this); 

تحته علي طول هنضيف ده


كود:
Equipment = new Game.ConquerStructures.Equipment(this); 

وبعدين نفتح ملف Entiy.cs ندور ع الكود ده


كود:
public void AddClone(ushort cloneid)
        { 

هنضيف تحته ع طول الكود ده


كود:
#region SpawnPacket(10014)

            
var Entity = new Entity(EntityFlag.Entitytrue);
            
Entity.MonsterInfo = new MonsterInformation();
            
MonsterInformation.MonsterInformations.TryGetValue(9003out Entity.MonsterInfo);
            
Entity.Owner Owner;
            
Entity.MonsterInfo.Owner Entity;
            
Entity.IsClone true;
            
Entity._Name "ShadowClone";
            
Entity.clan Name;
            
Entity.SpawnPacket = new byte[_Names _Name.Length 36];
            Array.
Copy(SpawnPacketEntity.SpawnPacketEntity.SpawnPacket.Length);
            
WriteStringList(new List<string>() { "ShadowClone"""""Name"" }, _NamesEntity.SpawnPacket);
            
Entity.Mesh Mesh;
            
Entity.Hitpoints 1;
            
Entity.UID Owner.Map.CloneCounter.Next;
            
Entity.GuildID Entity.GuildRank Entity.Action 0;
            
Entity.CountryID Enums.CountryID.Default;
            
Entity.StatusFlag Entity.StatusFlag2 Entity.StatusFlag3 Entity.StatusFlag4 0;
            
Writer.Write((uint)0Game.ConquerStructures.Equipment.SteedEntity.SpawnPacket);
            
Writer.Write((uint)0Game.ConquerStructures.Equipment.SteedPlusEntity.SpawnPacket);
            
Writer.Write((uint)0Game.ConquerStructures.Equipment.SteedColorEntity.SpawnPacket);
            
Writer.Write((uint)0Game.ConquerStructures.Equipment.MountArmorEntity.SpawnPacket);
            
Writer.Write((uint)0Game.ConquerStructures.Equipment.WingEntity.SpawnPacket);
            
Writer.Write((uint)0Game.ConquerStructures.Equipment.WingPlusEntity.SpawnPacket);
            
Entity.FlowerRank 0;
            
Entity.NobilityRank ConquerStructures.NobilityRank.Serf;
            
Entity.Class = Entity.FirstRebornClass Entity.SecondRebornClass Entity.JiangTalent Entity.SubClassesActive Entity.Reborn Entity.Level Entity.ServerID 0;
            
Writer.Write((byte)2271Entity.SpawnPacket);
            
Writer.Write(cloneid272Entity.SpawnPacket);
            
Entity.OwnerUID UID;
            
Entity.JiangActive false;
            
Writer.Write((uint)0178Entity.SpawnPacket);
            
Writer.Write((uint)0182Entity.SpawnPacket);
            
Writer.Write((uint)0186Entity.SpawnPacket);
            
Writer.Write((uint)0_UnionExploitsEntity.SpawnPacket);
            
Writer.Write((uint)0_UnionIDEntity.SpawnPacket);
            
Writer.Write((uint)0_UnionRankEntity.SpawnPacket);
            
Writer.Write((uint)0_UnionTypeEntity.SpawnPacket);
            
Writer.Write((uint)0_MyTitleEntity.SpawnPacket);
            
Writer.Write((uint)0_MyTitleScoreEntity.SpawnPacket);
            
Writer.Write((uint)0_MyWingEntity.SpawnPacket);
            
Entity.MinAttack MinAttack;
            
Entity.MaxAttack Entity.MagicAttack Math.Max(MinAttackMaxAttack);
            
Entity.Appearance Appearance;
            
Entity.MapID Owner.Map.ID;
            
Entity.SendUpdates true;

            
#endregion SpawnPacket(10014) 

بعدين هنروح ملف Handle.cs هنبحث ع الكود ده


كود:
public Game.ConquerStructures.Inventory Inventory

تحته ع طول نضيف ده


كود:
public Game.ConquerStructures.Equipment Equipment

هنفتح ملف بعدها Lobby.cs هنشوف الكود ده موجود ولا لا


كود:
 if (Bot.Equipment == nullBot.Equipment = new Equipment(Bot); 

لو مش موجود ابحث ع اكلود ده


كود:
Bot.Equipment.Add(new ConquerItem(true) { ID 420439Plus 12Position }); 

فوقه هنضيف الكود ال مش موجود وبكده المشكله اتحلت مليون في الميه

قديم 2019-11-11, 07:11 PM
المشاركة 5
Adel Abd El Hay
.:: عضو نشيط ::.
  • غير متواجد
Unhappy رد: Redeem Equipment
المشكله ان السورس عندي بتكويد Msg فا معظم الاكواد اللي بتبعتها بتبقي مش موجوده او مكتوبه بصيغ تانيه ومش بعرف اوصلها

قديم 2019-11-12, 12:22 AM
المشاركة 6
Adel Abd El Hay
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: Redeem Equipment
ياريت حد يساعدني ف المشكله دي ياشباب بعد اذنكو !!
مع العلم ان السورس بتكويد Msg وشكرا !!

قديم 2019-11-16, 08:27 AM
المشاركة 7
محمد ياسر
*
  • غير متواجد
افتراضي رد: Redeem Equipment
تحويل العادي لمسج سهل جدا ياحب قارن بين الاكواد الي بتيجي ايروا عندك باكواد تاني بنفس طريقه التكويد

قديم 2023-10-11, 10:04 PM
المشاركة 8
karem1q
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: Redeem Equipment
عاش


العلامات المرجعية



الذين يشاهدون محتوى الموضوع الآن : 3 ( الأعضاء 0 والزوار 3)
 

الانتقال السريع



الساعة الآن 07:40 PM

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.