View Full Version : [SOLVED] [Help] C++ Npc registers players on Event

07-02-2014, 03:02 PM
Good afternoon Administration and Users of Emuduevs:)

I need to your help. I for players did interesting world event, that is started every hour.

My problem consists of that I own a language С++ and I need to do Npc, through that players will be reg at npc, and when the necessary amount of players will accumulate them will throw on coordinates on a battle-field!

I very ask to help to realize this idea!

07-02-2014, 07:13 PM
I didn't understand this at all. As far as I can tell, you want to iterate through map (or vector, etc) elements after a certain amount of players queue up and port them to a battlefield?

07-02-2014, 07:14 PM
You should make container to store the player guids that sign up.
Here is a simple unthreadsafe set of functions.
Basically the idea is to just use gossip to sign up and use QueAdd(guid) to add the player by guid to the que.
The script will automatically then when the limit is reached, teleport the players to the designed location.

It will also do a check if the players actually exist etc. Do note that this is a very simple script.
You should take a look at the teleporting commands for a better view at what should be done when teleporting players.
Also this would allow them to teleport from instances, bg and so on so be wary of what you are doing.

static const uint32 maxPlayers = 50;

std::set<uint64> queuedPlayers;

void QueTryTele()
std::list<uint64> to_erase;
std::list<Player*> players;

for (uint64 guid : queuedPlayers)
Player* player = ObjectAccessor::FindPlayer(guid);
if (player)

for (uint64 guid : to_erase)

for (Player* player : players)
player->TeleportTo(map, x, y, z, o);
bool QueHas(uint64 guid)
return queuedPlayers.find(guid) != queuedPlayers.end();
void QueRemove(uint64 guid)
void QueAdd(uint64 guid)
if (queuedPlayers.size() >= maxPlayers)

07-05-2014, 11:00 AM
As I already talked, I understand nothing in With++.

Went through a code saw, line with coordinates, and I need that threw players on 2 points, alliance on the coordinates of alliance, and horde on the coordinates of horde.

or all right in cod. I beg pardon beforehand

07-08-2014, 07:20 PM
Nobody understands what you mean. Are you using a translator? If not, I would recommend in using one so we can understand what you're wanting.