View Full Version : GetNearest Method

01-07-2014, 02:13 PM
Hi, I am very new to Eluna, so wondering how exactly does how "GetNearestTarget" methods work?
I constantly get error when using them.
Actually I want to use this method:

01-07-2014, 02:17 PM
What error are you getting? And post the script if possible :)

01-07-2014, 03:34 PM
Error i get is not while loading scripts, but when boss fight starts!
I get:
boss_JergoshInvoker.lua:9:attempt to call method 'GetNearestHostileTargetInAggroRange' <a nil value>

Here is code:

01-07-2014, 05:09 PM
If you look in LuaFunctions.cpp, you will see that most of what we have is commented out until Mangos supports them: https://github.com/ElunaLuaEngine/Eluna/blob/master/TrinityCore/WotLK/src/LuaEngine/LuaFunctions.cpp#L614-L616

You can freely uncomment them if you want, but once Mangos supports those, the structure will be changed.

01-07-2014, 05:57 PM
I use Trinity.
So its not supported yet?

01-07-2014, 06:04 PM
I use Trinity.
So its not supported yet?

I know you're using Trinity, what did you think I linked? Mangos? No. I gave you this link https://github.com/ElunaLuaEngine/Eluna/blob/master/TrinityCore/WotLK/src/LuaEngine/LuaFunctions.cpp#L614-L616 to show you that they are commented until Mangos supports them. You can uncomment the methods, but as I said, once Mangos supports them everything will change.

01-07-2014, 06:05 PM
Ok thanks