Jump to content

Custom weapons after 3.3.0


Guest bosc0

Recommended Posts

Hello there, im having some issues with custom weapons that dont get recognized by the game as melee weapons, in consequence any spell that require a melee weapon equipped wont work and will give the "Must have a melee weapon equipped in the main hand" message back to the user.

So from what i know (and from what VladimirMangos told me) mangos send all data from DB in item data requests from client. But client now partly ignore this data and use own taking them from DBC. Before this only affected icons in inventory but now this have a more wide effect.

So since we cant make the client understand we really have a weapon equipped, maybe we can eventually try to "cheat him" and make him believe the spell we are trying to cast doesnt require a melee weapon equipped, after an eventual internal check in the core to see if the item needed from the spell is equipped(if there isnt already).

I dont really know how this works but i think that maybe someone that knows something more than me about packet snifing and coding will clear me out some more infos about that.

I dont expect someone to give me a patch for that, but maybe someone writing maytbe the part of the core that handle spell check for equipped weps, someone else writing some other usefull part of the core and so on we can eventually work out something.

I know im not an expert coder but im willing to learn and im smart enought to work with some c++ (i just have school skills :P.. really crappy school btw lol) and after all, mangos is made for learning purpose, so whats better to learn and have fun at the same time :P

Link to comment
Share on other sites

I already found some IDS not used in DB with proper CLASS and SUBCLASS fields, to update the entry in the DB I know I should run something like:

UPDATE item_template SET entry = '1313' WHERE entry = '75000';

Now the question is, what should I run in order to update characters inventory? I dont feel like manually changing all the custom items ingame. I know I have to run a query to update characters.character_inventory and item_instance, I know it have to be something like

UPDATE character_inventory SET item_template = '1313' WHERE item_template = '75000';

The problem is that I dont know what should I run in order to update item_instance, hope someone could help us with any idea =)

Thanks in advance for your help.

Link to comment
Share on other sites

I looked trought the DBC and seen a little bit how the items.dbc works, but in example if i want to have a dagger i will have to use the id stored as dagger into the dbc since the game now read from them, so i wont just have to find an unused id but find some unused id stored as dagger (or else we will have the same issue).

I looked intot he dbc and i didnt really find many unused ids except the blank one (doest work, still see as no melee weapon is equipped)

Correct me if im wrong but with a work arround we wont be using IDs already in the DBC that may get used again in the future by B******d.

And sorry voldemort but i dunno what u should run to update item_istance.. and as far as i know most of the items called just ITEM (like the 1313 u posted up here) are items used by NPCs, max u will see an npc with a custom item wquipped in place of the weapon he is supposed ot wield.

So i think u got a good idea up here, well but i think that if u will use those ids u will eventually get a wrong item icon but it should work properly, imma give it a try later :)

Link to comment
Share on other sites

I already found some IDS not used in DB with proper CLASS and SUBCLASS fields, to update the entry in the DB I know I should run something like:

Now the question is, what should I run in order to update characters inventory? I dont feel like manually changing all the custom items ingame. I know I have to run a query to update characters.character_inventory and item_instance, I know it have to be something like

The problem is that I dont know what should I run in order to update item_instance, hope someone could help us with any idea =)

Thanks in advance for your help.

So you want to change the entry of al 75000 items to 1313? Is that correct?

Link to comment
Share on other sites

@ bosc0 I get the Data from the DBC, and the id 1313 is the id for a dagger stored in the DBC but not in DB (u cant find it even in wowhead) but as I say it is in DBC like a Dagger (Use MyWarcraftStudio to read DBC, get fields comparing them with current DB, update dbclayout_3.2.2 to add fields not added in Item.dbc extract and insert dbc_item to DB and start comparing class and subclass fields to get entrys not in DB, already got IDS for custom weapons I got)

@Mordaunt: YES, thats is exactly what I want to do, change the entry of all 75000 items to 1313 (thats just an example, but I can get the example and change values for the IDS I got)

Link to comment
Share on other sites

Well, finally I could came to the correct query.

Just replace the

  1. and <NEWENTRY> marks in the following query.



UPDATE `item_instance` SET `data`=CONCAT(CAST(SUBSTRING_INDEX(`data`, ' ', 3) AS CHAR), ' ', <NEW ENTRY>, ' ',
CAST(SUBSTRING_INDEX(`data`, ' ', -61) AS CHAR)) WHERE CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 4), ' ', -1) AS UNSIGNED) = [list=1];
UPDATE character_inventory SET item_template = <NEWENTRY> WHERE item_template = [list=1];

Here an example



UPDATE `item_instance` SET `data`=CONCAT(CAST(SUBSTRING_INDEX(`data`, ' ', 3) AS CHAR), ' ', 1313, ' ',
CAST(SUBSTRING_INDEX(`data`, ' ', -61) AS CHAR)) WHERE CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 4), ' ', -1) AS UNSIGNED) = 75000;
UPDATE character_inventory SET item_template = 1313 WHERE item_template = 75000;

Link to comment
Share on other sites

good, thanks for the code, but there is another issue as i see, now the client takes also the display ids from his own DBC files i believe... So no more custom display weps if we dont make some sort of workarround for it, i tryed this patch but just now i deleted my cache and i found out the dagger i converted just look like a normal dagger <.<.. not using the modei i set up in the db.

So i dont know what to do about that, i dont see really any use if i cant chose the look of custom weapons...

I guess we will have to find another way for this, or anywya keep the display ids we get by using those random ids from the DBC.

Link to comment
Share on other sites

будет какой-то патч в ядро вноситься или начинать присваивать своим вещам существующие номера?

will be some patch to the kernel made? or start assigning things to their existing numbers?

Link to comment
Share on other sites

