Basically, I have taken the code that was in the PR: https://github.com/azerothcore/mod-aoe-loot/pull/7 and I have managed to make it work (in part), because what is missing, is that the script is also executed when the drop is gold. Because if it is an item, it works fine, although it does not update the amount of gold generated in the chat, if the player receives it. I don't know if I'm implementing the hooks wrong, or what will be the reason, but I wanted to upload the progress, in case someone wants to take the code, or has any suggestion, that allows to finish it.
Basically, I have taken the code that was in the PR: https://github.com/azerothcore/mod-aoe-loot/pull/7 and I have managed to make it work (in part), because what is missing, is that the script is also executed when the drop is gold. Because if it is an item, it works fine, although it does not update the amount of gold generated in the chat, if the player receives it. I don't know if I'm implementing the hooks wrong, or what will be the reason, but I wanted to upload the progress, in case someone wants to take the code, or has any suggestion, that allows to finish it.