EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   General::General Discussion (https://www.eqemulator.org/forums/forumdisplay.php?f=586)
-   -   #itemsearch GUI ... ? (https://www.eqemulator.org/forums/showthread.php?t=26896)

Furinex 12-03-2008 05:13 AM

#itemsearch GUI ... ?
 
I had a thought today. I wonder if we could make a UI addon that tied into #itemsearch and #summonitem so you could visually see the item's stats before summoning. It would be pretty useful for GM's i think. Using the baseline for the window, we could use the bazaar UI window, but instead of searching for bazaar items, it could refer to the #itemsearch command instead, and probably could throw a button in for a #summonitem command. I dunno, just an idea, any thoughts?

yoman258 12-03-2008 08:07 AM

OH MY AND/OR YOUR GOD!!! That is exactly what is needed. I have always thought about wanting something like this, but I didn't have any wya to implement it to be useful. But using the bazaar window type thing sounds perfect. I hope someone with the knowledge can confirm if this can be done or not.

liquest 12-07-2008 10:05 PM

Quote:

Originally Posted by Furinex (Post 160860)
I had a thought today. I wonder if we could make a UI addon that tied into #itemsearch and #summonitem so you could visually see the item's stats before summoning. It would be pretty useful for GM's i think. Using the baseline for the window, we could use the bazaar UI window, but instead of searching for bazaar items, it could refer to the #itemsearch command instead, and probably could throw a button in for a #summonitem command. I dunno, just an idea, any thoughts?

this would be great, and usefull for that fact. if it was implemented it would be easy

Richardo 12-08-2008 01:07 AM

Quote:

Originally Posted by Furinex (Post 160860)
I had a thought today. I wonder if we could make a UI addon that tied into #itemsearch and #summonitem so you could visually see the item's stats before summoning. It would be pretty useful for GM's i think. Using the baseline for the window, we could use the bazaar UI window, but instead of searching for bazaar items, it could refer to the #itemsearch command instead, and probably could throw a button in for a #summonitem command. I dunno, just an idea, any thoughts?

I believe that UI creation/editing is a lost art my friend.

trevius 12-08-2008 01:11 AM

Making a UI for that would probably be pretty tough. But, I was thinking of an idea that might help a little for admins. The idea is to make a command that will pop up an item stats window just like you had clicked an item link, or right clicked an item. Basically, you would search for items and then type something like #itemlink <Item ID>, or #il <Item ID> for short. Then, it would just pop up the window for stats. This would save a little time from having to summon the item, put it in your inventory, then right click to show the stats. I always check item stats before using the #giveitem command to verify that I am giving the correct item. This command would help a bit for doing that.

The code there DOES NOT work yet, it is just there as a place to start working on it. Hopefully I or someone else can get it working at some point. Here is a link to the post on my site about it:
http://stormhavenserver.com/forums/v...php?f=25&t=578

cavedude 12-08-2008 01:22 AM

Why not just have #finditem list the item link instead of just the name?

trevius 12-08-2008 01:34 AM

That is an AWESOME idea, CD! Genius! I am definitely gonna see if I can figure out how to do that lol. I also might increase the output max of finditem to higher than 20 unless anyone apposes. I think 50ish would be better. Oh, and I think an alias command of #fi would help a bit too. That is an easy little fix.

trevius 12-08-2008 06:57 AM

Well, that was WAY easier than I thought it would be lol (took like 5 minutes to do). I am going to add this to the SVN right now :)

command.cpp - Replace the old itemsearch command with this (changes are in RED):
Code:

void command_itemsearch(Client *c, const Seperator *sep)
{
        if (sep->arg[1][0] == 0)
                c->Message(0, "Usage: #itemsearch [search string]");
        else
        {
                const char *search_criteria=sep->argplus[1];

                const Item_Struct* item = 0;
                if (Seperator::IsNumber(search_criteria)) {
                        item = database.GetItem(atoi(search_criteria));
                        if (item)
                                c->Message(0, "  %i: %c%06X000000000000000000000000000000000000000%s%c",(int) item->ID,0x12, item->ID, item->Name, 0x12);
                        else
                                c->Message(0, "Item #%s not found", search_criteria);
                        return;
                }
#ifdef SHAREMEM
                int count=0;
                //int iSearchLen = strlen(search_criteria)+1;
                char sName[64];
                char sCriteria[255];
                strn0cpy(sCriteria, search_criteria, sizeof(sCriteria));
                strupr(sCriteria);
                char* pdest;
                int32 it = 0;
                while ((item = database.IterateItems(&it))) {
                        strn0cpy(sName, item->Name, sizeof(sName));
                        strupr(sName);
                        pdest = strstr(sName, sCriteria);
                        if (pdest != NULL) {
                                c->Message(0, "  %i: %c%06X000000000000000000000000000000000000000%s%c",(int) item->ID,0x12, item->ID, item->Name, 0x12);
                                count++;
                        }
                        if (count == 50)
                                break;
                }
                if (count == 50)
                        c->Message(0, "50 items shown...too many results.");
                else
                        c->Message(0, "%i items found", count);
#endif
        }
}

I am going to add the #fi alias for finditem as well. This command is awesome! Thanks CD for the idea lol. I don't know why no one thought of this before now!

EDIT: The more I play with this command, the more I love it! It's just so freakin cool! This is now in Revision 237. Lemme know how you like it, or if there are any changes/fixes that are needed.

Zeice 12-08-2008 11:25 AM

I added those changes and I can't get it to work. Am I supposed to do something other than just save the file like compile it or anything?

