diff --git a/bin/data/scp/class.scp b/bin/data/scp/class.scp index 2f57bc1..361809c 100644 --- a/bin/data/scp/class.scp +++ b/bin/data/scp/class.scp @@ -16,7 +16,7 @@ name=Rogue name=Priest [6] -name=UNKNOWN CLASS(6) +name=Death Knight [7] name=Shaman diff --git a/bin/data/scp/map.scp b/bin/data/scp/map.scp index 256941d..547ad1d 100644 --- a/bin/data/scp/map.scp +++ b/bin/data/scp/map.scp @@ -279,10 +279,34 @@ name=Eye of the Storm name_general=ZulAman name=Zul'Aman +[571] +name_general=Northrend +name=Northrend + [572] name_general=PVPLordaeron name=Ruins of Lordaeron +[573] +name_general=ExteriorTest +name=ExteriorTest + +[574] +name_general=Valgarde70 +name=Utgarde Keep + +[575] +name_general=UtgardePinnacle +name=Utgarde Pinnacle + +[576] +name_general=Nexus70 +name=The Nexus + +[578] +name_general=Nexus80 +name=The Oculus + [580] name_general=SunwellPlateau name=The Sunwell @@ -323,11 +347,131 @@ name=Transport: Grom'Gol to Undercity name_general=Transport164871 name=Transport: Undercity to Orgrimmar +[592] +name_general=Transport186238 +name=Transport: Borean Tundra Test + [593] name_general=Transport20808 name=Transport: Booty Bay to Ratchet +[594] +name_general=Transport187038 +name=Transport: Howling Fjord Sister Mercy (Quest) + +[595] +name_general=StratholmeCOT +name=The Culling of Stratholme + +[596] +name_general=Transport187263 +name=Transport: Naglfar + +[597] +name_general=CraigTest +name=Craig Test + [598] name_general=Sunwell5Man name=Sunwell Fix (Unused) +[599] +name_general=Ulduar70 +name=Halls of Stone + +[600] +name_general=DrakTheronKeep +name=Drak'Tharon Keep + +[601] +name_general=Azjol_Uppercity +name=Azjol-Nerub + +[602] +name_general=Ulduar80 +name=Halls of Lightning + +[603] +name_general=UlduarRaid +name=Ulduar + +[604] +name_general=GunDrak +name=Gundrak + +[605] +name_general=development_nonweighted +name=Development Land (non-weighted textures) + +[606] +name_general=QA_DVD +name=QA and DVD + +[607] +name_general=NorthrendBG +name=Strand of the Ancients + +[608] +name_general=DalaranPrison +name=Violet Hold + +[609] +name_general=DeathKnightStart +name=Ebon Hold + +[610] +name_general=Transport_Tirisfal _Vengeance_Landing +name=Transport: Tirisfal to Vengeance Landing + +[612] +name_general=Transport_Menethil_Valgarde +name=Transport: Menethil to Valgarde + +[613] +name_general=Transport_Orgrimmar_Warsong_Hold +name=Transport: Orgrimmar to Warsong Hold + +[614] +name_general=Transport_Stormwind_Valiance_Keep +name=Transport: Stormwind to Valiance Keep + +[615] +name_general=ChamberOfAspectsBlack +name=The Obsidian Sanctum + +[616] +name_general=NexusRaid +name=The Eye of Eternity + +[617] +name_general=DalaranArena +name=Dalaran Sewers + +[618] +name_general=OrgrimmarArena +name=The Ring of Valor + +[619] +name_general=Azjol_LowerCity +name=Ahn'kahet: The Old Kingdom + +[620] +name_general=Transport_Moa'ki_Unu'pe +name=Transport: Moa'ki to Unu'pe + +[621] +name_general=Transport_Moa'ki_Kamagua +name=Transport: Moa'ki to Kamagua + +[622] +name_general=Transport192241 +name=Transport: Orgrim's Hammer + +[623] +name_general=Transport192242 +name=Transport: The Skybreaker + +[624] +name_general=WintergraspRaid +name=Vault of Archavon + diff --git a/bin/data/scp/race.scp b/bin/data/scp/race.scp index 1170896..3a650d3 100644 --- a/bin/data/scp/race.scp +++ b/bin/data/scp/race.scp @@ -119,6 +119,22 @@ faction=7 name_general=Skeleton name=Skeleton +[16] +model_m=21685 +model_f=21686 +name_short=Vr +faction=7 +name_general=Vrykul +name=Vrykul + +[17] +model_m=21780 +model_f=21781 +name_short=Tu +faction=7 +name_general=Tuskarr +name=Tuskarr + [18] model_m=21963 model_f=21964 @@ -127,3 +143,27 @@ faction=7 name_general=ForestTroll name=Forest Troll +[19] +model_m=26316 +model_f=26317 +name_short=Wt +faction=7 +name_general=Taunka +name=Taunka + +[20] +model_m=26871 +model_f=26872 +name_short=NS +faction=7 +name_general=NorthrendSkeleton +name=Northrend Skeleton + +[21] +model_m=26873 +model_f=26874 +name_short=It +faction=7 +name_general=IceTroll +name=Ice Troll + diff --git a/src/Client/GUI/CM2MeshFileLoader.cpp b/src/Client/GUI/CM2MeshFileLoader.cpp index 0e49400..1447be1 100644 --- a/src/Client/GUI/CM2MeshFileLoader.cpp +++ b/src/Client/GUI/CM2MeshFileLoader.cpp @@ -556,7 +556,10 @@ for(u32 i=0; i < currentView.nSub;i++)// Device->getSceneManager()->getMeshManipulator()->flipSurfaces(AnimatedMesh); //Fix inverted surfaces after the rotation -Device->getSceneManager()->getMeshManipulator()->recalculateNormals(AnimatedMesh,true);//just to be sure + +// False.Genesis: commented out this problematic line.. was causing crashes for me, since 3.x client models +// SEEMS TO CRASH ONLY IN OPENGL-MODE ?! -- investigate! +//Device->getSceneManager()->getMeshManipulator()->recalculateNormals(AnimatedMesh,true);//just to be sure AnimatedMesh->setInterpolationMode(scene::EIM_LINEAR); diff --git a/src/Client/SCPDatabase.cpp b/src/Client/SCPDatabase.cpp index 6e11def..349ac96 100644 --- a/src/Client/SCPDatabase.cpp +++ b/src/Client/SCPDatabase.cpp @@ -134,7 +134,7 @@ uint32 SCPDatabase::GetFieldByStringValue(uint32 entry, char *val) { for(uint32 row = 0; row < _rowcount; row++) if(!stricmp(GetStringByOffset(_intbuf[row * _fields_per_row + entry]), val)) - return row; + return _indexes_reverse[row]; return SCP_INVALID_INT; } diff --git a/src/Client/World/MovementMgr.cpp b/src/Client/World/MovementMgr.cpp index 39f6518..bef07db 100644 --- a/src/Client/World/MovementMgr.cpp +++ b/src/Client/World/MovementMgr.cpp @@ -34,7 +34,7 @@ void MovementMgr::_BuildPacket(uint16 opcode) { WorldPacket *wp = new WorldPacket(opcode,4+1+4+12); // it can be larger, if we are jumping, on transport or swimming *wp << _moveFlags; - *wp << (uint8)0; // unk + *wp << (uint16)0; // unk *wp << getMSTime(); *wp << _mychar->GetPosition(); // TODO: transport not yet handled/done diff --git a/src/Client/World/Player.h b/src/Client/World/Player.h index fce614c..4c61477 100644 --- a/src/Client/World/Player.h +++ b/src/Client/World/Player.h @@ -9,118 +9,118 @@ /* TODO: Update me or use UpdateFields directly -#define PLAYER_SLOT_START 0 - -#define EQUIPMENT_SLOT_START 0 -#define EQUIPMENT_SLOT_HEAD 0 -#define EQUIPMENT_SLOT_NECK 1 -#define EQUIPMENT_SLOT_SHOULDERS 2 -#define EQUIPMENT_SLOT_BODY 3 -#define EQUIPMENT_SLOT_CHEST 4 -#define EQUIPMENT_SLOT_WAIST 5 -#define EQUIPMENT_SLOT_LEGS 6 -#define EQUIPMENT_SLOT_FEET 7 -#define EQUIPMENT_SLOT_WRISTS 8 -#define EQUIPMENT_SLOT_HANDS 9 -#define EQUIPMENT_SLOT_FINGER1 10 -#define EQUIPMENT_SLOT_FINGER2 11 -#define EQUIPMENT_SLOT_TRINKET1 12 -#define EQUIPMENT_SLOT_TRINKET2 13 -#define EQUIPMENT_SLOT_BACK 14 -#define EQUIPMENT_SLOT_MAINHAND 15 -#define EQUIPMENT_SLOT_OFFHAND 16 -#define EQUIPMENT_SLOT_RANGED 17 -#define EQUIPMENT_SLOT_TABARD 18 -#define EQUIPMENT_SLOT_END 19 - -#define INVENTORY_SLOT_BAG_0 255 -#define INVENTORY_SLOT_BAG_START 19 -#define INVENTORY_SLOT_BAG_1 19 -#define INVENTORY_SLOT_BAG_2 20 -#define INVENTORY_SLOT_BAG_3 21 -#define INVENTORY_SLOT_BAG_4 22 -#define INVENTORY_SLOT_BAG_END 23 - -#define INVENTORY_SLOT_ITEM_START 23 -#define INVENTORY_SLOT_ITEM_1 23 -#define INVENTORY_SLOT_ITEM_2 24 -#define INVENTORY_SLOT_ITEM_3 25 -#define INVENTORY_SLOT_ITEM_4 26 -#define INVENTORY_SLOT_ITEM_5 27 -#define INVENTORY_SLOT_ITEM_6 28 -#define INVENTORY_SLOT_ITEM_7 29 -#define INVENTORY_SLOT_ITEM_8 30 -#define INVENTORY_SLOT_ITEM_9 31 -#define INVENTORY_SLOT_ITEM_10 32 -#define INVENTORY_SLOT_ITEM_11 33 -#define INVENTORY_SLOT_ITEM_12 34 -#define INVENTORY_SLOT_ITEM_13 35 -#define INVENTORY_SLOT_ITEM_14 36 -#define INVENTORY_SLOT_ITEM_15 37 -#define INVENTORY_SLOT_ITEM_16 38 -#define INVENTORY_SLOT_ITEM_END 39 - -#define BANK_SLOT_ITEM_START 39 -#define BANK_SLOT_ITEM_1 39 -#define BANK_SLOT_ITEM_2 40 -#define BANK_SLOT_ITEM_3 41 -#define BANK_SLOT_ITEM_4 42 -#define BANK_SLOT_ITEM_5 43 -#define BANK_SLOT_ITEM_6 44 -#define BANK_SLOT_ITEM_7 45 -#define BANK_SLOT_ITEM_8 46 -#define BANK_SLOT_ITEM_9 47 -#define BANK_SLOT_ITEM_10 48 -#define BANK_SLOT_ITEM_11 49 -#define BANK_SLOT_ITEM_12 50 -#define BANK_SLOT_ITEM_13 51 -#define BANK_SLOT_ITEM_14 52 -#define BANK_SLOT_ITEM_15 53 -#define BANK_SLOT_ITEM_16 54 -#define BANK_SLOT_ITEM_17 55 -#define BANK_SLOT_ITEM_18 56 -#define BANK_SLOT_ITEM_19 57 -#define BANK_SLOT_ITEM_20 58 -#define BANK_SLOT_ITEM_21 59 -#define BANK_SLOT_ITEM_22 60 -#define BANK_SLOT_ITEM_23 61 -#define BANK_SLOT_ITEM_24 62 -#define BANK_SLOT_ITEM_END 63 - -#define BANK_SLOT_BAG_START 63 -#define BANK_SLOT_BAG_1 63 -#define BANK_SLOT_BAG_2 64 -#define BANK_SLOT_BAG_3 65 -#define BANK_SLOT_BAG_4 66 -#define BANK_SLOT_BAG_5 67 -#define BANK_SLOT_BAG_6 68 -#define BANK_SLOT_BAG_END 69 - -// strored in m_buybackitems -#define BUYBACK_SLOT_START 69 -#define BUYBACK_SLOT_1 69 -#define BUYBACK_SLOT_2 70 -#define BUYBACK_SLOT_3 71 -#define BUYBACK_SLOT_4 72 -#define BUYBACK_SLOT_5 73 -#define BUYBACK_SLOT_6 74 -#define BUYBACK_SLOT_7 75 -#define BUYBACK_SLOT_8 76 -#define BUYBACK_SLOT_9 77 -#define BUYBACK_SLOT_10 78 -#define BUYBACK_SLOT_11 79 -#define BUYBACK_SLOT_12 80 -#define BUYBACK_SLOT_END 81 - -#define KEYRING_SLOT_START 81 -#define KEYRING_SLOT_END 97 - -// last+1 slot for item stored (in any way in player m_items data) -#define PLAYER_SLOT_END 97 -#define PLAYER_SLOTS_COUNT (PLAYER_SLOT_END - PLAYER_SLOT_START) - -#define TRADE_SLOT_COUNT 7 -#define TRADE_SLOT_TRADED_COUNT 6 +#define PLAYER_SLOT_START 0 + +#define EQUIPMENT_SLOT_START 0 +#define EQUIPMENT_SLOT_HEAD 0 +#define EQUIPMENT_SLOT_NECK 1 +#define EQUIPMENT_SLOT_SHOULDERS 2 +#define EQUIPMENT_SLOT_BODY 3 +#define EQUIPMENT_SLOT_CHEST 4 +#define EQUIPMENT_SLOT_WAIST 5 +#define EQUIPMENT_SLOT_LEGS 6 +#define EQUIPMENT_SLOT_FEET 7 +#define EQUIPMENT_SLOT_WRISTS 8 +#define EQUIPMENT_SLOT_HANDS 9 +#define EQUIPMENT_SLOT_FINGER1 10 +#define EQUIPMENT_SLOT_FINGER2 11 +#define EQUIPMENT_SLOT_TRINKET1 12 +#define EQUIPMENT_SLOT_TRINKET2 13 +#define EQUIPMENT_SLOT_BACK 14 +#define EQUIPMENT_SLOT_MAINHAND 15 +#define EQUIPMENT_SLOT_OFFHAND 16 +#define EQUIPMENT_SLOT_RANGED 17 +#define EQUIPMENT_SLOT_TABARD 18 +#define EQUIPMENT_SLOT_END 19 + +#define INVENTORY_SLOT_BAG_0 255 +#define INVENTORY_SLOT_BAG_START 19 +#define INVENTORY_SLOT_BAG_1 19 +#define INVENTORY_SLOT_BAG_2 20 +#define INVENTORY_SLOT_BAG_3 21 +#define INVENTORY_SLOT_BAG_4 22 +#define INVENTORY_SLOT_BAG_END 23 + +#define INVENTORY_SLOT_ITEM_START 23 +#define INVENTORY_SLOT_ITEM_1 23 +#define INVENTORY_SLOT_ITEM_2 24 +#define INVENTORY_SLOT_ITEM_3 25 +#define INVENTORY_SLOT_ITEM_4 26 +#define INVENTORY_SLOT_ITEM_5 27 +#define INVENTORY_SLOT_ITEM_6 28 +#define INVENTORY_SLOT_ITEM_7 29 +#define INVENTORY_SLOT_ITEM_8 30 +#define INVENTORY_SLOT_ITEM_9 31 +#define INVENTORY_SLOT_ITEM_10 32 +#define INVENTORY_SLOT_ITEM_11 33 +#define INVENTORY_SLOT_ITEM_12 34 +#define INVENTORY_SLOT_ITEM_13 35 +#define INVENTORY_SLOT_ITEM_14 36 +#define INVENTORY_SLOT_ITEM_15 37 +#define INVENTORY_SLOT_ITEM_16 38 +#define INVENTORY_SLOT_ITEM_END 39 + +#define BANK_SLOT_ITEM_START 39 +#define BANK_SLOT_ITEM_1 39 +#define BANK_SLOT_ITEM_2 40 +#define BANK_SLOT_ITEM_3 41 +#define BANK_SLOT_ITEM_4 42 +#define BANK_SLOT_ITEM_5 43 +#define BANK_SLOT_ITEM_6 44 +#define BANK_SLOT_ITEM_7 45 +#define BANK_SLOT_ITEM_8 46 +#define BANK_SLOT_ITEM_9 47 +#define BANK_SLOT_ITEM_10 48 +#define BANK_SLOT_ITEM_11 49 +#define BANK_SLOT_ITEM_12 50 +#define BANK_SLOT_ITEM_13 51 +#define BANK_SLOT_ITEM_14 52 +#define BANK_SLOT_ITEM_15 53 +#define BANK_SLOT_ITEM_16 54 +#define BANK_SLOT_ITEM_17 55 +#define BANK_SLOT_ITEM_18 56 +#define BANK_SLOT_ITEM_19 57 +#define BANK_SLOT_ITEM_20 58 +#define BANK_SLOT_ITEM_21 59 +#define BANK_SLOT_ITEM_22 60 +#define BANK_SLOT_ITEM_23 61 +#define BANK_SLOT_ITEM_24 62 +#define BANK_SLOT_ITEM_END 63 + +#define BANK_SLOT_BAG_START 63 +#define BANK_SLOT_BAG_1 63 +#define BANK_SLOT_BAG_2 64 +#define BANK_SLOT_BAG_3 65 +#define BANK_SLOT_BAG_4 66 +#define BANK_SLOT_BAG_5 67 +#define BANK_SLOT_BAG_6 68 +#define BANK_SLOT_BAG_END 69 + +// strored in m_buybackitems +#define BUYBACK_SLOT_START 69 +#define BUYBACK_SLOT_1 69 +#define BUYBACK_SLOT_2 70 +#define BUYBACK_SLOT_3 71 +#define BUYBACK_SLOT_4 72 +#define BUYBACK_SLOT_5 73 +#define BUYBACK_SLOT_6 74 +#define BUYBACK_SLOT_7 75 +#define BUYBACK_SLOT_8 76 +#define BUYBACK_SLOT_9 77 +#define BUYBACK_SLOT_10 78 +#define BUYBACK_SLOT_11 79 +#define BUYBACK_SLOT_12 80 +#define BUYBACK_SLOT_END 81 + +#define KEYRING_SLOT_START 81 +#define KEYRING_SLOT_END 97 + +// last+1 slot for item stored (in any way in player m_items data) +#define PLAYER_SLOT_END 97 +#define PLAYER_SLOTS_COUNT (PLAYER_SLOT_END - PLAYER_SLOT_START) + +#define TRADE_SLOT_COUNT 7 +#define TRADE_SLOT_TRADED_COUNT 6 #define TRADE_SLOT_NONTRADED 6 */ @@ -149,7 +149,7 @@ public: float _y; float _z; uint32 _guildId; - uint8 _flags; + uint32 _flags; uint32 _petInfoId; uint32 _petLevel; uint32 _petFamilyId; @@ -211,4 +211,4 @@ private: }; -#endif +#endif diff --git a/src/Client/World/WorldSession.cpp b/src/Client/World/WorldSession.cpp index 73da83c..4fe8da9 100644 --- a/src/Client/World/WorldSession.cpp +++ b/src/Client/World/WorldSession.cpp @@ -11,6 +11,7 @@ #include "World.h" #include "RealmSession.h" #include "WorldSession.h" +#include "MemoryDataHolder.h" struct OpcodeHandler { @@ -533,10 +534,13 @@ void WorldSession::_HandleAuthChallengeOpcode(WorldPacket& recvPacket) WorldPacket auth; auth<<(uint32)(GetInstance()->GetConf()->clientbuild)< + + + + + + diff --git a/src/shared/ADTFile.cpp b/src/shared/ADTFile.cpp index e0eb97d..7d778ac 100644 --- a/src/shared/ADTFile.cpp +++ b/src/shared/ADTFile.cpp @@ -14,6 +14,41 @@ inline void flipcc(uint8 *fcc) fcc[2]=t; } +void MCAL_decompress(uint8 *inbuf, uint8 *outbuf) +{ + /* + How the decompression works + + * read a byte + * check for sign bit + * if set we are in fill mode else we are in copy mode + * take the 7 lesser bits of the first byte as a count indicator + o fill mode: read the next byte an fill it by count in resulting alpha map + o copy mode: read the next count bytes and copy them in the resulting alpha map + * if the alpha map is complete we are done otherwise start at 1. again + */ + // 21-10-2008 by Flow + uint32 offI = 0; //offset IN buffer + uint32 offO = 0; //offset OUT buffer + + while( offO < 4096 ) + { + // fill or copy mode + bool fill = inbuf[offI] & 0x80; + unsigned n = inbuf[offI] & 0x7F; + offI++; + for( unsigned k = 0; k < n; k++ ) + { + outbuf[offO] = inbuf[offI]; + offO++; + if( !fill ) + offI++; + } + if( fill ) offI++; + } +} + + bool ADTFile::Load(std::string fn) { try @@ -185,6 +220,7 @@ bool ADTFile::LoadMem(ByteBuffer& buf) uint8 *mfcc = &_cc2[0]; mfcc[4]=0; uint32 msize; + bool mcal_compressed = false; while(buf.rpos()(); } + if(_chunks[mcnkid].layer[i].flags & 0x200) + mcal_compressed = true; } else if(!strcmp((char*)mfcc,"MCSH")) { @@ -233,7 +271,23 @@ bool ADTFile::LoadMem(ByteBuffer& buf) // we can NOT use _chunks[mcnkid].hdr.nLayers here... so we use: (full block size - header size) / single block size for(uint32 i = 0; i < (_chunks[mcnkid].hdr.sizeAlpha - 8) / 2048; i++) { - buf.read((uint8*)(_chunks[mcnkid].alphamap[i]),2048); + uint8 alphamap[2048]; + buf.read((uint8*)alphamap,2048); + if(mcal_compressed) + { + MCAL_decompress(alphamap,_chunks[mcnkid].alphamap[i]); + } + else + { + for(uint32 aly = 0; aly < 64; aly++) + { + for(uint32 alx = 0; alx < 32; alx++) + { + _chunks[mcnkid].alphamap[i][aly*64 + (alx*2)] = alphamap[aly*64 + alx] & 0xF0; // first 4 bits + _chunks[mcnkid].alphamap[i][aly*64 + (alx*2)+1] = alphamap[aly*64 + alx] & 0x0F; // second + } + } + } } } /*else if(!strcmp((char*)mfcc,"MCLQ")) // MCLQ changed to MH2O chunk for whole ADT file diff --git a/src/shared/ADTFileStructs.h b/src/shared/ADTFileStructs.h index 13d95e5..407cba2 100644 --- a/src/shared/ADTFileStructs.h +++ b/src/shared/ADTFileStructs.h @@ -200,7 +200,7 @@ struct ADTMapChunk MCLY_chunk layer[ADT_MAXLAYERS]; // can be less uint32 nTextures; uint8 shadowmap[512]; // 1 bit 64x64 - uint8 alphamap[ADT_MAXLAYERS][2048]; // 4 bits, 64x64. max 4, 1 per layer + uint8 alphamap[ADT_MAXLAYERS][4096]; // 8 bits, 64x64. max 4, 1 per layer bool haswater; float waterlevel; LiquidVertex lqvertex[81]; diff --git a/src/shared/MapTile.cpp b/src/shared/MapTile.cpp index 9cd4dc0..0d79467 100644 --- a/src/shared/MapTile.cpp +++ b/src/shared/MapTile.cpp @@ -55,6 +55,10 @@ void MapTile::ImportFromADT(ADTFile *adt) uint32 texoffs = adt->_chunks[ch].layer[ly].textureId; _chunks[ch].texlayer.push_back(std::string("data/texture/") + NormalizeFilename(std::string(adt->_textures[texoffs])).c_str()); } + + memcpy(_chunks[ch].alphamap, adt->_chunks[ch].alphamap, adt->_chunks[ch].hdr.sizeAlpha - 8); + + /* // extract alpha maps. in adt they are stored in 4-bit encoding, which makes 4096 entries in 64x32 values for(uint32 al = 0; al < (adt->_chunks[ch].hdr.sizeAlpha - 8) / 2048; al++) // see comment in ADTFile.cpp when loading MCAL chunk for explanation { @@ -67,6 +71,7 @@ void MapTile::ImportFromADT(ADTFile *adt) } } } + */ } // copy over doodads and do some transformations