Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static bool HandlePhaseSkyboxCommand(ChatHandler * handler, char const* args)
- {
- if (!*args)
- return false;
- char const* pId = strtok((char*)args, " ");
- Player* player = handler->GetSession()->GetPlayer();
- QueryResult results = WorldDatabase.PQuery("Select ID, Skybox from light_reference where mapid = %u and (POWER(x - %f, 2) + POWER(y - %f, 2) + POWER(z - %f, 2)) < POWER(FalloffEnd, 2) order by FalloffEnd = 0, FalloffEnd", player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
- Field* fields = results->Fetch();
- uint32 replaceID = uint32(atoi(pId));
- uint32 lightId = fields[0].GetUInt32();
- WorldPacket data(SMSG_OVERRIDE_LIGHT, 12);
- data << lightId;
- data << replaceID;
- data << 200;
- handler->GetSession()->SendPacket(&data, true);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement