Search code examples
azerothcore

Is it possible to have a NPC offer items only to characters with a certain achievement?


Im looking for a way to add an NPC which sells items based on the achievements a character has. Because of my lack of other coding skills, if at all possible i would like to achieve it with SQL commands, hence modifying the db. I was looking through the conditions page on the wiki but have no idea how to use the provided information.

Also i was backtracing the db regarding the NPC Charles Worth who happens to teach tailors recipes based on achievements they have. I intended to copy this toons conditions, but couldnt find what entries to use.

Any help, clarifying db entries, or pointing to the right direction in another way, is much appreciated.


Solution

  • Please follow this link for the documentation: https://www.azerothcore.org/wiki/conditions

    You can use the source type: "SOURCE_TYPE_NPC_VENDOR" and the condition type: "CONDITION_ACHIEVEMENT" for what you need, how to implement this, you can find that in the link above. Also, one way to make this easier is to use the tool developer by the azerothcore team, Keira3.

    This is a very visual Database Editor and can help you understand what each column do as almost each cell is documented and you have links to the full documentation as well.

    Keira3 link: https://github.com/azerothcore/keira3