Register for your free account! | Forgot your password?

You last visited: Today at 12:53

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

Advertisement



Item Displaying

Discussion on Item Displaying within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2011
Posts: 15
Received Thanks: 0
Item Displaying

After coding Alternative Equipment it's just working fine but when Equipping any item i have to restart Server to Display the items that i have equipped it





I have to relogin to display this items that's not displaying
Any idea how to fix it?
The~Lord! is offline  
Old 01/02/2014, 19:58   #2
 
~Crystaline's Avatar
 
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
My guess is, you have to send an Entity.Equip when item is being equipped.

Code:
Update.Entity.Equipment (maybe), I'm not sure tho
~Crystaline is offline  
Old 01/02/2014, 20:05   #3
 
elite*gold: 0
Join Date: Jan 2011
Posts: 15
Received Thanks: 0
It's already sends to ItemPacket to show the gears ,
Code:
user.Equipment.DisplayGears();
and I've checked my code, nothing wrong , Everything seems to be working well
Code:
            public void DisplayGears()
            {
                Packet.ItemPacket msg;
                if (Packet.ItemPacket.Create(Owner.UID, ItemAction.DisplayGears, (byte)(Owner.AlternateEquipment ? 1 : 0), out msg))
                {
                    if (Headgear != null) msg.Gear1 = Headgear.UniqueID;
                    if (Necklace != null) msg.Gear2 = Necklace.UniqueID;
                    if (Armor != null) msg.Gear3 = Armor.UniqueID;
                    if (WeaponR != null) msg.Gear4 = WeaponR.UniqueID;
                    if (WeaponL != null) msg.Gear5 = WeaponL.UniqueID;
                    if (Ring != null) msg.Gear6 = Ring.UniqueID;
                    if (Bottle != null) msg.Gear7 = Bottle.UniqueID;
                    if (Boots != null) msg.Gear8 = Boots.UniqueID;
                    if (Owner._disguiseGarment != null)
                        msg.Gear9 = Owner._disguiseGarment.UniqueID;
                    else if (Garment != null) msg.Gear9 = Garment.UniqueID;
                    //if (Fan != null) msg.Gear10 = Fan.UniqueID;
                    // if (Tower != null) msg.Gear13 = Tower.UniqueID;
                    //if (Steed != null) msg.Gear14 = Steed.UniqueID;
                    if (AccessoryR != null) msg.Gear15 = AccessoryR.UniqueID;
                    if (AccessoryL != null) msg.Gear16 = AccessoryL.UniqueID;
                    if (Crop != null) msg.Gear17 = Crop.UniqueID;
                    //Alternate
                    if (Owner.AlternateEquipment) {
                        if (ALTHeadgear != null) msg.Gear1 = ALTHeadgear.UniqueID;
                        if (ALTNecklace != null) msg.Gear2 = ALTNecklace.UniqueID;
                        if (ALTArmor != null) msg.Gear3 = ALTArmor.UniqueID;
                        if (ALTWeaponR != null) msg.Gear4 = ALTWeaponR.UniqueID;
                        if (ALTWeaponL != null) msg.Gear5 = ALTWeaponL.UniqueID;
                        if (ALTRing != null) msg.Gear6 = ALTRing.UniqueID;
                        if (ALTBottle != null) msg.Gear7 = ALTBottle.UniqueID;
                        if (ALTBoots != null) msg.Gear8 = ALTBoots.UniqueID;
                        if (ALTGarment != null) { msg.Gear9 = ALTGarment.UniqueID; ShowOthersGear(ItemLocation.ALTGarment); }
                    }
                    Owner.Send(msg);
                }
            }
