//In Handlers/Quest.cpp, place this code under this:
// if (npc->index == npc_index && npc->Data()->type == ENF::Quest && character->InRange(npc))
//In Quest_Use
if ((npc->Data()->vendor_id = static_cast<int>(npc->map->world->config["TopPlayersID"])))
{
int distance = util::path_length(character->x, character->y, npc->x, npc->y);
if(distance < 12)
{
PacketBuilder reply(PACKET_QUEST, PACKET_DIALOG, 10);
reply.AddByte(2);
reply.AddShort(0);//4
reply.AddShort(0);//4
reply.AddThree(3);
reply.AddByte(255);
reply.AddShort(0);//qid
reply.AddBreakString("Top Players");
int count = 1;
UTIL_FOREACH(npc->map->world->characters, character)
{
count += 1;
reply.AddShort(2);
reply.AddShort(count);
reply.AddBreakString(character->name);
reply.AddShort(2);
reply.AddShort(count + 1);
reply.AddBreakString("Level / Exp [" + util::to_string(character->level) + " / " + util::to_string(character->exp) +"]");
}
if (character->InRange(npc))
{
character->player->client->Send(reply);
}
}
}
//Then in a config, place this.
//## Interactable NPCS ##
//## TopPlayersID (Number) ##
//# Quest ID for a top players dialog npc
//TopPlayersID = 1