CoEmu clearinv NPC

07/14/2009 23:09 imported_spitt_fire911#1
Ok I just made this NPC on my own im learning #C.. So umm... It works and all.. but when I relog the items show up.. how do I make it not do that?

Code:
                case 10151://Clearinv NPC
                    {
                        if (LinkBack == 0)
                        {
                            Text("Would you like me to clear your Inventory?", CSocket);
                            Link("Yes", 1, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            foreach (Struct.ItemInfo Itm in CSocket.Client.Inventory.Values)
                            CSocket.Send(ConquerPacket.ItemUsage(Itm.UID, 0, Struct.ItemUsage.RemoveItem));
                            CSocket.Client.Inventory.Clear();
                        }
                    }
                    break;
07/14/2009 23:17 n0mansland#2
I'll look at it. One second
07/14/2009 23:32 alexbigfoot#3
Your code is rather LOTF? If you didnt know LOTF != CoEmu.

Code:
 case 10151: //Clearinv NPC
                    {
                        if (LinkBack == 0)
                        {
                            Text("Would you like me to clear your Inventory?", CSocket);
                            Link("Yes", 1, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            foreach(Struct.ItemInfo Itm in CSocket.Client.Inventory.Values)
                                CSocket.Send(ConquerPacket.ItemUsage(Itm.UID, 0, Struct.ItemUsage.RemoveItem));
                            CSocket.Client.Inventory.Clear();
                        }
                    }
                    break;
+
What should i worry about? You haxing me? Not a chance.
---------------------------------

Quote:
Originally Posted by n0mansland View Post
I'll look at it. One second
I'd love to see your version.
07/14/2009 23:52 imported_spitt_fire911#4
I made the NPC for for CoEmu.. and just used the

Code:
                            foreach(Struct.ItemInfo Itm in CSocket.Client.Inventory.Values)
                                CSocket.Send(ConquerPacket.ItemUsage(Itm.UID, 0, Struct.ItemUsage.RemoveItem));
                            CSocket.Client.Inventory.Clear()
From Lotf
07/15/2009 00:32 danielachraf#5
does coemu have MyChar ?
07/15/2009 00:37 alexbigfoot#6
thats a GREAT guess. i think just thread owner's coemu source has "MyChar" and all variables from LOTF. -> Noobs just copy and paste.
07/15/2009 01:31 arab4life#7
good job import
07/15/2009 02:16 imported_spitt_fire911#8
ty arab4life... So I do do it correct?? Sweet.....
07/15/2009 09:57 alexbigfoot#9
Quote:
Originally Posted by imported_spitt_fire911 View Post
ty arab4life... So I do do it correct?? Sweet.....
Of course not. thats why i reply with the good version, even though it doesnt delete the items from database, but it removes the items for moment.
07/15/2009 11:18 tanelipe#10
Try not to be so harsh and don't use expressions like 'dipshit' etc.
07/15/2009 12:07 JustChillin#11
#request close, thread starter got what he wanted, Dont need more useless flame
07/15/2009 12:08 tanelipe#12
Actually no.. he was asking how to save the items so they won't be gone even after relog.

@Threadstarter: Save the new inventory to database with the new values.
07/15/2009 12:10 imported_spitt_fire911#13
# Request NOT CLOSE...... Cause i did not want it to be closed... and im still waiting for a reply on the save
07/15/2009 13:38 f0am#14
Quote:
Originally Posted by imported_spitt_fire911 View Post
# Request NOT CLOSE...... Cause i did not want it to be closed... and im still waiting for a reply on the save
You try yourself? Atleast worked on it 3 days or more?
07/15/2009 20:36 imported_spitt_fire911#15
Ya.. I've looked for awhile... im starting to have the save problem alot... idk how to set a save on them.... like..... my cps... clearinv...... CPs wont save.... clearinv doesn't take them from database.. just takes them outa ur inv till u log back in. lol