Hi, i wanna know how can i get the pointer to a creature that it is already spawned in the World.
I have the creature Guid, from a query “Select guid from creature where id = myentry”, then i write:
if (Unit* unit = sObjectAccessor->FindUnit(myguid))
if (Creature* creature = unit->ToCreature())
Do you have some other worldobject on the same map that you have access to?
For example if you are trying to do this stuff when a player does something and the creature should be near the player (on same map, probably in sight),
you have access to player (a worldobject).
Then you can do this:
Creature* creature = sObjectAccessor::GetCreature(*player, MAKE_NEW_GUID(dbguid, entry, HIGHGUID_UNIT));
You can get dbguid and entry from the database or w/e
Im hoping you are not in an instance /emoticons/default_smile.png