Furinex 12-08-2008 01:08 PM

UI creation might be lost for some, but Im in the process of incorporating a modified Bazaar UI window that will do the #itemsearch command and list more than 20. The max I seem I could get it to show is 50 atm, but im working on maxing that out. I will post UI files when I get this working, shouldnt take me more than a week, im Underway right now so I dont have my computer with me and I dont have the tools nessisary. Anyways, I'll post back with more info when I get back home.

AndMetal 12-08-2008 03:04 PM

Quote:

Originally Posted by trevius (Post 161088)
But, I was thinking of an idea that might help a little for admins. The idea is to make a command that will pop up an item stats window just like you had clicked an item link, or right clicked an item. Basically, you would search for items and then type something like #itemlink <Item ID>, or #il <Item ID> for short. Then, it would just pop up the window for stats.

The code there DOES NOT work yet, it is just there as a place to start working on it. Hopefully I or someone else can get it working at some point. Here is a link to the post on my site about it:
http://stormhavenserver.com/forums/v...php?f=25&t=578

First of all, if we wanted to sent an item window, I think we can utilize something like this:
zone/client_packet.cpp
Code:

void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) {
                LDONItemViewRequest_Struct* item = (LDONItemViewRequest_Struct*)app->pBuffer;
                ItemInst* inst = database.CreateItem(item->item_id);
                if (inst) {
                        SendItemPacket(0, inst, ItemPacketViewLink);
                        safe_delete(inst);
                }
                return;
}

I was also working on a function to parse an item instance and return the "link" part that we need (so everything except the item name & null characters so we can use it for both links in the chat window & links in Task windows, etc). I haven't worked on it for a bit, and what I have so far doesn't work right due to some memory definitions, but here's the diff:
Code:

Index: zone/client.h
===================================================================
--- zone/client.h        (revision 229)
+++ zone/client.h        (working copy)
@@ -674,6 +674,7 @@
        void        SetStats(int8 type,sint16 set_val);
        void        IncStats(int8 type,sint16 increase_val);
        void        DropItem(sint16 slot_id);
+        bool        MakeItemLink(char *return_link, const ItemInst* inst);
        void        SendItemLink(const ItemInst* inst, bool sendtoall=false);
        void        SendLootItemInPacket(const ItemInst* inst, sint16 slot_id);
        void        SendItemPacket(sint16 slot_id, const ItemInst* inst, ItemPacketType packet_type);
Index: zone/inventory.cpp
===================================================================
--- zone/inventory.cpp        (revision 229)
+++ zone/inventory.cpp        (working copy)
@@ -477,7 +477,44 @@
        }
 }
 
+bool Client::MakeItemLink(char *return_link, const ItemInst *inst) {
+        //we're sending back the entire "link", minus the null characters & item name
+        //that way, we can use it for regular links & Task links
+        //note: initiator needs to pass us return_link
+        /*
+        if (!inst) //have to have an item to make the link
+                return false;
 
+        const Item_Struct* item = inst->GetItem();
+        //format:
+        //0        itemid        aug1        aug2        aug3        aug4        aug5        evolving?        loregroup        evolved level        hash
+        //0        00000        00000        00000        00000        00000        00000        0                0000                0                00000000
+        //length:
+        //1        5        5        5        5        5        5        1                4                1                8        = 45
+        //evolving item info: http://eqitems.13th-floor.org/phpBB2/viewtopic.php?t=145#558
+        //char link[45+1] = "0" "00000" "00000" "00000" "00000" "00000" "00000" "0" "0000" "0" "00000000";
+        int8 evolving = 0;
+        uint16 loregroup = 0;
+        int8 = evolvedlevel = 0;
+        int hash = 0;
+        return_link = sprintf(&link, "%1X%05X%05X%05X%05X%05X%05X%1X%04X%1X%08X",
+                0,
+                item->ID,
+                inst->GetAugmentItemID(0),
+                inst->GetAugmentItemID(1),
+                inst->GetAugmentItemID(2),
+                inst->GetAugmentItemID(3),
+                inst->GetAugmentItemID(4),
+                evolving,
+                loregroup,
+                evolvedlevel,
+                hash
+        );
+
+        return true;
+        */
+}
+
 void Client::SendItemLink(const ItemInst* inst, bool send_to_all)
 {
 /*

All you would have to do is feed an item instance to it, which would include augments.

If someone wants to mess with this, feel free.

trevius 12-08-2008 04:31 PM

Quote:

Originally Posted by Zeice (Post 161115)
I added those changes and I can't get it to work. Am I supposed to do something other than just save the file like compile it or anything?

Yes, once you make that change, you need to compile it :)

Furinex 12-26-2008 03:53 AM

Well I have an alpha of the bazaar window, im still out at sea (missed christmas :( ) but I should be back by new years, Im having issues uploading it from here... but here's what i've got so far. The window replaces ALT+K (Mp3 player) but it can replace any window you wish to specify (like the bandolier or whatever...Anyways, it opens just like the bazaar window, instead of "Find Trader", the button is replaced by "Summon Item". Ive also narrowed down the search paramiters so it looks for items by class, race, and all other specifications that you can do in the bazaar window. I will post this completed project when I get home. Later yall.

Richardo 12-26-2008 04:23 AM

I'll believe it when I see it. Hah-hah-hah.. :p

Gonner 12-26-2008 04:33 AM

You can use the /Buyer window in the bazaar to see the stats of everything. Sadly though its not my number but by name.


All times are GMT -4. The time now is 01:55 PM.

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