SpellCastTargets targets; ObjectGuid targetGuid = ...; // get target ID from somewhere Creature* target = targets.getUnitTargetIn this example, we create a "SpellCastTargets" object and obtain the target's GUID from some other part of the code. We then call the "getUnitTarget" method, specifying that we're looking for a "Creature" unit. If a creature was targeted, the method will return a pointer to that creature's object. We can then use that pointer to interact with the creature in some way. The TrinityCore game server emulator package library is used for game server programming in the World of Warcraft game.(targetGuid); if (target) { // do something with targeted creature }