SHARE
TWEET

Untitled

a guest Sep 14th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static bool HandlePhaseSkyboxCommand(ChatHandler * handler, char const* args)
  2.     {
  3.         if (!*args)
  4.             return false;
  5.  
  6.         char const* pId = strtok((char*)args, " ");
  7.  
  8.  
  9.         Player* player = handler->GetSession()->GetPlayer();
  10.         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());
  11.  
  12.  
  13.         Field* fields = results->Fetch();
  14.  
  15.         uint32 replaceID = uint32(atoi(pId));
  16.         uint32 lightId = fields[0].GetUInt32();
  17.  
  18.         WorldPacket data(SMSG_OVERRIDE_LIGHT, 12);
  19.         data << lightId;
  20.         data << replaceID;
  21.         data << 200;
  22.  
  23.         handler->GetSession()->SendPacket(&data, true);
  24.        
  25.         return true;
  26.     }
RAW Paste Data
Top