And item Slot doesn't even change when I equip another item
Code:
             public void EquipItem(ItemInfo itm, ItemLocation loc)
            {
                if (Owner.Inventory.Count > 39)
                    return;
                if (!Owner.Inventory.ContainsKey(itm.UniqueID))
                    return;
                Owner.Inventory.Remove(itm.UniqueID);
                itm.Location = (ushort)loc;
                Database.ModifyItem(itm.Location, "Position", itm.UniqueID);
                Database.ModifyItem(itm.CurrentDura, "Durability", itm.UniqueID);
                #region Sets up item location
                switch (loc)
                {
                    case ItemLocation.Head:
                        if (Headgear != null)
                            Headgear.Unequip(Owner, false);
                        Headgear = itm;
                        break;
                    case ItemLocation.Necklace:
                        if (Necklace != null)
                            Necklace.Unequip(Owner, false);
                        Necklace = itm;
                        break;
                    case ItemLocation.Armor:
                        if (Armor != null)
                            Armor.Unequip(Owner, false);
                        Armor = itm;
                        break;
                    case ItemLocation.WeaponR:
                        if (WeaponR != null)
                            WeaponR.Unequip(Owner, false);
                        WeaponR = itm;
                        break;
                    case ItemLocation.WeaponL:
                        if (WeaponL != null)
                            WeaponL.Unequip(Owner, false);
                        WeaponL = itm;
                        break;
                    case ItemLocation.Ring:
                        if (Ring != null)
                            Ring.Unequip(Owner, false);
                        Ring = itm;
                        break;
                    case ItemLocation.Bottle:
                        if (Bottle != null)
                            Bottle.Unequip(Owner, false);
                        Bottle = itm;
                        break;
                    case ItemLocation.Boots:
                        if (Boots != null)
                            Boots.Unequip(Owner, false);
                        Boots = itm;
                        break;
                    case ItemLocation.Garment:
                        if (Garment != null)
                            Garment.Unequip(Owner, false);
                        Garment = itm;
                        break;
                    case ItemLocation.Fan:
                        if (Fan != null)
                            Fan.Unequip(Owner, false);
                        Fan = itm;
                        break;
                    case ItemLocation.Tower:
                        if (Tower != null)
                            Tower.Unequip(Owner, false);
                        Tower = itm;
                        break;
                    case ItemLocation.Steed:
                        if (Steed != null)
                            Steed.Unequip(Owner, false);
                        Steed = itm;
                        break;

                    case ItemLocation.AccessoryL:
                        if (AccessoryL != null)
                            AccessoryL.Unequip(Owner, false);
                        AccessoryL = itm;
                        break;
                    case ItemLocation.AccessoryR:
                        if (AccessoryR != null)
                            AccessoryR.Unequip(Owner, false);
                        AccessoryR = itm;
                        break;

                    case ItemLocation.SteedArmor:
                        if (SteedArmor != null)
                            SteedArmor.Unequip(Owner, false);
                        SteedArmor = itm;
                        break;
                    case ItemLocation.Crop:
                        if (Crop != null)
                            Crop.Unequip(Owner, false);
                        Crop = itm;
                        break;

                    case ItemLocation.ALTHead:
                        if (ALTHeadgear != null)
                            ALTHeadgear.Unequip(Owner, false);
                        ALTHeadgear = itm;
                        break;
                    case ItemLocation.ALTNecklace:
                        if (ALTNecklace != null)
                            ALTNecklace.Unequip(Owner, false);
                        ALTNecklace = itm;
                        break;
                    case ItemLocation.ALTArmor:
                        if (ALTArmor != null)
                            ALTArmor.Unequip(Owner, false);
                        ALTArmor = itm;
                        break;
                    case ItemLocation.ALTWeaponR:
                        if (ALTWeaponR != null)
                            ALTWeaponR.Unequip(Owner, false);
                        ALTWeaponR = itm;
                        break;
                    case ItemLocation.ALTWeaponL:
                        if (ALTWeaponL != null)
                            ALTWeaponL.Unequip(Owner, false);
                        ALTWeaponL = itm;
                        break;
                    case ItemLocation.ALTRing:
                        if (ALTRing != null)
                            ALTRing.Unequip(Owner, false);
                        ALTRing = itm;
                        break;
                    case ItemLocation.ALTBottle:
                        if (ALTBottle != null)
                            ALTBottle.Unequip(Owner, false);
                        ALTBottle = itm;
                        break;
                    case ItemLocation.ALTBoots:
                        if (ALTBoots != null)
                            ALTBoots.Unequip(Owner, false);
                        ALTBoots = itm;
                        break;
                    case ItemLocation.ALTGarment:
                        if (ALTGarment != null)
                            ALTGarment.Unequip(Owner, false);
                        ALTGarment = itm;
                        break;
                }
                #endregion
                Owner.Send(new Packet.ItemPacket { Id = itm.UniqueID, Action = ItemAction.Equip, Data1Low = (ushort)loc });
                ShowOthersGear(loc);
                DisplayGears();
                Owner.Recalculate();
            }
