View Full Version : [Trinity] Setting creature as guardian for player

12-09-2014, 03:30 PM
Hello everyone. I have a script that gives a 10% chance to spawn a creature when the player kills a mob, and that creature then takes the displayid and level etc of said mob, and should then become the player's Guardian. For those of you who don't know, a guardian is like a pet except it's not like a primary minion (doesn't show up on your HUD or anything, just fights for you). Originally I was just going to set the cerature's faction to 1857, but that just makes it attack hostile mobs, so it won't rally defend you in PvP or against Neutral mobs.

So my question is, how can I set a creature as the guardian of another? (In this case, my player)

Script snippet: http://pastebin.com/DdL9zGGu

Thanks everyone, I really appreciate the help

12-09-2014, 04:49 PM
It is not currently possible by default. This is due to similar functionality not being directly available with same methods on MaNGOS based cores.
The functionality is implemented for TC in the core. You can uncomment the function in LuaFunctions.cpp and in UnitMethods.h. It may need some additional tweaking.