[DiscordArchive] Anyone know how to get info about respawn time of creature that is somewhere in world ?
[DiscordArchive] Anyone know how to get info about respawn time of creature that is somewhere in world ?
Archived author: hguy • Posted: 2021-01-22T19:23:21.159000+00:00
Original source
Anyone know how to get info about respawn time of creature that is somewhere in world ?
Archived author: hguy • Posted: 2021-01-22T19:23:33.393000+00:00
Original source
if (Creature* boss1 = ObjectAccessor::GetCreature(*player, BOSS_ID_1))
{
if (boss1->isDead())
g1 << "Test: |cffff0000DEAD|r\n" << "> |cffDA70D6Respawn in " << secsToTimeString(uint32(boss1->GetRespawnTime()));
Archived author: Kitzunu • Posted: 2021-01-22T19:25:53.820000+00:00
Original source
I may be wrong, but I think the command `.npc info` shows the respawn time of a dead creature. That way you could look in the command to see how it works.
But I can't remember if that works on AC or if it was on TC
Archived author: Kitzunu • Posted: 2021-01-22T19:27:32.029000+00:00
Original source
but you'd probably need to get the GUID of the creature
Archived author: hguy • Posted: 2021-01-22T19:30:06.392000+00:00
Original source
I just don't know how to find creature by guid in the world
Archived author: hguy • Posted: 2021-01-22T19:31:34.003000+00:00
Original source
// these functions return objects if found in whole world
// ACCESS LIKE THAT IS NOT THREAD SAFE
static Pet* FindPet(uint64);
static Player* FindPlayer(uint64);
static Creature* FindCreature(uint64);
Archived author: hguy • Posted: 2021-01-22T19:36:30.392000+00:00
Original source
maybe like this ?
Archived author: hguy • Posted: 2021-01-22T19:36:30.921000+00:00
Original source
if (Creature* boss1 = ObjectAccessor::GetObjectInWorld(BOSS_ID_1, creature))
Archived author: hguy • Posted: 2021-01-22T19:45:34.908000+00:00
Original source
Found it if (Creature* boss1 = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(BOSS_ID_1, 200001, HIGHGUID_UNIT), (Creature*)NULL))