I tested the SQLs to exchange the weapons id and it worked, the items actualy works now, but the thing that annoy me more its the display ids of them, i cant change them in any way except completly changing the ID of the item, does this means the client now takes the display id info from his own DBC or its just the server that takes the infos fromt he stored DBC files? if its esrver side can i get a little suggestion on where to look where this is handled in the core please? I will work on it if i know where to work :P

Link to comment
Share on other sites

будет какой-то патч в ядро вноситься или начинать присваивать своим вещам существующие номера?

will be some patch to the kernel made? or start assigning things to their existing numbers?

I think aleready has been writed: this is client side problems and core not related to weapon not work....

Link to comment
Share on other sites

Thats not really a patch lol, its more likely just telling the server to ignore his own DBC check and send the disp id stored in the DB anyway.

But it do what i needed too without any notable stability issue.

Tested on Mangos rev 9201 + scriptdev2 + teleportnpc

@@ -1717,15 +1717,15 @@ void ObjectMgr::LoadItemPrototypes()
            {
                sLog.outErrorDb("Item (Entry: %u) not correct %u inventory type, must be %u (still using DB value).",i,proto->InventoryType,dbcitem->InventoryType);
                // It safe let use InventoryType from DB
            }

-            if(proto->DisplayInfoID != dbcitem->DisplayId)
+            /*if(proto->DisplayInfoID != dbcitem->DisplayId)
            {
                sLog.outErrorDb("Item (Entry: %u) not correct %u display id, must be %u (using it).",i,proto->DisplayInfoID,dbcitem->DisplayId);
                const_cast<ItemPrototype*>(proto)->DisplayInfoID = dbcitem->DisplayId;
-            }
+            }*/
            if(proto->Sheath != dbcitem->Sheath)
            {
                sLog.outErrorDb("Item (Entry: %u) not correct %u sheath, must be %u  (using it).",i,proto->Sheath,dbcitem->Sheath);
                const_cast<ItemPrototype*>(proto)->Sheath = dbcitem->Sheath;
            }

just commented the item id-to-dbc check

Link to comment
Share on other sites

Could a patch like that not be used to circumvent the entire issue? I mean some servers I'm sure like mine have many many custom items. It would take an extremely long time for those people to change all of the items involved to unused ones in the DB finding items with the correct fields and such.

Could a patch not be made like the one above that simply tells the client to continue retrieving the items info out of the DB entirely, or however it did it in previous versions?

Link to comment
Share on other sites

Ok, display part as show above still used from DB by client. Mangos have DBC preference in use because this more stable (no client crashes at wrong display id)

tells the client to continue retrieving the items info out of the DB entirely
Do you read thread?

client still read data from DB but _ignore_ some. In in ignored part you can;'t do anything.

Link to comment
Share on other sites

get a bunch of your devs to work on all the items needed, i didnt find another way but i can tell i created this script for all the weapons and all the shields and now all works fine as far as i know(for 1000+ items).

I had luck finding the correct items all classified by Class and Subclass so it didnt take so long, too bad i dont have this list i used anymore since i oweritted the unused IDs...

Link to comment
Share on other sites

I have similar problem, but just with c*stom item display icons (?). So, yes I know that this is a really really old problem with the c*stom items, I've done some reading, but still couldn't find a way to "force" the client display real icons rather then "?" in character's inventory and bank. And no, I do not want to "fix" this by installing some addons - I want to fix it from the root.

So what I tried is bit hacky - to edit .dbc item files like my custom item is already in the .dbc, (like any other "official item", which is created by B******)

So this is what I did while using MaNGOS 9200, no custom patches, UDB (DB for 3.2.2 client):

1) I made my custom item with ID entry 52063 in the item_template in my sql DB

2) Opened It*m.dbc and created a new entry at the bottom with entry 52063 (on client 3.3 in It*m.dbc the greatest item ID is 52062, so the next one would be my custom item (a+1)).

3) For display values of my "new custom item" in It*m.dbc I copy/pasted display ID 1399, which was already used by other "retail items", which do not show like "?".

After this procedure I still can't get rid of that "?" mark. Correct me if I'm wrong, but basically I think that, the "realm display info" is hold in ItemDisplayInfo.dbc, and by creating a n*w item entry in Item.dbc and pointing it's values to already existing "retail" display info" in ItemDisplayInfo.dbc should produce a result like if the item was created by B*******.

I think that it's not working, because probably there are some more .dbc relations with other .dbc files, which I still don't know about.

Please - if somebody has a already a fix for this custom item "?" icon display issue, do not hesitate to post here, or if the fix requires client/client file mod*f*cation on PM ( for obvious reasons :) )

To the "copyright lawyers": I dared to edit the .dbc files only for my very personal, educational, non-commercial purpose. I don't support the non-educational modifying of the client and it's files.

Link to comment
Share on other sites

Oh, now as I think:

OK, I've got the custom item with correct display icon and info in my SERVER .dbc, so we assume that the server sends the info to the player telling that "this custom item has this display icon" (reading from this his server .dbc s), however the player's client does not have in his .dbcs the new custom item with the new display icon, so this is why player client still can't procude the correct icon for the "custom item".

Someone please tell me if my reasonings are correct or no. :)

Link to comment
Share on other sites

Well yes I did read the thread.. What I was asking was cause we use a commnet line or something that would allow the Custom items To be sent from DB as normal so that they would be recognized as (Main hand or Shield or such)

Or maybe a line something like If Itementry > 50000 then select * `entry` from `item_template` where `entry` = 'Itemid'

Now before anyone complains that they sentence is wrong or wouldnt even work I KNOW that. I wasnt suggesting that line itself be used.. just an example of how I meant it.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use