Register for your free account! | Forgot your password?

Go Back   elitepvpers > Conquer Online 2 > CO2 PServer - Discussions / Questions > CO2 PServer Guides & Releases
You last visited: Today at 20:46

  • Please register to post and access all features, it's quick, easy and FREE!


Fix the Damage in Equipment classic in Suorce [c#]

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2012
Posts: 93
Received Thanks: 44
Fix the Damage in Equipment classic in Suorce [c#]

Hello every one i will upload all class will help to fixed all System was Damage in more Source if any one need any thing tell it in the Topic

1: Go to that way : Your source.Game.ConquerStructures.Equipment
2: then change all code an replace the next.

3:Code C# project
PHP Code:
using System;
using System.Collections.Generic;
using OmanyProject.Network.GamePackets;
using OmanyProject.Interfaces;

namespace 
OmanyProject.Game.ConquerStructures
{
    public class 
Equipment
    
{
        
ConquerItem[] objects;
        
Client.GameState Owner;
        public 
Equipment(Client.GameState client)
        {
            
Owner client;
            
objects = new ConquerItem[40];
        }

        public 
void UpdateEntityPacket()
        {
            for (
byte Position 1Position 29Position++)
            {
                if (
Free(Position))
                {
                    
ClearItemview(Position);
                }
                else
                {
                    var 
item TryGetItem(Position);
                    
UpdateItemview(item);
                }
            }

            if (
Owner.ArmorLook != 0)
            {
                
Network.Writer.WriteUInt32(0ArmorSoulOwner.Entity.SpawnPacket);
                
Network.Writer.WriteUInt32(Owner.ArmorLookArmorOwner.Entity.SpawnPacket);
            }
            if (
Owner.HeadgearLook 0)
            {
                
Network.Writer.WriteUInt32(0HeadSoulOwner.Entity.SpawnPacket);
                
Network.Writer.WriteUInt32(Owner.HeadgearLookHeadOwner.Entity.SpawnPacket);
            }

            
Owner.SendScreen(Owner.Entity.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 (
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.Entityfalse);

                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 
48,
            
Garment 52,
            
Armor 56,
            
LeftWeapon 60,
            
RightWeapon 64,
            
LeftWeaponAccessory 68,
            
RightWeaponAccessory 72,
            
Steed 76,
            
MountArmor 80,
            
ArmorColor 141,
            
LeftWeaponColor 143,
            
HeadColor 145,
            
SteedPlus 151,
            
SteedColor 157,
            
HeadSoul 200,
            
ArmorSoul 204,
            
LeftWeaponSoul 208,
            
RightWeaponSoul 212;
        
#endregion

#region ClearItemview
        
public void ClearItemview(uint Position)
        {
            switch ((
ushort)Position)
            {
                case 
Network.GamePackets.ConquerItem.Head:
                    if (
Owner.HeadgearLook != 0)
                    {
                        
Network.Writer.WriteUInt32(0HeadSoulOwner.Entity.SpawnPacket);
                        
Network.Writer.WriteUInt32(Owner.HeadgearLookHeadOwner.Entity.SpawnPacket);
                    }
                    else
                    {
                        
Network.Writer.WriteUInt32(0HeadSoulOwner.Entity.SpawnPacket);
                        
Network.Writer.WriteUInt32(0HeadOwner.Entity.SpawnPacket);
                        
Network.Writer.WriteUInt16(0HeadColorOwner.Entity.SpawnPacket);
                    }
                    break;
                case 
Network.GamePackets.ConquerItem.Garment:
                    if (
Owner.Entity.MapID != 1081)
                        
Network.Writer.WriteUInt32(0GarmentOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.Armor:
                    if (
Owner.ArmorLook != 0)
                    {
                        
Network.Writer.WriteUInt32(0ArmorSoulOwner.Entity.SpawnPacket);
                        
Network.Writer.WriteUInt32(Owner.ArmorLookArmorOwner.Entity.SpawnPacket);
                    }
                    else
                    {
                        
Network.Writer.WriteUInt32(0ArmorSoulOwner.Entity.SpawnPacket);
                        
Network.Writer.WriteUInt32(0ArmorOwner.Entity.SpawnPacket);
                        
Network.Writer.WriteUInt16(0ArmorColorOwner.Entity.SpawnPacket);
                    }
                    break;
                case 
Network.GamePackets.ConquerItem.RightWeapon:
                    
Network.Writer.WriteUInt32(0RightWeaponSoulOwner.Entity.SpawnPacket);
                    
Network.Writer.WriteUInt32(0RightWeaponOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.LeftWeapon:
                    
Network.Writer.WriteUInt32(0LeftWeaponSoulOwner.Entity.SpawnPacket);
                    
Network.Writer.WriteUInt32(0LeftWeaponOwner.Entity.SpawnPacket);
                    
Network.Writer.WriteUInt16(0LeftWeaponColorOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.RightWeaponAccessory:
                    
Network.Writer.WriteUInt32(0RightWeaponAccessoryOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.LeftWeaponAccessory:
                    
Network.Writer.WriteUInt32(0LeftWeaponAccessoryOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.Steed:
                    
Network.Writer.WriteUInt32(0SteedOwner.Entity.SpawnPacket);
                    
Network.Writer.WriteUInt16(0SteedPlusOwner.Entity.SpawnPacket);
                    
Network.Writer.WriteUInt32(0SteedColorOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.SteedArmor:
                    
Network.Writer.WriteUInt32(0MountArmorOwner.Entity.SpawnPacket);
                    break;
            }
        }
#enregion
#region UpdateItemview
        
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 (
Owner.HeadgearLook != 0)
                    {
                        
Network.Writer.WriteUInt32(0HeadSoulOwner.Entity.SpawnPacket);
                        
Network.Writer.WriteUInt32(Owner.HeadgearLookHeadOwner.Entity.SpawnPacket);
                    }
                    else
                    {
                        if (
item.Purification.Available)
                            
Network.Writer.WriteUInt32(item.Purification.PurificationItemIDHeadSoulOwner.Entity.SpawnPacket);
                        else 
Network.Writer.WriteUInt32(0HeadSoulOwner.Entity.SpawnPacket);
                        
Network.Writer.WriteUInt32(item.IDHeadOwner.Entity.SpawnPacket);
                    }
                    
Network.Writer.WriteUInt16((byte)item.ColorHeadColorOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.AlternateGarment:
                case 
Network.GamePackets.ConquerItem.Garment:
                        
Network.Writer.WriteUInt32(item.IDGarmentOwner.Entity.SpawnPacket);
                        break;
                case 
Network.GamePackets.ConquerItem.AlternateArmor:
                case 
Network.GamePackets.ConquerItem.Armor:
                    if (
Owner.ArmorLook != 0)
                    {
                        
Network.Writer.WriteUInt32(0ArmorSoulOwner.Entity.SpawnPacket);
                        
Network.Writer.WriteUInt32(Owner.ArmorLookArmorOwner.Entity.SpawnPacket);
                    }
                    else
                    {
                        if (
item.Purification.Available)
                            
Network.Writer.WriteUInt32(item.Purification.PurificationItemIDArmorSoulOwner.Entity.SpawnPacket);
                        else 
Network.Writer.WriteUInt32(0ArmorSoulOwner.Entity.SpawnPacket);
                        
Network.Writer.WriteUInt32(item.IDArmorOwner.Entity.SpawnPacket);
                    }
                    
Network.Writer.WriteUInt16((byte)item.ColorArmorColorOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.AlternateRightWeapon:
                case 
Network.GamePackets.ConquerItem.RightWeapon:
                    if (
item.Purification.Available)
                        
Network.Writer.WriteUInt32(item.Purification.PurificationItemIDRightWeaponSoulOwner.Entity.SpawnPacket);
                    else 
Network.Writer.WriteUInt32(0RightWeaponSoulOwner.Entity.SpawnPacket);
                    
Network.Writer.WriteUInt32(item.IDRightWeaponOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.RightWeaponAccessory:
                    
Network.Writer.WriteUInt32(item.IDRightWeaponAccessoryOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.AlternateLeftWeapon:
                case 
Network.GamePackets.ConquerItem.LeftWeapon:
                    if (
item.Purification.Available)
                        
Network.Writer.WriteUInt32(item.Purification.PurificationItemIDLeftWeaponSoulOwner.Entity.SpawnPacket);
                    else 
Network.Writer.WriteUInt32(0LeftWeaponSoulOwner.Entity.SpawnPacket);
                    
Network.Writer.WriteUInt16((byte)item.ColorLeftWeaponColorOwner.Entity.SpawnPacket);
                    
Network.Writer.WriteUInt32(item.IDLeftWeaponOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.LeftWeaponAccessory:
                    
Network.Writer.WriteUInt32(item.IDLeftWeaponAccessoryOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.Steed:
                    
Network.Writer.WriteUInt32(item.IDSteedOwner.Entity.SpawnPacket);
                    
Network.Writer.WriteUInt16((byte)item.PlusSteedPlusOwner.Entity.SpawnPacket);
                    
Network.Writer.WriteUInt32(item.SocketProgressSteedColorOwner.Entity.SpawnPacket);
                    break;
                case 
Network.GamePackets.ConquerItem.SteedArmor:
                    
Network.Writer.WriteUInt32(item.IDMountArmorOwner.Entity.SpawnPacket);
                    break;
            }
        }
#enregion
#region Remove
        
public bool Remove(byte Position)
        {
            if (
objects[Position 1] != null)
            {
                if (
Owner.Inventory.Count <= 39)
                {
                    if (
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.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Ride);
                        if (
Position == 4)
                            
Owner.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Fly);
                        
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);
                        
ClearItemview(Position);
                        
objects[Position 1] = null;
                        
Owner.SendScreenSpawn(Owner.Entityfalse);
                        return 
true;
                    }
                }
                else
                {
                    
Owner.Send(new Network.GamePackets.Message("Not enough room in your inventory."System.Drawing.Color.RedNetwork.GamePackets.Message.TopLeft));
                }
            }
            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;
                
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;
        }
#enregion
#region RemoveToGround
        
public bool RemoveToGround(uint Position)
        {
            if (
Position == || Position 19)
                return 
true;
            if (
objects[Position 1] != null)
            {
                
objects[Position 1].Position = (ushort)Position;
                
objects[Position 1].IsWorn 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 39)
                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);
        }
#enregion
#region [Is]Super
        
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.Entity.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;
        }
#enregion
        
public void ForceEquipments(Equipment equips)
        {
            
objects equips.objects;
        }
    }




omany25jan is offline  
Old 01/06/2014, 05:14   #2
 
elite*gold: 0
Join Date: Dec 2010
Posts: 103
Received Thanks: 13
"source.Game.ConquerStructures.Equipment" this is probably something for the trinity source and it looks pretty messy if you ask me.


Smallxmac is offline  
Thanks
2 Users
Old 01/07/2014, 14:15   #3
 
elite*gold: 0
Join Date: Dec 2013
Posts: 4
Received Thanks: 2
And it's not for damage xD
The-Dreamer is offline  
Thanks
1 User
Old 01/12/2014, 12:43   #4
 
elite*gold: 0
Join Date: Jul 2011
Posts: 366
Received Thanks: 196
He pasted the wrong class


Execution! is offline  
Old 01/22/2014, 00:33   #5
 
elite*gold: 0
Join Date: Feb 2013
Posts: 92
Received Thanks: 12
i didnt see any damage there man.. did you mean spawnpackets too see the items?


EOS 60D is offline  
Reply


Similar Threads
**Metin2 [B] Imba Equipment auf Server 18 Erfoo [S]Equipment auf S1 Mosha oder Psc**
08/21/2012 - Metin2 Trading - 4 Replies
huhu liebe com, da ich inaktiv auf s18 erfoo bin, biete ich hier mein restequip zum tausch/Verkauf an dgp+9 2k tp 5tp absorb 3crap 3+4er standard
[B] FinalMT2 IMBA Equipment-Accounts [S]Amkira Equipment-Account/ PSC / Paypal
03/19/2012 - Metin2 Trading - 1 Replies
.



All times are GMT +1. The time now is 20:46.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.