TrinityCore Latest Rev: How to add more “heroic” affixes to items in the core? menu

User Tag List

Results 1 to 4 of 4
  1. #1
    Teryaki's Avatar Legendary Explorer CoreCoins Purchaser
    Reputation
    667
    Join Date
    Mar 2010
    Posts
    950
    Thanks G/R
    103/82
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    TrinityCore Latest Rev: How to add more “heroic” affixes to items in the core?

    Hey Guys!

    Been working on a server and had one question regarding items. There is a flag in TrinityCore to add the “heroic” affix to an item so it shows as grew in the items description. Is it possible to add more affixes to the core? For example, I need an affix that says “Solo” and “LAN Party”. I am able to edit the current “heroic” affix to say one of these, but I need to add more flags so I can differentiate the items. I’m not the best at core editing, so I wasn’t sure how to add more flags to allow those to show on items.

    Thanks!

    PS Off Topic: does anyone know of any good guides on how TrinityCore phasing works? Such as after quest completion, mob killing, etc.
    My Exploration Channel: Teryaki's Channel
    Teryaki#1806

    TrinityCore Latest Rev: How to add more “heroic” affixes to items in the core?
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1614
    Join Date
    Sep 2007
    Posts
    4,558
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    This sort of thing is quite a specific request where a lot of knowledge is required to achieve it. You are in luck, there is a tutorial for adding custom item affixes here: Creating a new item flag (HEROIC DISPLAY)

    Phasing works via a bitmask. All creatures, players, and gameobjects have a phase bitmask and these are compared to see if one can see the other. I refer you to here: What is a bitmask and a mask? - Stack Overflow

    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:
    PHP Code:
    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):

    PHP Code:
    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 (Hex Calculator - Addition, Subtraction, Multiplication & Division), 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:

    PHP Code:
    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):

    PHP Code:
    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:

    PHP Code:
    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

    PHP Code:
    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.



    [img][https://i.imgur.com/iCUUyw2.jpg[/img]
    PS: in this SS i named my custom flag to Titanforged.
    Bits and Bytes

    In computing, numbers are internally represented in binary. This means, where you use an integer type for a variable, this will actually internally will be represented as a summation of zeros and ones.

    As you might know, a single bit represents one 0 or one 1. A concatenation of eight of those bits represent a Byte, e.g. 00000101, which is the number 5. I presume you know how numbers are represented in binary, if not, take a look here.

    In PHP a number is (mostly) 4 Bytes long. This means that your number actually uses 32 bits of the internal storage. But for simplicity reasons, throughout this answer I will use 8 bit numbers.

    Storing states in bits

    Now imagine you want to create a program that holds a state, which is based on multiple values that are one(true) or zero(false). One could store these values in different variables, may they be booleans or integers. Or instead use a single integer variable and use each bit of its internal 32 bits to represent the different true and falses.

    An example: 00000101. Here the the first bit (reading from right to left) is true, which represents the first variable. The 2nd is false, which represents the 2nd variable. The third true. And so on...

    This is a very compact way of storing data and has many usages.

    Bit Masking

    This is where bit masking comes in. It sounds complex but actually it's very simple.

    Bit masking allows you to use operations that work on bit-level.

    Editing particular bits in a byte(s)
    Checking if particular bit values are present or not.
    You actually apply a mask to a value, where in our case the value is our state 00000101 and the mask is again a binary number, which indicates the bits of interest.

    By performing binary operations on the mask and the state one could achieve the following:

    The AND operator extracts a subset of the bits in the state
    The OR operator sets a subset of the bits in the state
    The XOR operator toggles a subset of the bits in the state
    If we want to set a particular value to true, we could do this by using the OR operator and the following bit mask:

    Mask: 10000000b
    Value: 00000101b
    ---- OR ---------
    Result: 10000101b
    Or one could select a particular value from the state by using the AND operator:

    Mask: 00000100b
    Value: 00000101b
    ---- AND ---------
    Result: 00000100b
    I suggest you to take some deeper look into it and get familiar with the jargon. A good start may be this link.

    Goodluck!
    Last edited by stoneharry; 06-20-2019 at 03:57 PM.

  3. Thanks Teryaki (1 members gave Thanks to stoneharry for this useful post)
  4. #3
    Teryaki's Avatar Legendary Explorer CoreCoins Purchaser
    Reputation
    667
    Join Date
    Mar 2010
    Posts
    950
    Thanks G/R
    103/82
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Stoneharry, you’re a lifesaver! (Sorry for the late response)

    EDIT: Just wanted to add a screenshot, I got it working and was able to change the color! Now to see if I can add a third option. Thanks again!

    Last edited by Teryaki; 08-08-2019 at 11:52 PM.
    My Exploration Channel: Teryaki's Channel
    Teryaki#1806

  5. Thanks stoneharry (1 members gave Thanks to Teryaki for this useful post)
  6. #4
    terjteny's Avatar Member
    Reputation
    1
    Join Date
    Jan 2024
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm having trouble doing this. Is it possible to have some assistance with it?

Similar Threads

  1. [READ] How to post in the Exploits Section
    By Conflag in forum World of Warcraft Exploits
    Replies: 34
    Last Post: 05-12-2008, 12:44 AM
  2. How to post in the gold seller section?
    By burnzy12 in forum World of Warcraft General
    Replies: 2
    Last Post: 02-17-2008, 11:29 AM
  3. HOW TO swim in the air 2.1.0+
    By BrantX in forum WoW EMU Guides & Tutorials
    Replies: 1
    Last Post: 09-14-2007, 11:43 AM
  4. how to slide in the air on your flying mount
    By warlock_hellfire in forum World of Warcraft Exploits
    Replies: 9
    Last Post: 05-10-2007, 10:24 AM
  5. [READ] How to post in the Bots and Programs section .
    By Flying Piggy in forum World of Warcraft Bots and Programs
    Replies: 15
    Last Post: 03-31-2007, 08:47 AM
All times are GMT -5. The time now is 05:12 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search