• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[Lua] Enchant visual system and gossip

Rochet2

Moderator / Eluna Dev
2EhB5.jpg
2Ehu7.jpg
2EhuV.jpg
2EhvA.jpg
2Ehw7.jpg
2EhyK.jpg
2Ehzr.jpg


I think it was Nerc who asked me about something and I got this idea of adding enchant visuals to items.
It would make noob items and others look a lot more epic if they had epic enchant visuals :p

So I started thinking what I would need and how it would work.
I knew it would probably be like the transmogrification system, but I didnt really want to start messing around with C++ and compiling and patches and all that.
I decided to use Eluna as it was already compiled to the server and had almost all functions needed.
Cause I am lazy like that, I also used player gossip to skip making an NPC or using hearthstone :)

I thought I would make it a system where when you get a weapon, it would automatically select one enchant visual randomly and add that to the item. (or none)
But I decided just to make a plain system and gossip to test it.

What it does:
You can use a chat command to open a menu (asd by default)
In this menu you can select main or off hand and then select an enchant.
All the enchant visuals are different and can be applied to most weapons.
The enchant is saved to database and you can re equip the items and relog and so on and the visual stays on.
*Note This script contains all unique enchant visuals.

There are a few variables in the script that you can modify and the script is built so that you can register the HELLO and SELECT functions for any unit gossip.

Get It:
http://pastebin.com/uqctudvj
Execute the SQL to your characters database
Add the code to scripts folder with .lua extention

Menu images:
http://puu.sh/2Ehro.jpg
http://puu.sh/2EhrP.jpg
 
Last edited:

DarkAngel

Wiki Author
Which one do you mean :)
The one with gossip or the one with random chance on loot?

I have tried both; The one with random chance on loot is my favorite.
That is not in any way implying that I do not like the interface :smile:

Regards, DarkAngel
 

Tommy

Founder
Rochet2, Script not work in last trinitycore.
You can help me?

You need to be more specific. If you're downloading TrinityCore/other from their repo, then you're downloading the wrong source for Eluna. Which ever emulator you want to download, you need to download the source from one of these links:

[Eluna TrinityCore WotLK](https://github.com/ElunaLuaEngine/ElunaTrinityWotlk)
[Eluna TrinityCore Cataclysm](https://github.com/ElunaLuaEngine/ElunaTrinityCata)
[Eluna cMaNGOS Classic](https://github.com/ElunaLuaEngine/ElunaMangosClassic)
[Eluna cMaNGOS TBC](https://github.com/ElunaLuaEngine/ElunaMangosTbc)
[Eluna cMaNGOS WotLK](https://github.com/ElunaLuaEngine/ElunaMangosWotlk)

However, if you're using one of Eluna's emulator sources, then you'll need to be more specific about which error you are getting. Paste the error or take a screenshot and show us.
 

Marko

Enthusiast
ERROR lua_scripts/ItemEnchant.lua:156: bad argument #1 to 'GetItemByPos' (value must be greater than or equal to 0)
Tried to put 0 or 1 or 15, 16 but always says "No item equipped in selected slot"
Any fix?
 

Rochet2

Moderator / Eluna Dev
ERROR lua_scripts/ItemEnchant.lua:156: bad argument #1 to 'GetItemByPos' (value must be greater than or equal to 0)
Tried to put 0 or 1 or 15, 16 but always says "No item equipped in selected slot"
Any fix?

-1 changed to 255
I fixed it in the original code in main post now.
 
Top