From 97a34b5793718c67a45ddd8136eb293a1eaec940 Mon Sep 17 00:00:00 2001 From: Trevius Date: Sat, 6 Dec 2014 14:38:34 -0600 Subject: [PATCH] The RoF2 client is now enabled by default. It is almost caught up to RoF Client compatibility. --- common/patches/patches.cpp | 6 ++--- common/patches/rof2.cpp | 20 ++++++++--------- common/patches/rof2_structs.h | 6 ++--- utils/patches/patch_RoF2.conf | 22 +++++++++---------- utils/scripts/opcode_scripts/.gitignore | 2 +- .../scripts/opcode_scripts/oplist_to_conf.pl | 11 +++++----- world/client.cpp | 2 +- zone/inventory.cpp | 20 ++++++++++++++++- zone/questmgr.cpp | 14 +++++++----- 9 files changed, 61 insertions(+), 42 deletions(-) diff --git a/common/patches/patches.cpp b/common/patches/patches.cpp index d35ded9ba..50d77a43f 100644 --- a/common/patches/patches.cpp +++ b/common/patches/patches.cpp @@ -17,8 +17,7 @@ void RegisterAllPatches(EQStreamIdentifier &into) { SoD::Register(into); Underfoot::Register(into); RoF::Register(into); - // Uncomment the line below to enable RoF2 Client - //RoF2::Register(into); + RoF2::Register(into); } void ReloadAllPatches() { @@ -28,6 +27,5 @@ void ReloadAllPatches() { SoD::Reload(); Underfoot::Reload(); RoF::Reload(); - // Uncomment the line below to enable RoF2 Client - //RoF2::Reload(); + RoF2::Reload(); } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 372da9b07..869fef666 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -2045,15 +2045,6 @@ namespace RoF2 outapp->WriteUInt32(emu->skills[r]); } - // deprecated - // Write zeroes for the rest of the skills - /* - for(uint32 r = 0; r < structs::MAX_PP_SKILL - MAX_PP_SKILL; r++) - { - outapp->WriteUInt32(emu->skills[r]); - } - */ - outapp->WriteUInt32(25); // Unknown count for (uint32 r = 0; r < 25; r++) @@ -2334,7 +2325,6 @@ namespace RoF2 outapp->WriteUInt8(emu->pvp); outapp->WriteUInt8(0); // Unknown outapp->WriteUInt8(emu->gm); - outapp->WriteUInt32(emu->guild_id); outapp->WriteUInt8(0); // Unknown - observed 1 in a live packet. outapp->WriteUInt32(0); // Unknown - observed 1 in a live packet. @@ -2349,6 +2339,7 @@ namespace RoF2 outapp->WriteUInt32(emu->silver_bank); outapp->WriteUInt32(emu->copper_bank); + // Commenting out for RoF Test outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown @@ -2396,6 +2387,13 @@ namespace RoF2 outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown + /* + + // Begin RoF2 Test + for (uint32 r = 0; r < 1000; r++) + outapp->WriteUInt8(0); // Unknown + // End RoF2 Test + // Block of 121 unknown bytes for (uint32 r = 0; r < 121; r++) outapp->WriteUInt8(0); // Unknown @@ -2537,6 +2535,8 @@ namespace RoF2 outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown + */ + outapp->WriteUInt8(emu->groupAutoconsent); outapp->WriteUInt8(emu->raidAutoconsent); outapp->WriteUInt8(emu->guildAutoconsent); diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index b75faee91..4bc9a9bb3 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -1205,7 +1205,7 @@ union /*00000*/ uint8 unknown_rof52[82]; // /*00000*/ uint32 unknown_rof53; // Seen 50 -uint8 unknown_rof54[1325]; // Unknown Section +/*00000*/ uint8 unknown_rof54[1325]; // Unknown Section // Bottom of Struct: /*00000*/ uint8 groupAutoconsent; // 0=off, 1=on @@ -2833,8 +2833,8 @@ struct Door_Struct /*0085*/ uint8 unknown0085; // seen 1 or 0 or rarely 2C or 90 or ED or 2D or A1 /*0086*/ uint8 unknown0086; // seen 0 or rarely FF or FE or 10 or 5A or 82 /*0087*/ uint8 unknown0087; // seen 0 or rarely 02 or 7C -/*0088*/ uint8 unknown0088[8]; // mostly 0s, the last 3 bytes are something tho -/*0096*/ +/*0088*/ uint8 unknown0088[12]; // mostly 0s, the last 3 bytes are something tho +/*0100*/ }; struct DoorSpawns_Struct { diff --git a/utils/patches/patch_RoF2.conf b/utils/patches/patch_RoF2.conf index 8c15c59c6..5ab89f001 100644 --- a/utils/patches/patch_RoF2.conf +++ b/utils/patches/patch_RoF2.conf @@ -297,7 +297,7 @@ OP_DelegateAbility=0x76b8 OP_SetGroupTarget=0x2814 OP_Charm=0x5d92 OP_Stun=0x36a4 -OP_SendFindableNPCs=0x7e62 +OP_SendFindableNPCs=0x4613 OP_FindPersonRequest=0x5cea OP_FindPersonReply=0x7e58 OP_Sound=0x1a30 @@ -308,7 +308,7 @@ OP_Sacrifice=0x1821 OP_PopupResponse=0x08a6 OP_OnLevelMessage=0x4d6e OP_AugmentInfo=0x0afb -OP_Petition=0x3de3 +OP_Petition=0x1901 OP_SomeItemPacketMaybe=0x747c OP_PVPStats=0x4b15 OP_PVPLeaderBoardRequest=0x04aa @@ -334,13 +334,13 @@ OP_NPCMoveUpdate=0x5892 OP_CameraEffect=0x127f OP_SpellEffect=0x5936 OP_RemoveNimbusEffect=0x7b1e -OP_AltCurrency=0x62ab -OP_AltCurrencyMerchantRequest=0x61cb -OP_AltCurrencyMerchantReply=0x5409 -OP_AltCurrencyPurchase=0x0165 -OP_AltCurrencySell=0x74ec -OP_AltCurrencySellSelection=0x3788 -OP_AltCurrencyReclaim=0x3899 +OP_AltCurrency=0x6b6d +OP_AltCurrencyMerchantRequest=0x5409 +OP_AltCurrencyMerchantReply=0x27a2 +OP_AltCurrencyPurchase=0x3788 +OP_AltCurrencySell=0x40b6 +OP_AltCurrencySellSelection=0x532a +OP_AltCurrencyReclaim=0x0339 OP_CrystalCountUpdate=0x467f OP_CrystalCreate=0x7aee OP_CrystalReclaim=0x2439 @@ -368,7 +368,7 @@ OP_DzLeaderStatus=0x32f0 OP_DzExpeditionEndsWarning=0x7e94 OP_DzMemberList=0x3de9 OP_DzCompass=0x3e0e -OP_DzChooseZone=0x0000 +OP_DzChooseZone=0x0b7d # New Opcodes OP_SpawnPositionUpdate=0x0000 # Actually OP_MobUpdate ? @@ -585,7 +585,7 @@ OP_LoginComplete=0x0000 # discovered opcodes not yet used: OP_PickLockSuccess=0x0000 -OP_PlayMP3=0x0000 +OP_PlayMP3=0x5770 OP_ReclaimCrystals=0x0000 OP_DynamicWall=0x0000 OP_OpenDiscordMerchant=0x0000 diff --git a/utils/scripts/opcode_scripts/.gitignore b/utils/scripts/opcode_scripts/.gitignore index 4104a1572..0227fe923 100644 --- a/utils/scripts/opcode_scripts/.gitignore +++ b/utils/scripts/opcode_scripts/.gitignore @@ -1,3 +1,3 @@ -# Input and Output txt and conf files. +# Input and Output txt and conf files *.txt *.conf diff --git a/utils/scripts/opcode_scripts/oplist_to_conf.pl b/utils/scripts/opcode_scripts/oplist_to_conf.pl index 0d808707d..0a3088dd6 100644 --- a/utils/scripts/opcode_scripts/oplist_to_conf.pl +++ b/utils/scripts/opcode_scripts/oplist_to_conf.pl @@ -6,11 +6,12 @@ # Directions to use this script: # 1. Copy the opcodes and opcode names columns from the opcode spreadsheet # for the columns you want to create a new .conf file from into the file. -# 2. Remove the header row entries in the newly created text file and save it. -# 3. Paste the contents of the current patch file in the patch_OLD.conf file. -# 4. Run this script using "perl oplist_to_conf.pl" -# 5. This creates a new .conf file named patch_NEW.conf -# 6. Rename patch_NEW.conf to the desired name and you are all done +# 2. Remove the header row entries in the text file. +# 3. Find/Replace all Tabs " " with 2 spaces " " and save the file. +# 4. Paste the contents of the current patch file in the patch_OLD.conf file. +# 5. Run this script using "perl oplist_to_conf.pl" +# 6. This creates a new .conf file named patch_NEW.conf +# 7. Rename patch_NEW.conf to the desired name and you are all done $stopmessage = "Failed to open file"; diff --git a/world/client.cpp b/world/client.cpp index 0f9b92abf..e37015e19 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -223,7 +223,7 @@ void Client::SendMembership() { mc->entries[1] = 0xffffffff; // Max Level Restriction mc->entries[2] = 0xffffffff; // Max Char Slots per Account (not used by client?) mc->entries[3] = 0xffffffff; // 1 for Silver - mc->entries[4] = 8; // Main Inventory Size (0xffffffff on Live for Gold, but limitting to 8 until 10 is supported) + mc->entries[4] = 8; // Main Inventory Size (0xffffffff on Live for Gold, but limiting to 8 until 10 is supported) mc->entries[5] = 0xffffffff; // Max Platinum per level mc->entries[6] = 1; // 0 for Silver mc->entries[7] = 1; // 0 for Silver diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 6b7a0b297..bb9802e1c 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -1032,7 +1032,25 @@ bool Client::MakeItemLink(char* &ret_link, const ItemInst *inst) { uint8 evolvedlevel = 0; int hash = 0; //int hash = GetItemLinkHash(inst); //eventually this will work (currently crashes zone), but for now we'll skip the extra overhead - if (GetClientVersion() >= EQClientRoF) + if (GetClientVersion() >= EQClientRoF2) + { + MakeAnyLenString(&ret_link, "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%01X" "%1X" "%04X" "%1X" "%05X" "%08X", + 0, + item->ID, + inst->GetAugmentItemID(0), + inst->GetAugmentItemID(1), + inst->GetAugmentItemID(2), + inst->GetAugmentItemID(3), + inst->GetAugmentItemID(4), + inst->GetAugmentItemID(5), + evolving, + loregroup, + evolvedlevel, + 0, + hash + ); + } + else if (GetClientVersion() >= EQClientRoF) { MakeAnyLenString(&ret_link, "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%1X" "%05X" "%08X", 0, diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 2ce1dbc37..38f40142d 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2658,14 +2658,16 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam char linktext[250]; if (initiator) { - if (initiator->GetClientVersion() >= EQClientRoF) - sprintf(linktext,"%c%06X%s%s%c",0x12,sayid,"0000000000000000000000000000000000000000000000000",LinkName,0x12); + if (initiator->GetClientVersion() >= EQClientRoF2) + sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "00000000000000000000000000000000000000000000000000", LinkName, 0x12); + else if (initiator->GetClientVersion() >= EQClientRoF) + sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "0000000000000000000000000000000000000000000000000", LinkName, 0x12); else if (initiator->GetClientVersion() >= EQClientSoF) - sprintf(linktext,"%c%06X%s%s%c",0x12,sayid,"00000000000000000000000000000000000000000000",LinkName,0x12); + sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "00000000000000000000000000000000000000000000", LinkName, 0x12); else - sprintf(linktext,"%c%06X%s%s%c",0x12,sayid,"000000000000000000000000000000000000000",LinkName,0x12); - } else { // If no initiator, create an RoF saylink, since older clients handle RoF ones better than RoF handles older ones. - sprintf(linktext,"%c%06X%s%s%c",0x12,sayid,"0000000000000000000000000000000000000000000000000",LinkName,0x12); + sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "000000000000000000000000000000000000000", LinkName, 0x12); + } else { // If no initiator, create an RoF2 saylink, since older clients handle RoF2 ones better than RoF2 handles older ones. + sprintf(linktext, "%c%06X%s%s%c", 0x12, sayid, "00000000000000000000000000000000000000000000000000", LinkName, 0x12); } strcpy(Phrase,linktext);