The~Lord! is offline  
Old 01/03/2014, 03:22   #4
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Quote:
Originally Posted by The~Lord! View Post
It's already sends to ItemPacket to show the gears ,
Code:
user.Equipment.DisplayGears();
and I've checked my code, nothing wrong , Everything seems to be working well
Code:
            public void DisplayGears()
            {
                Packet.ItemPacket msg;
                if (Packet.ItemPacket.Create(Owner.UID, ItemAction.DisplayGears, (byte)(Owner.AlternateEquipment ? 1 : 0), out msg))
                {
                    if (Headgear != null) msg.Gear1 = Headgear.UniqueID;
                    if (Necklace != null) msg.Gear2 = Necklace.UniqueID;
                    if (Armor != null) msg.Gear3 = Armor.UniqueID;
                    if (WeaponR != null) msg.Gear4 = WeaponR.UniqueID;
                    if (WeaponL != null) msg.Gear5 = WeaponL.UniqueID;
                    if (Ring != null) msg.Gear6 = Ring.UniqueID;
                    if (Bottle != null) msg.Gear7 = Bottle.UniqueID;
                    if (Boots != null) msg.Gear8 = Boots.UniqueID;
                    if (Owner._disguiseGarment != null)
                        msg.Gear9 = Owner._disguiseGarment.UniqueID;
                    else if (Garment != null) msg.Gear9 = Garment.UniqueID;
                    //if (Fan != null) msg.Gear10 = Fan.UniqueID;
                    // if (Tower != null) msg.Gear13 = Tower.UniqueID;
                    //if (Steed != null) msg.Gear14 = Steed.UniqueID;
                    if (AccessoryR != null) msg.Gear15 = AccessoryR.UniqueID;
                    if (AccessoryL != null) msg.Gear16 = AccessoryL.UniqueID;
                    if (Crop != null) msg.Gear17 = Crop.UniqueID;
                    //Alternate
                    if (Owner.AlternateEquipment) {
                        if (ALTHeadgear != null) msg.Gear1 = ALTHeadgear.UniqueID;
                        if (ALTNecklace != null) msg.Gear2 = ALTNecklace.UniqueID;
                        if (ALTArmor != null) msg.Gear3 = ALTArmor.UniqueID;
                        if (ALTWeaponR != null) msg.Gear4 = ALTWeaponR.UniqueID;
                        if (ALTWeaponL != null) msg.Gear5 = ALTWeaponL.UniqueID;
                        if (ALTRing != null) msg.Gear6 = ALTRing.UniqueID;
                        if (ALTBottle != null) msg.Gear7 = ALTBottle.UniqueID;
                        if (ALTBoots != null) msg.Gear8 = ALTBoots.UniqueID;
                        if (ALTGarment != null) { msg.Gear9 = ALTGarment.UniqueID; ShowOthersGear(ItemLocation.ALTGarment); }
                    }
                    Owner.Send(msg);
                }
            }
