Creating a new item flag (HEROIC DISPLAY) using OD2.X(Xingyun86)

xingyun86 2018-11-13 2927

All credits to Grymskvll this was so helpful to me, maybe to some other too.

To add a custom tooltip line for Epic difficulty items, you need to make some changes to Wow.exe (or alternatively do some Lua tooltip modding).

This is for WotLK 3.3.5 12340

Backup your Wow.exe.

Also, this probably requires that you've already patched Wow.exe to load custom interface files.

Open up notepad and copy this over:

OFFSET_1 = 
OFFSET_2 = 
OFFSET_3 = 
OFFSET_4 = 
OFFSET_5 = 
OFFSET_6 =

Open Wow.exe in Ollydbg

Right click, search for -> All referenced strings

In the strings window, hit ctrl+f and find "ITEM_HEROIC".

Double click it and it'll take you to something that looks like this (the addresses might be slightly different):

00627BA3      F641 18 08               TEST BYTE PTR DS:[ECX+18],08
00627BA7      74 24                    JE SHORT 00627BCD
00627BA9  |> /56                       PUSH ESI
00627BAA  |. |6A FF                    PUSH -1
00627BAC  |. |68 4866A200              PUSH OFFSET 00A26648         ; ASCII "ITEM_HEROIC"
00627BB1  |> |E8 8A211F00              CALL 00819D40
00627BB6  |. |83C4 0C                  ADD ESP,0C
00627BB9  |. |56                       PUSH ESI
00627BBA  |. |68 402DAD00              PUSH OFFSET 00AD2D40
00627BBF  |. |68 402DAD00              PUSH OFFSET 00AD2D40
00627BC4  |> |56                       PUSH ESI
00627BC5  |. |50                       PUSH EAX
00627BC6  |> |8BCF                     MOV ECX,EDI
00627BC8  |. |E8 F382FFFF              CALL 0061FEC0              ; Wow.0061FEC0
00627BCD  |> |3975 F0                  CMP DWORD PTR SS:[EBP-10],ESI

Right click the first "PUSH ESI" line (2 higher than the line with the ASCII comment), Edit->Copy address

Paste the address after OFFSET_1 in Notepad

Do the same for "CALL 00819D40" as OFFSET_2

Do the same for "CMP DWORD PTR SS:[EBP-10],ESI" as OFFSET_3

Now scroll to the bottom where you just see a bunch of lines that say "DB 00" (you can press Page Up/Down to advance one page at a time). 

Pick a nice empty spot with 60 empty bytes. I chose 009DE3C0

Write down the address you choose as OFFSET_4

Calculate OFFSET_4 + 0x13 (http://www.miniwebtool.com/hex-calculator/), write it down as OFFSET_5.

Calculate OFFSET_4 + 0x24, write it down as OFFSET_6

Starting at your OFFSET_4, enter these lines, replacing OFFSET_# with your addresses:

TEST BYTE PTR DS:[ECX+18],01
JE SHORT OFFSET_5
PUSH ESI
PUSH -1
PUSH OFFSET_6
JMP OFFSET_2
TEST BYTE PTR DS:[ECX+18],08
JE OFFSET_3
JMP OFFSET_1

Press ctrl+G and go to OFFSET_6.

Right click the highlighted line, go to Edit -> Binary edit

Put your cursor at the leftmost place in the HEX field, right click and paste this (make sure "Keep size" is UNCHECKED):

49 54 45 4D 5F 48 45 52 4F 49 43 5F 45 50 49 43
5F 43 55 53 54 4F 4D 00 00 00 00

This will turn into ASCII "ITEM_HEROIC_EPIC_CUSTOM", which will be the name of our global Lua variable that holds the string we want to show in the tooltip.

Select all the red lines, right click -> Edit -> Copy to executable.

Don't close the popup, minimize it or drag it to the side so you can still find it.

Go back to the main window.

Press ctrl+G and go to OFFSET_1.

Select the two lines above it that say "TEST..." and "JE SHORT..."

Right click, Edit->Fill with NOPs

Then, with the red NOP lines still selected press space to edit them to:

JMP OFFSET_4
NOP

Select these 2 red lines, right click -> Edit -> Copy to executable.

Now go to the popup from before, right click -> Save to file...

Choose a name you'll recognize, like Wow_tooltip_test.exe.

Close OllyDbg.

Next you just need to add a string for ITEM_HEROIC_EPIC_CUSTOM to GlobalStrings.lua

Extract the most up-to-date GobalStrings.lua from your game archives (or if you've already modified it, grab your modified one).

Open GlobalStrings.lua, search for "ITEM_HEROIC_EPIC".

Under it, add this line, replacing the string with whatever you like

ITEM_HEROIC_EPIC_CUSTOM = "Epic Dungeon loot";

Save and pack into a custom MPQ or load it straight from WowInterfaceFrameXML

Finally, to create an item with this new tooltip line, set the 0x01 flag for the item in world.item_template.

If you're changing an existing item, remember to delete your client cache (WowcacheWDB).

If you don't know how to change the flag properly, take the old "flags" value from your world.item_template item row, convert to hex, add 0x01, convert back to decimal and enter it back into your database.

A warning is due, though. The 0x01 flag isn't used and its purpose is unknown, but it's possible that it will interfere with something. If the mod works but it crashes at a (random?) point, or has some other weird behavior, let me know. If this happens and you want to try to fix it, check documentation for the "flags" field in world.item_template and see which other flags are unused. You'll need to modify the condition we added for the 0x01 flag and update item flags.


PS: in this SS i named my custom flag to Titanforged.


×
打赏作者
最新回复 (0)
只看楼主
全部楼主
返回