Checking for Bound Items in Inventory

06/16/2013 00:24 hacksaw#1
Im trying to get it so when you talk to an npc they can tell if an item in your inventory is bound or not, and if it is to not give reward but i cant seem to get it working, Can someone take a look at what i have done so far and explain where im going wrong pls or a better way of doin it if there is, Thanks.

Code:
                                        case 1:
                                            {
                                                Interfaces.IConquerItem item = new ConquerItem(true);
                                                item.ID = 1058011;
                                                if (client.Inventory.TryGetItem(item.UID, out item))
                                                {
                                                  if (item.Bound == false)
                                                   {
                                                    client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                                                    client.Entity.BoundCps += 100;
                                                   }
                                                else
                                                {
                                                    dialog.Text("Your item is bound.");
                                                    dialog.Send();
                                                    break;
                                                   }
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have the item");
                                                    dialog.Send();
                                                    break;
                                                }
                                                break;
                                            }
06/16/2013 00:30 diedwarrior#2
TryGetItem or w/e method in impulse base
06/16/2013 00:35 hacksaw#3
Yeah thats what im currently using, But i cant seem to get it to pick up the item id which i refrence just before it & just comes back as you dont have the item.
06/16/2013 00:56 LordGragen.#4
its look fine to me but let me check my old source on trinity

#edit why not just use this?


Code:
  case 1:if {
(client.Inventory.Contains(ItemId, 1))
                                                {
                                                  if (item.Bound == false)
                                                   {
                                                    client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                                                    client.Entity.BoundCps += 100;
                                                   }
                                                else
                                                {
                                                    dialog.Text("Your item is bound.");
                                                    dialog.Send();
                                                    break;
                                                   }
                                                }
                                                else
                                                {
                                                    dialog.Text("You do not have the item");
                                                    dialog.Send();
                                                    break;
                                                }
                                                break;
                                            }
06/16/2013 02:45 hacksaw#5
Hmmm just having a test but looks like you cant do the Bound Item check using that way.
06/16/2013 02:49 LordGragen.#6
you trying like this right?
(client.Inventory.Contains(1058011, 1))

and oh btw i think this is testing if there is only 1 in inventory, idk if you have more then one it will work but test.
06/16/2013 13:51 hacksaw#7
Yeah thats the normal way its handled when talking to an NPC & asking them to check if the player has an item in his bag but the problem is you cant seem to do a check on wether the item is bound or not.