And item Slot doesn't even change when I equip another item
Code:
             public void EquipItem(ItemInfo itm, ItemLocation loc)
            {
                if (Owner.Inventory.Count > 39)
                    return;
                if (!Owner.Inventory.ContainsKey(itm.UniqueID))
                    return;
                Owner.Inventory.Remove(itm.UniqueID);
                itm.Location = (ushort)loc;
                Database.ModifyItem(itm.Location, "Position", itm.UniqueID);
                Database.ModifyItem(itm.CurrentDura, "Durability", itm.UniqueID);
                #region Sets up item location
                switch (loc)
                {
                    case ItemLocation.Head:
                        if (Headgear != null)
                            Headgear.Unequip(Owner, false);
                        Headgear = itm;
                        break;
                    case ItemLocation.Necklace:
                        if (Necklace != null)
                            Necklace.Unequip(Owner, false);
                        Necklace = itm;
                        break;
                    case ItemLocation.Armor:
                        if (Armor != null)
                            Armor.Unequip(Owner, false);
                        Armor = itm;
                        break;
                    case ItemLocation.WeaponR:
                        if (WeaponR != null)
                            WeaponR.Unequip(Owner, false);
                        WeaponR = itm;
                        break;
                    case ItemLocation.WeaponL:
                        if (WeaponL != null)
                            WeaponL.Unequip(Owner, false);
                        WeaponL = itm;
                        break;
                    case ItemLocation.Ring:
                        if (Ring != null)
                            Ring.Unequip(Owner, false);
                        Ring = itm;
                        break;
                    case ItemLocation.Bottle:
                        if (Bottle != null)
                            Bottle.Unequip(Owner, false);
                        Bottle = itm;
                        break;
                    case ItemLocation.Boots:
                        if (Boots != null)
                            Boots.Unequip(Owner, false);
                        Boots = itm;
                        break;
                    case ItemLocation.Garment:
                        if (Garment != null)
                            Garment.Unequip(Owner, false);
                        Garment = itm;
                        break;
                    case ItemLocation.Fan:
                        if (Fan != null)
                            Fan.Unequip(Owner, false);
                        Fan = itm;
                        break;
                    case ItemLocation.Tower:
                        if (Tower != null)
                            Tower.Unequip(Owner, false);
                        Tower = itm;
                        break;
                    case ItemLocation.Steed:
                        if (Steed != null)
                            Steed.Unequip(Owner, false);
                        Steed = itm;
                        break;

                    case ItemLocation.AccessoryL:
                        if (AccessoryL != null)
                            AccessoryL.Unequip(Owner, false);
                        AccessoryL = itm;
                        break;
                    case ItemLocation.AccessoryR:
                        if (AccessoryR != null)
                            AccessoryR.Unequip(Owner, false);
                        AccessoryR = itm;
                        break;

                    case ItemLocation.SteedArmor:
                        if (SteedArmor != null)
                            SteedArmor.Unequip(Owner, false);
                        SteedArmor = itm;
                        break;
                    case ItemLocation.Crop:
                        if (Crop != null)
                            Crop.Unequip(Owner, false);
                        Crop = itm;
                        break;

                    case ItemLocation.ALTHead:
                        if (ALTHeadgear != null)
                            ALTHeadgear.Unequip(Owner, false);
                        ALTHeadgear = itm;
                        break;
                    case ItemLocation.ALTNecklace:
                        if (ALTNecklace != null)
                            ALTNecklace.Unequip(Owner, false);
                        ALTNecklace = itm;
                        break;
                    case ItemLocation.ALTArmor:
                        if (ALTArmor != null)
                            ALTArmor.Unequip(Owner, false);
                        ALTArmor = itm;
                        break;
                    case ItemLocation.ALTWeaponR:
                        if (ALTWeaponR != null)
                            ALTWeaponR.Unequip(Owner, false);
                        ALTWeaponR = itm;
                        break;
                    case ItemLocation.ALTWeaponL:
                        if (ALTWeaponL != null)
                            ALTWeaponL.Unequip(Owner, false);
                        ALTWeaponL = itm;
                        break;
                    case ItemLocation.ALTRing:
                        if (ALTRing != null)
                            ALTRing.Unequip(Owner, false);
                        ALTRing = itm;
                        break;
                    case ItemLocation.ALTBottle:
                        if (ALTBottle != null)
                            ALTBottle.Unequip(Owner, false);
                        ALTBottle = itm;
                        break;
                    case ItemLocation.ALTBoots:
                        if (ALTBoots != null)
                            ALTBoots.Unequip(Owner, false);
                        ALTBoots = itm;
                        break;
                    case ItemLocation.ALTGarment:
                        if (ALTGarment != null)
                            ALTGarment.Unequip(Owner, false);
                        ALTGarment = itm;
                        break;
                }
                #endregion
                Owner.Send(new Packet.ItemPacket { Id = itm.UniqueID, Action = ItemAction.Equip, Data1Low = (ushort)loc });
                ShowOthersGear(loc);
                DisplayGears();
                Owner.Recalculate();
            }
Soooo many if statements, it hurts my eyes
hunterman01 is offline  
Old 01/03/2014, 13:07   #5
 
abdoumatrix's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 239
check any source it have it working it will help u.

check messi i know it suck but it might help
abdoumatrix is offline  
Reply


Similar Threads Similar Threads
Item Equipping
02/11/2013 - CO2 Private Server - 3 Replies
Fixed. Thank you!
Weapon not equipping
05/21/2011 - Shaiya Private Server - 4 Replies
Anybody have a reason as to why a weapon wouldnt equip? It shows up just fine, its defined in DB and data file correctly. When i right click to equip it even makes the sound of being equipped, but it just doesnt go anywhere. In addition, i can not drag it to the weapon slot either. Can i get a few ideas? V-A
BUG-equipping a mainhand, offhand and 2 handed item all at once
04/05/2011 - Rift Hacks, Bots, Cheats & Exploits - 3 Replies
If all of your bags are full and you drag and drop a 2h weapon on top of your existing single handed items it will stack with them. This works with swords and shields as well as totems and such. You must use the bank to hold it for the drag and drop, of course. alternate method... First find your offhand item while wearing a 2-hand. Next go to the bank and put the offhand item in the bank. After that fill up your inventory. When your inventory is full, drag/drop the offhand from the bank...
Equipping Other Race Elems
05/25/2010 - RF Online - 6 Replies
I just want to know if equipping other races elems is easy to do. For example: 1. U have Cora Ele 2. U have an acc on the same account 3. go to your acc and look at your cora elem 4. change values of the cora elem 5. Equip the Cora elem using your acc..
Any Program that let u repair without un-equipping
02/14/2007 - Conquer Online 2 - 6 Replies
ya i was wondering if there was a new program that let u repair without unequipping



All times are GMT +2. The time now is 12:53.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.