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.
|