#include "Instance.h" #include "Main.h" MiniCompPck Instance::MakeMapPacket(unsigned short networkId) { CompiledPacket pck; //This is the pre-searing Ascalon map pck.AddShort(ServerOpcode(27)); pck.AddLong(0x40); pck.AddLong(0x80); pck.AddLong(0x20); pck.AddShort(ServerOpcode(28)); pck.AddLong(0x08); pck.AddShort(0x10); unsigned char d[32]= { 0xDF, 0x02, 0x3C, 0x03, 0x3B, 0x03, 0x3B, 0x03, 0x3B, 0x03, 0x3C, 0x02, 0x3C, 0x02, 0xFF, 0x9D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0xC5, 0x00, 0x00, 0x00 }; pck.Add(d, 28, false); int size; unsigned char* pData=pck.GetString(&size); FinishPacket(); } void Instance::SendInitialPacket(Player* pPlayer) { assert(pPlayer!=0); pPlayer->SetLocalId(mLocalIdMan.GetFreeID()); bool hostile_zone=false; bool observer_mode=false; CompiledPacket pck; //Build the instance load character name packet pck.AddShort(ServerOpcode(12)); int sl; unsigned char buffer[100]; pPlayer->GetPlayerNameUnicode(buffer, &sl); pck.AddShort(sl/2); pck.Add(buffer, sl, false); //Build the district info packet pck.AddShort(ServerOpcode(13)); pck.AddLong(pPlayer->GetLocalId()); pck.AddShort(this->mZoneId); pck.AddBool(hostile_zone); pck.AddShort(1);//District number pck.AddShort(0);//Language and probably territory? pck.AddByte(0);//Unknown pck.AddBool(observer_mode);//Observer mode Util::SendCompiledPacket(&pck, pPlayer->GetnetworkId(), gpGameServer); } MiniCompPck Instance::Send_GUIToggles(unsigned short networkId) { CompiledPacket pck; //Add the packet header pck.AddShort(ServerOpcode(21)); unsigned char hexData[269] = { 0x06, 0x44, 0x42, 0xD6, 0x56, 0x09, 0x44, 0x22, 0x38, 0x9B, 0x3D, 0x00, 0x40, 0x27, 0x40, 0x01, 0x90, 0x84, 0x00, 0x23, 0x75, 0xF0, 0x93, 0x01, 0x25, 0x63, 0x6B, 0x52, 0x2E, 0x5C, 0xFF, 0xDF, 0xE7, 0x9D, 0x6F, 0xDF, 0x7F, 0x7B, 0xFF, 0x3A, 0x26, 0x8C, 0x9B, 0xBF, 0x10, 0xEA, 0x48, 0xF0, 0xDB, 0xFF, 0xFD, 0x9B, 0xC0, 0xFF, 0xFF, 0xD9, 0xFF, 0xFF, 0xFB, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x91, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x20, 0x40, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x21, 0x04, 0x41, 0x02, 0x00, 0x08, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x10, 0x00, 0x00, 0x48, 0x00, 0xB0, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x03, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x40, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x48, 0x08, 0x00, 0x80, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x01, 0x00, 0xFE, 0x5F, 0x0C, 0x0D, 0x0D, 0x00, 0x01, 0x00, 0x03 }; //This should be changed later //pck.Fill(0x00, 224); pck.Add(hexData, 264, false);//231, 228, FinishPacket(); } MiniCompPck Instance::Send_PartyWindow(unsigned short networkId, Player* pPlayer) { CompiledPacket pck; //Add the packet header pck.AddShort(ServerOpcode(39)); pck.AddShort(pPlayer->GetLocalId()); pck.AddShort(pPlayer->GetLocalId()); //Packet header? pck.AddShort(ServerOpcode(54)); pck.AddShort(pPlayer->GetLocalId()); //Packet header? pck.AddShort(ServerOpcode(55)); pck.AddShort(pPlayer->GetLocalId()); pck.AddShort(pPlayer->GetLocalId()); pck.AddByte(1); //Packet header? pck.AddShort(ServerOpcode(56)); pck.AddShort(pPlayer->GetLocalId()); //Packet header? pck.AddShort(ServerOpcode(57)); pck.AddShort(pPlayer->GetLocalId()); pck.AddByte(1); //Packet header? pck.AddShort(ServerOpcode(58)); pck.AddShort(0); /*unsigned char hexData[30] = { 0xA0, 0x00, 0x06, 0x00, 0x06, 0x00, 0xB4, 0x01, 0x06, 0x00, 0xAD, 0x01, 0x06, 0x00, 0x06, 0x00, 0x01, 0xB5, 0x01, 0x06, 0x00, 0x94, 0x01, 0x06, 0x00, 0x01, 0xC0, 0x01, 0x00, 0x00 }; pck.Add(hexData, 30, false);*/ FinishPacket(); }