From 97a34b5793718c67a45ddd8136eb293a1eaec940 Mon Sep 17 00:00:00 2001 From: Trevius Date: Sat, 6 Dec 2014 14:38:34 -0600 Subject: [PATCH 001/153] 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); From 4138e6f82ca380c06642bd627f456514fc024fc5 Mon Sep 17 00:00:00 2001 From: Trevius Date: Sat, 6 Dec 2014 14:53:05 -0600 Subject: [PATCH 002/153] More RoF2 Opcodes identified. --- utils/patches/patch_RoF2.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/patches/patch_RoF2.conf b/utils/patches/patch_RoF2.conf index 5ab89f001..7837c2966 100644 --- a/utils/patches/patch_RoF2.conf +++ b/utils/patches/patch_RoF2.conf @@ -102,7 +102,7 @@ OP_ExpUpdate=0x20ed OP_HPUpdate=0x2828 OP_ManaChange=0x5467 OP_TGB=0x0876 -OP_SpecialMesg=0x083 +OP_SpecialMesg=0x0083 OP_GuildMemberList=0x12a6 OP_GuildMOTD=0x3e13 OP_CharInventory=0x5ca6 @@ -213,7 +213,7 @@ OP_MoveCoin=0x0bcf OP_ZonePlayerToBind=0x0ecb OP_KeyRing=0x6857 OP_WhoAllRequest=0x674b -OP_WhoAllResponse=0x51b8 +OP_WhoAllResponse=0x578c OP_FriendsWho=0x3956 OP_ConfirmDelete=0x43a3 OP_Logout=0x4ac6 @@ -306,7 +306,7 @@ OP_LevelAppearance=0x3bc9 OP_Translocate=0x6580 OP_Sacrifice=0x1821 OP_PopupResponse=0x08a6 -OP_OnLevelMessage=0x4d6e +OP_OnLevelMessage=0x575b OP_AugmentInfo=0x0afb OP_Petition=0x1901 OP_SomeItemPacketMaybe=0x747c @@ -348,7 +348,7 @@ OP_Untargetable=0x053c OP_IncreaseStats=0x70a3 OP_Weblink=0x6f4b OP_OpenContainer=0x0000 -OP_Marquee=0x0000 +OP_Marquee=0x502e OP_ItemRecastDelay=0x15a9 #OP_OpenInventory=0x0000 # Likely does not exist in RoF -U From 5713dc2de1b60b8dce4d9070d558bdf165ae2e7e Mon Sep 17 00:00:00 2001 From: Trevius Date: Sat, 6 Dec 2014 18:18:49 -0600 Subject: [PATCH 003/153] Guild Names now display properly in RoF2. --- common/patches/rof2.cpp | 4 ++++ utils/patches/patch_RoF2.conf | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 869fef666..4d403253f 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -3781,6 +3781,10 @@ namespace RoF2 VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->light); VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->flymode); + //VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 100); // LiveUnknown1 12/06/14 (possibly mana percent?) + //VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 10); // LiveUnknown2 12/06/14 + //VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // LiveUnknown3 12/06/14 + VARSTRUCT_ENCODE_STRING(Buffer, emu->lastName); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // aatitle ?? diff --git a/utils/patches/patch_RoF2.conf b/utils/patches/patch_RoF2.conf index 7837c2966..351b147c4 100644 --- a/utils/patches/patch_RoF2.conf +++ b/utils/patches/patch_RoF2.conf @@ -19,7 +19,7 @@ OP_ApproveWorld=0x7499 OP_LogServer=0x7ceb OP_SendCharInfo=0x00d2 OP_ExpansionInfo=0x590d -OP_GuildsList=0x0000 +OP_GuildsList=0x507a OP_EnterWorld=0x578f OP_PostEnterWorld=0x6259 OP_World_Client_CRC1=0x12cc From 6b9a408b463c3a130896af83f31f67c5e0887706 Mon Sep 17 00:00:00 2001 From: Natedog2012 Date: Tue, 23 Sep 2014 19:10:52 -0700 Subject: [PATCH 004/153] Don't allow AA to be bought that you cant use --- zone/aa.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index ba61c9005..9cb6cf43f 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -988,13 +988,20 @@ void Client::BuyAA(AA_Action* action) } uint32 real_cost; + uint8 req_level; std::map::iterator RequiredLevel = AARequiredLevelAndCost.find(action->ability); if(RequiredLevel != AARequiredLevelAndCost.end()) { real_cost = RequiredLevel->second.Cost; + req_level = RequiredLevel->second.Level; } - else + else { real_cost = aa2->cost + (aa2->cost_inc * cur_level); + req_level = aa2->class_type + (aa2->level_inc * cur_level); + } + + if (req_level > GetLevel()) + return; //Cheater trying to Buy AA... if (m_pp.aapoints >= real_cost && cur_level < aa2->max_level) { SetAA(aa2->id, cur_level + 1); From eed666c8c2124464fc6b40b626bfd5157f5647dd Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 6 Dec 2014 20:12:19 -0500 Subject: [PATCH 005/153] OP_ClearAA and OP_ClearLeadershipAbilities for RoF2 --- utils/patches/patch_RoF2.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/patches/patch_RoF2.conf b/utils/patches/patch_RoF2.conf index 351b147c4..d2ed7f651 100644 --- a/utils/patches/patch_RoF2.conf +++ b/utils/patches/patch_RoF2.conf @@ -94,6 +94,8 @@ OP_ClearBlockedBuffs=0x34cb OP_WorldObjectsSent=0x5ae2 OP_SendExpZonein=0x5f8e OP_SendAATable=0x66b5 +OP_ClearAA=0x0f50 +OP_ClearLeadershipAbilities=0x6da5 OP_RespondAA=0x7a27 OP_UpdateAA=0x66f0 OP_SendAAStats=0x43c8 From 3e73df2c723530b84a6ec3381d0fec2347c61eaa Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 6 Dec 2014 21:56:14 -0500 Subject: [PATCH 006/153] Clean up common/misc_functions.h --- common/misc_functions.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/misc_functions.h b/common/misc_functions.h index abc9747b5..a013423ff 100644 --- a/common/misc_functions.h +++ b/common/misc_functions.h @@ -92,8 +92,6 @@ int32 filesize(FILE* fp); uint32 ResolveIP(const char* hostname, char* errbuf = 0); bool ParseAddress(const char* iAddress, uint32* oIP, uint16* oPort, char* errbuf = 0); void CoutTimestamp(bool ms = true); -int MakeRandomInt(int low, int high); -double MakeRandomFloat(double low, double high); float EQ13toFloat(int d); float NewEQ13toFloat(int d); float EQ19toFloat(int d); From afd3b9acdc796ae153dd1c98b69d27c990cbada6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 7 Dec 2014 03:02:57 -0600 Subject: [PATCH 007/153] Header and code cleanup of debug.cpp --- common/debug.cpp | 395 ++++++++++++++++++++++++----------------------- 1 file changed, 204 insertions(+), 191 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index 228d57631..3b283240a 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -1,7 +1,5 @@ #include #include -#include -#include #ifdef _WINDOWS #include @@ -12,14 +10,13 @@ #define strcasecmp _stricmp #else - + #include #include #endif #include "debug.h" -#include "string_util.h" #include "misc_functions.h" #include "platform.h" @@ -34,34 +31,37 @@ EQEMuLog *LogFile = &realLogFile; static const char* FileNames[EQEMuLog::MaxLogID] = { "logs/eqemu", "logs/eqemu", "logs/eqemu_error", "logs/eqemu_debug", "logs/eqemu_quest", "logs/eqemu_commands", "logs/crash" }; static const char* LogNames[EQEMuLog::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Crash" }; -EQEMuLog::EQEMuLog() { - for (int i=0; i= MaxLogID) { - return false; - } - bool dofile = false; - if (pLogStatus[id] & 1) { - dofile = open(id); - } - if (!(dofile || pLogStatus[id] & 2)) - return false; - LockMutex lock(&MLog[id]); - if (!logFileValid) - return false; //check again for threading race reasons (to avoid two mutexes) - - time_t aclock; - struct tm *newtime; - - time( &aclock ); /* Get time in seconds */ - newtime = localtime( &aclock ); /* Convert time to struct */ - - if (dofile) -#ifndef NO_PIDLOG - fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); -#else - fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); -#endif - - va_list argptr, tmpargptr; - va_start(argptr, fmt); - if (dofile) { - va_copy(tmpargptr, argptr); - vfprintf( fp[id], fmt, tmpargptr ); - } - if(logCallbackFmt[id]) { - msgCallbackFmt p = logCallbackFmt[id]; - va_copy(tmpargptr, argptr); - p(id, fmt, tmpargptr ); - } - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) { - fprintf(stderr, "[%s] ", LogNames[id]); - vfprintf( stderr, fmt, argptr ); - } - else { - fprintf(stdout, "[%s] ", LogNames[id]); - vfprintf( stdout, fmt, argptr ); - } - } - va_end(argptr); - if (dofile) - fprintf(fp[id], "\n"); - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) { - fprintf(stderr, "\n"); - fflush(stderr); - } else { - fprintf(stdout, "\n"); - fflush(stdout); - } - } - if(dofile) - fflush(fp[id]); - return true; -} - -//write with Prefix and a VA_list -bool EQEMuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list argptr) { +bool EQEMuLog::write(LogIDs id, const char *fmt, ...) +{ if (!logFileValid) { return false; } @@ -198,56 +128,61 @@ bool EQEMuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list return false; } LockMutex lock(&MLog[id]); - if (!logFileValid) - return false; //check again for threading race reasons (to avoid two mutexes) - + if (!logFileValid) { + return false; //check again for threading race reasons (to avoid two mutexes) + } time_t aclock; struct tm *newtime; - time( &aclock ); /* Get time in seconds */ newtime = localtime( &aclock ); /* Convert time to struct */ - - va_list tmpargptr; - + if (dofile) + #ifndef NO_PIDLOG + fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); + #else + fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); + #endif + va_list argptr, tmpargptr; + va_start(argptr, fmt); if (dofile) { -#ifndef NO_PIDLOG - fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] %s", newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix); -#else - fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] %s", getpid(), newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix); -#endif va_copy(tmpargptr, argptr); vfprintf( fp[id], fmt, tmpargptr ); } - if(logCallbackPva[id]) { - msgCallbackPva p = logCallbackPva[id]; + if (logCallbackFmt[id]) { + msgCallbackFmt p = logCallbackFmt[id]; va_copy(tmpargptr, argptr); - p(id, prefix, fmt, tmpargptr ); + p(id, fmt, tmpargptr ); } if (pLogStatus[id] & 2) { if (pLogStatus[id] & 8) { - fprintf(stderr, "[%s] %s", LogNames[id], prefix); + fprintf(stderr, "[%s] ", LogNames[id]); vfprintf( stderr, fmt, argptr ); - } - else { - fprintf(stdout, "[%s] %s", LogNames[id], prefix); + } else { + fprintf(stdout, "[%s] ", LogNames[id]); vfprintf( stdout, fmt, argptr ); } } va_end(argptr); - if (dofile) + if (dofile) { fprintf(fp[id], "\n"); - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) - fprintf(stderr, "\n"); - else - fprintf(stdout, "\n"); } - if(dofile) + if (pLogStatus[id] & 2) { + if (pLogStatus[id] & 8) { + fprintf(stderr, "\n"); + fflush(stderr); + } else { + fprintf(stdout, "\n"); + fflush(stdout); + } + } + if (dofile) { fflush(fp[id]); + } return true; } -bool EQEMuLog::writebuf(LogIDs id, const char *buf, uint8 size, uint32 count) { +//write with Prefix and a VA_list +bool EQEMuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list argptr) +{ if (!logFileValid) { return false; } @@ -258,30 +193,92 @@ bool EQEMuLog::writebuf(LogIDs id, const char *buf, uint8 size, uint32 count) { if (pLogStatus[id] & 1) { dofile = open(id); } - if (!(dofile || pLogStatus[id] & 2)) + if (!(dofile || pLogStatus[id] & 2)) { return false; + } LockMutex lock(&MLog[id]); - if (!logFileValid) - return false; //check again for threading race reasons (to avoid two mutexes) - + if (!logFileValid) { + return false; //check again for threading race reasons (to avoid two mutexes) + } time_t aclock; struct tm *newtime; - time( &aclock ); /* Get time in seconds */ newtime = localtime( &aclock ); /* Convert time to struct */ + va_list tmpargptr; + if (dofile) { + #ifndef NO_PIDLOG + fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] %s", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix); + #else + fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] %s", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix); + #endif + va_copy(tmpargptr, argptr); + vfprintf( fp[id], fmt, tmpargptr ); + } + if (logCallbackPva[id]) { + msgCallbackPva p = logCallbackPva[id]; + va_copy(tmpargptr, argptr); + p(id, prefix, fmt, tmpargptr ); + } + if (pLogStatus[id] & 2) { + if (pLogStatus[id] & 8) { + fprintf(stderr, "[%s] %s", LogNames[id], prefix); + vfprintf( stderr, fmt, argptr ); + } else { + fprintf(stdout, "[%s] %s", LogNames[id], prefix); + vfprintf( stdout, fmt, argptr ); + } + } + va_end(argptr); + if (dofile) { + fprintf(fp[id], "\n"); + } + if (pLogStatus[id] & 2) { + if (pLogStatus[id] & 8) { + fprintf(stderr, "\n"); + } else { + fprintf(stdout, "\n"); + } + } + if (dofile) { + fflush(fp[id]); + } + return true; +} +bool EQEMuLog::writebuf(LogIDs id, const char *buf, uint8 size, uint32 count) +{ + if (!logFileValid) { + return false; + } + if (id >= MaxLogID) { + return false; + } + bool dofile = false; + if (pLogStatus[id] & 1) { + dofile = open(id); + } + if (!(dofile || pLogStatus[id] & 2)) { + return false; + } + LockMutex lock(&MLog[id]); + if (!logFileValid) { + return false; //check again for threading race reasons (to avoid two mutexes) + } + time_t aclock; + struct tm *newtime; + time( &aclock ); /* Get time in seconds */ + newtime = localtime( &aclock ); /* Convert time to struct */ if (dofile) -#ifndef NO_PIDLOG - fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); -#else - fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); -#endif - + #ifndef NO_PIDLOG + fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); + #else + fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); + #endif if (dofile) { fwrite(buf, size, count, fp[id]); fprintf(fp[id], "\n"); } - if(logCallbackBuf[id]) { + if (logCallbackBuf[id]) { msgCallbackBuf p = logCallbackBuf[id]; p(id, buf, size, count); } @@ -296,12 +293,14 @@ bool EQEMuLog::writebuf(LogIDs id, const char *buf, uint8 size, uint32 count) { fprintf(stdout, "\n"); } } - if(dofile) + if (dofile) { fflush(fp[id]); + } return true; } -bool EQEMuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) { +bool EQEMuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) +{ va_list argptr, tmpargptr; va_start(argptr, fmt); if (dofile) { @@ -309,132 +308,146 @@ bool EQEMuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) { vfprintf( fp[id], fmt, tmpargptr ); } if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) + if (pLogStatus[id] & 8) { vfprintf( stderr, fmt, argptr ); - else + } else { vfprintf( stdout, fmt, argptr ); + } } va_end(argptr); return true; }; -bool EQEMuLog::Dump(LogIDs id, uint8* data, uint32 size, uint32 cols, uint32 skip) { +bool EQEMuLog::Dump(LogIDs id, uint8* data, uint32 size, uint32 cols, uint32 skip) +{ if (!logFileValid) { -#if EQDEBUG >= 10 - std::cerr << "Error: Dump() from null pointer" << std::endl; -#endif + #if EQDEBUG >= 10 + std::cerr << "Error: Dump() from null pointer" << std::endl; + #endif return false; } - if (size == 0) + if (size == 0) { return true; - if (!LogFile) + } + if (!LogFile) { return false; - if (id >= MaxLogID) + } + if (id >= MaxLogID) { return false; + } bool dofile = false; if (pLogStatus[id] & 1) { dofile = open(id); } - if (!(dofile || pLogStatus[id] & 2)) + if (!(dofile || pLogStatus[id] & 2)) { return false; + } LockMutex lock(&MLog[id]); - if (!logFileValid) - return false; //check again for threading race reasons (to avoid two mutexes) - + if (!logFileValid) { + return false; //check again for threading race reasons (to avoid two mutexes) + } write(id, "Dumping Packet: %i", size); // Output as HEX - - int beginningOfLineOffset = 0; + int beginningOfLineOffset = 0; uint32 indexInData; std::string asciiOutput; - - for(indexInData=skip; indexInData= 32 && data[indexInData] < 127) - { + if (data[indexInData] >= 32 && data[indexInData] < 127) { // According to http://msdn.microsoft.com/en-us/library/vstudio/ee404875(v=vs.100).aspx - // Visual Studio 2010 doesn't have std::to_string(int) but it does have the long long + // Visual Studio 2010 doesn't have std::to_string(int) but it does have the long long // version. asciiOutput.append(std::to_string((long long)data[indexInData])); - } - else - { + } else { asciiOutput.append("."); } } - uint32 k = ((indexInData-skip)-1)%cols; - if (k < 8) + uint32 k = ((indexInData - skip) - 1) % cols; + if (k < 8) { writeNTS(id, dofile, " "); - for (uint32 h = k+1; h < cols; h++) { + } + for (uint32 h = k + 1; h < cols; h++) { writeNTS(id, dofile, " "); } writeNTS(id, dofile, " | %s\n", asciiOutput.c_str()); - if (dofile) + if (dofile) { fflush(fp[id]); + } return true; } -void EQEMuLog::SetCallback(LogIDs id, msgCallbackFmt proc) { - if (!logFileValid) +void EQEMuLog::SetCallback(LogIDs id, msgCallbackFmt proc) +{ + if (!logFileValid) { return; + } if (id >= MaxLogID) { return; } logCallbackFmt[id] = proc; } -void EQEMuLog::SetCallback(LogIDs id, msgCallbackBuf proc) { - if (!logFileValid) +void EQEMuLog::SetCallback(LogIDs id, msgCallbackBuf proc) +{ + if (!logFileValid) { return; + } if (id >= MaxLogID) { return; } logCallbackBuf[id] = proc; } -void EQEMuLog::SetCallback(LogIDs id, msgCallbackPva proc) { - if (!logFileValid) +void EQEMuLog::SetCallback(LogIDs id, msgCallbackPva proc) +{ + if (!logFileValid) { return; + } if (id >= MaxLogID) { return; } logCallbackPva[id] = proc; } -void EQEMuLog::SetAllCallbacks(msgCallbackFmt proc) { - if (!logFileValid) +void EQEMuLog::SetAllCallbacks(msgCallbackFmt proc) +{ + if (!logFileValid) { return; + } int r; - for(r = Status; r < MaxLogID; r++) { + for (r = Status; r < MaxLogID; r++) { SetCallback((LogIDs)r, proc); } } -void EQEMuLog::SetAllCallbacks(msgCallbackBuf proc) { - if (!logFileValid) +void EQEMuLog::SetAllCallbacks(msgCallbackBuf proc) +{ + if (!logFileValid) { return; + } int r; - for(r = Status; r < MaxLogID; r++) { + for (r = Status; r < MaxLogID; r++) { SetCallback((LogIDs)r, proc); } } -void EQEMuLog::SetAllCallbacks(msgCallbackPva proc) { - if (!logFileValid) +void EQEMuLog::SetAllCallbacks(msgCallbackPva proc) +{ + if (!logFileValid) { return; + } int r; - for(r = Status; r < MaxLogID; r++) { + for (r = Status; r < MaxLogID; r++) { SetCallback((LogIDs)r, proc); } } From f81f62670e224e544a7bf5c35bbbc04a9c65d818 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 7 Dec 2014 03:08:27 -0600 Subject: [PATCH 008/153] Header cleanup of aggro.cpp --- zone/aggro.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/zone/aggro.cpp b/zone/aggro.cpp index a904b9707..dc9aa50ec 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -15,18 +15,22 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" -#include -#include -#include "masterentity.h" #include "../common/faction.h" -#include "map.h" -#include "../common/spdat.h" -#include "../common/skills.h" -#include "../common/misc_functions.h" #include "../common/rulesys.h" -#include "string_ids.h" -#include +#include "../common/spdat.h" + +#include "client.h" +#include "corpse.h" +#include "entity.h" +#include "mob.h" + +#ifdef BOTS +#include "bot.h" +#endif + +#include "map.h" extern Zone* zone; //#define LOSDEBUG 6 From 70f570dbd9fb7837a6879bed39011665d5105e76 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Mon, 8 Dec 2014 01:22:01 -0500 Subject: [PATCH 009/153] Implemented support for allowing most focus effects to now be usable by NPCs (ie Heal/Damage focus, cast time, spell range ect) from both spell buffs and items. Rule for enabling spell focus is TRUE by default Rule for enabling item focus is FALSE by default. Consilidated a number of redundant client / mob functions to use the same pathway for calculating effect values. --- common/ruletypes.h | 2 + zone/aa.cpp | 3 +- zone/aggro.cpp | 6 +- zone/attack.cpp | 16 ---- zone/bonuses.cpp | 7 ++ zone/client.h | 6 -- zone/effects.cpp | 187 ++++++++++++++++------------------------- zone/merc.cpp | 147 -------------------------------- zone/merc.h | 2 - zone/mob.cpp | 9 +- zone/mob.h | 10 ++- zone/npc.h | 6 +- zone/pets.cpp | 2 +- zone/spell_effects.cpp | 177 +++++++++++++++++++++++++++++--------- zone/spells.cpp | 31 +++---- 15 files changed, 250 insertions(+), 361 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index 8ff077809..9874e4002 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -325,6 +325,8 @@ RULE_INT ( Spells, AI_IdleBeneficialChance, 100) // Chance while idle to do a be RULE_BOOL ( Spells, SHDProcIDOffByOne, true) // pre June 2009 SHD spell procs were off by 1, they stopped doing this in June 2009 (so UF+ spell files need this false) RULE_BOOL ( Spells, Jun182014HundredHandsRevamp, false) // this should be true for if you import a spell file newer than June 18, 2014 RULE_BOOL ( Spells, SwarmPetTargetLock, false) // Use old method of swarm pets target locking till target dies then despawning. +RULE_BOOL ( Spells, NPC_UseFocusFromSpells, true) // Allow npcs to use most spell derived focus effects. +RULE_BOOL ( Spells, NPC_UseFocusFromItems, false) // Allow npcs to use most item derived focus effects. RULE_CATEGORY_END() RULE_CATEGORY( Combat ) diff --git a/zone/aa.cpp b/zone/aa.cpp index 9cb6cf43f..28c4f60d7 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -519,8 +519,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u } } - if(IsClient()) - pet.duration += (CastToClient()->GetFocusEffect(focusSwarmPetDuration, spell_id) / 1000); + pet.duration += GetFocusEffect(focusSwarmPetDuration, spell_id) / 1000; pet.npc_id = record.npc_type; diff --git a/zone/aggro.cpp b/zone/aggro.cpp index dc9aa50ec..3e833aad9 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -1128,8 +1128,7 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, bool isproc) int HateMod = RuleI(Aggro, SpellAggroMod); - if (IsClient()) - HateMod += CastToClient()->GetFocusEffect(focusSpellHateMod, spell_id); + HateMod += GetFocusEffect(focusSpellHateMod, spell_id); AggroAmount = (AggroAmount * HateMod) / 100; @@ -1178,8 +1177,7 @@ int32 Mob::CheckHealAggroAmount(uint16 spell_id, uint32 heal_possible) if (AggroAmount > 0) { int HateMod = RuleI(Aggro, SpellAggroMod); - if (IsClient()) - HateMod += CastToClient()->GetFocusEffect(focusSpellHateMod, spell_id); + HateMod += GetFocusEffect(focusSpellHateMod, spell_id); //Live AA - Spell casting subtlety HateMod += aabonuses.hatemod + spellbonuses.hatemod + itembonuses.hatemod; diff --git a/zone/attack.cpp b/zone/attack.cpp index 825e90b58..b8c0a11ed 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1386,15 +1386,6 @@ void Client::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes att if(spell_id==0) spell_id = SPELL_UNKNOWN; - if(spell_id!=0 && spell_id != SPELL_UNKNOWN && other && damage > 0) - { - if(other->IsNPC() && !other->IsPet()) - { - float npcspellscale = other->CastToNPC()->GetSpellScale(); - damage = ((float)damage * npcspellscale) / (float)100; - } - } - // cut all PVP spell damage to 2/3 -solar // Blasting ourselfs is considered PvP //Don't do PvP mitigation if the caster is damaging himself @@ -3806,13 +3797,6 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id) int32 curhp = GetHP(); uint32 acthealed = 0; - if (caster && amount > 0) { - if (caster->IsNPC() && !caster->IsPet()) { - float npchealscale = caster->CastToNPC()->GetHealScale(); - amount = (static_cast(amount) * npchealscale) / 100.0f; - } - } - if (amount > (maxhp - curhp)) acthealed = (maxhp - curhp); else diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 7944c8ba6..ac9602a67 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -3050,6 +3050,13 @@ void NPC::CalcItemBonuses(StatBonuses *newbon) if (cur->Worn.Effect>0 && (cur->Worn.Type == ET_WornEffect)) { // latent effects ApplySpellsBonuses(cur->Worn.Effect, cur->Worn.Level, newbon); } + + if (RuleB(Spells, NPC_UseFocusFromItems)){ + if (cur->Focus.Effect>0 && (cur->Focus.Type == ET_Focus)){ // focus effects + ApplySpellsBonuses(cur->Focus.Effect, cur->Focus.Level, newbon, 0, true); + } + } + if (cur->Haste > newbon->haste) newbon->haste = cur->Haste; } diff --git a/zone/client.h b/zone/client.h index a63f37b2f..7cbddfdb2 100644 --- a/zone/client.h +++ b/zone/client.h @@ -485,14 +485,8 @@ public: inline virtual int32 GetDelayDeath() const { return aabonuses.DelayDeath + spellbonuses.DelayDeath + itembonuses.DelayDeath + 11; } - float GetActSpellRange(uint16 spell_id, float range, bool IsBard = false); - int32 GetActSpellDamage(uint16 spell_id, int32 value, Mob* target = nullptr); - int32 GetActSpellHealing(uint16 spell_id, int32 value, Mob* target = nullptr); int32 GetActSpellCost(uint16 spell_id, int32); - int32 GetActSpellDuration(uint16 spell_id, int32); int32 GetActSpellCasttime(uint16 spell_id, int32); - int32 GetDotFocus(uint16 spell_id, int32 value); - int32 GetActDoTDamage(uint16 spell_id, int32 value, Mob* target = nullptr); virtual bool CheckFizzle(uint16 spell_id); virtual bool CheckSpellLevelRestriction(uint16 spell_id); virtual int GetCurrentBuffSlots() const; diff --git a/zone/effects.cpp b/zone/effects.cpp index 5c542d16d..54e206e85 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -30,7 +30,7 @@ #include "string_ids.h" #include "npc_ai.h" -float Client::GetActSpellRange(uint16 spell_id, float range, bool IsBard) +float Mob::GetActSpellRange(uint16 spell_id, float range, bool IsBard) { float extrange = 100; @@ -39,94 +39,58 @@ float Client::GetActSpellRange(uint16 spell_id, float range, bool IsBard) return (range * extrange) / 100; } - -int32 NPC::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { - - //Quest scale all NPC spell damage via $npc->SetSpellFocusDMG(value) - //DoT Damage - Mob::DoBuffTic [spell_effects.cpp] / Direct Damage Mob::SpellEffect [spell_effects.cpp] - - int32 dmg = value; - - if (target) { - value += dmg*target->GetVulnerability(this, spell_id, 0)/100; - - if (spells[spell_id].buffduration == 0) - value -= target->GetFcDamageAmtIncoming(this, spell_id); - else - value -= target->GetFcDamageAmtIncoming(this, spell_id)/spells[spell_id].buffduration; - } - - value += dmg*GetSpellFocusDMG()/100; - - if (AI_HasSpellsEffects()){ - int16 chance = 0; - int ratio = 0; - - if (spells[spell_id].buffduration == 0) { - chance += spellbonuses.CriticalSpellChance + spellbonuses.FrenziedDevastation; - - if (chance && zone->random.Roll(chance)) { - ratio += spellbonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncNoStack; - value += (value*ratio)/100; - entity_list.MessageClose_StringID(this, true, 100, MT_SpellCrits, OTHER_CRIT_BLAST, GetCleanName(), itoa(-value)); - } - } - else { - chance += spellbonuses.CriticalDoTChance; - if (chance && zone->random.Roll(chance)) { - ratio += spellbonuses.DotCritDmgIncrease; - value += (value*ratio)/100; - } - } - } - - return value; -} - -int32 Client::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { +int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { if (spells[spell_id].targettype == ST_Self) return value; + if (IsNPC()) + value += value*CastToNPC()->GetSpellFocusDMG()/100; + bool Critical = false; int32 value_BaseEffect = 0; + int chance = 0; value_BaseEffect = value + (value*GetFocusEffect(focusFcBaseEffects, spell_id)/100); // Need to scale HT damage differently after level 40! It no longer scales by the constant value in the spell file. It scales differently, instead of 10 more damage per level, it does 30 more damage per level. So we multiply the level minus 40 times 20 if they are over level 40. - if ( (spell_id == SPELL_HARM_TOUCH || spell_id == SPELL_HARM_TOUCH2 || spell_id == SPELL_IMP_HARM_TOUCH ) && GetLevel() > 40) + if ((spell_id == SPELL_HARM_TOUCH || spell_id == SPELL_HARM_TOUCH2 || spell_id == SPELL_IMP_HARM_TOUCH ) && GetLevel() > 40) value -= (GetLevel() - 40) * 20; //This adds the extra damage from the AA Unholy Touch, 450 per level to the AA Improved Harm TOuch. - if (spell_id == SPELL_IMP_HARM_TOUCH) //Improved Harm Touch + if (spell_id == SPELL_IMP_HARM_TOUCH && IsClient()) //Improved Harm Touch value -= GetAA(aaUnholyTouch) * 450; //Unholy Touch - int chance = RuleI(Spells, BaseCritChance); //Wizard base critical chance is 2% (Does not scale with level) + chance = RuleI(Spells, BaseCritChance); //Wizard base critical chance is 2% (Does not scale with level) chance += itembonuses.CriticalSpellChance + spellbonuses.CriticalSpellChance + aabonuses.CriticalSpellChance; - chance += itembonuses.FrenziedDevastation + spellbonuses.FrenziedDevastation + aabonuses.FrenziedDevastation; - if (chance > 0 || (GetClass() == WIZARD && GetLevel() >= RuleI(Spells, WizCritLevel))) { + //Crtical Hit Calculation pathway + if (chance > 0 || (IsClient() && GetClass() == WIZARD && GetLevel() >= RuleI(Spells, WizCritLevel))) { int32 ratio = RuleI(Spells, BaseCritRatio); //Critical modifier is applied from spell effects only. Keep at 100 for live like criticals. //Improved Harm Touch is a guaranteed crit if you have at least one level of SCF. - if (spell_id == SPELL_IMP_HARM_TOUCH && (GetAA(aaSpellCastingFury) > 0) && (GetAA(aaUnholyTouch) > 0)) + if (spell_id == SPELL_IMP_HARM_TOUCH && IsClient() && (GetAA(aaSpellCastingFury) > 0) && (GetAA(aaUnholyTouch) > 0)) chance = 100; - if (zone->random.Roll(chance)) { + if (zone->random.Roll(chance)) { Critical = true; ratio += itembonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncrease + aabonuses.SpellCritDmgIncrease; ratio += itembonuses.SpellCritDmgIncNoStack + spellbonuses.SpellCritDmgIncNoStack + aabonuses.SpellCritDmgIncNoStack; } - else if (GetClass() == WIZARD && (GetLevel() >= RuleI(Spells, WizCritLevel)) && (zone->random.Roll(RuleI(Spells, WizCritChance)))) { - ratio += zone->random.Int(20,70); //Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio. (20-70 is parse confirmed) - Critical = true; + else if ((IsClient() && GetClass() == WIZARD) || (IsMerc() && GetClass() == CASTERDPS)) { + if ((GetLevel() >= RuleI(Spells, WizCritLevel)) && zone->random.Roll(RuleI(Spells, WizCritChance))){ + //Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio. (20-70 is parse confirmed) + ratio += zone->random.Int(20,70); + Critical = true; + } } - ratio += RuleI(Spells, WizCritRatio); //Default is zero - + if (IsClient() && GetClass() == WIZARD) + ratio += RuleI(Spells, WizCritRatio); //Default is zero + if (Critical){ value = value_BaseEffect*ratio/100; @@ -147,14 +111,19 @@ int32 Client::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5) value -= GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value)*ratio/100; + else if (IsNPC() && CastToNPC()->GetSpellScale()) + value = int(static_cast(value) * CastToNPC()->GetSpellScale() / 100.0f); + entity_list.MessageClose_StringID(this, true, 100, MT_SpellCrits, OTHER_CRIT_BLAST, GetName(), itoa(-value)); - Message_StringID(MT_SpellCrits, YOU_CRIT_BLAST, itoa(-value)); + + if (IsClient()) + Message_StringID(MT_SpellCrits, YOU_CRIT_BLAST, itoa(-value)); return value; } } - + //Non Crtical Hit Calculation pathway value = value_BaseEffect; value += value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100; @@ -173,14 +142,20 @@ int32 Client::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5) value -= GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value); + if (IsNPC() && CastToNPC()->GetSpellScale()) + value = int(static_cast(value) * CastToNPC()->GetSpellScale() / 100.0f); + return value; } -int32 Client::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) { +int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) { if (target == nullptr) return value; + if (IsNPC()) + value += value*CastToNPC()->GetSpellFocusDMG()/100; + int32 value_BaseEffect = 0; int32 extra_dmg = 0; int16 chance = 0; @@ -209,25 +184,28 @@ int32 Client::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) { } value -= extra_dmg; + } + else { - return value; + value = value_BaseEffect; + value += value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100; + value += value_BaseEffect*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100; + value += value_BaseEffect*target->GetVulnerability(this, spell_id, 0)/100; + extra_dmg = target->GetFcDamageAmtIncoming(this, spell_id) + + GetFocusEffect(focusFcDamageAmtCrit, spell_id) + + GetFocusEffect(focusFcDamageAmt, spell_id); + + if (extra_dmg) { + int duration = CalcBuffDuration(this, this, spell_id); + if (duration > 0) + extra_dmg /= duration; + } + + value -= extra_dmg; } - value = value_BaseEffect; - value += value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100; - value += value_BaseEffect*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100; - value += value_BaseEffect*target->GetVulnerability(this, spell_id, 0)/100; - extra_dmg = target->GetFcDamageAmtIncoming(this, spell_id) + - GetFocusEffect(focusFcDamageAmtCrit, spell_id) + - GetFocusEffect(focusFcDamageAmt, spell_id); - - if (extra_dmg) { - int duration = CalcBuffDuration(this, this, spell_id); - if (duration > 0) - extra_dmg /= duration; - } - - value -= extra_dmg; + if (IsNPC() && CastToNPC()->GetSpellScale()) + value = int(static_cast(value) * CastToNPC()->GetSpellScale() / 100.0f); return value; } @@ -254,39 +232,14 @@ int32 Mob::GetExtraSpellAmt(uint16 spell_id, int32 extra_spell_amt, int32 base_s return extra_spell_amt; } - -int32 NPC::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { - - //Scale all NPC spell healing via SetSpellFocusHeal(value) - - value += value*GetSpellFocusHeal()/100; - - if (target) { - value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id); - value += value*target->GetHealRate(spell_id, this)/100; - } - - //Allow for critical heal chance if NPC is loading spell effect bonuses. - if (AI_HasSpellsEffects()){ - if(spells[spell_id].buffduration < 1) { - if(spellbonuses.CriticalHealChance && (zone->random.Roll(spellbonuses.CriticalHealChance))) { - value = value*2; - entity_list.MessageClose_StringID(this, true, 100, MT_SpellCrits, OTHER_CRIT_HEAL, GetCleanName(), itoa(value)); - } - } - else if(spellbonuses.CriticalHealOverTime && (zone->random.Roll(spellbonuses.CriticalHealOverTime))) { - value = value*2; - } - } - - return value; -} - -int32 Client::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { +int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { if (target == nullptr) target = this; + if (IsNPC()) + value += value*CastToNPC()->GetSpellFocusHeal()/100; + int32 value_BaseEffect = 0; int16 chance = 0; int8 modifier = 1; @@ -323,10 +276,15 @@ int32 Client::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { value += value*target->GetHealRate(spell_id, this)/100; + if (IsNPC() && CastToNPC()->GetHealScale()) + value = int(static_cast(value) * CastToNPC()->GetHealScale() / 100.0f); + if (Critical) { entity_list.MessageClose_StringID(this, true, 100, MT_SpellCrits, OTHER_CRIT_HEAL, GetName(), itoa(value)); - Message_StringID(MT_SpellCrits, YOU_CRIT_HEAL, itoa(value)); + + if (IsClient()) + Message_StringID(MT_SpellCrits, YOU_CRIT_HEAL, itoa(value)); } return value; @@ -343,9 +301,12 @@ int32 Client::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay); if(chance && zone->random.Roll(chance)) - return (value * 2); + value *= 2; } + if (IsNPC() && CastToNPC()->GetHealScale()) + value = int(static_cast(value) * CastToNPC()->GetHealScale() / 100.0f); + return value; } @@ -359,9 +320,9 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost) cost *= 2; // Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell - if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5) + if(itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5) { - int16 mana_back = this->itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100; + int16 mana_back = itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100; // Doesnt generate mana, so best case is a free spell if(mana_back > cost) mana_back = cost; @@ -451,7 +412,7 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost) return cost; } -int32 Client::GetActSpellDuration(uint16 spell_id, int32 duration) +int32 Mob::GetActSpellDuration(uint16 spell_id, int32 duration) { if (spells[spell_id].not_extendable) return duration; @@ -463,7 +424,7 @@ int32 Client::GetActSpellDuration(uint16 spell_id, int32 duration) // Only need this for clients, since the change was for bard songs, I assume we should keep non bard songs getting +1 // However if its bard or not and is mez, charm or fear, we need to add 1 so that client is in sync - if (!(IsShortDurationBuff(spell_id) && IsBardSong(spell_id)) || + if (IsClient() && !(IsShortDurationBuff(spell_id) && IsBardSong(spell_id)) || IsFearSpell(spell_id) || IsCharmSpell(spell_id) || IsMezSpell(spell_id) || @@ -664,7 +625,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { if(spell.recast_time > 0) { uint32 reduced_recast = spell.recast_time / 1000; - reduced_recast -= CastToClient()->GetFocusEffect(focusReduceRecastTime, spell_id); + reduced_recast -= GetFocusEffect(focusReduceRecastTime, spell_id); if(reduced_recast <= 0){ reduced_recast = 0; if (GetPTimers().Enabled((uint32)DiscTimer)) diff --git a/zone/merc.cpp b/zone/merc.cpp index 437790588..1c4165c1e 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -2656,153 +2656,6 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) { return realTotal + realTotal2 + realTotal3; } - -int32 Merc::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { - - if (spells[spell_id].targettype == ST_Self) - return value; - - bool Critical = false; - int32 value_BaseEffect = 0; - - value_BaseEffect = value + (value*GetFocusEffect(focusFcBaseEffects, spell_id)/100); - - int chance = RuleI(Spells, BaseCritChance); - chance += itembonuses.CriticalSpellChance + spellbonuses.CriticalSpellChance + aabonuses.CriticalSpellChance; - - if (chance > 0){ - - int32 ratio = RuleI(Spells, BaseCritRatio); //Critical modifier is applied from spell effects only. Keep at 100 for live like criticals. - - if (zone->random.Roll(chance)) { - Critical = true; - ratio += itembonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncrease + aabonuses.SpellCritDmgIncrease; - ratio += itembonuses.SpellCritDmgIncNoStack + spellbonuses.SpellCritDmgIncNoStack + aabonuses.SpellCritDmgIncNoStack; - } - - else if (GetClass() == CASTERDPS && (GetLevel() >= RuleI(Spells, WizCritLevel)) && (zone->random.Roll(RuleI(Spells, WizCritChance)))) { - ratio = zone->random.Int(1,100); //Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio. - Critical = true; - } - - ratio += RuleI(Spells, WizCritRatio); //Default is zero - - if (Critical){ - - value = value_BaseEffect*ratio/100; - - value += value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100; - - value += int(value_BaseEffect*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100)*ratio/100; - - if (target) { - value += int(value_BaseEffect*target->GetVulnerability(this, spell_id, 0)/100)*ratio/100; - value -= target->GetFcDamageAmtIncoming(this, spell_id); - } - - value -= GetFocusEffect(focusFcDamageAmtCrit, spell_id)*ratio/100; - - value -= GetFocusEffect(focusFcDamageAmt, spell_id); - - if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5) - value -= GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value)*ratio/100; - - value = (value * GetSpellScale() / 100); - - entity_list.MessageClose_StringID(this, false, 100, MT_SpellCrits, - OTHER_CRIT_BLAST, GetName(), itoa(-value)); - - return value; - } - } - - value = value_BaseEffect; - - value += value_BaseEffect*GetFocusEffect(focusImprovedDamage, spell_id)/100; - - value += value_BaseEffect*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100; - - if (target) { - value += value_BaseEffect*target->GetVulnerability(this, spell_id, 0)/100; - value -= target->GetFcDamageAmtIncoming(this, spell_id); - } - - value -= GetFocusEffect(focusFcDamageAmtCrit, spell_id); - - value -= GetFocusEffect(focusFcDamageAmt, spell_id); - - if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5) - value -= GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value); - - value = (value * GetSpellScale() / 100); - - return value; -} - -int32 Merc::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { - - if (target == nullptr) - target = this; - - int32 value_BaseEffect = 0; - int16 chance = 0; - int8 modifier = 1; - bool Critical = false; - - value_BaseEffect = value + (value*GetFocusEffect(focusFcBaseEffects, spell_id)/100); - - value = value_BaseEffect; - - value += int(value_BaseEffect*GetFocusEffect(focusImprovedHeal, spell_id)/100); - - // Instant Heals - if(spells[spell_id].buffduration < 1) { - - chance += itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance; - - chance += target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id); - - if (spellbonuses.CriticalHealDecay) - chance += GetDecayEffectValue(spell_id, SE_CriticalHealDecay); - - if(chance && zone->random.Roll(chance)) { - Critical = true; - modifier = 2; //At present time no critical heal amount modifier SPA exists. - } - - value *= modifier; - value += GetFocusEffect(focusFcHealAmtCrit, spell_id) * modifier; - value += GetFocusEffect(focusFcHealAmt, spell_id); - value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id); - - if(itembonuses.HealAmt && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5) - value += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, value) * modifier; - - value += value*target->GetHealRate(spell_id, this)/100; - - if (Critical) - entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s performs an exceptional heal! (%d)", GetName(), value); - - return value; - } - - //Heal over time spells. [Heal Rate and Additional Healing effects do not increase this value] - else { - - chance = itembonuses.CriticalHealOverTime + spellbonuses.CriticalHealOverTime + aabonuses.CriticalHealOverTime; - - chance += target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id); - - if (spellbonuses.CriticalRegenDecay) - chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay); - - if(chance && zone->random.Roll(chance)) - return (value * 2); - } - - return value; -} - int32 Merc::GetActSpellCost(uint16 spell_id, int32 cost) { // Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell diff --git a/zone/merc.h b/zone/merc.h index fdcdbec49..167fe70d6 100644 --- a/zone/merc.h +++ b/zone/merc.h @@ -83,8 +83,6 @@ public: Corpse* GetGroupMemberCorpse(); // Merc Spell Casting Methods - virtual int32 GetActSpellDamage(uint16 spell_id, int32 value, Mob* target = nullptr); - virtual int32 GetActSpellHealing(uint16 spell_id, int32 value, Mob* target = nullptr); virtual int32 GetActSpellCasttime(uint16 spell_id, int32 casttime); virtual int32 GetActSpellCost(uint16 spell_id, int32 cost); int8 GetChanceToCastBySpellType(int16 spellType); diff --git a/zone/mob.cpp b/zone/mob.cpp index 13a2eb06b..f7193fbed 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -2926,6 +2926,10 @@ uint32 Mob::GetLevelHP(uint8 tlevel) } int32 Mob::GetActSpellCasttime(uint16 spell_id, int32 casttime) { + + int32 cast_reducer = 0; + cast_reducer += GetFocusEffect(focusSpellHaste, spell_id); + if (level >= 60 && casttime > 1000) { casttime = casttime / 2; @@ -2938,6 +2942,8 @@ int32 Mob::GetActSpellCasttime(uint16 spell_id, int32 casttime) { else casttime -= cast_deduction; } + + casttime = (casttime*(100 - cast_reducer)/100); return(casttime); } @@ -2973,8 +2979,7 @@ void Mob::ExecWeaponProc(const ItemInst *inst, uint16 spell_id, Mob *on) { bool twinproc = false; int32 twinproc_chance = 0; - if(IsClient()) - twinproc_chance = CastToClient()->GetFocusEffect(focusTwincast, spell_id); + twinproc_chance = GetFocusEffect(focusTwincast, spell_id); if(twinproc_chance && zone->random.Roll(twinproc_chance)) twinproc = true; diff --git a/zone/mob.h b/zone/mob.h index 6135c6571..dddce98f8 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -198,11 +198,12 @@ public: bool item_bonus = false, uint32 ticsremaining = 0, int buffslot = -1, bool IsAISpellEffect = false, uint16 effect_id = 0, int32 se_base = 0, int32 se_limit = 0, int32 se_max = 0); void NegateSpellsBonuses(uint16 spell_id); - virtual float GetActSpellRange(uint16 spell_id, float range, bool IsBard = false) { return range;} - virtual int32 GetActSpellDamage(uint16 spell_id, int32 value, Mob* target = nullptr) { return value; } - virtual int32 GetActSpellHealing(uint16 spell_id, int32 value, Mob* target = nullptr) { return value; } + virtual float GetActSpellRange(uint16 spell_id, float range, bool IsBard = false); + virtual int32 GetActSpellDamage(uint16 spell_id, int32 value, Mob* target = nullptr); + virtual int32 GetActDoTDamage(uint16 spell_id, int32 value, Mob* target); + virtual int32 GetActSpellHealing(uint16 spell_id, int32 value, Mob* target = nullptr); virtual int32 GetActSpellCost(uint16 spell_id, int32 cost){ return cost;} - virtual int32 GetActSpellDuration(uint16 spell_id, int32 duration){ return duration;} + virtual int32 GetActSpellDuration(uint16 spell_id, int32 duration); virtual int32 GetActSpellCasttime(uint16 spell_id, int32 casttime); float ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use_resist_override = false, int resist_override = 0, bool CharismaCheck = false, bool CharmTick = false, bool IsRoot = false); @@ -1044,6 +1045,7 @@ protected: int GetKickDamage(); int GetBashDamage(); virtual void ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg); + virtual int16 GetFocusEffect(focusType type, uint16 spell_id) { return 0; } void CalculateNewFearpoint(); float FindGroundZ(float new_x, float new_y, float z_offset=0.0); Map::Vertex UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &WaypointChange, bool &NodeReached); diff --git a/zone/npc.h b/zone/npc.h index cccf3ecf0..d4f3bfa64 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -135,9 +135,6 @@ public: void CalcNPCRegen(); void CalcNPCDamage(); - int32 GetActSpellDamage(uint16 spell_id, int32 value, Mob* target = nullptr); - int32 GetActSpellHealing(uint16 spell_id, int32 value, Mob* target = nullptr); - virtual void SetTarget(Mob* mob); virtual uint16 GetSkill(SkillUseTypes skill_num) const { if (skill_num <= HIGHEST_SKILL) { return skills[skill_num]; } return 0; } @@ -406,6 +403,8 @@ public: bool IsRaidTarget() const { return raid_target; }; + int16 GetFocusEffect(focusType type, uint16 spell_id); + protected: const NPCType* NPCTypedata; @@ -446,6 +445,7 @@ protected: virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0); AISpellsVar_Struct AISpellVar; + uint32 npc_spells_effects_id; std::vector AIspellsEffects; bool HasAISpellEffects; diff --git a/zone/pets.cpp b/zone/pets.cpp index 052a44bea..5c2bda36d 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -230,7 +230,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, int16 act_power = 0; // The actual pet power we'll use. if (petpower == -1) { if (this->IsClient()) { - act_power = CastToClient()->GetFocusEffect(focusPetPower, spell_id); + act_power = CastToClient()->GetFocusEffect(focusPetPower, spell_id);//Client only act_power = CastToClient()->mod_pet_power(act_power, spell_id); } } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 59526fbbc..9e7d87503 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -179,11 +179,8 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) int numhit = spells[spell_id].numhits; - if (caster && caster->IsClient()){ - numhit += numhit*caster->CastToClient()->GetFocusEffect(focusFcLimitUse, spell_id)/100; - numhit += caster->CastToClient()->GetFocusEffect(focusIncreaseNumHits, spell_id); - } - + numhit += numhit*caster->GetFocusEffect(focusFcLimitUse, spell_id)/100; + numhit += caster->GetFocusEffect(focusIncreaseNumHits, spell_id); buffs[buffslot].numhits = numhit; } @@ -714,7 +711,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.", stun_resist); if (caster->IsClient()) - effect_value += effect_value*caster->CastToClient()->GetFocusEffect(focusFcStunTimeMod, spell_id)/100; + effect_value += effect_value*caster->GetFocusEffect(focusFcStunTimeMod, spell_id)/100; Stun(effect_value); } else { @@ -2265,8 +2262,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) int16 focus = 0; int ReuseTime = spells[spell_id].recast_time + spells[spell_id].recovery_time; - if(caster->IsClient()) - focus = caster->CastToClient()->GetFocusEffect(focusFcBaseEffects, spell_id); + focus = caster->GetFocusEffect(focusFcBaseEffects, spell_id); switch(spells[spell_id].skill) { @@ -3469,30 +3465,18 @@ void Mob::DoBuffTic(uint16 spell_id, int slot, uint32 ticsremaining, uint8 caste { effect_value = CalcSpellEffectValue(spell_id, i, caster_level, caster, ticsremaining); //Handle client cast DOTs here. - if (caster && caster->IsClient() && IsDetrimentalSpell(spell_id) && effect_value < 0) { - - effect_value = caster->CastToClient()->GetActDoTDamage(spell_id, effect_value, this); - - if (!caster->CastToClient()->GetFeigned()) - AddToHateList(caster, -effect_value); - } - - if(effect_value < 0) - { - if(caster) - { - if(!caster->IsClient()){ - - if (!IsClient()) //Allow NPC's to generate hate if casted on other NPC's. - AddToHateList(caster, -effect_value); - } - - if(caster->IsNPC()) - effect_value = caster->CastToNPC()->GetActSpellDamage(spell_id, effect_value, this); - - caster->ResourceTap(-effect_value, spell_id); + if (caster && effect_value < 0 && IsDetrimentalSpell(spell_id)){ + + if (caster->IsClient()){ + if (!caster->CastToClient()->GetFeigned()) + AddToHateList(caster, -effect_value); } + else if (!IsClient()) //Allow NPC's to generate hate if casted on other NPC's. + AddToHateList(caster, -effect_value); + effect_value = caster->GetActDoTDamage(spell_id, effect_value, this); + + caster->ResourceTap(-effect_value, spell_id); effect_value = -effect_value; Damage(caster, effect_value, spell_id, spell.skill, false, i, true); } else if(effect_value > 0) { @@ -5318,11 +5302,8 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) { //Improved Healing, Damage & Mana Reduction are handled differently in that some are random percentages //In these cases we need to find the most powerful effect, so that each piece of gear wont get its own chance - if((type == focusManaCost || type == focusImprovedHeal || type == focusImprovedDamage) - && RuleB(Spells, LiveLikeFocusEffects)) - { + if(RuleB(Spells, LiveLikeFocusEffects) && (type == focusManaCost || type == focusImprovedHeal || type == focusImprovedDamage)) rand_effectiveness = true; - } //Check if item focus effect exists for the client. if (itembonuses.FocusEffects[type]){ @@ -5540,6 +5521,122 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) { return realTotal + realTotal2 + realTotal3; } +int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) { + + int16 realTotal = 0; + int16 realTotal2 = 0; + bool rand_effectiveness = false; + + //Improved Healing, Damage & Mana Reduction are handled differently in that some are random percentages + //In these cases we need to find the most powerful effect, so that each piece of gear wont get its own chance + if(RuleB(Spells, LiveLikeFocusEffects) && (type == focusManaCost || type == focusImprovedHeal || type == focusImprovedDamage)) + rand_effectiveness = true; + + if (RuleB(Spells, NPC_UseFocusFromItems) && itembonuses.FocusEffects[type]){ + + const Item_Struct* TempItem = 0; + const Item_Struct* UsedItem = 0; + uint16 UsedFocusID = 0; + int16 Total = 0; + int16 focus_max = 0; + int16 focus_max_real = 0; + + //item focus + for(int i = 0; i < EmuConstants::EQUIPMENT_SIZE; i++){ + const Item_Struct *cur = database.GetItem(equipment[i]); + + if(!cur) + continue; + + TempItem = cur; + + if (TempItem && TempItem->Focus.Effect > 0 && TempItem->Focus.Effect != SPELL_UNKNOWN) { + if(rand_effectiveness) { + focus_max = CalcFocusEffect(type, TempItem->Focus.Effect, spell_id, true); + if (focus_max > 0 && focus_max_real >= 0 && focus_max > focus_max_real) { + focus_max_real = focus_max; + UsedItem = TempItem; + UsedFocusID = TempItem->Focus.Effect; + } else if (focus_max < 0 && focus_max < focus_max_real) { + focus_max_real = focus_max; + UsedItem = TempItem; + UsedFocusID = TempItem->Focus.Effect; + } + } + else { + Total = CalcFocusEffect(type, TempItem->Focus.Effect, spell_id); + if (Total > 0 && realTotal >= 0 && Total > realTotal) { + realTotal = Total; + UsedItem = TempItem; + UsedFocusID = TempItem->Focus.Effect; + } else if (Total < 0 && Total < realTotal) { + realTotal = Total; + UsedItem = TempItem; + UsedFocusID = TempItem->Focus.Effect; + } + } + } + } + + if(UsedItem && rand_effectiveness && focus_max_real != 0) + realTotal = CalcFocusEffect(type, UsedFocusID, spell_id); + } + + if (RuleB(Spells, NPC_UseFocusFromSpells) && spellbonuses.FocusEffects[type]){ + + //Spell Focus + int16 Total2 = 0; + int16 focus_max2 = 0; + int16 focus_max_real2 = 0; + + int buff_tracker = -1; + int buff_slot = 0; + uint16 focusspellid = 0; + uint16 focusspell_tracker = 0; + int buff_max = GetMaxTotalSlots(); + for (buff_slot = 0; buff_slot < buff_max; buff_slot++) { + focusspellid = buffs[buff_slot].spellid; + if (focusspellid == 0 || focusspellid >= SPDAT_RECORDS) + continue; + + if(rand_effectiveness) { + focus_max2 = CalcFocusEffect(type, focusspellid, spell_id, true); + if (focus_max2 > 0 && focus_max_real2 >= 0 && focus_max2 > focus_max_real2) { + focus_max_real2 = focus_max2; + buff_tracker = buff_slot; + focusspell_tracker = focusspellid; + } else if (focus_max2 < 0 && focus_max2 < focus_max_real2) { + focus_max_real2 = focus_max2; + buff_tracker = buff_slot; + focusspell_tracker = focusspellid; + } + } + else { + Total2 = CalcFocusEffect(type, focusspellid, spell_id); + if (Total2 > 0 && realTotal2 >= 0 && Total2 > realTotal2) { + realTotal2 = Total2; + buff_tracker = buff_slot; + focusspell_tracker = focusspellid; + } else if (Total2 < 0 && Total2 < realTotal2) { + realTotal2 = Total2; + buff_tracker = buff_slot; + focusspell_tracker = focusspellid; + } + } + } + + if(focusspell_tracker && rand_effectiveness && focus_max_real2 != 0) + realTotal2 = CalcFocusEffect(type, focusspell_tracker, spell_id); + + // For effects like gift of mana that only fire once, save the spellid into an array that consists of all available buff slots. + if(buff_tracker >= 0 && buffs[buff_tracker].numhits > 0) { + m_spellHitsLeft[buff_tracker] = focusspell_tracker; + } + } + + return realTotal + realTotal2; +} + void Mob::CheckNumHitsRemaining(uint8 type, int32 buff_slot, uint16 spell_id) { /* @@ -5946,15 +6043,13 @@ int32 Mob::ApplySpellEffectiveness(Mob* caster, int16 spell_id, int32 value, boo if (!caster) return value; - if (caster->IsClient()){ - int16 focus = caster->CastToClient()->GetFocusEffect(focusFcBaseEffects, spell_id); + int16 focus = GetFocusEffect(focusFcBaseEffects, spell_id); - if (IsBard) - value += focus; + if (IsBard) + value += focus; + else + value += value*focus/100; - else - value += value*focus/100; - } return value; } diff --git a/zone/spells.cpp b/zone/spells.cpp index b051dfdca..baae446c8 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -176,7 +176,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, BuffFadeByEffect(SE_Sanctuary); if(IsClient()){ - int chance = CastToClient()->GetFocusEffect(focusFcMute, spell_id); + int chance = CastToClient()->GetFocusEffect(focusFcMute, spell_id);//Client only if (zone->random.Roll(chance)) { Message_StringID(13, SILENCED_STRING); @@ -1043,7 +1043,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // Check for consumables and Reagent focus items // first check for component reduction if(IsClient()) { - int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id); + int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id);//Client only if(zone->random.Roll(reg_focus)) { mlog(SPELLS__CASTING, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); } else { @@ -2237,7 +2237,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 { recast -= GetAA(aaTouchoftheWicked) * 420; } - int reduction = CastToClient()->GetFocusEffect(focusReduceRecastTime, spell_id); + int reduction = CastToClient()->GetFocusEffect(focusReduceRecastTime, spell_id);//Client only if(reduction) recast -= reduction; @@ -4189,14 +4189,8 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use //Get resist modifier and adjust it based on focus 2 resist about eq to 1% resist chance int resist_modifier = (use_resist_override) ? resist_override : spells[spell_id].ResistDiff; - if(caster->IsClient()) - { - if(IsValidSpell(spell_id)) - { - int focus_resist = caster->CastToClient()->GetFocusEffect(focusResistRate, spell_id); - resist_modifier -= 2 * focus_resist; - } - } + int focus_resist = caster->GetFocusEffect(focusResistRate, spell_id); + resist_modifier -= 2 * focus_resist; //Check for fear resist bool IsFear = false; @@ -4580,17 +4574,14 @@ float Mob::GetAOERange(uint16 spell_id) { if(range == 0) range = 10; //something.... - if (IsClient()) { - - if(IsBardSong(spell_id) && IsBeneficialSpell(spell_id)) { - //Live AA - Extended Notes, SionachiesCrescendo - float song_bonus = static_cast(aabonuses.SongRange + spellbonuses.SongRange + itembonuses.SongRange); - range += range*song_bonus /100.0f; - } - - range = CastToClient()->GetActSpellRange(spell_id, range); + if(IsBardSong(spell_id) && IsBeneficialSpell(spell_id)) { + //Live AA - Extended Notes, SionachiesCrescendo + float song_bonus = static_cast(aabonuses.SongRange + spellbonuses.SongRange + itembonuses.SongRange); + range += range*song_bonus /100.0f; } + range = GetActSpellRange(spell_id, range); + return(range); } From a4df155219d95d03799f7449d1775f6b6dd6b708 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Mon, 8 Dec 2014 01:47:29 -0500 Subject: [PATCH 010/153] update --- zone/npc.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zone/npc.h b/zone/npc.h index d4f3bfa64..d374f4950 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -402,9 +402,7 @@ public: void AISpellsList(Client *c); bool IsRaidTarget() const { return raid_target; }; - - int16 GetFocusEffect(focusType type, uint16 spell_id); - + protected: const NPCType* NPCTypedata; @@ -444,6 +442,7 @@ protected: virtual bool AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes); virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0); AISpellsVar_Struct AISpellVar; + int16 GetFocusEffect(focusType type, uint16 spell_id); uint32 npc_spells_effects_id; From 9db39b5eec80ab4b89c3b73471c21118b98ca3b6 Mon Sep 17 00:00:00 2001 From: SecretsOTheP Date: Mon, 8 Dec 2014 05:46:10 -0500 Subject: [PATCH 011/153] Added a feature that allows an EQ client to log in directly to World without having to enter the LoginServer, provided the 'password' field is set in WorldServer. Mainly used for administration purposes. A DLL hack is needed to utilize this feature, and the DLL itself will be posted (source included) on the EQEmulator forums. It uses Microsoft Detours 1.5. Up to you guys if you want to add the source to this program here. --- changelog.txt | 3 +++ world/client.cpp | 7 ++++++- world/clientlist.cpp | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index e24dcd59d..25e6f2e54 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/08/2014 == +Secrets: Added a feature that allows an EQ client to log in directly to World without having to enter the LoginServer, provided the 'password' field is set in WorldServer. + == 12/04/2014 == Kayen: Ranged attacks will now more accurately check MAX firing range, fixing the issue where you would hit ranged attack and nothing would happpen due to incorrect server side range checks. diff --git a/world/client.cpp b/world/client.cpp index e37015e19..decb98f9a 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -397,6 +397,11 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { } else if(strncasecmp(name, "LS#", 3) == 0) id=atoi(&name[3]); + else if(database.GetAccountIDByName(name)){ + int16 status = 0; + uint32 lsid = 0; + id = database.GetAccountIDByName(name, &status, &lsid); + } else id=atoi(name); #ifdef IPBASED_AUTH_HACK @@ -406,7 +411,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { clog(WORLD__CLIENT_ERR,"Error: Login server login while not connected to login server."); return false; } - if ((minilogin && (cle = client_list.CheckAuth(id,password,ip))) || (cle = client_list.CheckAuth(id, password))) + if (((cle = client_list.CheckAuth(name, password)) || (cle = client_list.CheckAuth(id, password)))) #endif { if (cle->AccountID() == 0 || (!minilogin && cle->LSID()==0)) { diff --git a/world/clientlist.cpp b/world/clientlist.cpp index 6de17d176..c33822d93 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -424,11 +424,13 @@ ClientListEntry* ClientList::CheckAuth(const char* iName, const char* iPassword) } int16 tmpadmin; - _log(WORLD__ZONELIST,"Login with '%s' and '%s'", iName, iPassword); + //_log(WORLD__ZONELIST,"Login with '%s' and '%s'", iName, iPassword); uint32 accid = database.CheckLogin(iName, iPassword, &tmpadmin); if (accid) { - ClientListEntry* tmp = new ClientListEntry(GetNextCLEID(), accid, iName, tmpMD5, tmpadmin); + uint32 lsid = 0; + database.GetAccountIDByName(iName, &tmpadmin, &lsid); + ClientListEntry* tmp = new ClientListEntry(GetNextCLEID(), lsid, iName, tmpMD5, tmpadmin, 0, 0); clientlist.Append(tmp); return tmp; } From 8df6e7e26be8d4154d93fde71bd2d00cff84023d Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Mon, 8 Dec 2014 18:44:37 -0500 Subject: [PATCH 012/153] ADD FD check before adding projectile generated hate. --- zone/special_attacks.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 928353149..d5b6aef6d 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -979,7 +979,9 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite if (HeadShot) entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FATAL_BOW_SHOT, GetName()); - other->AddToHateList(this, hate, 0, false); + if (IsClient() && !CastToClient()->GetFeigned()) + other->AddToHateList(this, hate, 0, false); + other->Damage(this, TotalDmg, SPELL_UNKNOWN, SkillArchery); //Skill Proc Success @@ -1513,7 +1515,9 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else TotalDmg = -5; - other->AddToHateList(this, 2*WDmg, 0, false); + if (IsClient() && !CastToClient()->GetFeigned()) + other->AddToHateList(this, 2*WDmg, 0, false); + other->Damage(this, TotalDmg, SPELL_UNKNOWN, SkillThrowing); if (TotalDmg > 0 && HasSkillProcSuccess() && other && !other->HasDied()){ From ba2aefc5729bacdd900993243f8d0a39317d3a43 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Mon, 8 Dec 2014 18:55:23 -0500 Subject: [PATCH 013/153] NPC Focus Effects Optional Rules SQL --- utils/sql/git/optional/2014_12_8_NPC_FocusEffectRules.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 utils/sql/git/optional/2014_12_8_NPC_FocusEffectRules.sql diff --git a/utils/sql/git/optional/2014_12_8_NPC_FocusEffectRules.sql b/utils/sql/git/optional/2014_12_8_NPC_FocusEffectRules.sql new file mode 100644 index 000000000..7cbbb36b1 --- /dev/null +++ b/utils/sql/git/optional/2014_12_8_NPC_FocusEffectRules.sql @@ -0,0 +1,2 @@ +INSERT INTO `rule_values` (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES (1, 'Spells:NPC_UseFocusFromSpells', 'true', 'Allow npcs to use most spell buff derived focus effects.'); +INSERT INTO `rule_values` (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES (1, 'Spells:NPC_UseFocusFromItems', 'false', 'Allow npcs to use most item derived focus effects.'); From 7e7ec8e3d289867508a4eb9944176324b6d7d849 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Mon, 8 Dec 2014 20:58:49 -0500 Subject: [PATCH 014/153] Be more explicit about what we are checking (This removes a crap ton of clang warnings) --- common/seperator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/seperator.h b/common/seperator.h index 2524748d9..62054d137 100644 --- a/common/seperator.h +++ b/common/seperator.h @@ -126,7 +126,7 @@ public: if (check[i] == '.' && !SeenDec) { SeenDec = true; } - else if (i == 0 && (check[i] == '-' || check[i] == '+') && !check[i+1] == 0) { + else if (i == 0 && (check[i] == '-' || check[i] == '+') && check[i + 1] != '\0') { // this is ok, do nothin } else { From 4047c70de111e2be1bda91c5f2d49b5f1f6a9add Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Tue, 9 Dec 2014 00:38:20 -0500 Subject: [PATCH 015/153] Fix for completely broken skill proc function. --- zone/attack.cpp | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index b8c0a11ed..9b5f420a8 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -4505,17 +4505,23 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui if (CanProc && (!Success && spellbonuses.SkillProc[e] && IsValidSpell(spellbonuses.SkillProc[e])) || (Success && spellbonuses.SkillProcSuccess[e] && IsValidSpell(spellbonuses.SkillProcSuccess[e]))) { - base_spell_id = spellbonuses.SkillProc[e]; - base_spell_id = 0; + + if (Success) + base_spell_id = spellbonuses.SkillProcSuccess[e]; + else + base_spell_id = spellbonuses.SkillProc[e]; + + proc_spell_id = 0; ProcMod = 0; for (int i = 0; i < EFFECT_COUNT; i++) { - if (spells[base_spell_id].effectid[i] == SE_SkillProc) { + + if (spells[base_spell_id].effectid[i] == SE_SkillProc || spells[base_spell_id].effectid[i] == SE_SkillProcSuccess) { proc_spell_id = spells[base_spell_id].base[i]; ProcMod = static_cast(spells[base_spell_id].base2[i]); } - else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].effectid[i] <= HIGHEST_SKILL) { + else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= HIGHEST_SKILL) { if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) { float final_chance = chance * (ProcMod / 100.0f); @@ -4528,6 +4534,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui } } else { + //Reset and check for proc in sequence proc_spell_id = 0; ProcMod = 0; } @@ -4542,17 +4549,22 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui if (CanProc && (!Success && itembonuses.SkillProc[e] && IsValidSpell(itembonuses.SkillProc[e])) || (Success && itembonuses.SkillProcSuccess[e] && IsValidSpell(itembonuses.SkillProcSuccess[e]))) { - base_spell_id = itembonuses.SkillProc[e]; - base_spell_id = 0; + + if (Success) + base_spell_id = itembonuses.SkillProcSuccess[e]; + else + base_spell_id = itembonuses.SkillProc[e]; + + proc_spell_id = 0; ProcMod = 0; for (int i = 0; i < EFFECT_COUNT; i++) { - if (spells[base_spell_id].effectid[i] == SE_SkillProc) { + if (spells[base_spell_id].effectid[i] == SE_SkillProc || spells[base_spell_id].effectid[i] == SE_SkillProcSuccess) { proc_spell_id = spells[base_spell_id].base[i]; ProcMod = static_cast(spells[base_spell_id].base2[i]); } - else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].effectid[i] <= HIGHEST_SKILL) { + else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= HIGHEST_SKILL) { if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) { float final_chance = chance * (ProcMod / 100.0f); @@ -4584,8 +4596,14 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui if (CanProc && (!Success && aabonuses.SkillProc[e]) || (Success && aabonuses.SkillProcSuccess[e])){ - int aaid = aabonuses.SkillProc[e]; - base_spell_id = 0; + int aaid = 0; + + if (Success) + base_spell_id = aabonuses.SkillProcSuccess[e]; + else + base_spell_id = aabonuses.SkillProc[e]; + + proc_spell_id = 0; ProcMod = 0; std::map >::const_iterator find_iter = aa_effects.find(aaid); @@ -4598,12 +4616,12 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui base2 = iter->second.base2; slot = iter->second.slot; - if (effect == SE_SkillProc) { + if (effect == SE_SkillProc || effect == SE_SkillProcSuccess) { proc_spell_id = base1; ProcMod = static_cast(base2); } - else if (effect == SE_LimitToSkill && effect <= HIGHEST_SKILL) { + else if (effect == SE_LimitToSkill && base1 <= HIGHEST_SKILL) { if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) { float final_chance = chance * (ProcMod / 100.0f); From 37951d09c73693bb22e57cbc8409ee5042947ab4 Mon Sep 17 00:00:00 2001 From: Trevius Date: Tue, 9 Dec 2014 21:18:56 -0600 Subject: [PATCH 016/153] (RoF+) Implemented Hero's Forge Armor Models for Items. To use, set herosforgemodel field in the item table to a model number such as 63 (for example). --- changelog.txt | 3 + common/eq_packet_structs.h | 57 +++++-- common/item_fieldlist.h | 1 + common/item_struct.h | 3 +- common/patches/client62.cpp | 7 +- common/patches/rof.cpp | 32 ++-- common/patches/rof2.cpp | 34 ++-- common/patches/rof2_structs.h | 97 ++++++------ common/patches/rof_structs.h | 27 ++-- common/patches/sod.cpp | 24 +-- common/patches/sod_structs.h | 12 +- common/patches/sof.cpp | 20 +-- common/patches/sof_structs.h | 13 +- common/patches/titanium.cpp | 6 +- common/patches/underfoot.cpp | 24 +-- common/patches/underfoot_structs.h | 13 +- common/shareddb.cpp | 21 ++- utils/sql/db_update_manifest.txt | 1 + .../2014_12_09_items_table_update.sql | 1 + world/worlddb.cpp | 8 +- zone/bot.cpp | 121 ++++----------- zone/client.cpp | 145 +++++++++++------- zone/client_packet.cpp | 2 +- zone/command.cpp | 12 +- zone/merc.cpp | 24 ++- zone/mob.cpp | 73 +++++++-- zone/mob.h | 3 +- zone/perl_mob.cpp | 10 +- 28 files changed, 444 insertions(+), 350 deletions(-) create mode 100644 utils/sql/git/required/2014_12_09_items_table_update.sql diff --git a/changelog.txt b/changelog.txt index 25e6f2e54..2fe60ee70 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/09/2014 == +Trevius: (RoF+) Implemented Hero's Forge Armor Models for Items. To use, set herosforgemodel field in the item table to a model number such as 63 (for example). + == 12/08/2014 == Secrets: Added a feature that allows an EQ client to log in directly to World without having to enter the LoginServer, provided the 'password' field is set in WorldServer. diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index 62a166c67..cffe4e354 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -145,6 +145,28 @@ struct Color_Struct }; }; +/* +* Visible equiptment. +* Size: 20 Octets +*/ +struct EquipStruct { + /*00*/ uint32 material; + /*04*/ uint32 unknown1; + /*08*/ uint32 elitematerial; + /*12*/ uint32 heroforgemodel; + /*16*/ uint32 material2; // Same as material? + /*20*/ +}; + +struct CharSelectEquip { + uint32 material; + uint32 unknown1; + uint32 elitematerial; + uint32 heroforgemodel; + uint32 material2; + Color_Struct color; +}; + /* ** Character Selection Struct ** Length: 1704 Bytes @@ -152,10 +174,11 @@ struct Color_Struct */ struct CharacterSelect_Struct { /*0000*/ uint32 race[10]; // Characters Race -/*0040*/ Color_Struct cs_colors[10][9]; // Characters Equipment Colors +/*0040*/ //Color_Struct cs_colors[10][9]; // Characters Equipment Colors /*0400*/ uint8 beardcolor[10]; // Characters beard Color /*0410*/ uint8 hairstyle[10]; // Characters hair style -/*0420*/ uint32 equip[10][9]; // 0=helm, 1=chest, 2=arm, 3=bracer, 4=hand, 5=leg, 6=boot, 7=melee1, 8=melee2 (Might not be) +/*0420*/ //uint32 equip[10][9]; // 0=helm, 1=chest, 2=arm, 3=bracer, 4=hand, 5=leg, 6=boot, 7=melee1, 8=melee2 (Might not be) +/*0000*/ CharSelectEquip equip[10][9]; /*0780*/ uint32 secondary[10]; // Characters secondary IDFile number /*0820*/ uint32 drakkin_heritage[10]; // added for SoF /*0860*/ uint32 drakkin_tattoo[10]; // added for SoF @@ -258,21 +281,21 @@ struct Spawn_Struct { /*0193*/ uint8 guildrank; // 0=normal, 1=officer, 2=leader /*0194*/ uint8 unknown0194[3]; /*0197*/ union - { - struct - { - /*0197*/ uint32 equip_helmet; // Equipment: Helmet Visual - /*0201*/ uint32 equip_chest; // Equipment: Chest Visual - /*0205*/ uint32 equip_arms; // Equipment: Arms Visual - /*0209*/ uint32 equip_bracers; // Equipment: Bracers Visual - /*0213*/ uint32 equip_hands; // Equipment: Hands Visual - /*0217*/ uint32 equip_legs; // Equipment: Legs Visual - /*0221*/ uint32 equip_feet; // Equipment: Feet Visual - /*0225*/ uint32 equip_primary; // Equipment: Primary Visual - /*0229*/ uint32 equip_secondary; // Equipment: Secondary Visual - } equip; - /*0197*/ uint32 equipment[_MaterialCount]; // Array elements correspond to struct equipment above - }; +{ + struct + { + /*0000*/ EquipStruct equip_helmet; // Equipment: Helmet visual + /*0000*/ EquipStruct equip_chest; // Equipment: Chest visual + /*0000*/ EquipStruct equip_arms; // Equipment: Arms visual + /*0000*/ EquipStruct equip_bracers; // Equipment: Wrist visual + /*0000*/ EquipStruct equip_hands; // Equipment: Hands visual + /*0000*/ EquipStruct equip_legs; // Equipment: Legs visual + /*0000*/ EquipStruct equip_feet; // Equipment: Boots visual + /*0000*/ EquipStruct equip_primary; // Equipment: Main visual + /*0000*/ EquipStruct equip_secondary; // Equipment: Off visual + } equip; + /*0000*/ EquipStruct equipment[_MaterialCount]; +}; /*0233*/ float runspeed; // Speed when running /*0036*/ uint8 afk; // 0=no, 1=afk /*0238*/ uint32 guildID; // Current guild diff --git a/common/item_fieldlist.h b/common/item_fieldlist.h index fb3e4b41e..42ec12554 100644 --- a/common/item_fieldlist.h +++ b/common/item_fieldlist.h @@ -65,6 +65,7 @@ F(UNK054) F(maxcharges) F(itemtype) F(material) +F(herosforgemodel) F(sellrate) F(UNK059) F(casttime) diff --git a/common/item_struct.h b/common/item_struct.h index 26d3623bd..66af3d0c6 100644 --- a/common/item_struct.h +++ b/common/item_struct.h @@ -143,7 +143,7 @@ struct Item_Struct { uint8 Delay; // Delay * 10 uint8 RecLevel; // Recommended level to use item uint8 RecSkill; // Recommended skill to use item (refers to primary skill of item) - uint8 ElemDmgType; // Elemental Damage Type (1=magic, 2=fire) + uint8 ElemDmgType; // Elemental Damage Type (1=magic, 2=fire) uint8 ElemDmgAmt; // Elemental Damage uint8 Range; // Range of item uint32 Damage; // Delay between item usage (in 0.1 sec increments) @@ -154,6 +154,7 @@ struct Item_Struct { int16 MaxCharges; // Maximum charges items can hold: -1 if not a chargeable item uint8 ItemType; // Item Type/Skill (itemClass* from above) uint8 Material; // Item material type + uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?) float SellRate; // Sell rate //uint32 Unk059; union { diff --git a/common/patches/client62.cpp b/common/patches/client62.cpp index c291d2bc4..f3681721e 100644 --- a/common/patches/client62.cpp +++ b/common/patches/client62.cpp @@ -546,6 +546,7 @@ namespace Client62 for (r = 0; r < 9; r++) { OUT(item_material[r]); OUT(item_tint[r].color); + } for (r = 0; r < structs::MAX_PP_AA_ARRAY; r++) { OUT(aa_array[r].AA); @@ -785,8 +786,8 @@ namespace Client62 OUT(beard[r]); int k; for (k = 0; k < 9; k++) { - OUT(equip[r][k]); - OUT(cs_colors[r][k].color); + eq->equip[r][k] = emu->equip[r][k].material; + eq->cs_colors[r][k].color = emu->equip[r][k].color.color; } OUT(haircolor[r]); OUT(gohome[r]); @@ -934,7 +935,7 @@ namespace Client62 eq->petOwnerId = emu->petOwnerId; eq->guildrank = emu->guildrank; for (k = 0; k < 9; k++) { - eq->equipment[k] = emu->equipment[k]; + eq->equipment[k] = emu->equipment[k].material; eq->colors[k].color = emu->colors[k].color; } for (k = 0; k < 8; k++) { diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index c7efe0264..43b411dca 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -2874,12 +2874,12 @@ namespace RoF eq2->face = emu->face[r]; int k; for (k = 0; k < _MaterialCount; k++) { - eq2->equip[k].equip0 = emu->equip[r][k]; - eq2->equip[k].equip1 = 0; - eq2->equip[k].equip2 = 0; - eq2->equip[k].itemid = 0; - eq2->equip[k].equip3 = emu->equip[r][k]; - eq2->equip[k].color.color = emu->cs_colors[r][k].color; + eq2->equip[k].material = emu->equip[r][k].material; + eq2->equip[k].unknown1 = emu->equip[r][k].unknown1; + eq2->equip[k].elitematerial = emu->equip[r][k].elitematerial; + eq2->equip[k].heroforgemodel = emu->equip[r][k].heroforgemodel; + eq2->equip[k].material2 = emu->equip[r][k].material2; + eq2->equip[k].color.color = emu->equip[r][k].color.color; } eq2->u15 = 0xff; eq2->u19 = 0xFF; @@ -3809,11 +3809,11 @@ namespace RoF structs::EquipStruct *Equipment = (structs::EquipStruct *)Buffer; for (k = 0; k < 9; k++) { - Equipment[k].equip0 = emu->equipment[k]; - Equipment[k].equip1 = 0; - Equipment[k].equip2 = 0; - Equipment[k].equip3 = 0; - Equipment[k].itemId = 0; + Equipment[k].material = emu->equipment[k].material; + Equipment[k].unknown1 = emu->equipment[k].unknown1; + Equipment[k].elitematerial = emu->equipment[k].elitematerial; + Equipment[k].material2 = emu->equipment[k].heroforgemodel; + Equipment[k].elitematerial = emu->equipment[k].material2; } Buffer += (sizeof(structs::EquipStruct) * 9); @@ -3826,13 +3826,13 @@ namespace RoF VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary]); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary].material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary]); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary].material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); @@ -5017,10 +5017,10 @@ namespace RoF ibs.Prestige = 0; ibs.ItemType = item->ItemType; ibs.Material = item->Material; - ibs.unknown7 = 0; + ibs.MaterialUnknown1 = 0; ibs.EliteMaterial = item->EliteMaterial; - ibs.unknown_RoF3 = 0; - ibs.unknown_RoF4 = 0; + ibs.HerosForgeModel = item->HerosForgeModel; + ibs.MaterialUnknown2 = 0; ibs.SellRate = item->SellRate; ibs.CombatEffects = item->CombatEffects; ibs.Shielding = item->Shielding; diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 4d403253f..a22d2d4c5 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -2874,12 +2874,12 @@ namespace RoF2 eq2->face = emu->face[r]; int k; for (k = 0; k < _MaterialCount; k++) { - eq2->equip[k].equip0 = emu->equip[r][k]; - eq2->equip[k].equip1 = 0; - eq2->equip[k].equip2 = 0; - eq2->equip[k].itemid = 0; - eq2->equip[k].equip3 = emu->equip[r][k]; - eq2->equip[k].color.color = emu->cs_colors[r][k].color; + eq2->equip[k].material = emu->equip[r][k].material; + eq2->equip[k].unknown1 = emu->equip[r][k].unknown1; + eq2->equip[k].elitematerial = emu->equip[r][k].elitematerial; + eq2->equip[k].heroforgemodel = emu->equip[r][k].heroforgemodel; + eq2->equip[k].material2 = emu->equip[r][k].material2; + eq2->equip[k].color.color = emu->equip[r][k].color.color; } eq2->u15 = 0xff; eq2->u19 = 0xFF; @@ -3813,11 +3813,11 @@ namespace RoF2 structs::EquipStruct *Equipment = (structs::EquipStruct *)Buffer; for (k = 0; k < 9; k++) { - Equipment[k].equip0 = emu->equipment[k]; - Equipment[k].equip1 = 0; - Equipment[k].equip2 = 0; - Equipment[k].equip3 = 0; - Equipment[k].itemId = 0; + Equipment[k].material = emu->equipment[k].material; + Equipment[k].unknown1 = emu->equipment[k].unknown1; + Equipment[k].elitematerial = emu->equipment[k].elitematerial; + Equipment[k].material2 = emu->equipment[k].heroforgemodel; + Equipment[k].elitematerial = emu->equipment[k].material2; } Buffer += (sizeof(structs::EquipStruct) * 9); @@ -3830,13 +3830,13 @@ namespace RoF2 VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary]); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary].material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary]); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary].material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); @@ -4919,7 +4919,7 @@ namespace RoF2 hdrf.unknowna5 = 0; hdrf.ItemClass = item->ItemClass; ss.write((const char*)&hdrf, sizeof(RoF2::structs::ItemSerializationHeaderFinish)); - + if (strlen(item->Name) > 0) { ss.write(item->Name, strlen(item->Name)); @@ -5021,10 +5021,10 @@ namespace RoF2 ibs.Prestige = 0; ibs.ItemType = item->ItemType; ibs.Material = item->Material; - ibs.unknown7 = 0; + ibs.MaterialUnknown1 = 0; ibs.EliteMaterial = item->EliteMaterial; - ibs.unknown_RoF23 = 0; - ibs.unknown_RoF24 = 0; + ibs.HerosForgeModel = item->HerosForgeModel; + ibs.MaterialUnknown2 = 0; ibs.SellRate = item->SellRate; ibs.CombatEffects = item->CombatEffects; ibs.Shielding = item->Shielding; diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index 4bc9a9bb3..572a5a0f0 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -160,13 +160,25 @@ struct Color_Struct }; }; +/* +* Visible equiptment. +* Size: 20 Octets +*/ +struct EquipStruct { + /*00*/ uint32 material; + /*04*/ uint32 unknown1; + /*08*/ uint32 elitematerial; + /*12*/ uint32 heroforgemodel; + /*16*/ uint32 material2; // Same as material? + /*20*/ +}; + struct CharSelectEquip { - //totally guessed; - uint32 equip0; - uint32 equip1; - uint32 equip2; - uint32 itemid; - uint32 equip3; + uint32 material; + uint32 unknown1; + uint32 elitematerial; + uint32 heroforgemodel; + uint32 material2; Color_Struct color; }; @@ -252,21 +264,6 @@ struct Membership_Struct /*104*/ }; - -/* -* Visible equiptment. -* Size: 20 Octets -*/ -struct EquipStruct { -/*00*/ uint32 equip0; -/*04*/ uint32 equip1; -/*08*/ uint32 equip2; -/*12*/ uint32 itemId; -/*16*/ uint32 equip3; // Same as equip0? -/*20*/ -}; - - /* ** Generic Spawn Struct ** Length: 897 Octets @@ -1018,38 +1015,38 @@ union { struct { - /*00184*/ EquipStruct equip_helmet; // Equiptment: Helmet visual - /*00204*/ EquipStruct equip_chest; // Equiptment: Chest visual - /*00224*/ EquipStruct equip_arms; // Equiptment: Arms visual - /*00244*/ EquipStruct equip_bracers; // Equiptment: Wrist visual - /*00264*/ EquipStruct equip_hands; // Equiptment: Hands visual - /*00284*/ EquipStruct equip_legs; // Equiptment: Legs visual - /*00304*/ EquipStruct equip_feet; // Equiptment: Boots visual - /*00324*/ EquipStruct equip_primary; // Equiptment: Main visual - /*00344*/ EquipStruct equip_secondary; // Equiptment: Off visual + /*00184*/ EquipStruct equip_helmet; // Equipment: Helmet visual + /*00204*/ EquipStruct equip_chest; // Equipment: Chest visual + /*00224*/ EquipStruct equip_arms; // Equipment: Arms visual + /*00244*/ EquipStruct equip_bracers; // Equipment: Wrist visual + /*00264*/ EquipStruct equip_hands; // Equipment: Hands visual + /*00284*/ EquipStruct equip_legs; // Equipment: Legs visual + /*00304*/ EquipStruct equip_feet; // Equipment: Boots visual + /*00324*/ EquipStruct equip_primary; // Equipment: Main visual + /*00344*/ EquipStruct equip_secondary; // Equipment: Off visual // Below slots are just guesses, but all 0s anyway... - /*00364*/ EquipStruct equip_charm; // Equiptment: Non-visual - /*00384*/ EquipStruct equip_ear1; // Equiptment: Non-visual - /*00404*/ EquipStruct equip_ear2; // Equiptment: Non-visual - /*00424*/ EquipStruct equip_face; // Equiptment: Non-visual - /*00444*/ EquipStruct equip_neck; // Equiptment: Non-visual - /*00464*/ EquipStruct equip_shoulder; // Equiptment: Non-visual - /*00484*/ EquipStruct equip_bracer2; // Equiptment: Non-visual - /*00504*/ EquipStruct equip_range; // Equiptment: Non-visual - /*00524*/ EquipStruct equip_ring1; // Equiptment: Non-visual - /*00544*/ EquipStruct equip_ring2; // Equiptment: Non-visual - /*00564*/ EquipStruct equip_waist; // Equiptment: Non-visual - /*00584*/ EquipStruct equip_powersource; // Equiptment: Non-visual - /*00604*/ EquipStruct equip_ammo; // Equiptment: Non-visual + /*00364*/ EquipStruct equip_charm; // Equipment: Non-visual + /*00384*/ EquipStruct equip_ear1; // Equipment: Non-visual + /*00404*/ EquipStruct equip_ear2; // Equipment: Non-visual + /*00424*/ EquipStruct equip_face; // Equipment: Non-visual + /*00444*/ EquipStruct equip_neck; // Equipment: Non-visual + /*00464*/ EquipStruct equip_shoulder; // Equipment: Non-visual + /*00484*/ EquipStruct equip_bracer2; // Equipment: Non-visual + /*00504*/ EquipStruct equip_range; // Equipment: Non-visual + /*00524*/ EquipStruct equip_ring1; // Equipment: Non-visual + /*00544*/ EquipStruct equip_ring2; // Equipment: Non-visual + /*00564*/ EquipStruct equip_waist; // Equipment: Non-visual + /*00584*/ EquipStruct equip_powersource;// Equipment: Non-visual + /*00604*/ EquipStruct equip_ammo; // Equipment: Non-visual } equip; - /*00184*/ EquipStruct equipment[22]; + /*00184*/ EquipStruct equipment[22]; // Total Slots }; /*00624*/ uint32 equip2_count; // Seen 9 -/*00628*/ EquipStruct equipment2[9]; // Appears to be Visible slots, but all 0s +/*00628*/ EquipStruct equipment2[_MaterialCount]; // Appears to be Visible slots, but all 0s /*00808*/ uint32 tint_count; // Seen 9 -/*00812*/ Color_Struct item_tint[9]; // RR GG BB 00 +/*00812*/ Color_Struct item_tint[_MaterialCount]; // RR GG BB 00 /*00848*/ uint32 tint_count2; // Seen 9 -/*00852*/ Color_Struct item_tint2[9]; // RR GG BB 00 +/*00852*/ Color_Struct item_tint2[_MaterialCount]; // RR GG BB 00 /*00888*/ uint8 haircolor; // Player hair color /*00889*/ uint8 beardcolor; // Player beard color /*00890*/ uint32 unknown_rof5; // @@ -4504,10 +4501,10 @@ struct ItemBodyStruct uint32 Prestige; // New to March 21 2012 client uint8 ItemType; uint32 Material; - uint32 unknown7; + uint32 MaterialUnknown1; uint32 EliteMaterial; - uint32 unknown_RoF23; // New to March 21 2012 client - uint32 unknown_RoF24; // New to December 10th 2012 client - NEW + uint32 HerosForgeModel; // New to March 21 2012 client + uint32 MaterialUnknown2; // New to December 10th 2012 client - NEW float SellRate; int32 CombatEffects; int32 Shielding; diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index 075e6633b..285b15675 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -161,12 +161,11 @@ struct Color_Struct }; struct CharSelectEquip { - //totally guessed; - uint32 equip0; - uint32 equip1; - uint32 equip2; - uint32 itemid; - uint32 equip3; + uint32 material; + uint32 unknown1; + uint32 elitematerial; + uint32 heroforgemodel; + uint32 material2; Color_Struct color; }; @@ -258,11 +257,11 @@ struct Membership_Struct * Size: 20 Octets */ struct EquipStruct { -/*00*/ uint32 equip0; -/*04*/ uint32 equip1; -/*08*/ uint32 equip2; -/*12*/ uint32 itemId; -/*16*/ uint32 equip3; // Same as equip0? +/*00*/ uint32 material; +/*04*/ uint32 unknown1; +/*08*/ uint32 elitematerial; +/*12*/ uint32 heroforgemodel; +/*16*/ uint32 material2; // Same as material? /*20*/ }; @@ -4499,10 +4498,10 @@ struct ItemBodyStruct uint32 Prestige; // New to March 21 2012 client uint8 ItemType; uint32 Material; - uint32 unknown7; + uint32 MaterialUnknown1; uint32 EliteMaterial; - uint32 unknown_RoF3; // New to March 21 2012 client - uint32 unknown_RoF4; // New to December 10th 2012 client - NEW + uint32 HerosForgeModel; // New to March 21 2012 client + uint32 MaterialUnknown2; // New to December 10th 2012 client - NEW float SellRate; int32 CombatEffects; int32 Shielding; diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 54dd33841..498058e19 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -1429,9 +1429,9 @@ namespace SoD OUT(beard); // OUT(unknown00178[10]); for (r = 0; r < 9; r++) { - eq->equipment[r].equip0 = emu->item_material[r]; - eq->equipment[r].equip1 = 0; - eq->equipment[r].itemId = 0; + eq->equipment[r].material = emu->item_material[r]; + eq->equipment[r].unknown1 = 0; + eq->equipment[r].elitematerial = 0; //eq->colors[r].color = emu->colors[r].color; } for (r = 0; r < 7; r++) { @@ -1825,10 +1825,10 @@ namespace SoD eq2->face = emu->face[r]; int k; for (k = 0; k < _MaterialCount; k++) { - eq2->equip[k].equip0 = emu->equip[r][k]; - eq2->equip[k].equip1 = 0; - eq2->equip[k].itemid = 0; - eq2->equip[k].color.color = emu->cs_colors[r][k].color; + eq2->equip[k].material = emu->equip[r][k].material; + eq2->equip[k].unknown1 = emu->equip[r][k].unknown1; + eq2->equip[k].elitematerial = emu->equip[r][k].elitematerial; + eq2->equip[k].color.color = emu->equip[r][k].color.color; } eq2->primary = emu->primary[r]; eq2->secondary = emu->secondary[r]; @@ -2548,11 +2548,11 @@ namespace SoD VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary]); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary].material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary]); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary].material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); } @@ -2563,9 +2563,9 @@ namespace SoD structs::EquipStruct *Equipment = (structs::EquipStruct *)Buffer; for (k = 0; k < 9; k++) { - Equipment[k].equip0 = emu->equipment[k]; - Equipment[k].equip1 = 0; - Equipment[k].itemId = 0; + Equipment[k].material = emu->equipment[k].material; + Equipment[k].unknown1 = emu->equipment[k].unknown1; + Equipment[k].elitematerial = emu->equipment[k].elitematerial; } Buffer += (sizeof(structs::EquipStruct) * 9); diff --git a/common/patches/sod_structs.h b/common/patches/sod_structs.h index 47b228cb7..7ec101fd3 100644 --- a/common/patches/sod_structs.h +++ b/common/patches/sod_structs.h @@ -118,9 +118,9 @@ struct Color_Struct struct CharSelectEquip { //totally guessed; - uint32 equip0; - uint32 equip1; - uint32 itemid; + uint32 material; + uint32 unknown1; + uint32 elitematerial; Color_Struct color; }; @@ -169,9 +169,9 @@ struct CharacterSelect_Struct { * Size: 12 Octets */ struct EquipStruct { -/*00*/ uint32 equip0; -/*04*/ uint32 equip1; -/*08*/ uint32 itemId; +/*00*/ uint32 material; +/*04*/ uint32 unknown1; +/*08*/ uint32 elitematerial; /*12*/ }; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 629395cd1..2d2fff48d 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -1087,9 +1087,9 @@ namespace SoF OUT(beard); // OUT(unknown00178[10]); for (r = 0; r < 9; r++) { - eq->equipment[r].equip0 = emu->item_material[r]; - eq->equipment[r].equip1 = 0; - eq->equipment[r].itemId = 0; + eq->equipment[r].material = emu->item_material[r]; + eq->equipment[r].unknown1 = 0; + eq->equipment[r].elitematerial = 0; //eq->colors[r].color = emu->colors[r].color; } for (r = 0; r < 7; r++) { @@ -1484,10 +1484,10 @@ namespace SoF eq2->face = emu->face[r]; int k; for (k = 0; k < _MaterialCount; k++) { - eq2->equip[k].equip0 = emu->equip[r][k]; - eq2->equip[k].equip1 = 0; - eq2->equip[k].itemid = 0; - eq2->equip[k].color.color = emu->cs_colors[r][k].color; + eq2->equip[k].material = emu->equip[r][k].material; + eq2->equip[k].unknown1 = emu->equip[r][k].unknown1; + eq2->equip[k].elitematerial = emu->equip[r][k].elitematerial; + eq2->equip[k].color.color = emu->equip[r][k].color.color; } eq2->primary = emu->primary[r]; eq2->secondary = emu->secondary[r]; @@ -1840,9 +1840,9 @@ namespace SoF eq->drakkin_heritage = emu->drakkin_heritage; eq->gender = emu->gender; for (k = 0; k < 9; k++) { - eq->equipment[k].equip0 = emu->equipment[k]; - eq->equipment[k].equip1 = 0; - eq->equipment[k].itemId = 0; + eq->equipment[k].material = emu->equipment[k].material; + eq->equipment[k].unknown1 = emu->equipment[k].unknown1; + eq->equipment[k].elitematerial = emu->equipment[k].elitematerial; eq->colors[k].color = emu->colors[k].color; } eq->StandState = emu->StandState; diff --git a/common/patches/sof_structs.h b/common/patches/sof_structs.h index 9c3238f73..385fd8b46 100644 --- a/common/patches/sof_structs.h +++ b/common/patches/sof_structs.h @@ -117,10 +117,9 @@ struct Color_Struct }; struct CharSelectEquip { - //totally guessed; - uint32 equip0; - uint32 equip1; - uint32 itemid; + uint32 material; + uint32 unknown1; + uint32 elitematerial; Color_Struct color; }; @@ -167,9 +166,9 @@ struct CharacterSelect_Struct { * Size: 12 Octets */ struct EquipStruct { -/*00*/ uint32 equip0; -/*04*/ uint32 equip1; -/*08*/ uint32 itemId; +/*00*/ uint32 material; +/*04*/ uint32 unknown1; +/*08*/ uint32 elitematerial; /*12*/ }; diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index 4d400c9b7..0fc9d5e75 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -1042,8 +1042,8 @@ namespace Titanium OUT(beard[r]); int k; for (k = 0; k < 9; k++) { - OUT(equip[r][k]); - OUT(cs_colors[r][k].color); + eq->equip[r][k] = emu->equip[r][k].material; + eq->cs_colors[r][k].color = emu->equip[r][k].color.color; } OUT(haircolor[r]); OUT(gohome[r]); @@ -1270,7 +1270,7 @@ namespace Titanium eq->guildrank = emu->guildrank; // eq->unknown0194[3] = emu->unknown0194[3]; for (k = 0; k < 9; k++) { - eq->equipment[k] = emu->equipment[k]; + eq->equipment[k] = emu->equipment[k].material; eq->colors[k].color = emu->colors[k].color; } for (k = 0; k < 8; k++) { diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index c9d726a25..6da577be6 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -1702,9 +1702,9 @@ namespace Underfoot OUT(beard); // OUT(unknown00178[10]); for (r = 0; r < 9; r++) { - eq->equipment[r].equip0 = emu->item_material[r]; - eq->equipment[r].equip1 = 0; - eq->equipment[r].itemId = 0; + eq->equipment[r].material = emu->item_material[r]; + eq->equipment[r].unknown1 = 0; + eq->equipment[r].elitematerial = 0; //eq->colors[r].color = emu->colors[r].color; } for (r = 0; r < 7; r++) { @@ -2132,10 +2132,10 @@ namespace Underfoot eq2->face = emu->face[r]; int k; for (k = 0; k < _MaterialCount; k++) { - eq2->equip[k].equip0 = emu->equip[r][k]; - eq2->equip[k].equip1 = 0; - eq2->equip[k].itemid = 0; - eq2->equip[k].color.color = emu->cs_colors[r][k].color; + eq2->equip[k].material = emu->equip[r][k].material; + eq2->equip[k].unknown1 = emu->equip[r][k].unknown1; + eq2->equip[k].elitematerial = emu->equip[r][k].elitematerial; + eq2->equip[k].color.color = emu->equip[r][k].color.color; } eq2->primary = emu->primary[r]; eq2->secondary = emu->secondary[r]; @@ -2832,11 +2832,11 @@ namespace Underfoot VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary]); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialPrimary].material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary]); + VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment[MaterialSecondary].material); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); } @@ -2846,9 +2846,9 @@ namespace Underfoot structs::EquipStruct *Equipment = (structs::EquipStruct *)Buffer; for (k = 0; k < 9; k++) { - Equipment[k].equip0 = emu->equipment[k]; - Equipment[k].equip1 = 0; - Equipment[k].itemId = 0; + Equipment[k].material = emu->equipment[k].material; + Equipment[k].unknown1 = emu->equipment[k].unknown1; + Equipment[k].elitematerial = emu->equipment[k].elitematerial; } Buffer += (sizeof(structs::EquipStruct) * 9); diff --git a/common/patches/underfoot_structs.h b/common/patches/underfoot_structs.h index 45c47875d..378665db1 100644 --- a/common/patches/underfoot_structs.h +++ b/common/patches/underfoot_structs.h @@ -117,10 +117,9 @@ struct Color_Struct }; struct CharSelectEquip { - //totally guessed; - uint32 equip0; - uint32 equip1; - uint32 itemid; + uint32 material; + uint32 unknown1; + uint32 elitematerial; Color_Struct color; }; @@ -169,9 +168,9 @@ struct CharacterSelect_Struct { * Size: 12 Octets */ struct EquipStruct { -/*00*/ uint32 equip0; -/*04*/ uint32 equip1; -/*08*/ uint32 itemId; +/*00*/ uint32 material; +/*04*/ uint32 unknown1; +/*08*/ uint32 elitematerial; /*12*/ }; diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 05c7b6962..6bf1cb52f 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -852,9 +852,26 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ item.MaxCharges = (int16)atoi(row[ItemField::maxcharges]); item.ItemType = (uint8)atoi(row[ItemField::itemtype]); - item.Material = (uint8)atoi(row[ItemField::material]); + item.Material = (uint8)atoi(row[ItemField::material]); + item.HerosForgeModel = (uint32)atoi(row[ItemField::herosforgemodel]); + if (item.HerosForgeModel > 0) + { + item.HerosForgeModel *= 100; + uint32 HeroSlot = 0; + switch (item.Slots) + { + case 4: { HeroSlot = 0; break; } // Head + case 131072: { HeroSlot = 1; break; } // Chest + case 128: { HeroSlot = 2; break; } // Arms + case 1536: { HeroSlot = 3; break; } // Bracers + case 4096: { HeroSlot = 4; break; } // Hands + case 262144: { HeroSlot = 5; break; } // Legs + case 524288: { HeroSlot = 6; break; } // Feet + default: { HeroSlot = 1; break; } // Chest + } + item.HerosForgeModel += HeroSlot; + } item.SellRate = (float)atof(row[ItemField::sellrate]); - item.CastTime = (uint32)atoul(row[ItemField::casttime]); item.EliteMaterial = (uint32)atoul(row[ItemField::elitematerial]); item.ProcRate = (int32)atoi(row[ItemField::procrate]); diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 2af5e6e90..a06a9d94e 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -313,6 +313,7 @@ 9057|2014_11_13_spells_new_updates.sql|SHOW COLUMNS FROM `spells_new` LIKE 'disallow_sit'|empty| 9058|2014_11_26_InventoryTableUpdate.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornamenticon'|empty| 9059|2014_12_01_mercs_table_update.sql|SHOW COLUMNS FROM `mercs` LIKE 'MercSize'|empty| +9060|2014_12_09_items_table_update.sql|SHOW COLUMNS FROM `items` LIKE 'herosforgemodel'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/required/2014_12_09_items_table_update.sql b/utils/sql/git/required/2014_12_09_items_table_update.sql new file mode 100644 index 000000000..82866a3a3 --- /dev/null +++ b/utils/sql/git/required/2014_12_09_items_table_update.sql @@ -0,0 +1 @@ +ALTER TABLE `items` ADD `herosforgemodel` int( 11 ) NOT NULL DEFAULT '0' AFTER `material`; diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 458025349..7d70fd71d 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -182,12 +182,16 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct* if (item == 0) continue; - cs->equip[char_num][material] = item->GetItem()->Material; + cs->equip[char_num][material].material = item->GetItem()->Material; + cs->equip[char_num][material].material = 0; + cs->equip[char_num][material].elitematerial = item->GetItem()->EliteMaterial; + cs->equip[char_num][material].heroforgemodel = item->GetItem()->HerosForgeModel; + cs->equip[char_num][material].material2 = item->GetItem()->Material; if (pp.item_tint[material].rgb.use_tint){ color = pp.item_tint[material].color; } else{ color = item->GetItem()->Color; } - cs->cs_colors[char_num][material].color = color; + cs->equip[char_num][material].color.color = color; /* Weapons are handled a bit differently */ if ((material == MaterialPrimary) || (material == MaterialSecondary)) { diff --git a/zone/bot.cpp b/zone/bot.cpp index 9ae33318a..bb4c53210 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -4361,7 +4361,8 @@ void Bot::SetLevel(uint8 in_level, bool command) { } void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { - if(ns) { + if(ns) + { Mob::FillSpawnStruct(ns, ForWho); ns->spawn.afk = 0; @@ -4389,98 +4390,34 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { uint32 spawnedbotid = 0; spawnedbotid = this->GetBotID(); - inst = GetBotItem(MainHands); - if(inst) { - item = inst->GetItem(); - if(item) { - ns->spawn.equipment[MaterialHands] = item->Material; - ns->spawn.colors[MaterialHands].color = GetEquipmentColor(MaterialHands); - } - } + for (i = 0; i < _MaterialCount; i++) + { + inst = GetBotItem(i); + if (inst) + { + item = inst->GetItem(); + if (item != 0) + { + ns->spawn.equipment[i].material = item->Material; + ns->spawn.equipment[i].elitematerial = item->EliteMaterial; + ns->spawn.equipment[i].heroforgemodel = item->HerosForgeModel; + if (armor_tint[i]) + { + ns->spawn.colors[i].color = armor_tint[i]; - inst = GetBotItem(MainHead); - if(inst) { - item = inst->GetItem(); - if(item) { - ns->spawn.equipment[MaterialHead] = item->Material; - ns->spawn.colors[MaterialHead].color = GetEquipmentColor(MaterialHead); - } - } - - inst = GetBotItem(MainArms); - if(inst) { - item = inst->GetItem(); - if(item) { - ns->spawn.equipment[MaterialArms] = item->Material; - ns->spawn.colors[MaterialArms].color = GetEquipmentColor(MaterialArms); - } - } - - inst = GetBotItem(MainWrist1); - if(inst) { - item = inst->GetItem(); - if(item) { - ns->spawn.equipment[MaterialWrist] = item->Material; - ns->spawn.colors[MaterialWrist].color = GetEquipmentColor(MaterialWrist); - } - } - - /* - // non-live behavior - inst = GetBotItem(MainWrist2); - if(inst) { - item = inst->GetItem(); - if(item) { - ns->spawn.equipment[MaterialWrist] = item->Material; - ns->spawn.colors[MaterialWrist].color = GetEquipmentColor(MaterialWrist); - } - } - */ - - inst = GetBotItem(MainChest); - if(inst) { - item = inst->GetItem(); - if(item) { - ns->spawn.equipment[MaterialChest] = item->Material; - ns->spawn.colors[MaterialChest].color = GetEquipmentColor(MaterialChest); - } - } - - inst = GetBotItem(MainLegs); - if(inst) { - item = inst->GetItem(); - if(item) { - ns->spawn.equipment[MaterialLegs] = item->Material; - ns->spawn.colors[MaterialLegs].color = GetEquipmentColor(MaterialLegs); - } - } - - inst = GetBotItem(MainFeet); - if(inst) { - item = inst->GetItem(); - if(item) { - ns->spawn.equipment[MaterialFeet] = item->Material; - ns->spawn.colors[MaterialFeet].color = GetEquipmentColor(MaterialFeet); - } - } - - inst = GetBotItem(MainPrimary); - if(inst) { - item = inst->GetItem(); - if(item) { - if(strlen(item->IDFile) > 2) - ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]); - ns->spawn.colors[MaterialPrimary].color = GetEquipmentColor(MaterialPrimary); - } - } - - inst = GetBotItem(MainSecondary); - if(inst) { - item = inst->GetItem(); - if(item) { - if(strlen(item->IDFile) > 2) - ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]); - ns->spawn.colors[MaterialSecondary].color = GetEquipmentColor(MaterialSecondary); + } + else + { + ns->spawn.colors[i].color = item->Color; + } + } + else + { + if (armor_tint[i]) + { + ns->spawn.colors[i].color = armor_tint[i]; + } + } } } } diff --git a/zone/client.cpp b/zone/client.cpp index f67328ae9..014d4f0bb 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -1823,80 +1823,113 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) // (update: i think pp should do it, as this holds LoY dye - plus, this is ugly code with Inventory!) const Item_Struct* item = nullptr; const ItemInst* inst = nullptr; - if ((inst = m_inv[MainHands]) && inst->IsType(ItemClassCommon)) { - item = inst->GetItem(); - ns->spawn.equipment[MaterialHands] = item->Material; - ns->spawn.colors[MaterialHands].color = GetEquipmentColor(MaterialHands); - } - if ((inst = m_inv[MainHead]) && inst->IsType(ItemClassCommon)) { - item = inst->GetItem(); - ns->spawn.equipment[MaterialHead] = item->Material; - ns->spawn.colors[MaterialHead].color = GetEquipmentColor(MaterialHead); - } - if ((inst = m_inv[MainArms]) && inst->IsType(ItemClassCommon)) { - item = inst->GetItem(); - ns->spawn.equipment[MaterialArms] = item->Material; - ns->spawn.colors[MaterialArms].color = GetEquipmentColor(MaterialArms); - } - if ((inst = m_inv[MainWrist1]) && inst->IsType(ItemClassCommon)) { - item = inst->GetItem(); - ns->spawn.equipment[MaterialWrist]= item->Material; - ns->spawn.colors[MaterialWrist].color = GetEquipmentColor(MaterialWrist); - } - /* - // non-live behavior - if ((inst = m_inv[SLOT_BRACER02]) && inst->IsType(ItemClassCommon)) { - item = inst->GetItem(); - ns->spawn.equipment[MaterialWrist]= item->Material; - ns->spawn.colors[MaterialWrist].color = GetEquipmentColor(MaterialWrist); - } - */ + // Only Player Races Wear Armor + if (IsPlayerRace(race)) + { + if ((inst = m_inv[MainHands]) && inst->IsType(ItemClassCommon)) + { + item = inst->GetItem(); + ns->spawn.equipment[MaterialHands].material = item->Material; + ns->spawn.equipment[MaterialHands].elitematerial = item->EliteMaterial; + ns->spawn.equipment[MaterialHands].heroforgemodel = item->HerosForgeModel; + ns->spawn.colors[MaterialHands].color = m_pp.item_tint[MaterialHands].rgb.use_tint ? m_pp.item_tint[MaterialHands].color : item->Color; + } + if ((inst = m_inv[MainHead]) && inst->IsType(ItemClassCommon)) + { + item = inst->GetItem(); + ns->spawn.equipment[MaterialHead].material = item->Material; + ns->spawn.equipment[MaterialHead].elitematerial = item->EliteMaterial; + ns->spawn.equipment[MaterialHead].heroforgemodel = item->HerosForgeModel; + ns->spawn.colors[MaterialHead].color = m_pp.item_tint[MaterialHead].rgb.use_tint ? m_pp.item_tint[MaterialHead].color : item->Color; + } + if ((inst = m_inv[MainArms]) && inst->IsType(ItemClassCommon)) + { + item = inst->GetItem(); + ns->spawn.equipment[MaterialArms].material = item->Material; + ns->spawn.equipment[MaterialArms].elitematerial = item->EliteMaterial; + ns->spawn.equipment[MaterialArms].heroforgemodel = item->HerosForgeModel; + ns->spawn.colors[MaterialArms].color = m_pp.item_tint[MaterialArms].rgb.use_tint ? m_pp.item_tint[MaterialArms].color : item->Color; + } + if ((inst = m_inv[MainWrist1]) && inst->IsType(ItemClassCommon)) + { + item = inst->GetItem(); + ns->spawn.equipment[MaterialWrist].material = item->Material; + ns->spawn.equipment[MaterialWrist].elitematerial = item->EliteMaterial; + ns->spawn.equipment[MaterialWrist].heroforgemodel = item->HerosForgeModel; + ns->spawn.colors[MaterialWrist].color = m_pp.item_tint[MaterialWrist].rgb.use_tint ? m_pp.item_tint[MaterialWrist].color : item->Color; + } - if ((inst = m_inv[MainChest]) && inst->IsType(ItemClassCommon)) { - item = inst->GetItem(); - ns->spawn.equipment[MaterialChest] = item->Material; - ns->spawn.colors[MaterialChest].color = GetEquipmentColor(MaterialChest); - } - if ((inst = m_inv[MainLegs]) && inst->IsType(ItemClassCommon)) { - item = inst->GetItem(); - ns->spawn.equipment[MaterialLegs] = item->Material; - ns->spawn.colors[MaterialLegs].color = GetEquipmentColor(MaterialLegs); - } - if ((inst = m_inv[MainFeet]) && inst->IsType(ItemClassCommon)) { - item = inst->GetItem(); - ns->spawn.equipment[MaterialFeet] = item->Material; - ns->spawn.colors[MaterialFeet].color = GetEquipmentColor(MaterialFeet); + if ((inst = m_inv[MainChest]) && inst->IsType(ItemClassCommon)) + { + item = inst->GetItem(); + ns->spawn.equipment[MaterialChest].material = item->Material; + ns->spawn.equipment[MaterialChest].elitematerial = item->EliteMaterial; + ns->spawn.equipment[MaterialChest].heroforgemodel = item->HerosForgeModel; + ns->spawn.colors[MaterialChest].color = m_pp.item_tint[MaterialChest].rgb.use_tint ? m_pp.item_tint[MaterialChest].color : item->Color; + } + if ((inst = m_inv[MainLegs]) && inst->IsType(ItemClassCommon)) + { + item = inst->GetItem(); + ns->spawn.equipment[MaterialLegs].material = item->Material; + ns->spawn.equipment[MaterialLegs].elitematerial = item->EliteMaterial; + ns->spawn.equipment[MaterialLegs].heroforgemodel = item->HerosForgeModel; + ns->spawn.colors[MaterialLegs].color = m_pp.item_tint[MaterialLegs].rgb.use_tint ? m_pp.item_tint[MaterialLegs].color : item->Color; + } + if ((inst = m_inv[MainFeet]) && inst->IsType(ItemClassCommon)) + { + item = inst->GetItem(); + ns->spawn.equipment[MaterialFeet].material = item->Material; + ns->spawn.equipment[MaterialFeet].elitematerial = item->EliteMaterial; + ns->spawn.equipment[MaterialFeet].heroforgemodel = item->HerosForgeModel; + ns->spawn.colors[MaterialFeet].color = m_pp.item_tint[MaterialFeet].rgb.use_tint ? m_pp.item_tint[MaterialFeet].color : item->Color; + } } int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); - if ((inst = m_inv[MainPrimary]) && inst->IsType(ItemClassCommon)) { - if (inst->GetOrnamentationAug(ornamentationAugtype)) { + if ((inst = m_inv[MainPrimary]) && inst->IsType(ItemClassCommon)) + { + if (inst->GetOrnamentationAug(ornamentationAugtype)) + { item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); if (strlen(item->IDFile) > 2) - ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]); + { + ns->spawn.equipment[MaterialPrimary].material = atoi(&item->IDFile[2]); + } } - else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) { - ns->spawn.equipment[MaterialPrimary] = inst->GetOrnamentationIDFile(); + else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) + { + ns->spawn.equipment[MaterialPrimary].material = inst->GetOrnamentationIDFile(); } - else { + else + { item = inst->GetItem(); if (strlen(item->IDFile) > 2) - ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]); + { + ns->spawn.equipment[MaterialPrimary].material = atoi(&item->IDFile[2]); + } } } - if ((inst = m_inv[MainSecondary]) && inst->IsType(ItemClassCommon)) { - if (inst->GetOrnamentationAug(ornamentationAugtype)) { + if ((inst = m_inv[MainSecondary]) && inst->IsType(ItemClassCommon)) + { + if (inst->GetOrnamentationAug(ornamentationAugtype)) + { item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); if (strlen(item->IDFile) > 2) - ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]); + { + ns->spawn.equipment[MaterialSecondary].material = atoi(&item->IDFile[2]); + } } - else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) { - ns->spawn.equipment[MaterialSecondary] = inst->GetOrnamentationIDFile(); + else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) + { + ns->spawn.equipment[MaterialSecondary].material = inst->GetOrnamentationIDFile(); } - else { + else + { item = inst->GetItem(); if (strlen(item->IDFile) > 2) - ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]); + { + ns->spawn.equipment[MaterialSecondary].material = atoi(&item->IDFile[2]); + } } } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 6ff76e346..c68434109 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -8341,7 +8341,7 @@ void Client::Handle_OP_ItemPreview(const EQApplicationPacket *app) outapp->WriteUInt32(item->Material); outapp->WriteUInt32(0); //unknown outapp->WriteUInt32(item->EliteMaterial); - outapp->WriteUInt32(0); // unknown + outapp->WriteUInt32(item->HerosForgeModel); outapp->WriteUInt32(0); // unknown outapp->WriteUInt32(0); //This is unknown057 from lucy for (spacer = 0; spacer < 77; spacer++) { //More Item stats, but some seem to be off based on packet check diff --git a/zone/command.cpp b/zone/command.cpp index f4c2c8e91..59a786a19 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -5598,7 +5598,11 @@ void command_itemsearch(Client *c, const Seperator *sep) if (Seperator::IsNumber(search_criteria)) { item = database.GetItem(atoi(search_criteria)); if (item) - if (c->GetClientVersion() >= EQClientRoF) + if (c->GetClientVersion() >= EQClientRoF2) + { + c->Message(0, " %i: %c%06X00000000000000000000000000000000000000000000000000%s%c", (int)item->ID, 0x12, item->ID, item->Name, 0x12); + } + else if (c->GetClientVersion() >= EQClientRoF) { c->Message(0, " %i: %c%06X0000000000000000000000000000000000000000000000000%s%c",(int) item->ID,0x12, item->ID, item->Name, 0x12); } @@ -5627,7 +5631,11 @@ void command_itemsearch(Client *c, const Seperator *sep) strupr(sName); pdest = strstr(sName, sCriteria); if (pdest != nullptr) { - if (c->GetClientVersion() >= EQClientRoF) + if (c->GetClientVersion() >= EQClientRoF2) + { + c->Message(0, " %i: %c%06X00000000000000000000000000000000000000000000000000%s%c", (int)item->ID, 0x12, item->ID, item->Name, 0x12); + } + else if (c->GetClientVersion() >= EQClientRoF) { c->Message(0, " %i: %c%06X0000000000000000000000000000000000000000000000000%s%c",(int) item->ID,0x12, item->ID, item->Name, 0x12); } diff --git a/zone/merc.cpp b/zone/merc.cpp index 1c4165c1e..2641e7cb4 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1196,18 +1196,32 @@ void Merc::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { ns->spawn.NPC = 1; // 0=player,1=npc,2=pc corpse,3=npc corpse ns->spawn.IsMercenary = 1; + /* + // Wear Slots are not setup for Mercs yet unsigned int i; - //should not include 21 (SLOT_AMMO) - for (i = 0; i < MainAmmo; i++) { - if(equipment[i] == 0) + for (i = 0; i < _MaterialCount; i++) + { + if (equipment[i] == 0) + { continue; + } const Item_Struct* item = database.GetItem(equipment[i]); if(item) { - ns->spawn.equipment[i] = item->Material; - ns->spawn.colors[i].color = item->Color; + ns->spawn.equipment[i].material = item->Material; + ns->spawn.equipment[i].elitematerial = item->EliteMaterial; + ns->spawn.equipment[i].heroforgemodel = item->HerosForgeModel; + if (armor_tint[i]) + { + ns->spawn.colors[i].color = armor_tint[i]; + } + else + { + ns->spawn.colors[i].color = item->Color; + } } } + */ } } diff --git a/zone/mob.cpp b/zone/mob.cpp index f7193fbed..e501862a2 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -963,22 +963,44 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) ns->spawn.flymode = FindType(SE_Levitate) ? 2 : 0; } else + { ns->spawn.flymode = flymode; + } ns->spawn.lastName[0] = '\0'; strn0cpy(ns->spawn.lastName, lastname, sizeof(ns->spawn.lastName)); - for(i = 0; i < _MaterialCount; i++) + const Item_Struct *item; + + for (i = 0; i < _MaterialCount; i++) { - ns->spawn.equipment[i] = GetEquipmentMaterial(i); - if (armor_tint[i]) + // Only Player Races Wear Armor + if (IsPlayerRace(race) || i > 6) { - ns->spawn.colors[i].color = armor_tint[i]; - } - else - { - ns->spawn.colors[i].color = GetEquipmentColor(i); + ns->spawn.equipment[i].material = GetEquipmentMaterial(i); + + item = database.GetItem(GetEquipment(i)); + if (item != 0) + { + ns->spawn.equipment[i].elitematerial = item->EliteMaterial; + ns->spawn.equipment[i].heroforgemodel = item->HerosForgeModel; + if (armor_tint[i]) + { + ns->spawn.colors[i].color = armor_tint[i]; + } + else + { + ns->spawn.colors[i].color = item->Color; + } + } + else + { + if (armor_tint[i]) + { + ns->spawn.colors[i].color = armor_tint[i]; + } + } } } @@ -2601,8 +2623,20 @@ void Mob::SendWearChange(uint8 material_slot) wc->spawn_id = GetID(); wc->material = GetEquipmentMaterial(material_slot); - wc->elite_material = IsEliteMaterialItem(material_slot); - wc->color.color = GetEquipmentColor(material_slot); + const Item_Struct *item; + item = database.GetItem(GetEquipment(material_slot)); + if (item != 0) + { + wc->elite_material = item->EliteMaterial; + wc->hero_forge_model = item->HerosForgeModel; + wc->color.color = item->Color; + } + else + { + wc->elite_material = 0; + wc->hero_forge_model = 0; + wc->color.color = 0; + } wc->wear_slot_id = material_slot; entity_list.QueueClients(this, outapp); @@ -2646,6 +2680,7 @@ void Mob::SetSlotTint(uint8 material_slot, uint8 red_tint, uint8 green_tint, uin wc->spawn_id = this->GetID(); wc->material = GetEquipmentMaterial(material_slot); + wc->hero_forge_model = GetHeroForgeModel(material_slot); wc->color.color = color; wc->wear_slot_id = material_slot; @@ -2653,7 +2688,7 @@ void Mob::SetSlotTint(uint8 material_slot, uint8 red_tint, uint8 green_tint, uin safe_delete(outapp); } -void Mob::WearChange(uint8 material_slot, uint16 texture, uint32 color) +void Mob::WearChange(uint8 material_slot, uint16 texture, uint32 color, uint32 hero_forge_model) { armor_tint[material_slot] = color; @@ -2662,6 +2697,7 @@ void Mob::WearChange(uint8 material_slot, uint16 texture, uint32 color) wc->spawn_id = this->GetID(); wc->material = texture; + wc->hero_forge_model = hero_forge_model; wc->color.color = color; wc->wear_slot_id = material_slot; @@ -2741,6 +2777,19 @@ uint32 Mob::IsEliteMaterialItem(uint8 material_slot) const return 0; } +uint32 Mob::GetHeroForgeModel(uint8 material_slot) const +{ + const Item_Struct *item; + + item = database.GetItem(GetEquipment(material_slot)); + if (item != 0) + { + return item->HerosForgeModel; + } + + return 0; +} + // works just like a printf void Mob::Say(const char *format, ...) { @@ -3797,6 +3846,8 @@ int32 Mob::GetItemStat(uint32 itemid, const char *identifier) stat = int32(item->CastTime); if (id == "elitematerial") stat = int32(item->EliteMaterial); + if (id == "herosforgemodel") + stat = int32(item->HerosForgeModel); if (id == "procrate") stat = int32(item->ProcRate); if (id == "combateffects") diff --git a/zone/mob.h b/zone/mob.h index dddce98f8..ada3c5df9 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -171,7 +171,7 @@ public: virtual void SendTextureWC(uint8 slot, uint16 texture, uint32 hero_forge_model = 0, uint32 elite_material = 0, uint32 unknown06 = 0, uint32 unknown18 = 0); virtual void SetSlotTint(uint8 material_slot, uint8 red_tint, uint8 green_tint, uint8 blue_tint); - virtual void WearChange(uint8 material_slot, uint16 texture, uint32 color); + virtual void WearChange(uint8 material_slot, uint16 texture, uint32 color, uint32 hero_forge_model = 0); void DoAnim(const int animnum, int type=0, bool ackreq = true, eqFilterType filter = FilterNone); void ProjectileAnimation(Mob* to, int item_id, bool IsArrow = false, float speed = 0, float angle = 0, float tilt = 0, float arc = 0, const char *IDFile = nullptr, SkillUseTypes skillInUse = SkillArchery); @@ -314,6 +314,7 @@ public: virtual int32 GetEquipmentMaterial(uint8 material_slot) const; virtual uint32 GetEquipmentColor(uint8 material_slot) const; virtual uint32 IsEliteMaterialItem(uint8 material_slot) const; + virtual uint32 GetHeroForgeModel(uint8 material_slot) const; bool AffectedBySpellExcludingSlot(int slot, int effect); virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) = 0; virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index c47b463d3..4351fb89f 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -7460,12 +7460,13 @@ XS(XS_Mob_WearChange) { dXSARGS; if (items < 3 || items > 4) - Perl_croak(aTHX_ "Usage: Mob::WearChange(THIS, material_slot, texture, color)"); + Perl_croak(aTHX_ "Usage: Mob::WearChange(THIS, material_slot, texture, [color, hero_forge_model])"); { Mob * THIS; uint8 material_slot = (uint8)SvIV(ST(1)); uint16 texture = (uint16)SvUV(ST(2)); uint32 color = 0; + uint32 hero_forge_model = 0; if (sv_derived_from(ST(0), "Mob")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -7479,8 +7480,11 @@ XS(XS_Mob_WearChange) if (items > 3) { color = (uint32)SvUV(ST(3)); } + if (items > 4) { + hero_forge_model = (uint32)SvUV(ST(3)); + } - THIS->WearChange(material_slot, texture, color); + THIS->WearChange(material_slot, texture, color, hero_forge_model); } XSRETURN_EMPTY; } @@ -8614,7 +8618,7 @@ XS(boot_Mob) newXSproto(strcpy(buf, "TarGlobal"), XS_Mob_TarGlobal, file, "$$$$$$$"); newXSproto(strcpy(buf, "DelGlobal"), XS_Mob_DelGlobal, file, "$$"); newXSproto(strcpy(buf, "SetSlotTint"), XS_Mob_SetSlotTint, file, "$$$$$"); - newXSproto(strcpy(buf, "WearChange"), XS_Mob_WearChange, file, "$$$;$"); + newXSproto(strcpy(buf, "WearChange"), XS_Mob_WearChange, file, "$$$;$$"); newXSproto(strcpy(buf, "DoKnockback"), XS_Mob_DoKnockback, file, "$$$$"); newXSproto(strcpy(buf, "RemoveNimbusEffect"), XS_Mob_RemoveNimbusEffect, file, "$$"); newXSproto(strcpy(buf, "IsRunning"), XS_Mob_IsRunning, file, "$"); From 362bfc79d60e270a432e750aa8721b7cf2f327b1 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Tue, 9 Dec 2014 22:33:09 -0500 Subject: [PATCH 017/153] Fix compile error --- zone/bot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index bb4c53210..11bbf44c7 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -4390,7 +4390,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { uint32 spawnedbotid = 0; spawnedbotid = this->GetBotID(); - for (i = 0; i < _MaterialCount; i++) + for (int i = 0; i < _MaterialCount; i++) { inst = GetBotItem(i); if (inst) From 4c9befee22680219e8029289a64bb2f58d9d8597 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Tue, 9 Dec 2014 23:41:19 -0500 Subject: [PATCH 018/153] Some clean ups due thanks to clang's warnings --- common/eq_stream_factory.cpp | 2 +- common/spdat.cpp | 2 +- world/clientlist.cpp | 2 +- zone/aa.cpp | 6 +- zone/aa.h | 3 +- zone/attack.cpp | 197 +++++++++++++++-------------------- 6 files changed, 94 insertions(+), 118 deletions(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index bc3e2e2ba..12828b28c 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -291,7 +291,7 @@ Timer DecayTimer(20); //bullshit checking, to see if this is really happening, GDB seems to think so... if(stream_itr->second == nullptr) { - fprintf(stderr, "ERROR: nullptr Stream encountered in EQStreamFactory::WriterLoop for: %i", stream_itr->first.first, stream_itr->first.second); + fprintf(stderr, "ERROR: nullptr Stream encountered in EQStreamFactory::WriterLoop for: %i:%i", stream_itr->first.first, stream_itr->first.second); continue; } diff --git a/common/spdat.cpp b/common/spdat.cpp index 1ff8f2696..3f8ae4849 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -896,7 +896,7 @@ bool IsHealOverTimeSpell(uint16 spell_id) bool IsCompleteHealSpell(uint16 spell_id) { if (spell_id == 13 || IsEffectInSpell(spell_id, SE_CompleteHeal) || - IsPercentalHealSpell(spell_id) && !IsGroupSpell(spell_id)) + (IsPercentalHealSpell(spell_id) && !IsGroupSpell(spell_id))) return true; return false; diff --git a/world/clientlist.cpp b/world/clientlist.cpp index c33822d93..a18a9cafc 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -547,7 +547,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S if(totalusers<=20 || admin>=100) totallength=totallength+strlen(countcle->name())+strlen(countcle->AccountName())+strlen(guild_mgr.GetGuildName(countcle->GuildID()))+5; } - else if((countcle->Anon()>0 && admin<=countcle->Admin()) || countcle->Anon()==0 && !countcle->GetGM()){ + else if((countcle->Anon()>0 && admin<=countcle->Admin()) || (countcle->Anon()==0 && !countcle->GetGM())) { totalusers++; if(totalusers<=20 || admin>=100) totallength=totallength+strlen(countcle->name())+strlen(guild_mgr.GetGuildName(countcle->GuildID()))+5; diff --git a/zone/aa.cpp b/zone/aa.cpp index 28c4f60d7..27229cb89 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -893,7 +893,7 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration) //turn on an AA effect //duration == 0 means no time limit, used for one-shot deals, etc.. void Client::EnableAAEffect(aaEffectType type, uint32 duration) { - if(type > 32) + if(type > _maxaaEffectType) return; //for now, special logic needed. m_epp.aa_effects |= 1 << (type-1); @@ -905,7 +905,7 @@ void Client::EnableAAEffect(aaEffectType type, uint32 duration) { } void Client::DisableAAEffect(aaEffectType type) { - if(type > 32) + if(type > _maxaaEffectType) return; //for now, special logic needed. uint32 bit = 1 << (type-1); if(m_epp.aa_effects & bit) { @@ -919,7 +919,7 @@ By default an AA effect is a one shot deal, unless a duration timer is set. */ bool Client::CheckAAEffect(aaEffectType type) { - if(type > 32) + if(type > _maxaaEffectType) return(false); //for now, special logic needed. if(m_epp.aa_effects & (1 << (type-1))) { //is effect enabled? //has our timer expired? diff --git a/zone/aa.h b/zone/aa.h index 00f74e8c6..e2e0749d1 100644 --- a/zone/aa.h +++ b/zone/aa.h @@ -51,7 +51,8 @@ typedef enum { //AA Effect IDs aaEffectFrostArrows, aaEffectWarcry, aaEffectLeechTouch, - aaEffectProjectIllusion // unused - Handled via spell effect + aaEffectProjectIllusion, // unused - Handled via spell effect + _maxaaEffectType = 32 } aaEffectType; diff --git a/zone/attack.cpp b/zone/attack.cpp index 9b5f420a8..68e088b02 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -197,7 +197,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c pvpmode = true; if (chance_mod >= 10000) - return true; + return true; float avoidanceBonus = 0; float hitBonus = 0; @@ -268,21 +268,21 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c } //Avoidance Bonuses on defender decreases baseline hit chance by percent. - avoidanceBonus = defender->spellbonuses.AvoidMeleeChanceEffect + - defender->itembonuses.AvoidMeleeChanceEffect + + avoidanceBonus = defender->spellbonuses.AvoidMeleeChanceEffect + + defender->itembonuses.AvoidMeleeChanceEffect + defender->aabonuses.AvoidMeleeChanceEffect + (defender->itembonuses.AvoidMeleeChance / 10.0f); //Item Mod 'Avoidence' Mob *owner = nullptr; - if (defender->IsPet()) + if (defender->IsPet()) owner = defender->GetOwner(); else if ((defender->IsNPC() && defender->CastToNPC()->GetSwarmOwner())) owner = entity_list.GetMobID(defender->CastToNPC()->GetSwarmOwner()); - + if (owner) avoidanceBonus += owner->aabonuses.PetAvoidance + owner->spellbonuses.PetAvoidance + owner->itembonuses.PetAvoidance; - if(defender->IsNPC()) + if(defender->IsNPC()) avoidanceBonus += (defender->CastToNPC()->GetAvoidanceRating() / 10.0f); //Modifier from database //Hit Chance Bonuses on attacker increases baseline hit chance by percent. @@ -293,7 +293,6 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c attacker->spellbonuses.HitChanceEffect[HIGHEST_SKILL+1] + attacker->aabonuses.HitChanceEffect[HIGHEST_SKILL+1]; - //Accuracy = Spell Effect , HitChance = 'Accuracy' from Item Effect //Only AA derived accuracy can be skill limited. ie (Precision of the Pathfinder, Dead Aim) hitBonus += (attacker->itembonuses.Accuracy[HIGHEST_SKILL+1] + @@ -306,7 +305,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c if(attacker->IsNPC()) hitBonus += (attacker->CastToNPC()->GetAccuracyRating() / 10.0f); //Modifier from database - + if(skillinuse == SkillArchery) hitBonus -= hitBonus*RuleR(Combat, ArcheryHitPenalty); @@ -326,11 +325,10 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c else if(chancetohit < RuleR(Combat,MinChancetoHit)) { chancetohit = RuleR(Combat,MinChancetoHit); } - + //I dont know the best way to handle a garunteed hit discipline being used //agains a garunteed riposte (for example) discipline... for now, garunteed hit wins - #if EQDEBUG>=11 LogFile->write(EQEMuLog::Debug, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); #endif @@ -346,7 +344,6 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c return(tohit_roll <= chancetohit); } - bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) { /* solar: called when a mob is attacked, does the checks to see if it's a hit @@ -562,7 +559,7 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac armor = (armor / RuleR(Combat, NPCACFactor)); Mob *owner = nullptr; - if (IsPet()) + if (IsPet()) owner = GetOwner(); else if ((CastToNPC()->GetSwarmOwner())) owner = entity_list.GetMobID(CastToNPC()->GetSwarmOwner()); @@ -1164,7 +1161,6 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if (GetFeigned()) return false; // Rogean: How can you attack while feigned? Moved up from Aggro Code. - ItemInst* weapon; if (Hand == MainSecondary){ // Kaiyodo - Pick weapon from the attacking hand weapon = GetInv().GetItem(MainSecondary); @@ -1225,7 +1221,6 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b CheckIncreaseSkill(skillinuse, other, -15); CheckIncreaseSkill(SkillOffense, other, -15); - // *************************************************************** // *** Calculate the damage bonus, if applicable, for this hit *** // *************************************************************** @@ -1419,7 +1414,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att if(dead) return false; //cant die more than once... - if(!spell) + if(!spell) spell = SPELL_UNKNOWN; char buffer[48] = { 0 }; @@ -1444,7 +1439,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att #1: Send death packet to everyone */ uint8 killed_level = GetLevel(); - + SendLogoutPackets(); /* Make self become corpse packet */ @@ -1522,7 +1517,6 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att hate_list.RemoveEnt(this); RemoveAutoXTargets(); - //remove ourself from all proximities ClearAllProximities(); @@ -1598,7 +1592,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att else UnmemSpellAll(false); - if(RuleB(Character, LeaveCorpses) && GetLevel() >= RuleI(Character, DeathItemLossLevel) || RuleB(Character, LeaveNakedCorpses)) + if((RuleB(Character, LeaveCorpses) && GetLevel() >= RuleI(Character, DeathItemLossLevel)) || RuleB(Character, LeaveNakedCorpses)) { // creating the corpse takes the cash/items off the player too Corpse *new_corpse = new Corpse(this, exploss); @@ -1657,8 +1651,8 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att if(LeftCorpse && (GetClientVersionBit() & BIT_SoFAndLater) && RuleB(Character, RespawnFromHover)) { - ClearDraggedCorpses(); - RespawnFromHoverTimer.Start(RuleI(Character, RespawnFromHoverTimer) * 1000); + ClearDraggedCorpses(); + RespawnFromHoverTimer.Start(RuleI(Character, RespawnFromHoverTimer) * 1000); SendRespawnBinds(); } else @@ -1675,19 +1669,19 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att if(r) r->MemberZoned(this); - dead_timer.Start(5000, true); + dead_timer.Start(5000, true); m_pp.zone_id = m_pp.binds[0].zoneId; m_pp.zoneInstance = m_pp.binds[0].instance_id; - database.MoveCharacterToZone(this->CharacterID(), database.GetZoneName(m_pp.zone_id)); - Save(); + database.MoveCharacterToZone(this->CharacterID(), database.GetZoneName(m_pp.zone_id)); + Save(); GoToDeath(); } /* QS: PlayerLogDeaths */ if (RuleB(QueryServ, PlayerLogDeaths)){ const char * killer_name = ""; - if (killerMob && killerMob->GetCleanName()){ killer_name = killerMob->GetCleanName(); } - std::string event_desc = StringFormat("Died in zoneid:%i instid:%i by '%s', spellid:%i, damage:%i", this->GetZoneID(), this->GetInstanceID(), killer_name, spell, damage); + if (killerMob && killerMob->GetCleanName()){ killer_name = killerMob->GetCleanName(); } + std::string event_desc = StringFormat("Died in zoneid:%i instid:%i by '%s', spellid:%i, damage:%i", this->GetZoneID(), this->GetInstanceID(), killer_name, spell, damage); QServ->PlayerLogEvent(Player_Log_Deaths, this->CharacterID(), event_desc); } @@ -1836,7 +1830,6 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool else damage = zone->random.Int((min_dmg+eleBane),(max_dmg+eleBane)); - //check if we're hitting above our max or below it. if((min_dmg+eleBane) != 0 && damage < (min_dmg+eleBane)) { mlog(COMBAT__DAMAGE, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); @@ -1846,7 +1839,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool mlog(COMBAT__DAMAGE, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); damage = (max_dmg+eleBane); } - + damage = mod_npc_damage(damage, skillinuse, Hand, weapon, other); int32 hate = damage; @@ -1925,7 +1918,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool return false; MeleeLifeTap(damage); - + CommonBreakInvisible(); //I doubt this works... @@ -1934,15 +1927,15 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if(!bRiposte && !other->HasDied()) { TryWeaponProc(nullptr, weapon, other, Hand); //no weapon - + if (!other->HasDied()) TrySpellProc(nullptr, weapon, other, Hand); - + if (damage > 0 && HasSkillProcSuccess() && !other->HasDied()) TrySkillProc(other, skillinuse, 0, true, Hand); } - if(GetHP() > 0 && !other->HasDied()) + if(GetHP() > 0 && !other->HasDied()) TriggerDefensiveProcs(nullptr, other, Hand, damage); // now check ripostes @@ -2002,7 +1995,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill) { mlog(COMBAT__HITS, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); - + Mob *oos = nullptr; if(killerMob) { oos = killerMob->GetOwnerOrSelf(); @@ -2057,7 +2050,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack if(p_depop == true) return false; - + HasAISpellEffects = false; BuffFadeAll(); uint8 killed_level = GetLevel(); @@ -2118,8 +2111,8 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack Group *kg = entity_list.GetGroupByClient(give_exp_client); Raid *kr = entity_list.GetRaidByClient(give_exp_client); - int32 finalxp = EXP_FORMULA; - finalxp = give_exp_client->mod_client_xp(finalxp, this); + int32 finalxp = EXP_FORMULA; + finalxp = give_exp_client->mod_client_xp(finalxp, this); if(kr) { @@ -2230,7 +2223,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack parse->EventNPC(EVENT_KILLED_MERIT, this, give_exp_client, "killed", 0); if(RuleB(NPC, EnableMeritBasedFaction)) - give_exp_client->SetFactionLevel(give_exp_client->CharacterID(), GetNPCFactionID(), give_exp_client->GetBaseClass(), + give_exp_client->SetFactionLevel(give_exp_client->CharacterID(), GetNPCFactionID(), give_exp_client->GetBaseClass(), give_exp_client->GetBaseRace(), give_exp_client->GetDeity()); mod_npc_killed_merit(give_exp_client); @@ -2392,9 +2385,9 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack } void Mob::AddToHateList(Mob* other, int32 hate, int32 damage, bool iYellForHelp, bool bFrenzy, bool iBuffTic) { - + assert(other != nullptr); - + if (other == this) return; @@ -2411,12 +2404,12 @@ void Mob::AddToHateList(Mob* other, int32 hate, int32 damage, bool iYellForHelp, if(other){ AddRampage(other); int hatemod = 100 + other->spellbonuses.hatemod + other->itembonuses.hatemod + other->aabonuses.hatemod; - + int32 shieldhatemod = other->spellbonuses.ShieldEquipHateMod + other->itembonuses.ShieldEquipHateMod + other->aabonuses.ShieldEquipHateMod; if (shieldhatemod && other->HasShieldEquiped()) hatemod += shieldhatemod; - + if(hatemod < 1) hatemod = 1; hate = ((hate * (hatemod))/100); @@ -2433,7 +2426,7 @@ void Mob::AddToHateList(Mob* other, int32 hate, int32 damage, bool iYellForHelp, if (other->IsNPC() && (other->IsPet() || other->CastToNPC()->GetSwarmOwner() > 0)) TryTriggerOnValueAmount(false, false, false, true); - + if(IsClient() && !IsAIControlled()) return; @@ -2475,9 +2468,9 @@ void Mob::AddToHateList(Mob* other, int32 hate, int32 damage, bool iYellForHelp, if(damage > GetHP()) damage = GetHP(); - if (spellbonuses.ImprovedTaunt[1] && (GetLevel() < spellbonuses.ImprovedTaunt[0]) + if (spellbonuses.ImprovedTaunt[1] && (GetLevel() < spellbonuses.ImprovedTaunt[0]) && other && (buffs[spellbonuses.ImprovedTaunt[2]].casterid != other->GetID())) - hate = (hate*spellbonuses.ImprovedTaunt[1])/100; + hate = (hate*spellbonuses.ImprovedTaunt[1])/100; hate_list.Add(other, hate, damage, bFrenzy, !iBuffTic); @@ -2497,7 +2490,6 @@ void Mob::AddToHateList(Mob* other, int32 hate, int32 damage, bool iYellForHelp, } #endif //BOTS - // if other is a merc, add the merc client to the hate list if(other->IsMerc()) { if(other->CastToMerc()->GetMercOwner() && other->CastToMerc()->GetMercOwner()->CastToClient()->GetFeigned()) { @@ -2636,7 +2628,6 @@ uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon ) // This function calculates and returns the damage bonus for the weapon identified by the parameter "Weapon". // Modified 9/21/2008 by Cantus - // Assert: This function should only be called for hits by the mainhand, as damage bonuses apply only to the // weapon in the primary slot. Be sure to check that Hand == MainPrimary before calling. @@ -2648,7 +2639,6 @@ uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon ) // Assert: This function should not be called unless the player is a melee class, as casters do not receive a damage bonus. - if( Weapon == nullptr || Weapon->ItemType == ItemType1HSlash || Weapon->ItemType == ItemType1HBlunt || Weapon->ItemType == ItemTypeMartial || Weapon->ItemType == ItemType1HPiercing ) { // The weapon in the player's main (primary) hand is a one-handed weapon, or there is no item equipped at all. @@ -2676,7 +2666,6 @@ uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon ) // as I suspect, then please feel free to delete the following line, and replace all occurences of "ucPlayerLevel" with "GetLevel()". uint8 ucPlayerLevel = (uint8) GetLevel(); - // The following may look cleaner, and would certainly be easier to understand, if it was // a simple 53x150 cell matrix. // @@ -2694,7 +2683,6 @@ uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon ) // lookup table. In cases where a formula is the best bet, I use a formula. In other places // where a formula would be ugly, I use a lookup table in the interests of speed. - if( Weapon->Delay <= 27 ) { // Damage Bonuses for all 2H weapons with delays of 27 or less are identical. @@ -2706,7 +2694,6 @@ uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon ) return (ucPlayerLevel - 22) / 3; } - if( ucPlayerLevel == 65 && Weapon->Delay <= 59 ) { // Consider these two facts: @@ -2725,7 +2712,6 @@ uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon ) return ucLevel65DamageBonusesForDelays28to59[Weapon->Delay-28]; } - if( ucPlayerLevel > 65 ) { if( ucPlayerLevel > 80 ) @@ -2864,7 +2850,6 @@ uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon ) } } - // If we've gotten to this point in the function without hitting a return statement, // we know that the character's level is between 28 and 65, and that the 2H weapon's // delay is 28 or higher. @@ -3110,7 +3095,6 @@ int Mob::GetMonkHandToHandDelay(void) } } - int32 Mob::ReduceDamage(int32 damage) { if(damage <= 0) @@ -3123,7 +3107,7 @@ int32 Mob::ReduceDamage(int32 damage) slot = spellbonuses.NegateAttacks[1]; if(slot >= 0) { if(--buffs[slot].numhits == 0) { - + if(!TryFadeEffect(slot)) BuffFadeBySlot(slot , true); } @@ -3138,8 +3122,8 @@ int32 Mob::ReduceDamage(int32 damage) //Only mitigate if damage is above the minimium specified. if (spellbonuses.MeleeThresholdGuard[0]){ slot = spellbonuses.MeleeThresholdGuard[1]; - - if (slot >= 0 && (damage > spellbonuses.MeleeThresholdGuard[2])) + + if (slot >= 0 && (damage > spellbonuses.MeleeThresholdGuard[2])) { DisableMeleeRune = true; int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[0] / 100; @@ -3161,7 +3145,6 @@ int32 Mob::ReduceDamage(int32 damage) } } - if (spellbonuses.MitigateMeleeRune[0] && !DisableMeleeRune){ slot = spellbonuses.MitigateMeleeRune[1]; if(slot >= 0) @@ -3170,7 +3153,7 @@ int32 Mob::ReduceDamage(int32 damage) if (spellbonuses.MitigateMeleeRune[2] && (damage_to_reduce > spellbonuses.MitigateMeleeRune[2])) damage_to_reduce = spellbonuses.MitigateMeleeRune[2]; - + if(spellbonuses.MitigateMeleeRune[3] && (damage_to_reduce >= buffs[slot].melee_rune)) { mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" @@ -3183,10 +3166,10 @@ int32 Mob::ReduceDamage(int32 damage) { mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); - + if (spellbonuses.MitigateMeleeRune[3]) buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce); - + damage -= damage_to_reduce; } } @@ -3217,7 +3200,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi slot = spellbonuses.NegateAttacks[1]; if(slot >= 0) { if(--buffs[slot].numhits == 0) { - + if(!TryFadeEffect(slot)) BuffFadeBySlot(slot , true); } @@ -3231,8 +3214,8 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi // If this is a DoT, use DoT Shielding... if(iBuffTic) { - damage -= (damage * itembonuses.DoTShielding / 100); - + damage -= (damage * itembonuses.DoTShielding / 100); + if (spellbonuses.MitigateDotRune[0]){ slot = spellbonuses.MitigateDotRune[1]; if(slot >= 0) @@ -3252,7 +3235,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi { if (spellbonuses.MitigateDotRune[3]) buffs[slot].dot_rune = (buffs[slot].dot_rune - damage_to_reduce); - + damage -= damage_to_reduce; } } @@ -3265,12 +3248,11 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi // Reduce damage by the Spell Shielding first so that the runes don't take the raw damage. damage -= (damage * itembonuses.SpellShield / 100); - //Only mitigate if damage is above the minimium specified. if (spellbonuses.SpellThresholdGuard[0]){ slot = spellbonuses.SpellThresholdGuard[1]; - - if (slot >= 0 && (damage > spellbonuses.MeleeThresholdGuard[2])) + + if (slot >= 0 && (damage > spellbonuses.MeleeThresholdGuard[2])) { DisableSpellRune = true; int damage_to_reduce = damage * spellbonuses.SpellThresholdGuard[0] / 100; @@ -3287,8 +3269,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi } } } - - + // Do runes now. if (spellbonuses.MitigateSpellRune[0] && !DisableSpellRune){ slot = spellbonuses.MitigateSpellRune[1]; @@ -3311,10 +3292,10 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi { mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].magic_rune); - + if (spellbonuses.MitigateSpellRune[3]) buffs[slot].magic_rune = (buffs[slot].magic_rune - damage_to_reduce); - + damage -= damage_to_reduce; } } @@ -3322,14 +3303,14 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi if(damage < 1) return 0; - + //Regular runes absorb spell damage (except dots) - Confirmed on live. if (spellbonuses.MeleeRune[0] && spellbonuses.MeleeRune[1] >= 0) - damage = RuneAbsorb(damage, SE_Rune); + damage = RuneAbsorb(damage, SE_Rune); if (spellbonuses.AbsorbMagicAtt[0] && spellbonuses.AbsorbMagicAtt[1] >= 0) damage = RuneAbsorb(damage, SE_AbsorbMagicAtt); - + if(damage < 1) return 0; } @@ -3349,7 +3330,7 @@ int32 Mob::ReduceAllDamage(int32 damage) TryTriggerOnValueAmount(false, true); } } - + CheckNumHitsRemaining(NUMHIT_IncomingDamage); return(damage); @@ -3556,7 +3537,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons attacker->CastToClient()->sneaking = false; attacker->SendAppearancePacket(AT_Sneak, 0); } - + //final damage has been determined. SetHP(GetHP() - damage); @@ -3588,7 +3569,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons entity_list.MessageClose_StringID(this, true, 100, MT_WornOff, HAS_BEEN_AWAKENED, GetCleanName(), attacker->GetCleanName()); BuffFadeByEffect(SE_Mez); - } + } //check stun chances if bashing if (damage > 0 && ((skill_used == SkillBash || skill_used == SkillKick) && attacker)) { @@ -3721,18 +3702,15 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //if the attacker is a client, try them with the correct filter if(attacker && attacker->IsClient()) { - if (((spell_id != SPELL_UNKNOWN)||(FromDamageShield)) && damage>0) { + if ((spell_id != SPELL_UNKNOWN || FromDamageShield) && damage > 0) { //special crap for spell damage, looks hackish to me - char val1[20]={0}; - if (FromDamageShield) - { - if(!attacker->CastToClient()->GetFilter(FilterDamageShields) == FilterHide) - { - attacker->Message_StringID(MT_DS,OTHER_HIT_NONMELEE,GetCleanName(),ConvertArray(damage,val1)); - } - } - else - entity_list.MessageClose_StringID(this, true, 100, MT_NonMelee,HIT_NON_MELEE,attacker->GetCleanName(),GetCleanName(),ConvertArray(damage,val1)); + char val1[20] = {0}; + if (FromDamageShield) { + if (attacker->CastToClient()->GetFilter(FilterDamageShields) != FilterHide) + attacker->Message_StringID(MT_DS,OTHER_HIT_NONMELEE, GetCleanName(), ConvertArray(damage, val1)); + } else { + entity_list.MessageClose_StringID(this, true, 100, MT_NonMelee, HIT_NON_MELEE, attacker->GetCleanName(), GetCleanName(), ConvertArray(damage, val1)); + } } else { if(damage > 0) { if(spell_id != SPELL_UNKNOWN) @@ -3790,7 +3768,6 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons } - void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id) { int32 maxhp = GetMaxHP(); @@ -3879,7 +3856,7 @@ float Mob::GetProcChances(float ProcBonus, uint16 hand) } float Mob::GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand, Mob* on) { - + if (!on) return ProcChance; @@ -3935,7 +3912,7 @@ void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { LogFile->write(EQEMuLog::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); return; } - + if (!IsAttackAllowed(on)) { mlog(COMBAT__PROCS, "Preventing procing off of unattackable things."); return; @@ -3962,7 +3939,7 @@ void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, uint16 hand) { - + if (!weapon) return; uint16 skillinuse = 28; @@ -4123,7 +4100,7 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, uint16 skillinuse = 28; if (weapon) skillinuse = GetSkillByItemType(weapon->ItemType); - + TrySkillProc(on, skillinuse, 0, false, hand); } @@ -4190,7 +4167,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack // decided to branch this into it's own function since it's going to be duplicating a lot of the // code in here, but could lead to some confusion otherwise - if (IsPet() && GetOwner()->IsClient() || (IsNPC() && CastToNPC()->GetSwarmOwner())) { + if ((IsPet() && GetOwner()->IsClient()) || (IsNPC() && CastToNPC()->GetSwarmOwner())) { TryPetCriticalHit(defender,skill,damage); return; } @@ -4234,7 +4211,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack //are defined you will have an innate chance to hit at Level 1 regardless of bonuses. //Warning: Do not define these rules if you want live like critical hits. critChance += RuleI(Combat, MeleeBaseCritChance); - + if (IsClient()) { critChance += RuleI(Combat, ClientBaseCritChance); @@ -4335,7 +4312,6 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack } } - bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) { if (defender && !defender->IsClient() && defender->GetHPRatio() < 10){ @@ -4484,8 +4460,8 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui if (!spellbonuses.LimitToSkill[skill] && !itembonuses.LimitToSkill[skill] && !aabonuses.LimitToSkill[skill]) return; - /*Allow one proc from each (Spell/Item/AA) - Kayen: Due to limited avialability of effects on live it is too difficult + /*Allow one proc from each (Spell/Item/AA) + Kayen: Due to limited avialability of effects on live it is too difficult to confirm how they stack at this time, will adjust formula when more data is avialablle to test.*/ bool CanProc = true; @@ -4503,9 +4479,9 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui for(int e = 0; e < MAX_SKILL_PROCS; e++){ if (CanProc && - (!Success && spellbonuses.SkillProc[e] && IsValidSpell(spellbonuses.SkillProc[e])) - || (Success && spellbonuses.SkillProcSuccess[e] && IsValidSpell(spellbonuses.SkillProcSuccess[e]))) { - + ((!Success && spellbonuses.SkillProc[e] && IsValidSpell(spellbonuses.SkillProc[e])) + || (Success && spellbonuses.SkillProcSuccess[e] && IsValidSpell(spellbonuses.SkillProcSuccess[e])))) { + if (Success) base_spell_id = spellbonuses.SkillProcSuccess[e]; else @@ -4547,8 +4523,8 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui CanProc = true; for(int e = 0; e < MAX_SKILL_PROCS; e++){ if (CanProc && - (!Success && itembonuses.SkillProc[e] && IsValidSpell(itembonuses.SkillProc[e])) - || (Success && itembonuses.SkillProcSuccess[e] && IsValidSpell(itembonuses.SkillProcSuccess[e]))) { + ((!Success && itembonuses.SkillProc[e] && IsValidSpell(itembonuses.SkillProc[e])) + || (Success && itembonuses.SkillProcSuccess[e] && IsValidSpell(itembonuses.SkillProcSuccess[e])))) { if (Success) base_spell_id = itembonuses.SkillProcSuccess[e]; @@ -4589,15 +4565,15 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui CanProc = true; uint32 effect = 0; int32 base1 = 0; - int32 base2 = 0; + int32 base2 = 0; uint32 slot = 0; for(int e = 0; e < MAX_SKILL_PROCS; e++){ if (CanProc && - (!Success && aabonuses.SkillProc[e]) - || (Success && aabonuses.SkillProcSuccess[e])){ + ((!Success && aabonuses.SkillProc[e]) + || (Success && aabonuses.SkillProcSuccess[e]))) { int aaid = 0; - + if (Success) base_spell_id = aabonuses.SkillProcSuccess[e]; else @@ -4670,7 +4646,7 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) { General Mechanics - Check buffslot to make sure damage from a root does not cancel the root - - If multiple roots on target, always and only checks first root slot and if broken only removes that slots root. + - If multiple roots on target, always and only checks first root slot and if broken only removes that slots root. - Only roots on determental spells can be broken by damage. - Root break chance values obtained from live parses. */ @@ -4731,7 +4707,7 @@ int32 Mob::RuneAbsorb(int32 damage, uint16 type) { if(melee_rune_left > 0) damage -= melee_rune_left; - + if(!TryFadeEffect(slot)) BuffFadeBySlot(slot); } @@ -4739,7 +4715,6 @@ int32 Mob::RuneAbsorb(int32 damage, uint16 type) } } - else{ for(uint32 slot = 0; slot < buff_max; slot++) { if(slot == spellbonuses.AbsorbMagicAtt[1] && spellbonuses.AbsorbMagicAtt[0] && buffs[slot].magic_rune && IsValidSpell(buffs[slot].spellid)){ @@ -4755,7 +4730,7 @@ int32 Mob::RuneAbsorb(int32 damage, uint16 type) { if(magic_rune_left > 0) damage -= magic_rune_left; - + if(!TryFadeEffect(slot)) BuffFadeBySlot(slot); } @@ -4768,7 +4743,7 @@ int32 Mob::RuneAbsorb(int32 damage, uint16 type) void Mob::CommonOutgoingHitSuccess(Mob* defender, int32 &damage, SkillUseTypes skillInUse) { - if (!defender) + if (!defender) return; ApplyMeleeDamageBonus(skillInUse, damage); From 2d1999c9618e23e9c0822c074a4c1bd7500669ff Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 10 Dec 2014 00:59:54 -0500 Subject: [PATCH 019/153] Update version too --- common/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/version.h b/common/version.h index 43b4f8b10..78aa9fcf0 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9059 +#define CURRENT_BINARY_DATABASE_VERSION 9060 #define COMPILE_DATE __DATE__ #define COMPILE_TIME __TIME__ #ifndef WIN32 From 820f99067d8fa144444640ab67d01429a445e067 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 10 Dec 2014 01:19:44 -0500 Subject: [PATCH 020/153] Make use of the targetable_with_hotkey flag for SoF+ --- changelog.txt | 1 + common/eq_packet_structs.h | 1 + common/patches/rof.cpp | 2 +- common/patches/rof2.cpp | 2 +- common/patches/sod.cpp | 2 +- common/patches/sof.cpp | 2 +- common/patches/underfoot.cpp | 2 +- zone/aa.cpp | 9 +++++++++ zone/merc.cpp | 1 + zone/mob.cpp | 3 ++- zone/npc.h | 2 +- 11 files changed, 20 insertions(+), 7 deletions(-) diff --git a/changelog.txt b/changelog.txt index 2fe60ee70..842d66f9a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 12/09/2014 == Trevius: (RoF+) Implemented Hero's Forge Armor Models for Items. To use, set herosforgemodel field in the item table to a model number such as 63 (for example). +demonstar55: SoF+ swarm pets will no longer be F8able (without a hack!) == 12/08/2014 == Secrets: Added a feature that allows an EQ client to log in directly to World without having to enter the LoginServer, provided the 'password' field is set in WorldServer. diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index cffe4e354..930b76843 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -363,6 +363,7 @@ union uint32 DestructibleUnk7; uint8 DestructibleUnk8; uint32 DestructibleUnk9; + bool targetable_with_hotkey; }; diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 43b411dca..fc35e36cd 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -3706,7 +3706,7 @@ namespace RoF Bitfields->showhelm = emu->showhelm; Bitfields->trader = 0; Bitfields->targetable = 1; - Bitfields->targetable_with_hotkey = (emu->IsMercenary ? 0 : 1); + Bitfields->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0; Bitfields->showname = ShowName; // Not currently found diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index a22d2d4c5..32a3fc592 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -3706,7 +3706,7 @@ namespace RoF2 Bitfields->showhelm = emu->showhelm; Bitfields->trader = 0; Bitfields->targetable = 1; - Bitfields->targetable_with_hotkey = (emu->IsMercenary ? 0 : 1); + Bitfields->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0; Bitfields->showname = ShowName; // Not currently found diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 498058e19..baca905a2 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -2383,7 +2383,7 @@ namespace SoD Bitfields->anon = emu->anon; Bitfields->showhelm = emu->showhelm; Bitfields->targetable = 1; - Bitfields->targetable_with_hotkey = (emu->IsMercenary ? 0 : 1); + Bitfields->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0; Bitfields->statue = 0; Bitfields->trader = 0; Bitfields->buyer = 0; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 2d2fff48d..8430a51bb 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -1889,7 +1889,7 @@ namespace SoF eq->beard = emu->beard; eq->targetable = 1; //New Field - Toggle Targetable on or off - 0 = off, 1 = on eq->NPC = emu->NPC; - eq->targetable_with_hotkey = 1;//New Field - Toggle Targetable on or off - 0 = off, 1 = on + eq->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0; //New Field - Toggle Targetable on or off - 0 = off, 1 = on eq->x = emu->x; eq->deltaX = emu->deltaX; eq->deltaY = emu->deltaY; diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 6da577be6..16095faa9 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -2668,7 +2668,7 @@ namespace Underfoot Bitfields->anon = emu->anon; Bitfields->showhelm = emu->showhelm; Bitfields->targetable = 1; - Bitfields->targetable_with_hotkey = (emu->IsMercenary ? 0 : 1); + Bitfields->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0; Bitfields->statue = 0; Bitfields->trader = 0; Bitfields->buyer = 0; diff --git a/zone/aa.cpp b/zone/aa.cpp index 27229cb89..61cf56db9 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -600,6 +600,9 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u if(npc_dup != nullptr) npca->GiveNPCTypeData(npc_dup); + if (IsClient()) + npca->no_target_hotkey = 1; + entity_list.AddNPC(npca, true, true); summon_count--; } @@ -696,6 +699,9 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid if(npc_dup != nullptr) npca->GiveNPCTypeData(npc_dup); + if (IsClient()) + npca->no_target_hotkey = 1; + entity_list.AddNPC(npca, true, true); summon_count--; } @@ -883,6 +889,9 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration) if(make_npc != nullptr) npca->GiveNPCTypeData(make_npc); + if (IsClient()) + npca->no_target_hotkey = 1; + entity_list.AddNPC(npca, true, true); //the target of these swarm pets will take offense to being cast on... diff --git a/zone/merc.cpp b/zone/merc.cpp index 2641e7cb4..f86ed7faf 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -4772,6 +4772,7 @@ Merc* Merc::LoadMerc(Client *c, MercTemplate* merc_template, uint32 merchant_id, npc_type->npc_id = 0; //NPC ID has to be 0, otherwise db gets all confuzzled. npc_type->class_ = merc_template->ClassID; npc_type->maxlevel = 0; //We should hard-set this to override scalerate's functionality in the NPC class when it is constructed. + npc_type->no_target_hotkey = 1; Merc* merc = new Merc(npc_type, c->GetX(), c->GetY(), c->GetZ(), 0); diff --git a/zone/mob.cpp b/zone/mob.cpp index e501862a2..c30cc6d2b 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -923,7 +923,8 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) ns->spawn.invis = (invisible || hidden) ? 1 : 0; // TODO: load this before spawning players ns->spawn.NPC = IsClient() ? 0 : 1; - ns->spawn.IsMercenary = (IsMerc() || no_target_hotkey) ? 1 : 0; + ns->spawn.IsMercenary = IsMerc() ? 1 : 0; + ns->spawn.targetable_with_hotkey = no_target_hotkey ? 0 : 1; // opposite logic! ns->spawn.petOwnerId = ownerid; diff --git a/zone/npc.h b/zone/npc.h index d374f4950..081fca514 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -269,7 +269,7 @@ public: void AddLootDrop(const Item_Struct*dbitem, ItemList* itemlistconst, int16 charges, uint8 minlevel, uint8 maxlevel, bool equipit, bool wearchange = false); virtual void DoClassAttacks(Mob *target); void CheckSignal(); - inline bool IsTargetableWithHotkey() const { return no_target_hotkey; } + inline bool IsNotTargetableWithHotkey() const { return no_target_hotkey; } int32 GetNPCHPRegen() const { return hp_regen + itembonuses.HPRegen + spellbonuses.HPRegen; } inline const char* GetAmmoIDfile() const { return ammo_idfile; } From d9a1bcb3fd59ab6b1add560608209440f19c49be Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 10 Dec 2014 02:15:15 -0500 Subject: [PATCH 021/153] Clean up SoF+ swarm pet F8 hack --- common/ruletypes.h | 1 - zone/aa.cpp | 9 --------- zone/npc.cpp | 13 ++++++------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index 9874e4002..c5a4bb562 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -136,7 +136,6 @@ RULE_CATEGORY_END() RULE_CATEGORY( Pets ) RULE_REAL( Pets, AttackCommandRange, 150 ) RULE_BOOL( Pets, UnTargetableSwarmPet, false ) -RULE_BOOL( Pets, SwarmPetNotTargetableWithHotKey, false ) //On SOF+ clients this a semi-hack to make swarm pets not F8 targetable. RULE_CATEGORY_END() RULE_CATEGORY( GM ) diff --git a/zone/aa.cpp b/zone/aa.cpp index 61cf56db9..27229cb89 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -600,9 +600,6 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u if(npc_dup != nullptr) npca->GiveNPCTypeData(npc_dup); - if (IsClient()) - npca->no_target_hotkey = 1; - entity_list.AddNPC(npca, true, true); summon_count--; } @@ -699,9 +696,6 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid if(npc_dup != nullptr) npca->GiveNPCTypeData(npc_dup); - if (IsClient()) - npca->no_target_hotkey = 1; - entity_list.AddNPC(npca, true, true); summon_count--; } @@ -889,9 +883,6 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration) if(make_npc != nullptr) npca->GiveNPCTypeData(make_npc); - if (IsClient()) - npca->no_target_hotkey = 1; - entity_list.AddNPC(npca, true, true); //the target of these swarm pets will take offense to being cast on... diff --git a/zone/npc.cpp b/zone/npc.cpp index 034be8f75..0c49f0388 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1854,27 +1854,26 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns) { swarmOwner = entity_list.GetMobID(GetSwarmOwner()); } - + if (swarmOwner != nullptr) { if(swarmOwner->IsClient()) { SetPetOwnerClient(true); //Simple flag to determine if pet belongs to a client SetAllowBeneficial(1);//Allow temp pets to receive buffs and heals if owner is client. - //This is a hack to allow CLIENT swarm pets NOT to be targeted with F8. Warning: Will turn name 'Yellow'! - if (RuleB(Pets, SwarmPetNotTargetableWithHotKey)) - ns->spawn.IsMercenary = 1; + //This will allow CLIENT swarm pets NOT to be targeted with F8. + ns->spawn.targetable_with_hotkey = 0; } else { //NPC cast swarm pets should still be targetable with F8. - ns->spawn.IsMercenary = 0; + ns->spawn.targetable_with_hotkey = 1; } SetTempPet(true); //Simple mob flag for checking if temp pet swarmOwner->SetTempPetsActive(true); //Necessary fail safe flag set if mob ever had a swarm pet to ensure they are removed. swarmOwner->SetTempPetCount(swarmOwner->GetTempPetCount() + 1); - + //Not recommended if using above (However, this will work better on older clients). if (RuleB(Pets, UnTargetableSwarmPet)) { @@ -1882,7 +1881,7 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns) if(!IsCharmed() && swarmOwner->IsClient()) sprintf(ns->spawn.lastName, "%s's Pet", swarmOwner->GetName()); } - } + } else if(GetOwnerID()) { ns->spawn.is_pet = 1; From 0e54019fd505eca4925c83a0f0e641ea818d0586 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 10 Dec 2014 02:18:57 -0500 Subject: [PATCH 022/153] Set the no_target_hotkey data as well --- zone/npc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zone/npc.cpp b/zone/npc.cpp index 0c49f0388..af8b9c544 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1863,11 +1863,13 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns) SetAllowBeneficial(1);//Allow temp pets to receive buffs and heals if owner is client. //This will allow CLIENT swarm pets NOT to be targeted with F8. ns->spawn.targetable_with_hotkey = 0; + no_target_hotkey = 1; } else { //NPC cast swarm pets should still be targetable with F8. ns->spawn.targetable_with_hotkey = 1; + no_target_hotkey = 0; } SetTempPet(true); //Simple mob flag for checking if temp pet From 118d58706487df73f9157120a6dcbde74c52ee75 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 12 Dec 2014 18:55:43 -0500 Subject: [PATCH 023/153] Implement IGNORE_ROOT_AGGRO_RULES (special attack 42) This allows you to have a mob be rooted but still try to attack the target with the most amount of hate instead of attacking the closest --- changelog.txt | 3 +++ zone/common.h | 4 ++-- zone/mob_ai.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 842d66f9a..c71b72c38 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/12/2014 == +demonstar55: Add special attack 42, Ignore Root Aggro Rules. This allows you to root a mob and have them still use the normal aggro rules (so they will attack the one with most hate, not closest) + == 12/09/2014 == Trevius: (RoF+) Implemented Hero's Forge Armor Models for Items. To use, set herosforgemodel field in the item table to a model number such as 63 (for example). demonstar55: SoF+ swarm pets will no longer be F8able (without a hack!) diff --git a/zone/common.h b/zone/common.h index 477d5b876..aa24964fd 100644 --- a/zone/common.h +++ b/zone/common.h @@ -134,8 +134,8 @@ enum { DISABLE_MELEE = 39, NPC_CHASE_DISTANCE = 40, ALLOW_TO_TANK = 41, - MAX_SPECIAL_ATTACK = 42 - + IGNORE_ROOT_AGGRO_RULES = 42, + MAX_SPECIAL_ATTACK = 43 }; typedef enum { //fear states diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index d041ac884..81c5f510c 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1088,7 +1088,7 @@ void Mob::AI_Process() { { // we are prevented from getting here if we are blind and don't have a target in range // from above, so no extra blind checks needed - if (IsRooted() || IsBlind()) + if ((IsRooted() && !GetSpecialAbility(IGNORE_ROOT_AGGRO_RULES)) || IsBlind()) SetTarget(hate_list.GetClosest(this)); else { From 80a67f9ebc159072c67c290606179f53fddb0bdf Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 13 Dec 2014 03:18:30 -0500 Subject: [PATCH 024/153] Fix guild rank spam --- changelog.txt | 3 +++ zone/client_packet.cpp | 23 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index c71b72c38..3b30d17e3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/13/2014 == +demonstar55: Fix guild rank spam on zone (needed to be in OP_PP) + == 12/12/2014 == demonstar55: Add special attack 42, Ignore Root Aggro Rules. This allows you to root a mob and have them still use the normal aggro rules (so they will attack the one with most hate, not closest) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index c68434109..574220e97 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1483,9 +1483,28 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) m_pp.gm = 0; /* Load Guild */ - if (!IsInAGuild()) { m_pp.guild_id = GUILD_NONE; } - else { + if (!IsInAGuild()) { + m_pp.guild_id = GUILD_NONE; + } else { m_pp.guild_id = GuildID(); + uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID()); + // FIXME: RoF guild rank + if (GetClientVersion() >= EQClientRoF) { + switch (rank) { + case 0: + rank = 5; + break; + case 1: + rank = 3; + break; + case 2: + rank = 1; + break; + default: + break; + } + } + m_pp.guildrank = rank; if (zone->GetZoneID() == RuleI(World, GuildBankZoneID)) GuildBanker = (guild_mgr.IsGuildLeader(GuildID(), CharacterID()) || guild_mgr.GetBankerFlag(CharacterID())); } From 9056008342cc519d608b4f8eb376c12de92b9192 Mon Sep 17 00:00:00 2001 From: Trevius Date: Sat, 13 Dec 2014 13:53:55 -0600 Subject: [PATCH 025/153] (RoF+) Implemented Armor Ornamentation using Hero's Forge Armor Models. To use, create an ornamentation augment and set the herosforgemodel field in the items table. (RoF+) Added command #heromodel (#hm for short) - Usage: #heromodel [hero forge model] [ [slot] ] (example: #heromodel 63) --- changelog.txt | 5 +- common/item.cpp | 83 +++++++++++-- common/item.h | 14 ++- common/patches/rof.cpp | 28 +++-- common/patches/rof2.cpp | 35 ++++-- common/patches/rof2_structs.h | 8 +- common/patches/rof_structs.h | 8 +- common/shareddb.cpp | 56 ++++----- common/version.h | 2 +- utils/sql/db_update_manifest.txt | 1 + world/worlddb.cpp | 96 ++++++++------- zone/bot.cpp | 34 +++++- zone/client.cpp | 201 ++++++------------------------- zone/client.h | 2 +- zone/client_packet.cpp | 21 ++-- zone/command.cpp | 43 +++++++ zone/command.h | 1 + zone/corpse.cpp | 2 +- zone/inventory.cpp | 21 ++-- zone/mob.cpp | 174 +++++++++++++------------- zone/mob.h | 2 +- zone/npc.cpp | 13 +- 22 files changed, 457 insertions(+), 393 deletions(-) diff --git a/changelog.txt b/changelog.txt index 3b30d17e3..3baa02623 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,10 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 12/13/2014 == -demonstar55: Fix guild rank spam on zone (needed to be in OP_PP) +demonstar55: Fix guild rank spam on zone (needed to be in OP_PP). +Trevius: (RoF+) Implemented Armor Ornamentation using Hero's Forge Armor Models. To use, create an ornamentation augment and set the herosforgemodel field in the items table. +Trevius: (RoF+) Added command #heromodel (#hm for short) - Usage: #heromodel [hero forge model] [ [slot] ] (example: #heromodel 63) + == 12/12/2014 == demonstar55: Add special attack 42, Ignore Root Aggro Rules. This allows you to root a mob and have them still use the normal aggro rules (so they will attack the one with most hate, not closest) diff --git a/common/item.cpp b/common/item.cpp index f92bc6a67..8af7f8b06 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -24,6 +24,7 @@ #include "races.h" #include "shareddb.h" #include "classes.h" +#include "rulesys.h" #include @@ -1125,10 +1126,12 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) m_trade[slot_id] = inst; result = slot_id; } - else { + else + { // Slot must be within a bag ItemInst* baginst = GetItem(Inventory::CalcSlotId(slot_id)); // Get parent bag - if (baginst && baginst->IsType(ItemClassContainer)) { + if (baginst && baginst->IsType(ItemClassContainer)) + { baginst->_PutItem(Inventory::CalcBagIdx(slot_id), inst); result = slot_id; } @@ -1414,6 +1417,7 @@ ItemInst::ItemInst(const Item_Struct* item, int16 charges) { m_scaling = false; m_ornamenticon = 0; m_ornamentidfile = 0; + m_ornament_hero_model = 0; } ItemInst::ItemInst(SharedDatabase *db, uint32 item_id, int16 charges) { @@ -1438,6 +1442,7 @@ ItemInst::ItemInst(SharedDatabase *db, uint32 item_id, int16 charges) { m_scaling = false; m_ornamenticon = 0; m_ornamentidfile = 0; + m_ornament_hero_model = 0; } ItemInst::ItemInst(ItemInstTypes use_type) { @@ -1457,6 +1462,7 @@ ItemInst::ItemInst(ItemInstTypes use_type) { m_scaling = false; m_ornamenticon = 0; m_ornamentidfile = 0; + m_ornament_hero_model = 0; } // Make a copy of an ItemInst object @@ -1509,6 +1515,7 @@ ItemInst::ItemInst(const ItemInst& copy) m_scaling = copy.m_scaling; m_ornamenticon = copy.m_ornamenticon; m_ornamentidfile = copy.m_ornamentidfile; + m_ornament_hero_model = copy.m_ornament_hero_model; } // Clean up container contents @@ -1782,21 +1789,79 @@ ItemInst* ItemInst::GetAugment(uint8 slot) const return nullptr; } -ItemInst* ItemInst::GetOrnamentationAug(int ornamentationAugtype) const +ItemInst* ItemInst::GetOrnamentationAug(int32 ornamentationAugtype) const { - for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { - if (GetAugment(i) && m_item->AugSlotType[i] == ornamentationAugtype) { - const char *item_IDFile = GetAugment(i)->GetItem()->IDFile; - if (strncmp(item_IDFile, "IT64", strlen(item_IDFile)) == 0 || strncmp(item_IDFile, "IT63", strlen(item_IDFile)) == 0) - continue; - + if (ornamentationAugtype > 0) + { + for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) + { + if (GetAugment(i) && m_item->AugSlotType[i] == ornamentationAugtype) + { + const char *item_IDFile = GetAugment(i)->GetItem()->IDFile; + if ( + (strncmp(item_IDFile, "IT64", strlen(item_IDFile)) == 0 + || strncmp(item_IDFile, "IT63", strlen(item_IDFile)) == 0) + && GetAugment(i)->GetItem()->HerosForgeModel == 0 + ) + { + continue; + } return this->GetAugment(i); + } } } return nullptr; } +uint32 ItemInst::GetOrnamentHeroModel(int32 material_slot) const { + uint32 HeroModel = 0; + if (m_ornament_hero_model > 0) + { + HeroModel = m_ornament_hero_model; + if (material_slot >= 0) + { + HeroModel = (m_ornament_hero_model * 100) + material_slot; + } + } + return HeroModel; +} + +bool ItemInst::UpdateOrnamentationInfo() { + bool ornamentSet = false; + + if (IsType(ItemClassCommon)) + { + int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); + if (GetOrnamentationAug(ornamentationAugtype)) + { + const Item_Struct* ornamentItem; + ornamentItem = GetOrnamentationAug(ornamentationAugtype)->GetItem(); + if (ornamentItem != nullptr) + { + SetOrnamentIcon(ornamentItem->Icon); + SetOrnamentHeroModel(ornamentItem->HerosForgeModel); + if (strlen(ornamentItem->IDFile) > 2) + { + SetOrnamentationIDFile(atoi(&ornamentItem->IDFile[2])); + } + else + { + SetOrnamentationIDFile(0); + } + ornamentSet = true; + } + } + else + { + SetOrnamentIcon(0); + SetOrnamentHeroModel(0); + SetOrnamentationIDFile(0); + } + } + return ornamentSet; +} + bool ItemInst::CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Container, bool AllowAll) { if (!ItemToTry || !Container) return false; diff --git a/common/item.h b/common/item.h index cce166eb0..4827f042b 100644 --- a/common/item.h +++ b/common/item.h @@ -329,7 +329,8 @@ public: void DeleteAugment(uint8 slot); ItemInst* RemoveAugment(uint8 index); bool IsAugmented(); - ItemInst* GetOrnamentationAug(int ornamentationAugtype) const; + ItemInst* GetOrnamentationAug(int32 ornamentationAugtype) const; + bool UpdateOrnamentationInfo(); static bool CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Container, bool AllowAll = false); // Has attack/delay? @@ -393,10 +394,12 @@ public: void SetActivated(bool activated) { m_activated = activated; } int8 GetEvolveLvl() const { return m_evolveLvl; } void SetScaling(bool v) { m_scaling = v; } - uint32 GetOrnamentationIcon() const { return m_ornamenticon; } - void SetOrnamentIcon(uint32 ornament_icon) { m_ornamenticon = ornament_icon; } - uint32 GetOrnamentationIDFile() const { return m_ornamentidfile; } - void SetOrnamentationIDFile(uint32 ornament_idfile) { m_ornamentidfile = ornament_idfile; } + uint32 GetOrnamentationIcon() const { return m_ornamenticon; } + void SetOrnamentIcon(uint32 ornament_icon) { m_ornamenticon = ornament_icon; } + uint32 GetOrnamentationIDFile() const { return m_ornamentidfile; } + void SetOrnamentationIDFile(uint32 ornament_idfile) { m_ornamentidfile = ornament_idfile; } + uint32 GetOrnamentHeroModel(int32 material_slot = -1) const; + void SetOrnamentHeroModel(uint32 ornament_hero_model) { m_ornament_hero_model = ornament_hero_model; } void Initialize(SharedDatabase *db = nullptr); void ScaleItem(); @@ -443,6 +446,7 @@ protected: bool m_scaling; uint32 m_ornamenticon; uint32 m_ornamentidfile; + uint32 m_ornament_hero_model; // // Items inside of this item (augs or contents); diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index fc35e36cd..202d4f090 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -3812,8 +3812,8 @@ namespace RoF Equipment[k].material = emu->equipment[k].material; Equipment[k].unknown1 = emu->equipment[k].unknown1; Equipment[k].elitematerial = emu->equipment[k].elitematerial; - Equipment[k].material2 = emu->equipment[k].heroforgemodel; - Equipment[k].elitematerial = emu->equipment[k].material2; + Equipment[k].heroforgemodel = emu->equipment[k].heroforgemodel; + Equipment[k].material2 = emu->equipment[k].material2; } Buffer += (sizeof(structs::EquipStruct) * 9); @@ -4847,7 +4847,6 @@ namespace RoF hdr.main_slot = (merchant_slot == 0) ? slot_id.MainSlot : merchant_slot; hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubSlot : 0xffff; hdr.unknown013 = (merchant_slot == 0) ? slot_id.AugSlot : 0xffff; - //hdr.unknown013 = 0xffff; hdr.price = inst->GetPrice(); hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount(); //hdr.merchant_slot = (merchant_slot == 0) ? 1 : 0xffffffff; @@ -4877,6 +4876,8 @@ namespace RoF } //ORNAMENT IDFILE / ICON uint16 ornaIcon = 0; + int32 heroModel = 0; + /* if (inst->GetOrnamentationAug(ornamentationAugtype)) { const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); //Mainhand @@ -4887,8 +4888,16 @@ namespace RoF ss.write((const char*)&null_term, sizeof(uint8)); //Icon ornaIcon = aug_weap->Icon; + if (aug_weap->HerosForgeModel > 0) + { + heroModel = (aug_weap->HerosForgeModel * 100) + Inventory::CalcMaterialFromSlot(slot_id_in); + } } - else if (inst->GetOrnamentationIDFile() && inst->GetOrnamentationIcon()) { + else + */ + + if (inst->GetOrnamentationIDFile() && inst->GetOrnamentationIcon()) + { char tmp[30]; memset(tmp, 0x0, 30); sprintf(tmp, "IT%d", inst->GetOrnamentationIDFile()); //Mainhand ss.write(tmp, strlen(tmp)); @@ -4897,10 +4906,12 @@ namespace RoF ss.write(tmp, strlen(tmp)); ss.write((const char*)&null_term, sizeof(uint8)); ornaIcon = inst->GetOrnamentationIcon(); + heroModel = inst->GetOrnamentHeroModel(Inventory::CalcMaterialFromSlot(slot_id_in)); } - else { - ss.write((const char*)&null_term, sizeof(uint8)); //no mh - ss.write((const char*)&null_term, sizeof(uint8));//no of + else + { + ss.write((const char*)&null_term, sizeof(uint8)); // no main hand Ornamentation + ss.write((const char*)&null_term, sizeof(uint8)); // no off hand Ornamentation } RoF::structs::ItemSerializationHeaderFinish hdrf; @@ -4908,12 +4919,13 @@ namespace RoF hdrf.unknown061 = 0; hdrf.unknown062 = 0; hdrf.unknowna1 = 0xffffffff; - hdrf.unknowna2 = 0; + hdrf.ornamentHeroModel = heroModel; hdrf.unknown063 = 0; hdrf.unknowna3 = 0; hdrf.unknowna4 = 0xffffffff; hdrf.unknowna5 = 0; hdrf.ItemClass = item->ItemClass; + ss.write((const char*)&hdrf, sizeof(RoF::structs::ItemSerializationHeaderFinish)); if (strlen(item->Name) > 0) diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 32a3fc592..531aa8c4d 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -3816,8 +3816,8 @@ namespace RoF2 Equipment[k].material = emu->equipment[k].material; Equipment[k].unknown1 = emu->equipment[k].unknown1; Equipment[k].elitematerial = emu->equipment[k].elitematerial; - Equipment[k].material2 = emu->equipment[k].heroforgemodel; - Equipment[k].elitematerial = emu->equipment[k].material2; + Equipment[k].heroforgemodel = emu->equipment[k].heroforgemodel; + Equipment[k].material2 = emu->equipment[k].material2; } Buffer += (sizeof(structs::EquipStruct) * 9); @@ -4851,7 +4851,6 @@ namespace RoF2 hdr.main_slot = (merchant_slot == 0) ? slot_id.MainSlot : merchant_slot; hdr.sub_slot = (merchant_slot == 0) ? slot_id.SubSlot : 0xffff; hdr.unknown013 = (merchant_slot == 0) ? slot_id.AugSlot : 0xffff; - //hdr.unknown013 = 0xffff; hdr.price = inst->GetPrice(); hdr.merchant_slot = (merchant_slot == 0) ? 1 : inst->GetMerchantCount(); //hdr.merchant_slot = (merchant_slot == 0) ? 1 : 0xffffffff; @@ -4862,8 +4861,8 @@ namespace RoF2 hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0; hdr.unknown044 = 0; - hdr.unknown048 = 0; - hdr.unknown052 = 0; + hdr.unknown048 = 7300 + Inventory::CalcMaterialFromSlot(slot_id_in); //0; + hdr.unknown052 = 7300 + Inventory::CalcMaterialFromSlot(slot_id_in); //0; hdr.isEvolving = item->EvolvingLevel > 0 ? 1 : 0; ss.write((const char*)&hdr, sizeof(RoF2::structs::ItemSerializationHeader)); @@ -4881,7 +4880,10 @@ namespace RoF2 } //ORNAMENT IDFILE / ICON uint16 ornaIcon = 0; - if (inst->GetOrnamentationAug(ornamentationAugtype)) { + int32 heroModel = 0; + /* + if (inst->GetOrnamentationAug(ornamentationAugtype)) + { const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); //Mainhand ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile)); @@ -4891,8 +4893,16 @@ namespace RoF2 ss.write((const char*)&null_term, sizeof(uint8)); //Icon ornaIcon = aug_weap->Icon; + if (aug_weap->HerosForgeModel > 0) + { + heroModel = (aug_weap->HerosForgeModel * 100) + Inventory::CalcMaterialFromSlot(slot_id_in); + } } - else if (inst->GetOrnamentationIDFile() && inst->GetOrnamentationIcon()) { + else + */ + + if (inst->GetOrnamentationIDFile() && inst->GetOrnamentationIcon()) + { char tmp[30]; memset(tmp, 0x0, 30); sprintf(tmp, "IT%d", inst->GetOrnamentationIDFile()); //Mainhand ss.write(tmp, strlen(tmp)); @@ -4901,10 +4911,12 @@ namespace RoF2 ss.write(tmp, strlen(tmp)); ss.write((const char*)&null_term, sizeof(uint8)); ornaIcon = inst->GetOrnamentationIcon(); + heroModel = inst->GetOrnamentHeroModel(Inventory::CalcMaterialFromSlot(slot_id_in)); } - else { - ss.write((const char*)&null_term, sizeof(uint8)); //no mh - ss.write((const char*)&null_term, sizeof(uint8));//no of + else + { + ss.write((const char*)&null_term, sizeof(uint8)); // no main hand Ornamentation + ss.write((const char*)&null_term, sizeof(uint8)); // no off hand Ornamentation } RoF2::structs::ItemSerializationHeaderFinish hdrf; @@ -4912,12 +4924,13 @@ namespace RoF2 hdrf.unknown061 = 0; hdrf.unknown062 = 0; hdrf.unknowna1 = 0xffffffff; - hdrf.unknowna2 = 0; + hdrf.ornamentHeroModel = heroModel; hdrf.unknown063 = 0; hdrf.unknowna3 = 0; hdrf.unknowna4 = 0xffffffff; hdrf.unknowna5 = 0; hdrf.ItemClass = item->ItemClass; + ss.write((const char*)&hdrf, sizeof(RoF2::structs::ItemSerializationHeaderFinish)); if (strlen(item->Name) > 0) diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index 572a5a0f0..90ea4f287 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -4425,14 +4425,14 @@ struct EvolvingItem { struct ItemSerializationHeaderFinish { - uint16 ornamentIcon; +/*079*/ uint16 ornamentIcon; /*081*/ uint8 unknown061; // 0 - Add Evolving Item struct if this isn't set to 0? /*082*/ uint8 unknown062; // 0 -/*083*/ uint32 unknowna1; // 0xffffffff -/*087*/ uint32 unknowna2; // 0 +/*083*/ int32 unknowna1; // 0xffffffff +/*087*/ uint32 ornamentHeroModel; // 0 /*091*/ uint8 unknown063; // 0 /*092*/ uint32 unknowna3; // 0 -/*096*/ uint32 unknowna4; // 0xffffffff +/*096*/ int32 unknowna4; // 0xffffffff /*100*/ uint32 unknowna5; // 0 /*104*/ uint8 ItemClass; //0, 1, or 2 /*105*/ diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index 285b15675..a7b494d0d 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -4422,14 +4422,14 @@ struct EvolvingItem { struct ItemSerializationHeaderFinish { - uint16 ornamentIcon; +/*079*/ uint16 ornamentIcon; /*081*/ uint8 unknown061; // 0 - Add Evolving Item struct if this isn't set to 0? /*082*/ uint8 unknown062; // 0 -/*083*/ uint32 unknowna1; // 0xffffffff -/*087*/ uint32 unknowna2; // 0 +/*083*/ int32 unknowna1; // 0xffffffff +/*087*/ uint32 ornamentHeroModel; // 0 /*091*/ uint8 unknown063; // 0 /*092*/ uint32 unknowna3; // 0 -/*096*/ uint32 unknowna4; // 0xffffffff +/*096*/ int32 unknowna4; // 0xffffffff /*100*/ uint32 unknowna5; // 0 /*104*/ uint8 ItemClass; //0, 1, or 2 /*105*/ diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 6bf1cb52f..8f99ac03d 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -199,14 +199,15 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i // Update/Insert item std::string query = StringFormat("REPLACE INTO inventory " "(charid, slotid, itemid, charges, instnodrop, custom_data, color, " - "augslot1, augslot2, augslot3, augslot4, augslot5, ornamenticon, ornamentidfile) " + "augslot1, augslot2, augslot3, augslot4, augslot5, ornamenticon, ornamentidfile, ornament_hero_model) " "VALUES( %lu, %lu, %lu, %lu, %lu, '%s', %lu, " - "%lu, %lu, %lu, %lu, %lu, %lu, %lu)", + "%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu)", (unsigned long)char_id, (unsigned long)slot_id, (unsigned long)inst->GetItem()->ID, (unsigned long)charges, (unsigned long)(inst->IsInstNoDrop()? 1: 0), inst->GetCustomDataString().c_str(), (unsigned long)inst->GetColor(), (unsigned long)augslot[0], (unsigned long)augslot[1], (unsigned long)augslot[2], - (unsigned long)augslot[3],(unsigned long)augslot[4], (unsigned long)inst->GetOrnamentationIcon(), (unsigned long)inst->GetOrnamentationIDFile()); + (unsigned long)augslot[3],(unsigned long)augslot[4], (unsigned long)inst->GetOrnamentationIcon(), + (unsigned long)inst->GetOrnamentationIDFile(), (unsigned long)inst->GetOrnamentHeroModel()); auto results = QueryDatabase(query); // Save bag contents, if slot supports bag contents @@ -488,7 +489,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { // Retrieve character inventory std::string query = StringFormat("SELECT slotid, itemid, charges, color, augslot1, " - "augslot2, augslot3, augslot4, augslot5, instnodrop, custom_data, ornamenticon, ornamentidfile " + "augslot2, augslot3, augslot4, augslot5, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model " "FROM inventory WHERE charid = %i ORDER BY slotid", char_id); auto results = QueryDatabase(query); if (!results.Success()) { @@ -515,6 +516,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { uint32 ornament_icon = (uint32)atoul(row[11]); uint32 ornament_idfile = (uint32)atoul(row[12]); + uint32 ornament_hero_model = (uint32)atoul(row[13]); const Item_Struct* item = GetItem(item_id); @@ -552,11 +554,10 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { value.push_back(v); } } - if (ornament_icon > 0) - inst->SetOrnamentIcon(ornament_icon); - if (ornament_idfile > 0) - inst->SetOrnamentationIDFile(ornament_idfile); + inst->SetOrnamentIcon(ornament_icon); + inst->SetOrnamentationIDFile(ornament_idfile); + inst->SetOrnamentHeroModel(ornament_hero_model); if (instnodrop || (((slot_id >= EmuConstants::EQUIPMENT_BEGIN && slot_id <= EmuConstants::EQUIPMENT_END) || slot_id == MainPowerSource) && inst->GetItem()->Attuneable)) inst->SetInstNoDrop(true); @@ -599,7 +600,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) { // Retrieve character inventory std::string query = StringFormat("SELECT slotid, itemid, charges, color, augslot1, " - "augslot2, augslot3, augslot4, augslot5, instnodrop, custom_data, ornamenticon, ornamentidfile " + "augslot2, augslot3, augslot4, augslot5, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model " "FROM inventory INNER JOIN character_data ch " "ON ch.id = charid WHERE ch.name = '%s' AND ch.account_id = %i ORDER BY slotid", name, account_id); @@ -627,6 +628,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) bool instnodrop = (row[9] && (uint16)atoi(row[9])) ? true : false; uint32 ornament_icon = (uint32)atoul(row[11]); uint32 ornament_idfile = (uint32)atoul(row[12]); + uint32 ornament_hero_model = (uint32)atoul(row[13]); const Item_Struct* item = GetItem(item_id); int16 put_slot_id = INVALID_INDEX; @@ -663,11 +665,9 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) } } - if (ornament_icon > 0) - inst->SetOrnamentIcon(ornament_icon); - - if (ornament_idfile > 0) - inst->SetOrnamentationIDFile(ornament_idfile); + inst->SetOrnamentIcon(ornament_icon); + inst->SetOrnamentationIDFile(ornament_idfile); + inst->SetOrnamentHeroModel(ornament_hero_model); if (color > 0) inst->SetColor(color); @@ -854,23 +854,6 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ item.ItemType = (uint8)atoi(row[ItemField::itemtype]); item.Material = (uint8)atoi(row[ItemField::material]); item.HerosForgeModel = (uint32)atoi(row[ItemField::herosforgemodel]); - if (item.HerosForgeModel > 0) - { - item.HerosForgeModel *= 100; - uint32 HeroSlot = 0; - switch (item.Slots) - { - case 4: { HeroSlot = 0; break; } // Head - case 131072: { HeroSlot = 1; break; } // Chest - case 128: { HeroSlot = 2; break; } // Arms - case 1536: { HeroSlot = 3; break; } // Bracers - case 4096: { HeroSlot = 4; break; } // Hands - case 262144: { HeroSlot = 5; break; } // Legs - case 524288: { HeroSlot = 6; break; } // Feet - default: { HeroSlot = 1; break; } // Chest - } - item.HerosForgeModel += HeroSlot; - } item.SellRate = (float)atof(row[ItemField::sellrate]); item.CastTime = (uint32)atoul(row[ItemField::casttime]); item.EliteMaterial = (uint32)atoul(row[ItemField::elitematerial]); @@ -1024,11 +1007,18 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ } const Item_Struct* SharedDatabase::GetItem(uint32 id) { - if(!items_hash || id > items_hash->max_key()) { + if (id == 0) + { return nullptr; } - if(items_hash->exists(id)) { + if(!items_hash || id > items_hash->max_key()) + { + return nullptr; + } + + if(items_hash->exists(id)) + { return &(items_hash->at(id)); } diff --git a/common/version.h b/common/version.h index 78aa9fcf0..e223fe606 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9060 +#define CURRENT_BINARY_DATABASE_VERSION 9061 #define COMPILE_DATE __DATE__ #define COMPILE_TIME __TIME__ #ifndef WIN32 diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index a06a9d94e..61806f625 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -314,6 +314,7 @@ 9058|2014_11_26_InventoryTableUpdate.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornamenticon'|empty| 9059|2014_12_01_mercs_table_update.sql|SHOW COLUMNS FROM `mercs` LIKE 'MercSize'|empty| 9060|2014_12_09_items_table_update.sql|SHOW COLUMNS FROM `items` LIKE 'herosforgemodel'|empty| +9061|2014_12_11_inventory_table_update.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornament_hero_model'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 7d70fd71d..d9315e80e 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -154,18 +154,11 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct* } /* Bind End */ - /* - Character's equipped items - @merth: Haven't done bracer01/bracer02 yet. - Also: this needs a second look after items are a little more solid - NOTE: items don't have a color, players MAY have a tint, if the - use_tint part is set. otherwise use the regular color - */ - /* Load Character Material Data for Char Select */ cquery = StringFormat("SELECT slot, red, green, blue, use_tint, color FROM `character_material` WHERE `id` = %u", character_id); auto results_b = database.QueryDatabase(cquery); uint8 slot = 0; - for (auto row_b = results_b.begin(); row_b != results_b.end(); ++row_b) { + for (auto row_b = results_b.begin(); row_b != results_b.end(); ++row_b) + { slot = atoi(row_b[0]); pp.item_tint[slot].rgb.red = atoi(row_b[1]); pp.item_tint[slot].rgb.green = atoi(row_b[2]); @@ -175,53 +168,70 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct* /* Load Inventory */ inv = new Inventory; - if (GetInventory(account_id, cs->name[char_num], inv)) { - for (uint8 material = 0; material <= 8; material++) { - uint32 color = 0; - ItemInst *item = inv->GetItem(Inventory::CalcSlotFromMaterial(material)); - if (item == 0) - continue; + if (GetInventory(account_id, cs->name[char_num], inv)) + { + const Item_Struct* item = nullptr; + const ItemInst* inst = nullptr; + int16 invslot = 0; - cs->equip[char_num][material].material = item->GetItem()->Material; - cs->equip[char_num][material].material = 0; - cs->equip[char_num][material].elitematerial = item->GetItem()->EliteMaterial; - cs->equip[char_num][material].heroforgemodel = item->GetItem()->HerosForgeModel; - cs->equip[char_num][material].material2 = item->GetItem()->Material; + for (uint32 matslot = 0; matslot < _MaterialCount; matslot++) + { + invslot = Inventory::CalcSlotFromMaterial(matslot); + if (invslot == INVALID_INDEX) { continue; } - if (pp.item_tint[material].rgb.use_tint){ color = pp.item_tint[material].color; } - else{ color = item->GetItem()->Color; } + inst = inv->GetItem(invslot); + if (inst == nullptr) { continue; } - cs->equip[char_num][material].color.color = color; + item = inst->GetItem(); + if (item == nullptr) { continue; } - /* Weapons are handled a bit differently */ - if ((material == MaterialPrimary) || (material == MaterialSecondary)) { - if (strlen(item->GetItem()->IDFile) > 2) { - int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); - uint32 idfile; - if (item->GetOrnamentationAug(ornamentationAugtype)) { - idfile = atoi(&item->GetOrnamentationAug(ornamentationAugtype)->GetItem()->IDFile[2]); - } - else if (item->GetOrnamentationIcon() && item->GetOrnamentationIDFile()) { - idfile = item->GetOrnamentationIDFile(); - } - else { - idfile = atoi(&item->GetItem()->IDFile[2]); - } - - if (material == MaterialPrimary) - cs->primary[char_num] = idfile; - else - cs->secondary[char_num] = idfile; + if (matslot > 6) + { + uint32 idfile = 0; + // Weapon Models + if (inst->GetOrnamentationIDFile() != 0) + { + idfile = inst->GetOrnamentationIDFile(); + cs->equip[char_num][matslot].material = idfile; } + else + { + if (strlen(item->IDFile) > 2) + { + idfile = atoi(&item->IDFile[2]); + cs->equip[char_num][matslot].material = idfile; + } + } + if (matslot == MaterialPrimary) + { + cs->primary[char_num] = idfile; + } + else + { + cs->secondary[char_num] = idfile; + } + } + else + { + // Armor Materials/Models + cs->equip[char_num][matslot].material = item->Material; + cs->equip[char_num][matslot].elitematerial = item->EliteMaterial; + cs->equip[char_num][matslot].heroforgemodel = inst->GetOrnamentHeroModel(matslot); + cs->equip[char_num][matslot].color.color = inst->GetColor(); } } } - else { + else + { printf("Error loading inventory for %s\n", cs->name[char_num]); } + safe_delete(inv); + if (++char_num > 10) + { break; + } } return; diff --git a/zone/bot.cpp b/zone/bot.cpp index 11bbf44c7..a79c45880 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -4390,7 +4390,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { uint32 spawnedbotid = 0; spawnedbotid = this->GetBotID(); - for (int i = 0; i < _MaterialCount; i++) + for (int i = 0; i < MaterialPrimary; i++) { inst = GetBotItem(i); if (inst) @@ -4420,6 +4420,34 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { } } } + + inst = GetBotItem(MainPrimary); + if(inst) + { + item = inst->GetItem(); + if(item) + { + if(strlen(item->IDFile) > 2) + { + ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]); + } + ns->spawn.colors[MaterialPrimary].color = GetEquipmentColor(MaterialPrimary); + } + } + + inst = GetBotItem(MainSecondary); + if(inst) + { + item = inst->GetItem(); + if(item) + { + if(strlen(item->IDFile) > 2) + { + ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]); + } + ns->spawn.colors[MaterialSecondary].color = GetEquipmentColor(MaterialSecondary); + } + } } } @@ -16007,11 +16035,13 @@ uint8 Bot::GetNumberNeedingHealedInGroup(uint8 hpr, bool includePets) { uint32 Bot::GetEquipmentColor(uint8 material_slot) const { //Bot tints - uint32 slotid = 0; + int16 slotid = 0; uint32 botid = this->GetBotID(); //Translate code slot # to DB slot # slotid = Inventory::CalcSlotFromMaterial(material_slot); + if(invslot == INVALID_INDEX) + return 0; //read from db std::string query = StringFormat("SELECT color FROM botinventory " diff --git a/zone/client.cpp b/zone/client.cpp index 014d4f0bb..d2349e02a 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -1819,129 +1819,43 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) ns->spawn.runspeed = (gmspeed == 0) ? runspeed : 3.125f; if (!m_pp.showhelm) ns->spawn.showhelm = 0; - // pp also hold this info; should we pull from there or inventory? - // (update: i think pp should do it, as this holds LoY dye - plus, this is ugly code with Inventory!) + /* + // Equipment/Weapons already set from Mob::FillSpawnStruct + // Commenting this out for now const Item_Struct* item = nullptr; const ItemInst* inst = nullptr; + int16 invslot; - // Only Player Races Wear Armor - if (IsPlayerRace(race)) + for (uint32 matslot = 0; matslot < _MaterialCount; matslot++) { - if ((inst = m_inv[MainHands]) && inst->IsType(ItemClassCommon)) + // Only Player Races Wear Armor + if (IsPlayerRace(race) || matslot > 6) { - item = inst->GetItem(); - ns->spawn.equipment[MaterialHands].material = item->Material; - ns->spawn.equipment[MaterialHands].elitematerial = item->EliteMaterial; - ns->spawn.equipment[MaterialHands].heroforgemodel = item->HerosForgeModel; - ns->spawn.colors[MaterialHands].color = m_pp.item_tint[MaterialHands].rgb.use_tint ? m_pp.item_tint[MaterialHands].color : item->Color; - } - if ((inst = m_inv[MainHead]) && inst->IsType(ItemClassCommon)) - { - item = inst->GetItem(); - ns->spawn.equipment[MaterialHead].material = item->Material; - ns->spawn.equipment[MaterialHead].elitematerial = item->EliteMaterial; - ns->spawn.equipment[MaterialHead].heroforgemodel = item->HerosForgeModel; - ns->spawn.colors[MaterialHead].color = m_pp.item_tint[MaterialHead].rgb.use_tint ? m_pp.item_tint[MaterialHead].color : item->Color; - } - if ((inst = m_inv[MainArms]) && inst->IsType(ItemClassCommon)) - { - item = inst->GetItem(); - ns->spawn.equipment[MaterialArms].material = item->Material; - ns->spawn.equipment[MaterialArms].elitematerial = item->EliteMaterial; - ns->spawn.equipment[MaterialArms].heroforgemodel = item->HerosForgeModel; - ns->spawn.colors[MaterialArms].color = m_pp.item_tint[MaterialArms].rgb.use_tint ? m_pp.item_tint[MaterialArms].color : item->Color; - } - if ((inst = m_inv[MainWrist1]) && inst->IsType(ItemClassCommon)) - { - item = inst->GetItem(); - ns->spawn.equipment[MaterialWrist].material = item->Material; - ns->spawn.equipment[MaterialWrist].elitematerial = item->EliteMaterial; - ns->spawn.equipment[MaterialWrist].heroforgemodel = item->HerosForgeModel; - ns->spawn.colors[MaterialWrist].color = m_pp.item_tint[MaterialWrist].rgb.use_tint ? m_pp.item_tint[MaterialWrist].color : item->Color; - } + invslot = Inventory::CalcSlotFromMaterial(matslot); + if (invslot == INVALID_INDEX) + continue; - if ((inst = m_inv[MainChest]) && inst->IsType(ItemClassCommon)) - { - item = inst->GetItem(); - ns->spawn.equipment[MaterialChest].material = item->Material; - ns->spawn.equipment[MaterialChest].elitematerial = item->EliteMaterial; - ns->spawn.equipment[MaterialChest].heroforgemodel = item->HerosForgeModel; - ns->spawn.colors[MaterialChest].color = m_pp.item_tint[MaterialChest].rgb.use_tint ? m_pp.item_tint[MaterialChest].color : item->Color; - } - if ((inst = m_inv[MainLegs]) && inst->IsType(ItemClassCommon)) - { - item = inst->GetItem(); - ns->spawn.equipment[MaterialLegs].material = item->Material; - ns->spawn.equipment[MaterialLegs].elitematerial = item->EliteMaterial; - ns->spawn.equipment[MaterialLegs].heroforgemodel = item->HerosForgeModel; - ns->spawn.colors[MaterialLegs].color = m_pp.item_tint[MaterialLegs].rgb.use_tint ? m_pp.item_tint[MaterialLegs].color : item->Color; - } - if ((inst = m_inv[MainFeet]) && inst->IsType(ItemClassCommon)) - { - item = inst->GetItem(); - ns->spawn.equipment[MaterialFeet].material = item->Material; - ns->spawn.equipment[MaterialFeet].elitematerial = item->EliteMaterial; - ns->spawn.equipment[MaterialFeet].heroforgemodel = item->HerosForgeModel; - ns->spawn.colors[MaterialFeet].color = m_pp.item_tint[MaterialFeet].rgb.use_tint ? m_pp.item_tint[MaterialFeet].color : item->Color; - } - } - int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); - if ((inst = m_inv[MainPrimary]) && inst->IsType(ItemClassCommon)) - { - if (inst->GetOrnamentationAug(ornamentationAugtype)) - { - item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); - if (strlen(item->IDFile) > 2) + if ((inst = m_inv[invslot]) && inst->IsType(ItemClassCommon)) { - ns->spawn.equipment[MaterialPrimary].material = atoi(&item->IDFile[2]); - } - } - else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) - { - ns->spawn.equipment[MaterialPrimary].material = inst->GetOrnamentationIDFile(); - } - else - { - item = inst->GetItem(); - if (strlen(item->IDFile) > 2) - { - ns->spawn.equipment[MaterialPrimary].material = atoi(&item->IDFile[2]); + item = inst->GetItem(); + + if (matslot > 6) + { + // Weapon Models + ns->spawn.equipment[matslot].material = GetEquipmentMaterial(matslot); + } + else + { + // Armor Materials/Models + ns->spawn.equipment[matslot].material = item->Material; + ns->spawn.equipment[matslot].elitematerial = item->EliteMaterial; + ns->spawn.equipment[matslot].heroforgemodel = GetHerosForgeModel(matslot); + ns->spawn.colors[matslot].color = m_pp.item_tint[matslot].rgb.use_tint ? m_pp.item_tint[matslot].color : item->Color; + } } } } - if ((inst = m_inv[MainSecondary]) && inst->IsType(ItemClassCommon)) - { - if (inst->GetOrnamentationAug(ornamentationAugtype)) - { - item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); - if (strlen(item->IDFile) > 2) - { - ns->spawn.equipment[MaterialSecondary].material = atoi(&item->IDFile[2]); - } - } - else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) - { - ns->spawn.equipment[MaterialSecondary].material = inst->GetOrnamentationIDFile(); - } - else - { - item = inst->GetItem(); - if (strlen(item->IDFile) > 2) - { - ns->spawn.equipment[MaterialSecondary].material = atoi(&item->IDFile[2]); - } - } - } - - //these two may be related to ns->spawn.texture - /* - ns->spawn.npc_armor_graphic = texture; - ns->spawn.npc_helm_graphic = helmtexture; */ - - //filling in some unknowns to make the client happy -// ns->spawn.unknown0002[2] = 3; - } bool Client::GMHideMe(Client* client) { @@ -2769,48 +2683,10 @@ bool Client::BindWound(Mob* bindmob, bool start, bool fail){ void Client::SetMaterial(int16 in_slot, uint32 item_id) { const Item_Struct* item = database.GetItem(item_id); - int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); - if (item && (item->ItemClass==ItemClassCommon)) { - if (in_slot==MainHead) - m_pp.item_material[MaterialHead] = item->Material; - else if (in_slot==MainChest) - m_pp.item_material[MaterialChest] = item->Material; - else if (in_slot==MainArms) - m_pp.item_material[MaterialArms] = item->Material; - else if (in_slot==MainWrist1) - m_pp.item_material[MaterialWrist] = item->Material; - else if (in_slot==MainHands) - m_pp.item_material[MaterialHands] = item->Material; - else if (in_slot==MainLegs) - m_pp.item_material[MaterialLegs] = item->Material; - else if (in_slot==MainFeet) - m_pp.item_material[MaterialFeet] = item->Material; - else if (in_slot == MainPrimary) { - const ItemInst* inst = m_inv[MainPrimary]; - if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) { - item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); - m_pp.item_material[MaterialPrimary] = atoi(item->IDFile + 2); - } - else if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) { - m_pp.item_material[MaterialPrimary] = inst->GetOrnamentationIDFile(); - } - else { - m_pp.item_material[MaterialPrimary] = atoi(item->IDFile + 2); - } - } - else if (in_slot == MainSecondary) { - const ItemInst* inst = m_inv[MainSecondary]; - if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) { - item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); - m_pp.item_material[MaterialSecondary] = atoi(item->IDFile + 2); - } - else if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) { - m_pp.item_material[MaterialSecondary] = inst->GetOrnamentationIDFile(); - } - else { - m_pp.item_material[MaterialSecondary] = atoi(item->IDFile + 2); - } - } + if (item && (item->ItemClass==ItemClassCommon)) + { + uint32 matslot = Inventory::CalcMaterialFromSlot(in_slot); + m_pp.item_material[matslot] = GetEquipmentMaterial(matslot); } } @@ -5859,17 +5735,18 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) { if(inst) { item = inst->GetItem(); if(item) { - if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) { - const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); - strcpy(insr->itemnames[L], item->Name); - insr->itemicons[L] = aug_weap->Icon; + strcpy(insr->itemnames[L], item->Name); + if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) + { + const Item_Struct *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); + insr->itemicons[L] = aug_item->Icon; } - else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) { - strcpy(insr->itemnames[L], item->Name); + else if (inst && inst->GetOrnamentationIcon()) + { insr->itemicons[L] = inst->GetOrnamentationIcon(); } - else { - strcpy(insr->itemnames[L], item->Name); + else + { insr->itemicons[L] = item->Icon; } } diff --git a/zone/client.h b/zone/client.h index 7cbddfdb2..b5f414052 100644 --- a/zone/client.h +++ b/zone/client.h @@ -805,7 +805,7 @@ public: void QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call = false); void PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data = 0); bool AutoPutLootInInventory(ItemInst& inst, bool try_worn = false, bool try_cursor = true, ServerLootItem_Struct** bag_item_data = 0); - bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, bool attuned = false, uint16 to_slot = MainCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0); + bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, bool attuned = false, uint16 to_slot = MainCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0); void SetStats(uint8 type,int16 set_val); void IncStats(uint8 type,int16 increase_val); void DropItem(int16 slot_id); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 574220e97..db209317b 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -3085,7 +3085,6 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) uint16 slot_id = in_augment->container_slot; uint16 aug_slot_id = in_augment->augment_slot; - //Message(13, "%i AugSlot", aug_slot_id); if (slot_id == INVALID_INDEX || aug_slot_id == INVALID_INDEX) { Message(13, "Error: Invalid Aug Index."); @@ -3101,6 +3100,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) (tobe_auged->AvailableWearSlot(auged_with->GetItem()->Slots))) { tobe_auged->PutAugment(in_augment->augment_index, *auged_with); + tobe_auged->UpdateOrnamentationInfo(); ItemInst *aug = tobe_auged->GetAugment(in_augment->augment_index); if (aug) { @@ -3123,15 +3123,16 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) { DeleteItemInInventory(slot_id, 0, true); DeleteItemInInventory(MainCursor, 0, true); + if (PutItemInInventory(slot_id, *itemOneToPush, true)) { CalcBonuses(); - //Message(13, "Sucessfully added an augment to your item!"); + // Successfully added an augment to the item return; } else { - Message(13, "Error: No available slot for end result. Please free up some bag space."); + Message(13, "Error: No available slot for end result. Please free up the augment slot."); } } else @@ -3185,6 +3186,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) return; } old_aug = tobe_auged->RemoveAugment(in_augment->augment_index); + tobe_auged->UpdateOrnamentationInfo(); itemOneToPush = tobe_auged->Clone(); if (old_aug) @@ -3193,9 +3195,10 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) { DeleteItemInInventory(slot_id, 0, true); DeleteItemInInventory(aug_slot_id, auged_with->IsStackable() ? 1 : 0, true); + if (!PutItemInInventory(slot_id, *itemOneToPush, true)) { - Message(15, "Shouldn't happen, contact an admin!"); + Message(15, "Failed to remove augment properly!"); } if (PutItemInInventory(MainCursor, *itemTwoToPush, true)) @@ -8031,17 +8034,15 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) item = inst ? inst->GetItem() : nullptr; if (item) { + strcpy(insr->itemnames[L], item->Name); if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) { - const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); - strcpy(insr->itemnames[L], item->Name); - insr->itemicons[L] = aug_weap->Icon; + const Item_Struct *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); + insr->itemicons[L] = aug_item->Icon; } - else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) { - strcpy(insr->itemnames[L], item->Name); + else if (inst->GetOrnamentationIcon()) { insr->itemicons[L] = inst->GetOrnamentationIcon(); } else { - strcpy(insr->itemnames[L], item->Name); insr->itemicons[L] = item->Icon; } } diff --git a/zone/command.cpp b/zone/command.cpp index 59a786a19..3876d90de 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -153,6 +153,8 @@ int command_init(void) { command_add("version","- Display current version of EQEmu server",0,command_version) || command_add("setfaction","[faction number] - Sets targeted NPC's faction in the database",170,command_setfaction) || command_add("wc","[wear slot] [material] - Sends an OP_WearChange for your target",200,command_wc) || + command_add("heromodel", "[hero model] [slot] - Full set of Hero's Forge Armor appearance. If slot is set, sends exact model just to slot.", 200, command_heromodel) || + command_add("hm", "[hero model] [slot] - Full set of Hero's Forge Armor appearance. If slot is set, sends exact model just to slot.)", 200, command_heromodel) || command_add("setanim","[animnum] - Set target's appearance to animnum",200,command_setanim) || command_add("connectworldserver","- Make zone attempt to connect to worldserver",200,command_connectworldserver) || command_add("connectworld",nullptr,0,command_connectworldserver) || @@ -787,6 +789,47 @@ void command_wc(Client *c, const Seperator *sep) } } +void command_heromodel(Client *c, const Seperator *sep) +{ + if (sep->argnum < 1) + { + c->Message(0, "Usage: #heromodel [hero forge model] [ [slot] ] (example: #heromodel 63)"); + } + else if (c->GetTarget() == nullptr) + { + c->Message(13, "You must have a target to do a wear change for Hero's Forge Models."); + } + else + { + uint32 hero_forge_model = atoi(sep->arg[1]); + + if (sep->argnum > 1) + { + uint8 wearslot = (uint8)atoi(sep->arg[2]); + c->GetTarget()->SendTextureWC(wearslot, 0, hero_forge_model, 0, 0, 0); + } + else + { + if (hero_forge_model > 0) + { + // Conversion to simplify the command arguments + // Hero's Forge model is actually model * 1000 + texture * 100 + wearslot + // Hero's Forge Model slot 7 is actually for Robes, but it still needs to use wearslot 1 in the packet + hero_forge_model *= 100; + + for (uint8 wearslot = 0; wearslot < 7; wearslot++) + { + c->GetTarget()->SendTextureWC(wearslot, 0, (hero_forge_model + wearslot), 0, 0, 0); + } + } + else + { + c->Message(13, "Hero's Forge Model must be greater than 0."); + } + } + } +} + void command_setanim(Client *c, const Seperator *sep) { if (c->GetTarget() && sep->IsNumber(1)) { diff --git a/zone/command.h b/zone/command.h index 72ee5c06a..68e956166 100644 --- a/zone/command.h +++ b/zone/command.h @@ -76,6 +76,7 @@ void command_serversidename(Client *c, const Seperator *sep); void command_testspawnkill(Client *c, const Seperator *sep); void command_testspawn(Client *c, const Seperator *sep); void command_wc(Client *c, const Seperator *sep); +void command_heromodel(Client *c, const Seperator *sep); void command_numauths(Client *c, const Seperator *sep); void command_setanim(Client *c, const Seperator *sep); void command_connectworldserver(Client *c, const Seperator *sep); diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 40ecccf80..d61fc02c9 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -1428,7 +1428,7 @@ void Corpse::Spawn() { } uint32 Corpse::GetEquipment(uint8 material_slot) const { - int invslot; + int16 invslot; if(material_slot > EmuConstants::MATERIAL_END) { return NO_ITEM; diff --git a/zone/inventory.cpp b/zone/inventory.cpp index bb9802e1c..08a7ceb29 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -189,7 +189,7 @@ bool Client::CheckLoreConflict(const Item_Struct* item) { return (m_inv.HasItemByLoreGroup(item->LoreGroup, ~invWhereSharedBank) != INVALID_INDEX); } -bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, uint16 to_slot, uint32 ornament_icon, uint32 ornament_idfile) { +bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, uint16 to_slot, uint32 ornament_icon, uint32 ornament_idfile, uint32 ornament_hero_model) { this->EVENT_ITEM_ScriptStopReturn(); // TODO: update calling methods and script apis to handle a failure return @@ -548,10 +548,9 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(attuned && inst->GetItem()->Attuneable) inst->SetInstNoDrop(true); - if(ornament_icon > 0 && ornament_idfile > 0) { - inst->SetOrnamentIcon(ornament_icon); - inst->SetOrnamentationIDFile(ornament_idfile); - } + inst->SetOrnamentIcon(ornament_icon); + inst->SetOrnamentationIDFile(ornament_idfile); + inst->SetOrnamentHeroModel(ornament_hero_model); // check to see if item is usable in requested slot if(enforceusable && (((to_slot >= MainCharm) && (to_slot <= MainAmmo)) || (to_slot == MainPowerSource))) { @@ -581,11 +580,13 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if((RuleB(Character, EnableDiscoveredItems)) && !GetGM()) { if(!IsDiscovered(item_id)) DiscoverItem(item_id); - + /* + // Augments should have been discovered prior to being placed on an item. for (int iter = AUG_BEGIN; iter < EmuConstants::ITEM_COMMON_SIZE; ++iter) { if(augments[iter] && !IsDiscovered(augments[iter])) DiscoverItem(augments[iter]); } + */ } return true; @@ -819,7 +820,11 @@ bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client m_inv.PutItem(slot_id, inst); if (client_update) + { SendItemPacket(slot_id, &inst, ((slot_id == MainCursor) ? ItemPacketSummonItem : ItemPacketTrade)); + //SendWearChange(Inventory::CalcMaterialFromSlot(slot_id)); + } + if (slot_id == MainCursor) { std::list::const_iterator s = m_inv.cursor_begin(), e = m_inv.cursor_end(); @@ -2292,7 +2297,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { // these functions operate with a material slot, which is from 0 to 8 uint32 Client::GetEquipment(uint8 material_slot) const { - int invslot; + int16 invslot; const ItemInst *item; if(material_slot > EmuConstants::MATERIAL_END) @@ -2301,7 +2306,7 @@ uint32 Client::GetEquipment(uint8 material_slot) const } invslot = Inventory::CalcSlotFromMaterial(material_slot); - if(invslot == -1) + if (invslot == INVALID_INDEX) { return 0; } diff --git a/zone/mob.cpp b/zone/mob.cpp index c30cc6d2b..73e356efb 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -972,36 +972,15 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) strn0cpy(ns->spawn.lastName, lastname, sizeof(ns->spawn.lastName)); - const Item_Struct *item; - for (i = 0; i < _MaterialCount; i++) { // Only Player Races Wear Armor - if (IsPlayerRace(race) || i > 6) + if (Mob::IsPlayerRace(race) || i > 6) { ns->spawn.equipment[i].material = GetEquipmentMaterial(i); - - item = database.GetItem(GetEquipment(i)); - if (item != 0) - { - ns->spawn.equipment[i].elitematerial = item->EliteMaterial; - ns->spawn.equipment[i].heroforgemodel = item->HerosForgeModel; - if (armor_tint[i]) - { - ns->spawn.colors[i].color = armor_tint[i]; - } - else - { - ns->spawn.colors[i].color = item->Color; - } - } - else - { - if (armor_tint[i]) - { - ns->spawn.colors[i].color = armor_tint[i]; - } - } + ns->spawn.equipment[i].elitematerial = IsEliteMaterialItem(i); + ns->spawn.equipment[i].heroforgemodel = GetHerosForgeModel(i); + ns->spawn.colors[i].color = GetEquipmentColor(i); } } @@ -1023,7 +1002,7 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) //ns->spawn.DestructibleAppearance = static_cast(_appearance); // #appearance 44 1 makes it jump but no visible damage // #appearance 44 2 makes it look completely broken but still visible - // #appearnace 44 3 makes it jump but not visible difference to 3 + // #appearance 44 3 makes it jump but not visible difference to 3 // #appearance 44 4 makes it disappear altogether // #appearance 44 5 makes the client crash. @@ -2611,8 +2590,8 @@ uint32 NPC::GetEquipment(uint8 material_slot) const { if(material_slot > 8) return 0; - int invslot = Inventory::CalcSlotFromMaterial(material_slot); - if (invslot == -1) + int16 invslot = Inventory::CalcSlotFromMaterial(material_slot); + if (invslot == INVALID_INDEX) return 0; return equipment[invslot]; } @@ -2624,20 +2603,9 @@ void Mob::SendWearChange(uint8 material_slot) wc->spawn_id = GetID(); wc->material = GetEquipmentMaterial(material_slot); - const Item_Struct *item; - item = database.GetItem(GetEquipment(material_slot)); - if (item != 0) - { - wc->elite_material = item->EliteMaterial; - wc->hero_forge_model = item->HerosForgeModel; - wc->color.color = item->Color; - } - else - { - wc->elite_material = 0; - wc->hero_forge_model = 0; - wc->color.color = 0; - } + wc->elite_material = IsEliteMaterialItem(material_slot); + wc->hero_forge_model = GetHerosForgeModel(material_slot); + wc->color.color = GetEquipmentColor(material_slot); wc->wear_slot_id = material_slot; entity_list.QueueClients(this, outapp); @@ -2681,7 +2649,7 @@ void Mob::SetSlotTint(uint8 material_slot, uint8 red_tint, uint8 green_tint, uin wc->spawn_id = this->GetID(); wc->material = GetEquipmentMaterial(material_slot); - wc->hero_forge_model = GetHeroForgeModel(material_slot); + wc->hero_forge_model = GetHerosForgeModel(material_slot); wc->color.color = color; wc->wear_slot_id = material_slot; @@ -2708,48 +2676,99 @@ void Mob::WearChange(uint8 material_slot, uint16 texture, uint32 color, uint32 h int32 Mob::GetEquipmentMaterial(uint8 material_slot) const { + uint32 equipmaterial = 0; + int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); const Item_Struct *item; - int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); item = database.GetItem(GetEquipment(material_slot)); - if(item != 0) + + if (item != 0) { - if // for primary and secondary we need the model, not the material - ( - material_slot == MaterialPrimary || - material_slot == MaterialSecondary - ) + // For primary and secondary we need the model, not the material + if (material_slot == MaterialPrimary || material_slot == MaterialSecondary) { - if (this->IsClient()){ - int currMatslot = MaterialPrimary == material_slot ? MainPrimary : MainSecondary; - const ItemInst* inst = CastToClient()->m_inv[currMatslot]; - if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) { - item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); - return atoi(&item->IDFile[2]); + if (this->IsClient()) + { + int16 invslot = Inventory::CalcSlotFromMaterial(material_slot); + if (invslot == INVALID_INDEX) + { + return 0; } - else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) { - return inst->GetOrnamentationIDFile(); - } - else { - if (strlen(item->IDFile) > 2) - return atoi(&item->IDFile[2]); - else //may as well try this, since were going to 0 anyways - return item->Material; + const ItemInst* inst = CastToClient()->m_inv[invslot]; + if (inst) + { + if (inst->GetOrnamentationAug(ornamentationAugtype)) + { + item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); + if (item && strlen(item->IDFile) > 2) + { + equipmaterial = atoi(&item->IDFile[2]); + } + } + else if (inst->GetOrnamentationIDFile()) + { + equipmaterial = inst->GetOrnamentationIDFile(); + } } } - else { - if (strlen(item->IDFile) > 2) - return atoi(&item->IDFile[2]); - else //may as well try this, since were going to 0 anyways - return item->Material; + + if (equipmaterial == 0 && strlen(item->IDFile) > 2) + { + equipmaterial = atoi(&item->IDFile[2]); } } else { - return item->Material; + equipmaterial = item->Material; } } - return 0; + return equipmaterial; +} + +int32 Mob::GetHerosForgeModel(uint8 material_slot) const +{ + + uint32 HeroModel = 0; + if (material_slot >= 0 && material_slot < MaterialPrimary) + { + uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); + const Item_Struct *item; + item = database.GetItem(GetEquipment(material_slot)); + int16 invslot = Inventory::CalcSlotFromMaterial(material_slot); + + if (item != 0 && invslot != INVALID_INDEX) + { + if (this->IsClient()) + { + const ItemInst* inst = CastToClient()->m_inv[invslot]; + if (inst) + { + if (inst->GetOrnamentationAug(ornamentationAugtype)) + { + item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); + HeroModel = item->HerosForgeModel; + } + else if (inst->GetOrnamentHeroModel()) + { + HeroModel = inst->GetOrnamentHeroModel(); + } + } + } + + if (HeroModel == 0) + { + HeroModel = item->HerosForgeModel; + } + } + } + + if (HeroModel > 0) + { + HeroModel *= 100; + HeroModel += material_slot; + } + + return HeroModel; } uint32 Mob::GetEquipmentColor(uint8 material_slot) const @@ -2778,19 +2797,6 @@ uint32 Mob::IsEliteMaterialItem(uint8 material_slot) const return 0; } -uint32 Mob::GetHeroForgeModel(uint8 material_slot) const -{ - const Item_Struct *item; - - item = database.GetItem(GetEquipment(material_slot)); - if (item != 0) - { - return item->HerosForgeModel; - } - - return 0; -} - // works just like a printf void Mob::Say(const char *format, ...) { diff --git a/zone/mob.h b/zone/mob.h index ada3c5df9..e0a969fc4 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -312,9 +312,9 @@ public: virtual uint16 GetSkill(SkillUseTypes skill_num) const { return 0; } virtual uint32 GetEquipment(uint8 material_slot) const { return(0); } virtual int32 GetEquipmentMaterial(uint8 material_slot) const; + virtual int32 GetHerosForgeModel(uint8 material_slot) const; virtual uint32 GetEquipmentColor(uint8 material_slot) const; virtual uint32 IsEliteMaterialItem(uint8 material_slot) const; - virtual uint32 GetHeroForgeModel(uint8 material_slot) const; bool AffectedBySpellExcludingSlot(int slot, int effect); virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) = 0; virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, diff --git a/zone/npc.cpp b/zone/npc.cpp index af8b9c544..6fdab645c 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1322,11 +1322,14 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const if (material_slot >= _MaterialCount) return 0; - int inv_slot = Inventory::CalcSlotFromMaterial(material_slot); - if (inv_slot == -1) + int16 invslot = Inventory::CalcSlotFromMaterial(material_slot); + if (invslot == INVALID_INDEX) return 0; - if(equipment[inv_slot] == 0) { - switch(material_slot) { + + if (equipment[invslot] == 0) + { + switch(material_slot) + { case MaterialHead: return helmtexture; case MaterialChest: @@ -1342,7 +1345,7 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const } //they have some loot item in this slot, pass it up to the default handler - return(Mob::GetEquipmentMaterial(material_slot)); + return (Mob::GetEquipmentMaterial(material_slot)); } uint32 NPC::GetMaxDamage(uint8 tlevel) From 250ad310385a4d86fc9b2e475e4ef321fe513227 Mon Sep 17 00:00:00 2001 From: Trevius Date: Sat, 13 Dec 2014 14:01:12 -0600 Subject: [PATCH 026/153] Added required SQL. Without it, there will be item loss using the last commit! --- changelog.txt | 2 ++ utils/sql/git/required/2014_12_13_inventory_table_update.sql | 1 + 2 files changed, 3 insertions(+) create mode 100644 utils/sql/git/required/2014_12_13_inventory_table_update.sql diff --git a/changelog.txt b/changelog.txt index 3baa02623..ae004543f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,8 @@ demonstar55: Fix guild rank spam on zone (needed to be in OP_PP). Trevius: (RoF+) Implemented Armor Ornamentation using Hero's Forge Armor Models. To use, create an ornamentation augment and set the herosforgemodel field in the items table. Trevius: (RoF+) Added command #heromodel (#hm for short) - Usage: #heromodel [hero forge model] [ [slot] ] (example: #heromodel 63) +Be sure to run this or there will be item loss: +Required SQL: utils/sql/git/required/2014_12_13_inventory_table_update.sql == 12/12/2014 == demonstar55: Add special attack 42, Ignore Root Aggro Rules. This allows you to root a mob and have them still use the normal aggro rules (so they will attack the one with most hate, not closest) diff --git a/utils/sql/git/required/2014_12_13_inventory_table_update.sql b/utils/sql/git/required/2014_12_13_inventory_table_update.sql new file mode 100644 index 000000000..97a07b6ee --- /dev/null +++ b/utils/sql/git/required/2014_12_13_inventory_table_update.sql @@ -0,0 +1 @@ +ALTER TABLE `inventory` ADD `ornament_hero_model` int( 11 ) NOT NULL DEFAULT '0' AFTER `ornamentidfile`; \ No newline at end of file From c85cbb2f087fd3d8757415a1de8c74890413e452 Mon Sep 17 00:00:00 2001 From: Trevius Date: Sat, 13 Dec 2014 14:09:44 -0600 Subject: [PATCH 027/153] Fixed bots build. --- zone/bot.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index a79c45880..266c8565e 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -4429,7 +4429,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { { if(strlen(item->IDFile) > 2) { - ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]); + ns->spawn.equipment[MaterialPrimary].material = atoi(&item->IDFile[2]); } ns->spawn.colors[MaterialPrimary].color = GetEquipmentColor(MaterialPrimary); } @@ -4443,7 +4443,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) { { if(strlen(item->IDFile) > 2) { - ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]); + ns->spawn.equipment[MaterialSecondary].material = atoi(&item->IDFile[2]); } ns->spawn.colors[MaterialSecondary].color = GetEquipmentColor(MaterialSecondary); } @@ -16040,7 +16040,7 @@ uint32 Bot::GetEquipmentColor(uint8 material_slot) const //Translate code slot # to DB slot # slotid = Inventory::CalcSlotFromMaterial(material_slot); - if(invslot == INVALID_INDEX) + if (slotid == INVALID_INDEX) return 0; //read from db From 026d5e71fae1f88baff3d941b8951b2da90ebdc9 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 14 Dec 2014 19:38:23 -0500 Subject: [PATCH 028/153] Adjust common/random.h based on N3551 --- common/random.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/common/random.h b/common/random.h index ef2b3ef73..514c483e1 100644 --- a/common/random.h +++ b/common/random.h @@ -33,31 +33,31 @@ namespace EQEmu { class Random { public: // AKA old MakeRandomInt - const int Int(int low, int high) + int Int(int low, int high) { if (low > high) std::swap(low, high); - return std::uniform_int_distribution(low, high)(m_gen); // [low, high] + return int_dist(m_gen, int_param_t(low, high)); // [low, high] } // AKA old MakeRandomFloat - const double Real(double low, double high) + double Real(double low, double high) { if (low > high) std::swap(low, high); - return std::uniform_real_distribution(low, high)(m_gen); // [low, high) + return real_dist(m_gen, real_param_t(low, high)); // [low, high) } // example Roll(50) would have a 50% success rate // Roll(100) 100%, etc // valid values 0-100 (well, higher works too but ...) - const bool Roll(const int required) + bool Roll(const int required) { return Int(0, 99) < required; } // valid values 0.0 - 1.0 - const bool Roll(const double required) + bool Roll(const double required) { return Real(0.0, 1.0) <= required; } @@ -76,7 +76,11 @@ namespace EQEmu { } private: + typedef std::uniform_int_distribution::param_type int_param_t; + typedef std::uniform_real_distribution::param_type real_param_t; std::mt19937 m_gen; + std::uniform_int_distribution int_dist; + std::uniform_real_distribution real_dist; }; } From 62181ff08c3336feb225cccac43fbbb4ab2842ea Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Mon, 15 Dec 2014 02:53:58 -0500 Subject: [PATCH 029/153] Add Random::Shuffle This is just a wrapper to std::shuffle since it requires a random engine and ours lives in a class Must pass random access iterators (array, vector, deque, etc) ex: std::vector v; /* init ... */ random.Shuffle(v.begin(), v.end()); --- common/random.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/common/random.h b/common/random.h index 514c483e1..44be53e98 100644 --- a/common/random.h +++ b/common/random.h @@ -21,6 +21,9 @@ #include #include +#include +#include +#include /* This uses mt19937 seeded with the std::random_device * The idea is to have this be included as a member of another class @@ -62,6 +65,16 @@ namespace EQEmu { return Real(0.0, 1.0) <= required; } + // std::shuffle requires a RNG engine passed to it, so lets provide a wrapper to use our engine + template + void Shuffle(RandomAccessIterator first, RandomAccessIterator last) + { + static_assert(std::is_same::iterator_category>::value, + "EQEmu::Random::Shuffle requires random access iterators"); + std::shuffle(first, last, m_gen); + } + void Reseed() { // We could do the seed_seq thing here too if we need better seeding From 123da175e13b316055de01fe90ccb37c8638abb1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 04:49:45 -0600 Subject: [PATCH 030/153] aa.cpp/.h cleanup --- zone/aa.cpp | 1 - zone/aa.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index 27229cb89..fc640ff92 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -19,7 +19,6 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) #include "../common/classes.h" #include "../common/debug.h" #include "../common/eq_packet_structs.h" -#include "../common/packet_dump.h" #include "../common/races.h" #include "../common/spdat.h" #include "../common/string_util.h" diff --git a/zone/aa.h b/zone/aa.h index e2e0749d1..ce6f9ea68 100644 --- a/zone/aa.h +++ b/zone/aa.h @@ -5,6 +5,7 @@ struct AA_Ability; struct SendAA_Struct; + #define MANA_BURN 664 #include From ee4935566b32d9162ed8fad28efbe01ae0634b50 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 04:56:01 -0600 Subject: [PATCH 031/153] beacon.h/cpp header cleanup --- zone/beacon.cpp | 14 ++++++++++++-- zone/beacon.h | 5 ++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/zone/beacon.cpp b/zone/beacon.cpp index 9b88dd524..f21a3b512 100644 --- a/zone/beacon.cpp +++ b/zone/beacon.cpp @@ -23,7 +23,7 @@ target to center around. */ -#include "../common/debug.h" +class Zone; #ifdef _WINDOWS #define snprintf _snprintf @@ -32,7 +32,17 @@ target to center around. #define strcasecmp _stricmp #endif -#include "masterentity.h" +#include "../common/races.h" +#include "beacon.h" +#include "entity.h" +#include "mob.h" + + +#ifdef BOTS +#include "bot.h" +#endif + + #include "../common/spdat.h" extern EntityList entity_list; diff --git a/zone/beacon.h b/zone/beacon.h index 0aad56e21..f7845e91d 100644 --- a/zone/beacon.h +++ b/zone/beacon.h @@ -19,11 +19,14 @@ #ifndef BEACON_H #define BEACON_H -#include "entity.h" #include "mob.h" #include "../common/types.h" #include "../common/timer.h" +class Group; +class Raid; +struct ExtraAttackOptions; + class Beacon : public Mob { public: From ed63c92839c80c7d23604ee8333a3eb4c6485541 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 04:58:53 -0600 Subject: [PATCH 032/153] bonuses.cpp header cleanup --- zone/bonuses.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index ac9602a67..aa89856a1 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -15,27 +15,29 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include "../common/spdat.h" -#include "masterentity.h" -#include "../common/packet_dump.h" -#include "../common/moremath.h" -#include "../common/item.h" -#include "worldserver.h" -#include "../common/skills.h" -#include "../common/bodytypes.h" #include "../common/classes.h" +#include "../common/debug.h" +#include "../common/item.h" #include "../common/rulesys.h" +#include "../common/skills.h" +#include "../common/spdat.h" + +#include "client.h" +#include "entity.h" +#include "mob.h" + +#ifdef BOTS +#include "bot.h" +#endif + #include "quest_parser_collection.h" -#include -#include -#include + + #ifndef WIN32 #include #include "../common/unix.h" #endif -#include "string_ids.h" void Mob::CalcBonuses() { From 0fd87d344c252ff046adddec55f3c2e8326cde6e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 05:13:45 -0600 Subject: [PATCH 033/153] client.h cleanup --- zone/client.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/zone/client.h b/zone/client.h index b5f414052..737d354cc 100644 --- a/zone/client.h +++ b/zone/client.h @@ -17,7 +17,17 @@ */ #ifndef CLIENT_H #define CLIENT_H + class Client; +class EQApplicationPacket; +class EQStream; +class Group; +class NPC; +class Object; +class Raid; +class Seperator; +class ServerPacket; +struct Item_Struct; #include "../common/timer.h" #include "../common/ptimer.h" @@ -28,25 +38,21 @@ class Client; #include "../common/eq_packet.h" #include "../common/linked_list.h" #include "../common/extprofile.h" -#include "../common/classes.h" #include "../common/races.h" -#include "../common/deity.h" #include "../common/seperator.h" #include "../common/item.h" #include "../common/guilds.h" #include "../common/item_struct.h" #include "../common/clientversions.h" -#include "common.h" -#include "zonedb.h" -#include "errno.h" -#include "mob.h" -#include "npc.h" -#include "merc.h" -#include "zone.h" #include "aa.h" -#include "questmgr.h" +#include "common.h" +#include "merc.h" +#include "mob.h" #include "qglobals.h" +#include "questmgr.h" +#include "zone.h" +#include "zonedb.h" #ifdef _WINDOWS // since windows defines these within windef.h (which windows.h include) @@ -57,7 +63,6 @@ class Client; #include #include -#include #include From 905961d2784b16aa203914c5bab7f588d4157bb9 Mon Sep 17 00:00:00 2001 From: JJ Date: Mon, 15 Dec 2014 11:06:53 -0500 Subject: [PATCH 034/153] Linux fix for Mob type in AA_SwarmPetInfo. --- zone/aa.h | 1 + 1 file changed, 1 insertion(+) diff --git a/zone/aa.h b/zone/aa.h index ce6f9ea68..ad41fc3ae 100644 --- a/zone/aa.h +++ b/zone/aa.h @@ -2156,6 +2156,7 @@ enum { //values of AA_Action.action }; class Timer; +class Mob; class AA_SwarmPetInfo { public: AA_SwarmPetInfo(); From d20c9c9ac6a71685ab4a1260e0bc99d2e1680a71 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 16:39:01 -0600 Subject: [PATCH 035/153] client_logs.cpp header cleanup --- zone/client_logs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/client_logs.h b/zone/client_logs.h index 9ce477f8c..e3d5350b5 100644 --- a/zone/client_logs.h +++ b/zone/client_logs.h @@ -18,11 +18,11 @@ #ifndef CLIENT_LOGS_H #define CLIENT_LOGS_H + #include "../common/debug.h" #include "../common/features.h" #ifdef CLIENT_LOGS -#include "../common/eq_packet_structs.h" #define CLIENT_LOG_CHANNEL MT_Chat10Echo From b90897c513b031412fb072ab06670391adbafc97 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 16:41:04 -0600 Subject: [PATCH 036/153] client_mods.cpp header cleanup --- zone/client_mods.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 55b522378..2db70e8a3 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -15,18 +15,20 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include "../common/debug.h" #include "../common/logsys.h" -#include "../common/spdat.h" #include "../common/rulesys.h" -#include "masterentity.h" -#include "npc_ai.h" -#include "petitions.h" -#include "string_ids.h" -#include "worldserver.h" -#include "zonedb.h" +#include "../common/spdat.h" + +#include "client.h" +#include "mob.h" + +#ifdef BOTS +#include "bot.h" +#endif + +#include int32 Client::GetMaxStat() const { From 5b6eb885a0f700ef8bcbe9d5ae2cc6a11ed6c3d1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 16:50:02 -0600 Subject: [PATCH 037/153] corpse.cpp & .h header cleanup & forward declarations --- zone/corpse.cpp | 29 ++++++++++++++++++----------- zone/corpse.h | 7 +++++++ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/zone/corpse.cpp b/zone/corpse.cpp index d61fc02c9..b6504c88f 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -20,12 +20,7 @@ New class for handeling corpses and everything associated with them. Child of the Mob class. -Quagmire */ -#include "../common/debug.h" -#include -#include -#include -#include -#include + #ifdef _WINDOWS #define snprintf _snprintf #define vsnprintf _vsnprintf @@ -33,14 +28,26 @@ Child of the Mob class. #define strcasecmp _stricmp #endif -#include "masterentity.h" -#include "../common/packet_functions.h" +#include "../common/debug.h" +#include "../common/rulesys.h" #include "../common/string_util.h" -#include "../common/crc32.h" + +#include "client.h" +#include "corpse.h" +#include "entity.h" +#include "groups.h" +#include "mob.h" +#include "raids.h" + +#ifdef BOTS +#include "bot.h" +#endif + +#include "quest_parser_collection.h" #include "string_ids.h" #include "worldserver.h" -#include "../common/rulesys.h" -#include "quest_parser_collection.h" +#include + extern EntityList entity_list; extern Zone* zone; diff --git a/zone/corpse.h b/zone/corpse.h index 3a3d2bce9..7488a572e 100644 --- a/zone/corpse.h +++ b/zone/corpse.h @@ -22,7 +22,14 @@ #include "mob.h" class Client; +class EQApplicationPacket; +class Group; +class ItemInst; class NPC; +class Raid; + +struct ExtraAttackOptions; +struct NPCType; #define MAX_LOOTERS 72 From 1c7acbdbd9ca640a267800ef76004dd8753f847e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 16:53:53 -0600 Subject: [PATCH 038/153] doors.cpp & .h header cleanup & forward declaration --- zone/doors.cpp | 21 ++++++++++++--------- zone/doors.h | 12 ++++++++---- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/zone/doors.cpp b/zone/doors.cpp index 4af1d3eae..50f1e8eaa 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -15,18 +15,21 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" -#include -#include -#include -#include "masterentity.h" -#include "worldserver.h" -#include "string_ids.h" -#include "zonedb.h" -#include "../common/packet_functions.h" -#include "../common/packet_dump.h" #include "../common/string_util.h" + +#include "client.h" +#include "doors.h" +#include "entity.h" #include "guild_mgr.h" +#include "mob.h" +#include "string_ids.h" +#include "worldserver.h" +#include "zonedb.h" + +#include +#include #define OPEN_DOOR 0x02 #define CLOSE_DOOR 0x03 diff --git a/zone/doors.h b/zone/doors.h index 59fe394c8..545834d88 100644 --- a/zone/doors.h +++ b/zone/doors.h @@ -1,14 +1,18 @@ #ifndef DOORS_H #define DOORS_H -#include "../common/types.h" -#include "../common/linked_list.h" -#include "../common/timer.h" + #include "../common/emu_opcodes.h" #include "../common/eq_packet_structs.h" -#include "entity.h" +#include "../common/linked_list.h" + #include "mob.h" #include "zonedump.h" +class Client; +class Mob; +class NPC; +struct Door; + class Doors : public Entity { public: From c5d23c5f1b758a8e202cbe2587e3f6b6f015d5d8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:02:26 -0600 Subject: [PATCH 039/153] effects.cpp header cleanup --- zone/effects.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/zone/effects.cpp b/zone/effects.cpp index 54e206e85..c236fb942 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -15,20 +15,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" -#include "masterentity.h" +#include "../common/spdat.h" + +#include "client.h" +#include "entity.h" +#include "mob.h" + +#include "string_ids.h" #include "worldserver.h" #include "zonedb.h" -#include "../common/spdat.h" -#include "../common/packet_dump.h" -#include "../common/packet_functions.h" -#include "petitions.h" -#include "../common/serverinfo.h" -#include "../common/zone_numbers.h" -#include "../common/moremath.h" -#include "../common/guilds.h" -#include "string_ids.h" -#include "npc_ai.h" float Mob::GetActSpellRange(uint16 spell_id, float range, bool IsBard) { From 4be92db77a9fa49b39534d736988cada2924945b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:04:31 -0600 Subject: [PATCH 040/153] embparser_api.cpp header org --- zone/embparser_api.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 62fa1dd70..e0866083b 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -23,12 +23,13 @@ #include "../common/debug.h" #include "../common/misc_functions.h" + #include "embparser.h" -#include "questmgr.h" #include "embxs.h" #include "entity.h" -#include "zone.h" #include "queryserv.h" +#include "questmgr.h" +#include "zone.h" extern Zone* zone; extern QueryServ* QServ; From 9cbaedc64f977c29692949f3db88bc25f2a7b333 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:19:49 -0600 Subject: [PATCH 041/153] entity.cpp & .h header cleanup & forward declare --- zone/entity.cpp | 2 +- zone/entity.h | 33 +++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 1283f4be5..fa029dd0f 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -31,7 +31,7 @@ #include "../common/features.h" #include "../common/guilds.h" -#include "../common/spdat.h" + #include "guild_mgr.h" #include "net.h" #include "petitions.h" diff --git a/zone/entity.h b/zone/entity.h index 486f1d49f..fd4f0b5a8 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -17,6 +17,7 @@ */ #ifndef ENTITY_H #define ENTITY_H + #include #include @@ -26,26 +27,30 @@ #include "../common/bodytypes.h" #include "../common/eq_constants.h" -#include "zonedb.h" #include "zonedump.h" -#include "qglobals.h" -class EQApplicationPacket; - -class Client; -class Mob; -class NPC; -class Merc; -class Corpse; class Beacon; -class Petition; -class Object; -class Group; -class Raid; +class Client; +class Corpse; class Doors; -class Trap; +class EQApplicationPacket; class Entity; class EntityList; +class Group; +class Merc; +class Mob; +class NPC; +class Object; +class Petition; +class Raid; +class Spawn2; +class Trap; + +struct GuildBankItemUpdate_Struct; +struct NewSpawn_Struct; +struct QGlobal; +struct UseAA_Struct; +struct Who_All_Struct; #ifdef BOTS class Bot; From 430f04775b0f4752e8631e7dcbea9d4a93068175 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:22:13 -0600 Subject: [PATCH 042/153] exp.cpp header cleanup --- zone/exp.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/zone/exp.cpp b/zone/exp.cpp index 0e01a4c0e..c30ea1918 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -15,14 +15,20 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" #include "../common/features.h" -#include "masterentity.h" -#include "string_ids.h" -#include "../common/string_util.h" #include "../common/rulesys.h" -#include "quest_parser_collection.h" +#include "../common/string_util.h" + +#include "client.h" +#include "groups.h" +#include "mob.h" +#include "raids.h" + #include "queryserv.h" +#include "quest_parser_collection.h" +#include "string_ids.h" extern QueryServ* QServ; From 494e2505143dad404fa299a6e8bfb15416084ca3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:23:13 -0600 Subject: [PATCH 043/153] fearpath.cpp header cleanup --- zone/fearpath.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index 25d514cfe..89b34c444 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -16,17 +16,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include -#include -#include -#include - #include "../common/rulesys.h" -#include "../common/misc_functions.h" + #include "map.h" -#include "zone.h" #include "pathing.h" +#include "zone.h" + #ifdef _WINDOWS #define snprintf _snprintf #endif From 756e5ee1393c332378bc00cc709f28a280be6180 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:26:51 -0600 Subject: [PATCH 044/153] groups.cpp & .h header cleanup and forward declare --- zone/groups.cpp | 1 + zone/groups.h | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/zone/groups.cpp b/zone/groups.cpp index 3180e51f1..3395833bf 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -22,6 +22,7 @@ #include "../common/packet_dump.h" #include "../common/string_util.h" #include "worldserver.h" + extern EntityList entity_list; extern WorldServer worldserver; diff --git a/zone/groups.h b/zone/groups.h index a0b17229b..909a9dd53 100644 --- a/zone/groups.h +++ b/zone/groups.h @@ -18,14 +18,14 @@ #ifndef GROUPS_H #define GROUPS_H -#include "../common/types.h" -#include "../common/linked_list.h" -#include "../common/emu_opcodes.h" #include "../common/eq_packet_structs.h" -#include "entity.h" +#include "../common/types.h" + #include "mob.h" -#include "../common/features.h" -#include "../common/servertalk.h" + +class Client; +class EQApplicationPacket; +class Mob; #define MAX_MARKED_NPCS 3 From 1fcb8235c529bf103220f8bc66999b6f227fefb6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:28:04 -0600 Subject: [PATCH 045/153] guild_mgr.cpp header cleanup --- zone/guild_mgr.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index bad060aef..5d42846e4 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -15,14 +15,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include "guild_mgr.h" -#include "zonedb.h" -#include "worldserver.h" + #include "../common/servertalk.h" #include "../common/string_util.h" + #include "client.h" #include "entity.h" +#include "guild_mgr.h" +#include "worldserver.h" +#include "zonedb.h" ZoneGuildManager guild_mgr; GuildBankManager *GuildBanks; From b733e96aea39531145b21e78dcb43dc644805241 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:34:19 -0600 Subject: [PATCH 046/153] masterentity.h header order cleanup hate_list.cpp & .h header cleanup and forward declare --- zone/hate_list.cpp | 17 ++++++++++------- zone/hate_list.h | 6 ++++++ zone/masterentity.h | 14 +++++++------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/zone/hate_list.cpp b/zone/hate_list.cpp index 2e64f092f..c8c1308aa 100644 --- a/zone/hate_list.cpp +++ b/zone/hate_list.cpp @@ -16,19 +16,22 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include -#include -#include -#include -#include "masterentity.h" +#include "client.h" +#include "entity.h" +#include "groups.h" +#include "mob.h" +#include "raids.h" + #include "../common/rulesys.h" -#include "../common/misc_functions.h" + #include "hate_list.h" #include "quest_parser_collection.h" #include "zone.h" #include "water_map.h" +#include +#include + extern Zone *zone; HateList::HateList() diff --git a/zone/hate_list.h b/zone/hate_list.h index 4ea8d0bd6..97f16f9d7 100644 --- a/zone/hate_list.h +++ b/zone/hate_list.h @@ -19,6 +19,12 @@ #ifndef HATELIST_H #define HATELIST_H +class Client; +class Group; +class Mob; +class Raid; +struct ExtraAttackOptions; + struct tHateEntry { Mob *ent; diff --git a/zone/masterentity.h b/zone/masterentity.h index 8c238ed34..72cf0b162 100644 --- a/zone/masterentity.h +++ b/zone/masterentity.h @@ -1,17 +1,17 @@ //Trumpcard: EntityLists are composed of multiple list types. This is the //master that includes all types. When entity.h is required, many of these are as well. -#include "entity.h" -#include "groups.h" -#include "raids.h" +#include "beacon.h" #include "client.h" -#include "object.h" #include "corpse.h" #include "doors.h" -#include "mob.h" -#include "trap.h" -#include "beacon.h" +#include "entity.h" +#include "groups.h" #include "horse.h" +#include "mob.h" +#include "object.h" +#include "raids.h" +#include "trap.h" #ifdef BOTS #include "bot.h" From abe471af64c2b015085578efd3374048dd6f216b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:39:16 -0600 Subject: [PATCH 047/153] horse.cpp & .h header cleanup and forward declare --- zone/horse.cpp | 10 +++++----- zone/horse.h | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/zone/horse.cpp b/zone/horse.cpp index df7c7e7c1..9a4e5240c 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -17,13 +17,13 @@ */ #include "../common/debug.h" -#include "masterentity.h" -#include "../common/item.h" #include "../common/linked_list.h" #include "../common/string_util.h" -#include -#include -#include "worldserver.h" + +#include "client.h" +#include "entity.h" +#include "horse.h" +#include "mob.h" std::map Horse::horse_types; LinkedList horses_auto_delete; diff --git a/zone/horse.h b/zone/horse.h index dd58007eb..0965a2b69 100644 --- a/zone/horse.h +++ b/zone/horse.h @@ -18,11 +18,15 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) #ifndef HORSES_H #define HORSES_H -#include "../common/debug.h" #include "npc.h" #include +class Client; +class Mob; +struct NPCType; +struct NewSpawn_Struct; + class Horse : public NPC { public: Horse(Client *owner, uint16 spell_id, float x, float y, float z, float heading); From 95c95525babe7998a0a027b6522952c76619be98 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:41:14 -0600 Subject: [PATCH 048/153] loottables.cpp & .h header include cleanup and forward declare --- zone/loottables.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/zone/loottables.cpp b/zone/loottables.cpp index c5fda890e..341a7b83c 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -15,15 +15,20 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" -#include -#include -#include -#include "npc.h" -#include "masterentity.h" -#include "zonedb.h" #include "../common/loottable.h" #include "../common/misc_functions.h" + +#include "client.h" +#include "entity.h" +#include "mob.h" +#include "npc.h" +#include "zonedb.h" + +#include +#include + #ifdef _WINDOWS #define snprintf _snprintf #endif From 85b7cc63301dbd92260a142eabc328ed3be09496 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:44:46 -0600 Subject: [PATCH 049/153] map.cpp & .h header cleanup --- zone/map.cpp | 8 ++++---- zone/map.h | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/zone/map.cpp b/zone/map.cpp index a023cc125..b6f4de2b5 100644 --- a/zone/map.cpp +++ b/zone/map.cpp @@ -1,15 +1,15 @@ #include "../common/debug.h" #include "../common/misc_functions.h" + #include "map.h" #include "raycast_mesh.h" #include "zone.h" -#include + #include -#include -#include +#include #include #include -#include +#include #include uint32 InflateData(const char* buffer, uint32 len, char* out_buffer, uint32 out_len_max) { diff --git a/zone/map.h b/zone/map.h index 224e30c73..dc03d8ac0 100644 --- a/zone/map.h +++ b/zone/map.h @@ -23,7 +23,6 @@ #define ZONE_MAP_H #include -#include #define BEST_Z_INVALID -99999 From 8584895427d055ae54f1e5c04ac0c3bd8e312e6f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:47:52 -0600 Subject: [PATCH 050/153] merc.h header cleanup and forward declare --- zone/merc.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/zone/merc.h b/zone/merc.h index 167fe70d6..f604d485c 100644 --- a/zone/merc.h +++ b/zone/merc.h @@ -1,9 +1,18 @@ #ifndef MERC_H #define MERC_H -#include "mob.h" -#include "zonedb.h" + #include "npc.h" +class Client; +class Corpse; +class Group; +class Mob; +class Raid; +struct Item_Struct; +struct MercTemplate; +struct NPCType; +struct NewSpawn_Struct; + #define MERC_DEBUG 0 #define MAXMERCS 1 #define TANK 1 From 55b495826c3c25c147dff487b7b84b917ce613af Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:48:18 -0600 Subject: [PATCH 051/153] masterentity.h include order revert for linux --- zone/masterentity.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zone/masterentity.h b/zone/masterentity.h index 72cf0b162..8c238ed34 100644 --- a/zone/masterentity.h +++ b/zone/masterentity.h @@ -1,17 +1,17 @@ //Trumpcard: EntityLists are composed of multiple list types. This is the //master that includes all types. When entity.h is required, many of these are as well. -#include "beacon.h" -#include "client.h" -#include "corpse.h" -#include "doors.h" #include "entity.h" #include "groups.h" -#include "horse.h" -#include "mob.h" -#include "object.h" #include "raids.h" +#include "client.h" +#include "object.h" +#include "corpse.h" +#include "doors.h" +#include "mob.h" #include "trap.h" +#include "beacon.h" +#include "horse.h" #ifdef BOTS #include "bot.h" From 782b6fee9429e4e09f8302bf67ab4b3e42789fe3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:54:23 -0600 Subject: [PATCH 052/153] merc.cpp header include cleanup --- zone/merc.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/zone/merc.cpp b/zone/merc.cpp index f86ed7faf..76167382f 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1,18 +1,21 @@ + #include "merc.h" -#include "masterentity.h" -#include "npc_ai.h" -#include "../common/packet_dump.h" +#include "client.h" +#include "corpse.h" +#include "entity.h" +#include "groups.h" +#include "mob.h" + #include "../common/eq_packet_structs.h" #include "../common/eq_constants.h" #include "../common/skills.h" #include "../common/spdat.h" + #include "zone.h" #include "string_ids.h" -#include "../common/misc_functions.h" + #include "../common/string_util.h" #include "../common/rulesys.h" -#include "quest_parser_collection.h" -#include "water_map.h" extern volatile bool ZoneLoaded; From 200027bf89ea3ef75a3abea1e03e77b7d80fa369 Mon Sep 17 00:00:00 2001 From: Trevius Date: Mon, 15 Dec 2014 17:55:23 -0600 Subject: [PATCH 053/153] (RoF+) Implemented the 6th Augment Slot for Items. Player Corpses now saved attuned settings for Items. Renamed IsInstNoDrop() and SetInstNoDrop() to IsAttuned() and SetAttuned() respectively. --- changelog.txt | 6 + common/database.cpp | 33 ++++-- common/database.h | 2 + common/eq_dictionary.h | 4 +- common/eq_packet_structs.h | 8 +- common/item.cpp | 8 +- common/item.h | 8 +- common/item_fieldlist.h | 2 + common/item_struct.h | 6 +- common/patches/client62.cpp | 2 +- common/patches/rof.cpp | 12 +- common/patches/rof2.cpp | 13 +-- common/patches/rof2_itemfields.h | 3 + common/patches/rof_itemfields.h | 3 + common/patches/sod.cpp | 4 +- common/patches/sof.cpp | 4 +- common/patches/titanium.cpp | 2 +- common/patches/underfoot.cpp | 4 +- common/shareddb.cpp | 103 ++++++++++-------- common/shareddb.h | 4 +- common/version.h | 2 +- utils/sql/db_update_manifest.txt | 1 + .../optional/2014_12_15_heromodelCommand.sql | 2 + .../2014_12_15_multiple_table_updates.sql | 16 +++ zone/bot.cpp | 4 +- zone/client.h | 2 +- zone/client_packet.cpp | 8 +- zone/command.cpp | 40 ++++--- zone/corpse.cpp | 12 +- zone/corpse.h | 2 +- zone/embparser.cpp | 2 +- zone/inventory.cpp | 68 ++++++------ zone/loottables.cpp | 2 + zone/lua_client.cpp | 4 +- zone/lua_iteminst.cpp | 4 +- zone/perl_client.cpp | 2 +- zone/perl_questitem.cpp | 2 +- zone/tradeskills.cpp | 4 +- zone/trading.cpp | 4 +- zone/zonedb.cpp | 38 ++++--- zone/zonedump.h | 2 + 41 files changed, 263 insertions(+), 189 deletions(-) create mode 100644 utils/sql/git/optional/2014_12_15_heromodelCommand.sql create mode 100644 utils/sql/git/required/2014_12_15_multiple_table_updates.sql diff --git a/changelog.txt b/changelog.txt index ae004543f..1a0be1590 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,11 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/15/2014 == +Trevius: (RoF+) Implemented the 6th Augment Slot for Items. +Trevius: Player Corpses now saved attuned settings for Items. + +Required SQL: utils/sql/git/required/2014_12_15_multiple_table_updates.sql + == 12/13/2014 == demonstar55: Fix guild rank spam on zone (needed to be in OP_PP). Trevius: (RoF+) Implemented Armor Ornamentation using Hero's Forge Armor Models. To use, create an ornamentation augment and set the herosforgemodel field in the items table. diff --git a/common/database.cpp b/common/database.cpp index 4cafc56d1..80ff355d7 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2099,6 +2099,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ "`aug_3` int(11) unsigned DEFAULT '0', " "`aug_4` int(11) unsigned DEFAULT '0', " "`aug_5` int(11) unsigned DEFAULT '0', " + "`aug_6` int(11) unsigned DEFAULT '0', " "`attuned` smallint(5) NOT NULL DEFAULT '0', " "PRIMARY KEY(`corpse_id`, `equip_slot`) " ") ENGINE = InnoDB DEFAULT CHARSET = latin1; " @@ -2276,8 +2277,8 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ for (unsigned int i = 0; i < dbpc->itemcount; i++) { if (first_entry != 1){ scquery = StringFormat("REPLACE INTO `character_corpse_items` \n" - " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, attuned) \n" - " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, aug_6, attuned) \n" + " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", atoi(row2[0]), dbpc->items[i].equipSlot, dbpc->items[i].item_id, @@ -2286,12 +2287,14 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ dbpc->items[i].aug2, dbpc->items[i].aug3, dbpc->items[i].aug4, - dbpc->items[i].aug5 + dbpc->items[i].aug5, + dbpc->items[i].aug6, + dbpc->items[i].attuned ); first_entry = 1; } else{ - scquery = scquery + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + scquery = scquery + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", atoi(row2[0]), dbpc->items[i].equipSlot, dbpc->items[i].item_id, @@ -2300,7 +2303,9 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ dbpc->items[i].aug2, dbpc->items[i].aug3, dbpc->items[i].aug4, - dbpc->items[i].aug5 + dbpc->items[i].aug5, + dbpc->items[i].aug6, + dbpc->items[i].attuned ); } } @@ -2310,7 +2315,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ /* Classic Converter */ scquery = StringFormat("UPDATE `character_corpses` SET \n" "`is_locked` = %d,\n" - "`exp` = %u,\n" + "`exp` = %u,\n" "`size` = %f,\n" "`level` = %u,\n" "`race` = %u,\n" @@ -2338,7 +2343,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ "`wc_6` = %u,\n" "`wc_7` = %u,\n" "`wc_8` = %u,\n" - "`wc_9` = %u \n" + "`wc_9` = %u \n" "WHERE `id` = %u \n", dbpc_c->locked, dbpc_c->exp, @@ -2381,8 +2386,8 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ for (unsigned int i = 0; i < dbpc_c->itemcount; i++) { if (first_entry != 1){ scquery = StringFormat("REPLACE INTO `character_corpse_items` \n" - " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, attuned) \n" - " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, aug_6, attuned) \n" + " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", atoi(row2[0]), dbpc_c->items[i].equipSlot, dbpc_c->items[i].item_id, @@ -2391,12 +2396,14 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ dbpc_c->items[i].aug2, dbpc_c->items[i].aug3, dbpc_c->items[i].aug4, - dbpc_c->items[i].aug5 + dbpc_c->items[i].aug5, + dbpc_c->items[i].aug6, + dbpc_c->items[i].attuned ); first_entry = 1; } else{ - scquery = scquery + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + scquery = scquery + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", atoi(row2[0]), dbpc_c->items[i].equipSlot, dbpc_c->items[i].item_id, @@ -2405,7 +2412,9 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ dbpc_c->items[i].aug2, dbpc_c->items[i].aug3, dbpc_c->items[i].aug4, - dbpc_c->items[i].aug5 + dbpc_c->items[i].aug5, + dbpc_c->items[i].aug6, + dbpc_c->items[i].attuned ); } } diff --git a/common/database.h b/common/database.h index 6325b4e3d..8f5d7430c 100644 --- a/common/database.h +++ b/common/database.h @@ -426,6 +426,8 @@ namespace Convert { uint32 aug3; uint32 aug4; uint32 aug5; + uint32 aug6; + uint8 attuned; }; } diff --git a/common/eq_dictionary.h b/common/eq_dictionary.h index 8ef38c77c..a17ade924 100644 --- a/common/eq_dictionary.h +++ b/common/eq_dictionary.h @@ -138,8 +138,8 @@ public: // items // common and container sizes will not increase until the new 'location' struct is implemented - static const uint16 ITEM_COMMON_SIZE = Underfoot::consts::ITEM_COMMON_SIZE; - static const uint16 ITEM_CONTAINER_SIZE = Underfoot::consts::ITEM_CONTAINER_SIZE; + static const uint16 ITEM_COMMON_SIZE = RoF::consts::ITEM_COMMON_SIZE; + static const uint16 ITEM_CONTAINER_SIZE = Titanium::consts::ITEM_CONTAINER_SIZE; // player profile //static const uint32 CLASS_BITMASK = 0; // needs value diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index 930b76843..ed62bb183 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -2919,7 +2919,7 @@ uint8 npccastfilters; // 0) No, 1) Ignore NPC Casts (all), 2) Ignore NPC Casts */ struct ItemViewRequest_Struct { /*000*/ uint32 item_id; -/*004*/ uint32 augments[5]; +/*004*/ uint32 augments[6]; /*024*/ uint32 link_hash; /*028*/ uint32 unknown028; /*032*/ char unknown032[12]; //probably includes loregroup & evolving info. see Client::MakeItemLink() in zone/inventory.cpp:469 @@ -5242,8 +5242,10 @@ struct ServerLootItem_Struct { uint32 aug_3; // uint32 aug_3; uint32 aug_4; // uint32 aug_4; uint32 aug_5; // uint32 aug_5; - uint8 min_level; // - uint8 max_level; // + uint32 aug_6; // uint32 aug_5; + uint8 attuned; + uint8 min_level; + uint8 max_level; }; //Found in client near a ref to the string: diff --git a/common/item.cpp b/common/item.cpp index 8af7f8b06..df4997470 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -1400,7 +1400,7 @@ ItemInst::ItemInst(const Item_Struct* item, int16 charges) { m_item = item; m_charges = charges; m_price = 0; - m_instnodrop = false; + m_attuned = false; m_merchantslot = 0; if(m_item &&m_item->ItemClass == ItemClassCommon) m_color = m_item->Color; @@ -1426,7 +1426,7 @@ ItemInst::ItemInst(SharedDatabase *db, uint32 item_id, int16 charges) { m_charges = charges; m_price = 0; m_merchantslot = 0; - m_instnodrop=false; + m_attuned=false; if(m_item && m_item->ItemClass == ItemClassCommon) m_color = m_item->Color; else @@ -1450,7 +1450,7 @@ ItemInst::ItemInst(ItemInstTypes use_type) { m_item = nullptr; m_charges = 0; m_price = 0; - m_instnodrop = false; + m_attuned = false; m_merchantslot = 0; m_color = 0; @@ -1475,7 +1475,7 @@ ItemInst::ItemInst(const ItemInst& copy) m_color=copy.m_color; m_merchantslot=copy.m_merchantslot; m_currentslot=copy.m_currentslot; - m_instnodrop=copy.m_instnodrop; + m_attuned=copy.m_attuned; m_merchantcount=copy.m_merchantcount; // Copy container contents iter_contents it; diff --git a/common/item.h b/common/item.h index 4827f042b..995f121d6 100644 --- a/common/item.h +++ b/common/item.h @@ -294,7 +294,7 @@ public: // // Augements // - inline bool IsAugmentable() const { return m_item->AugSlotType[0]!=0 || m_item->AugSlotType[1]!=0 || m_item->AugSlotType[2]!=0 || m_item->AugSlotType[3]!=0 || m_item->AugSlotType[4]!=0; } + inline bool IsAugmentable() const { return m_item->AugSlotType[0] != 0 || m_item->AugSlotType[1] != 0 || m_item->AugSlotType[2] != 0 || m_item->AugSlotType[3] != 0 || m_item->AugSlotType[4] != 0 || m_item->AugSlotType[5] != 0; } bool AvailableWearSlot(uint32 aug_wear_slots) const; int8 AvailableAugmentSlot(int32 augtype) const; bool IsAugmentSlotAvailable(int32 augtype, uint8 slot) const; @@ -362,8 +362,8 @@ public: void SetCurrentSlot(int16 curr_slot) { m_currentslot = curr_slot; } // Is this item already attuned? - bool IsInstNoDrop() const { return m_instnodrop; } - void SetInstNoDrop(bool flag) { m_instnodrop=flag; } + bool IsAttuned() const { return m_attuned; } + void SetAttuned(bool flag) { m_attuned=flag; } std::string GetCustomDataString() const; std::string GetCustomData(std::string identifier); @@ -435,7 +435,7 @@ protected: uint32 m_color; uint32 m_merchantslot; int16 m_currentslot; - bool m_instnodrop; + bool m_attuned; int32 m_merchantcount; //number avaliable on the merchant, -1=unlimited int32 m_SerialNumber; // Unique identifier for this instance of an item. Needed for Bazaar. uint32 m_exp; diff --git a/common/item_fieldlist.h b/common/item_fieldlist.h index 42ec12554..1b3fe0cb0 100644 --- a/common/item_fieldlist.h +++ b/common/item_fieldlist.h @@ -101,6 +101,8 @@ F(augslot4type) F(augslot4visible) F(augslot5type) F(augslot5visible) +F(augslot6type) +F(augslot6visible) F(ldontheme) F(ldonprice) F(ldonsold) diff --git a/common/item_struct.h b/common/item_struct.h index 66af3d0c6..3ef26db94 100644 --- a/common/item_struct.h +++ b/common/item_struct.h @@ -183,9 +183,9 @@ struct Item_Struct { int32 FactionAmt4; // Faction Amt 4 char CharmFile[32]; // ? uint32 AugType; - uint8 AugSlotType[EmuConstants::ITEM_COMMON_SIZE]; // LDoN: Augment Slot 1-5 Type - uint8 AugSlotVisible[EmuConstants::ITEM_COMMON_SIZE]; // LDoN: Augment Slot 1-5 Visible - uint8 AugSlotUnk2[EmuConstants::ITEM_COMMON_SIZE]; // LDoN: Augment Slot 1-5 Unknown + uint8 AugSlotType[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type + uint8 AugSlotVisible[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible + uint8 AugSlotUnk2[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown uint32 LDoNTheme; uint32 LDoNPrice; uint32 LDoNSold; diff --git a/common/patches/client62.cpp b/common/patches/client62.cpp index f3681721e..102414b16 100644 --- a/common/patches/client62.cpp +++ b/common/patches/client62.cpp @@ -1249,7 +1249,7 @@ namespace Client62 //merchant_slot, //instance ID, bullshit for now // The 'Merchant Slot' needs to be some unique id for bazaar to work properly (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot, - inst->IsInstNoDrop() ? 1 : 0, //not sure where this field is + inst->IsAttuned() ? 1 : 0, //not sure where this field is (stackable ? ((inst->GetItem()->ItemType == ItemTypePotion) ? charges : 0) : charges), 0 ); diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 202d4f090..1659dbd1c 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -4406,7 +4406,7 @@ namespace RoF IN(item_id); int r; - for (r = 0; r < 5; r++) { + for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) { IN(augments[r]); } // Max Augs is now 6, but no code to support that many yet @@ -4855,7 +4855,7 @@ namespace RoF hdr.unknown028 = 0; hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0); hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); - hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0; + hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0; hdr.unknown044 = 0; hdr.unknown048 = 0; hdr.unknown052 = 0; @@ -5074,7 +5074,7 @@ namespace RoF isbs.augdistiller = 65535; isbs.augrestrict = item->AugRestrict; - for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x) + for (int x = AUG_BEGIN; x < consts::ITEM_COMMON_SIZE; x++) { isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].visible = item->AugSlotVisible[x]; @@ -5082,9 +5082,9 @@ namespace RoF } // Increased to 6 max aug slots - isbs.augslots[5].type = 0; - isbs.augslots[5].visible = 1; - isbs.augslots[5].unknown = 0; + //isbs.augslots[5].type = 0; + //isbs.augslots[5].visible = 1; + //isbs.augslots[5].unknown = 0; isbs.ldonpoint_type = item->PointType; isbs.ldontheme = item->LDoNTheme; diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 531aa8c4d..fbbceda2c 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -4410,10 +4410,9 @@ namespace RoF2 IN(item_id); int r; - for (r = 0; r < 5; r++) { + for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) { IN(augments[r]); } - // Max Augs is now 6, but no code to support that many yet IN(link_hash); IN(icon); @@ -4859,7 +4858,7 @@ namespace RoF2 hdr.unknown028 = 0; hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0); hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); - hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0; + hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0; hdr.unknown044 = 0; hdr.unknown048 = 7300 + Inventory::CalcMaterialFromSlot(slot_id_in); //0; hdr.unknown052 = 7300 + Inventory::CalcMaterialFromSlot(slot_id_in); //0; @@ -5079,7 +5078,7 @@ namespace RoF2 isbs.augdistiller = 65535; isbs.augrestrict = item->AugRestrict; - for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x) + for (int x = AUG_BEGIN; x < consts::ITEM_COMMON_SIZE; x++) { isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].visible = item->AugSlotVisible[x]; @@ -5087,9 +5086,9 @@ namespace RoF2 } // Increased to 6 max aug slots - isbs.augslots[5].type = 0; - isbs.augslots[5].visible = 1; - isbs.augslots[5].unknown = 0; + //isbs.augslots[5].type = 0; + //isbs.augslots[5].visible = 1; + //isbs.augslots[5].unknown = 0; isbs.ldonpoint_type = item->PointType; isbs.ldontheme = item->LDoNTheme; diff --git a/common/patches/rof2_itemfields.h b/common/patches/rof2_itemfields.h index ccba333b5..b7b2223d3 100644 --- a/common/patches/rof2_itemfields.h +++ b/common/patches/rof2_itemfields.h @@ -332,6 +332,9 @@ These fields must be in the order of how they are serialized! /* 091 */ I(AugSlotType[4]) /* 092 */ I(AugSlotVisible[4]) /* 092 */ I(AugSlotUnk2[4]) +/* 091 */ I(AugSlotType[5]) +/* 092 */ I(AugSlotVisible[5]) +/* 092 */ I(AugSlotUnk2[5]) /* 093 */ I(PointType) /* 093 */ I(LDoNTheme) /* 094 */ I(LDoNPrice) diff --git a/common/patches/rof_itemfields.h b/common/patches/rof_itemfields.h index ccba333b5..b7b2223d3 100644 --- a/common/patches/rof_itemfields.h +++ b/common/patches/rof_itemfields.h @@ -332,6 +332,9 @@ These fields must be in the order of how they are serialized! /* 091 */ I(AugSlotType[4]) /* 092 */ I(AugSlotVisible[4]) /* 092 */ I(AugSlotUnk2[4]) +/* 091 */ I(AugSlotType[5]) +/* 092 */ I(AugSlotVisible[5]) +/* 092 */ I(AugSlotUnk2[5]) /* 093 */ I(PointType) /* 093 */ I(LDoNTheme) /* 094 */ I(LDoNPrice) diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index baca905a2..50d787472 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -3223,7 +3223,7 @@ namespace SoD hdr.unknown028 = 0; hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0); hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); - hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0; + hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0; hdr.unknown044 = 0; hdr.unknown048 = 0; hdr.unknown052 = 0; @@ -3370,7 +3370,7 @@ namespace SoD isbs.augtype = item->AugType; isbs.augrestrict = item->AugRestrict; - for (int x = 0; x < 5; ++x) + for (int x = 0; x < consts::ITEM_COMMON_SIZE; x++) { isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].visible = item->AugSlotVisible[x]; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 8430a51bb..f7d35d403 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -2547,7 +2547,7 @@ namespace SoF hdr.unknown028 = 0; hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0); hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); - hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0; + hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0; hdr.unknown044 = 0; hdr.unknown048 = 0; hdr.unknown052 = 0; @@ -2693,7 +2693,7 @@ namespace SoF isbs.augtype = item->AugType; isbs.augrestrict = item->AugRestrict; - for (int x = 0; x < 5; ++x) + for (int x = 0; x < consts::ITEM_COMMON_SIZE; x++) { isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].visible = item->AugSlotVisible[x]; diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index 0fc9d5e75..26ab0f531 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -1678,7 +1678,7 @@ namespace Titanium (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot, 0, // item recast timer timestamp field (aka..last_cast_time field in SoF+ clients) (stackable ? ((inst->GetItem()->ItemType == ItemTypePotion) ? 1 : 0) : charges), - inst->IsInstNoDrop() ? 1 : 0, + inst->IsAttuned() ? 1 : 0, 0 ); diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 16095faa9..3ddfeafd0 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -3637,7 +3637,7 @@ namespace Underfoot hdr.unknown028 = 0; hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0); hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); - hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0; + hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0; hdr.unknown044 = 0; hdr.unknown048 = 0; hdr.unknown052 = 0; @@ -3817,7 +3817,7 @@ namespace Underfoot isbs.augtype = item->AugType; isbs.augrestrict = item->AugRestrict; - for (int x = 0; x < 5; ++x) + for (int x = 0; x < consts::ITEM_COMMON_SIZE; x++) { isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].visible = item->AugSlotVisible[x]; diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 8f99ac03d..4ba16b441 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -183,7 +183,7 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 s bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, int16 slot_id) { - uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) for(int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { ItemInst *auginst=inst->GetItem(i); @@ -199,14 +199,14 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i // Update/Insert item std::string query = StringFormat("REPLACE INTO inventory " "(charid, slotid, itemid, charges, instnodrop, custom_data, color, " - "augslot1, augslot2, augslot3, augslot4, augslot5, ornamenticon, ornamentidfile, ornament_hero_model) " + "augslot1, augslot2, augslot3, augslot4, augslot5, augslot6, ornamenticon, ornamentidfile, ornament_hero_model) " "VALUES( %lu, %lu, %lu, %lu, %lu, '%s', %lu, " - "%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu)", + "%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu)", (unsigned long)char_id, (unsigned long)slot_id, (unsigned long)inst->GetItem()->ID, - (unsigned long)charges, (unsigned long)(inst->IsInstNoDrop()? 1: 0), + (unsigned long)charges, (unsigned long)(inst->IsAttuned()? 1: 0), inst->GetCustomDataString().c_str(), (unsigned long)inst->GetColor(), (unsigned long)augslot[0], (unsigned long)augslot[1], (unsigned long)augslot[2], - (unsigned long)augslot[3],(unsigned long)augslot[4], (unsigned long)inst->GetOrnamentationIcon(), + (unsigned long)augslot[3], (unsigned long)augslot[4], (unsigned long)augslot[5], (unsigned long)inst->GetOrnamentationIcon(), (unsigned long)inst->GetOrnamentationIDFile(), (unsigned long)inst->GetOrnamentHeroModel()); auto results = QueryDatabase(query); @@ -227,7 +227,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, int16 slot_id) { - uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) for(int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { ItemInst *auginst=inst->GetItem(i); @@ -244,12 +244,13 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, std::string query = StringFormat("REPLACE INTO sharedbank " "(acctid, slotid, itemid, charges, custom_data, " - "augslot1, augslot2, augslot3, augslot4, augslot5) " + "augslot1, augslot2, augslot3, augslot4, augslot5, augslot6) " "VALUES( %lu, %lu, %lu, %lu, '%s', " - "%lu, %lu, %lu, %lu, %lu)", + "%lu, %lu, %lu, %lu, %lu, %lu)", (unsigned long)account_id, (unsigned long)slot_id, (unsigned long)inst->GetItem()->ID, (unsigned long)charges, inst->GetCustomDataString().c_str(), (unsigned long)augslot[0], - (unsigned long)augslot[1],(unsigned long)augslot[2],(unsigned long)augslot[3],(unsigned long)augslot[4]); + (unsigned long)augslot[1], (unsigned long)augslot[2], (unsigned long)augslot[3], (unsigned long)augslot[4], + (unsigned long)augslot[5]); auto results = QueryDatabase(query); // Save bag contents, if slot supports bag contents @@ -395,13 +396,13 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { if (is_charid) query = StringFormat("SELECT sb.slotid, sb.itemid, sb.charges, " "sb.augslot1, sb.augslot2, sb.augslot3, " - "sb.augslot4, sb.augslot5, sb.custom_data " + "sb.augslot4, sb.augslot5, sb.augslot6, sb.custom_data " "FROM sharedbank sb INNER JOIN character_data ch " "ON ch.account_id=sb.acctid WHERE ch.id = %i", id); else query = StringFormat("SELECT slotid, itemid, charges, " "augslot1, augslot2, augslot3, " - "augslot4, augslot5, custom_data " + "augslot4, augslot5, augslot6, custom_data " "FROM sharedbank WHERE acctid=%i", id); auto results = QueryDatabase(query); if (!results.Success()) { @@ -415,11 +416,12 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { int8 charges = (int8)atoi(row[2]); uint32 aug[EmuConstants::ITEM_COMMON_SIZE]; - aug[0] = (uint32)atoi(row[3]); - aug[1] = (uint32)atoi(row[4]); - aug[2] = (uint32)atoi(row[5]); - aug[3] = (uint32)atoi(row[6]); - aug[4] = (uint32)atoi(row[7]); + aug[0] = (uint32)atoi(row[3]); + aug[1] = (uint32)atoi(row[4]); + aug[2] = (uint32)atoi(row[5]); + aug[3] = (uint32)atoi(row[6]); + aug[4] = (uint32)atoi(row[7]); + aug[5] = (uint32)atoi(row[8]); const Item_Struct* item = GetItem(item_id); @@ -441,10 +443,10 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { } } - if(!row[8]) + if(!row[9]) continue; - std::string data_str(row[8]); + std::string data_str(row[9]); std::string idAsString; std::string value; bool use_id = true; @@ -489,7 +491,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { // Retrieve character inventory std::string query = StringFormat("SELECT slotid, itemid, charges, color, augslot1, " - "augslot2, augslot3, augslot4, augslot5, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model " + "augslot2, augslot3, augslot4, augslot5, augslot6, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model " "FROM inventory WHERE charid = %i ORDER BY slotid", char_id); auto results = QueryDatabase(query); if (!results.Success()) { @@ -506,17 +508,18 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { uint32 aug[EmuConstants::ITEM_COMMON_SIZE]; - aug[0] = (uint32)atoul(row[4]); - aug[1] = (uint32)atoul(row[5]); - aug[2] = (uint32)atoul(row[6]); - aug[3] = (uint32)atoul(row[7]); - aug[4] = (uint32)atoul(row[8]); + aug[0] = (uint32)atoul(row[4]); + aug[1] = (uint32)atoul(row[5]); + aug[2] = (uint32)atoul(row[6]); + aug[3] = (uint32)atoul(row[7]); + aug[4] = (uint32)atoul(row[8]); + aug[5] = (uint32)atoul(row[9]); - bool instnodrop = (row[9] && (uint16)atoi(row[9]))? true: false; + bool instnodrop = (row[10] && (uint16)atoi(row[10]))? true: false; - uint32 ornament_icon = (uint32)atoul(row[11]); - uint32 ornament_idfile = (uint32)atoul(row[12]); - uint32 ornament_hero_model = (uint32)atoul(row[13]); + uint32 ornament_icon = (uint32)atoul(row[12]); + uint32 ornament_idfile = (uint32)atoul(row[13]); + uint32 ornament_hero_model = (uint32)atoul(row[14]); const Item_Struct* item = GetItem(item_id); @@ -529,8 +532,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { ItemInst* inst = CreateBaseItem(item, charges); - if(row[10]) { - std::string data_str(row[10]); + if(row[11]) { + std::string data_str(row[11]); std::string idAsString; std::string value; bool use_id = true; @@ -560,7 +563,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { inst->SetOrnamentHeroModel(ornament_hero_model); if (instnodrop || (((slot_id >= EmuConstants::EQUIPMENT_BEGIN && slot_id <= EmuConstants::EQUIPMENT_END) || slot_id == MainPowerSource) && inst->GetItem()->Attuneable)) - inst->SetInstNoDrop(true); + inst->SetAttuned(true); if (color > 0) inst->SetColor(color); @@ -600,7 +603,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) { // Retrieve character inventory std::string query = StringFormat("SELECT slotid, itemid, charges, color, augslot1, " - "augslot2, augslot3, augslot4, augslot5, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model " + "augslot2, augslot3, augslot4, augslot5, augslot6, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model " "FROM inventory INNER JOIN character_data ch " "ON ch.id = charid WHERE ch.name = '%s' AND ch.account_id = %i ORDER BY slotid", name, account_id); @@ -619,16 +622,17 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) uint32 color = atoul(row[3]); uint32 aug[EmuConstants::ITEM_COMMON_SIZE]; - aug[0] = (uint32)atoi(row[4]); - aug[1] = (uint32)atoi(row[5]); - aug[2] = (uint32)atoi(row[6]); - aug[3] = (uint32)atoi(row[7]); - aug[4] = (uint32)atoi(row[8]); + aug[0] = (uint32)atoi(row[4]); + aug[1] = (uint32)atoi(row[5]); + aug[2] = (uint32)atoi(row[6]); + aug[3] = (uint32)atoi(row[7]); + aug[4] = (uint32)atoi(row[8]); + aug[5] = (uint32)atoi(row[9]); - bool instnodrop = (row[9] && (uint16)atoi(row[9])) ? true : false; - uint32 ornament_icon = (uint32)atoul(row[11]); - uint32 ornament_idfile = (uint32)atoul(row[12]); - uint32 ornament_hero_model = (uint32)atoul(row[13]); + bool instnodrop = (row[10] && (uint16)atoi(row[10])) ? true : false; + uint32 ornament_icon = (uint32)atoul(row[12]); + uint32 ornament_idfile = (uint32)atoul(row[13]); + uint32 ornament_hero_model = (uint32)atoul(row[14]); const Item_Struct* item = GetItem(item_id); int16 put_slot_id = INVALID_INDEX; @@ -636,10 +640,10 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) continue; ItemInst* inst = CreateBaseItem(item, charges); - inst->SetInstNoDrop(instnodrop); + inst->SetAttuned(instnodrop); - if(row[10]) { - std::string data_str(row[10]); + if(row[11]) { + std::string data_str(row[11]); std::string idAsString; std::string value; bool use_id = true; @@ -895,6 +899,9 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ item.AugSlotType[4] = (uint8)atoi(row[ItemField::augslot5type]); item.AugSlotVisible[4] = (uint8)atoi(row[ItemField::augslot5visible]); item.AugSlotUnk2[4] = 0; + item.AugSlotType[5] = (uint8)atoi(row[ItemField::augslot6type]); + item.AugSlotVisible[5] = (uint8)atoi(row[ItemField::augslot6visible]); + item.AugSlotUnk2[5] = 0; item.LDoNTheme = (uint32)atoul(row[ItemField::ldontheme]); item.LDoNPrice = (uint32)atoul(row[ItemField::ldonprice]); @@ -1187,7 +1194,7 @@ bool SharedDatabase::LoadNPCFactionLists() { } // Create appropriate ItemInst class -ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) +ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned) { const Item_Struct* item = nullptr; ItemInst* inst = nullptr; @@ -1199,6 +1206,8 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, inst->PutAugment(this, 2, aug3); inst->PutAugment(this, 3, aug4); inst->PutAugment(this, 4, aug5); + inst->PutAugment(this, 5, aug6); + inst->SetAttuned(attuned); } return inst; @@ -1206,7 +1215,7 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, // Create appropriate ItemInst class -ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) +ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned) { ItemInst* inst = nullptr; if (item) { @@ -1216,6 +1225,8 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin inst->PutAugment(this, 2, aug3); inst->PutAugment(this, 3, aug4); inst->PutAugment(this, 4, aug5); + inst->PutAugment(this, 5, aug6); + inst->SetAttuned(attuned); } return inst; diff --git a/common/shareddb.h b/common/shareddb.h index 0b0dcf839..5f0707054 100644 --- a/common/shareddb.h +++ b/common/shareddb.h @@ -71,8 +71,8 @@ public: /* * Item Methods */ - ItemInst* CreateItem(uint32 item_id, int16 charges=0, uint32 aug1=0, uint32 aug2=0, uint32 aug3=0, uint32 aug4=0, uint32 aug5=0); - ItemInst* CreateItem(const Item_Struct* item, int16 charges=0, uint32 aug1=0, uint32 aug2=0, uint32 aug3=0, uint32 aug4=0, uint32 aug5=0); + ItemInst* CreateItem(uint32 item_id, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0); + ItemInst* CreateItem(const Item_Struct* item, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0); ItemInst* CreateBaseItem(const Item_Struct* item, int16 charges=0); /* diff --git a/common/version.h b/common/version.h index e223fe606..461c26e23 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9061 +#define CURRENT_BINARY_DATABASE_VERSION 9062 #define COMPILE_DATE __DATE__ #define COMPILE_TIME __TIME__ #ifndef WIN32 diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 61806f625..19246c290 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -315,6 +315,7 @@ 9059|2014_12_01_mercs_table_update.sql|SHOW COLUMNS FROM `mercs` LIKE 'MercSize'|empty| 9060|2014_12_09_items_table_update.sql|SHOW COLUMNS FROM `items` LIKE 'herosforgemodel'|empty| 9061|2014_12_11_inventory_table_update.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornament_hero_model'|empty| +9062|2014_12_15_multiple_table_updates.sql|SHOW COLUMNS FROM `inventory` LIKE 'augslot6type'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/optional/2014_12_15_heromodelCommand.sql b/utils/sql/git/optional/2014_12_15_heromodelCommand.sql new file mode 100644 index 000000000..4ded6664d --- /dev/null +++ b/utils/sql/git/optional/2014_12_15_heromodelCommand.sql @@ -0,0 +1,2 @@ +INSERT INTO `commands` (`command`, `access`) VALUES ('heromodel', 80); +INSERT INTO `commands` (`command`, `access`) VALUES ('hm', 80); \ No newline at end of file diff --git a/utils/sql/git/required/2014_12_15_multiple_table_updates.sql b/utils/sql/git/required/2014_12_15_multiple_table_updates.sql new file mode 100644 index 000000000..de652e570 --- /dev/null +++ b/utils/sql/git/required/2014_12_15_multiple_table_updates.sql @@ -0,0 +1,16 @@ +/* Add the new Aug Slot 6 Fields to the items table */ +ALTER TABLE `items` ADD `augslot6type` tinyint( 3 ) NOT NULL DEFAULT '0' AFTER `augslot5visible`; +ALTER TABLE `items` ADD `augslot6visible` tinyint( 3 ) NOT NULL DEFAULT '0' AFTER `augslot6type`; +ALTER TABLE `items` ADD `augslot6unk2` int( 11 ) NOT NULL DEFAULT '0' AFTER `augslot5unk2`; + +/* Add the new Aug Slot 6 Field to the inventory table */ +ALTER TABLE `inventory` ADD `augslot6` mediumint( 7 ) NOT NULL DEFAULT '0' AFTER `augslot5`; + +/* Add the new Aug Slot 6 Field to the sharedbank table */ +ALTER TABLE `sharedbank` ADD `augslot6` mediumint( 7 ) NOT NULL DEFAULT '0' AFTER `augslot5`; + +/* Add the new Aug Slot 6 Field to the object_contents table */ +ALTER TABLE `object_contents` ADD `augslot6` mediumint( 7 ) NOT NULL DEFAULT '0' AFTER `augslot5`; + +/* Add the new Aug Slot 6 Field to the sharedbank table */ +ALTER TABLE `character_corpse_items` ADD `aug_6` int( 11 ) NOT NULL DEFAULT '0' AFTER `aug_5`; \ No newline at end of file diff --git a/zone/bot.cpp b/zone/bot.cpp index 266c8565e..33d36d284 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -4173,7 +4173,7 @@ void Bot::SetBotItemInSlot(uint32 slotID, uint32 itemID, const ItemInst* inst, s "augslot1, augslot2, augslot3, augslot4, augslot5) " "VALUES(%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu)", (unsigned long)this->GetBotID(), (unsigned long)slotID, (unsigned long)itemID, - (unsigned long)inst->GetCharges(), (unsigned long)(inst->IsInstNoDrop()? 1: 0), + (unsigned long)inst->GetCharges(), (unsigned long)(inst->IsAttuned()? 1: 0), (unsigned long)inst->GetColor(), (unsigned long)augslot[0], (unsigned long)augslot[1], (unsigned long)augslot[2], (unsigned long)augslot[3], (unsigned long)augslot[4]); auto results = database.QueryDatabase(query); @@ -4235,7 +4235,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { int16 put_slot_id = INVALID_INDEX; if (instnodrop || ((slot_id >= EmuConstants::EQUIPMENT_BEGIN) && (slot_id <= EmuConstants::EQUIPMENT_END) && inst->GetItem()->Attuneable)) - inst->SetInstNoDrop(true); + inst->SetAttuned(true); if (color > 0) inst->SetColor(color); diff --git a/zone/client.h b/zone/client.h index 737d354cc..be503fccc 100644 --- a/zone/client.h +++ b/zone/client.h @@ -810,7 +810,7 @@ public: void QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call = false); void PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data = 0); bool AutoPutLootInInventory(ItemInst& inst, bool try_worn = false, bool try_cursor = true, ServerLootItem_Struct** bag_item_data = 0); - bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, bool attuned = false, uint16 to_slot = MainCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0); + bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = MainCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0); void SetStats(uint8 type,int16 set_val); void IncStats(uint8 type,int16 increase_val); void DropItem(int16 slot_id); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index db209317b..f0528501a 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -2742,7 +2742,7 @@ void Client::Handle_OP_AltCurrencyReclaim(const EQApplicationPacket *app) SetAlternateCurrencyValue(reclaim->currency_id, 0); } else { - SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, false, MainCursor); + SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, MainCursor); AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count)); } /* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */ @@ -6968,7 +6968,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) const Item_Struct* CursorItem = CursorItemInst->GetItem(); - if (!CursorItem->NoDrop || CursorItemInst->IsInstNoDrop()) + if (!CursorItem->NoDrop || CursorItemInst->IsAttuned()) { Message_StringID(13, GUILD_BANK_CANNOT_DEPOSIT); @@ -8213,7 +8213,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) } - ItemInst* inst = database.CreateItem(item, item->MaxCharges, ivrs->augments[0], ivrs->augments[1], ivrs->augments[2], ivrs->augments[3], ivrs->augments[4]); + ItemInst* inst = database.CreateItem(item, item->MaxCharges, ivrs->augments[0], ivrs->augments[1], ivrs->augments[2], ivrs->augments[3], ivrs->augments[4], ivrs->augments[5]); if (inst) { SendItemPacket(0, inst, ItemPacketViewLink); safe_delete(inst); @@ -8369,7 +8369,7 @@ void Client::Handle_OP_ItemPreview(const EQApplicationPacket *app) } outapp->WriteUInt32(0xFFFFFFFF); //Unknown but always seen as FF FF FF FF outapp->WriteUInt32(0); //Unknown - for (spacer = 0; spacer < 5; spacer++) { //Augment stuff + for (spacer = 0; spacer < 6; spacer++) { //Augment stuff outapp->WriteUInt32(item->AugSlotType[spacer]); outapp->WriteUInt8(item->AugSlotVisible[spacer]); outapp->WriteUInt8(item->AugSlotUnk2[spacer]); diff --git a/zone/command.cpp b/zone/command.cpp index 3876d90de..d5d781e02 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -5556,18 +5556,20 @@ void command_summonitem(Client *c, const Seperator *sep) if (item_status > c->Admin()) c->Message(13, "Error: Insufficient status to summon this item."); - else if (sep->argnum==2 && sep->IsNumber(2)) { - c->SummonItem(itemid, atoi(sep->arg[2]) ); - } else if (sep->argnum==3) { - c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]) ); - } else if (sep->argnum==4) - c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]) ); + else if (sep->argnum==2 && sep->IsNumber(2)) + c->SummonItem(itemid, atoi(sep->arg[2])); + else if (sep->argnum==3) + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3])); + else if (sep->argnum==4) + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4])); else if (sep->argnum==5) - c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]) ); + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5])); else if (sep->argnum==6) - c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]) ); + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6])); else if (sep->argnum==7) - c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]) ); + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7])); + else if (sep->argnum==8) + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]), atoi(sep->arg[8])); else { c->SummonItem(itemid); } @@ -5593,18 +5595,20 @@ void command_giveitem(Client *c, const Seperator *sep) if (item_status > c->Admin()) c->Message(13, "Error: Insufficient status to summon this item."); - else if (sep->argnum==2 && sep->IsNumber(2)) { - t->SummonItem(itemid, atoi(sep->arg[2]) ); - } else if (sep->argnum==3) { - t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]) ); - } else if (sep->argnum==4) - t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]) ); + else if (sep->argnum==2 && sep->IsNumber(2)) + t->SummonItem(itemid, atoi(sep->arg[2])); + else if (sep->argnum==3) + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3])); + else if (sep->argnum==4) + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4])); else if (sep->argnum==5) - t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]) ); + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5])); else if (sep->argnum==6) - t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]) ); + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6])); else if (sep->argnum==7) - t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]) ); + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7])); + else if (sep->argnum == 7) + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]), atoi(sep->arg[8])); else { t->SummonItem(itemid); } diff --git a/zone/corpse.cpp b/zone/corpse.cpp index b6504c88f..1e3bdcafb 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -452,7 +452,7 @@ std::list Corpse::MoveItemToCorpse(Client *client, ItemInst *item, int16 ItemInst *interior_item; std::list returnlist; - AddItem(item->GetItem()->ID, item->GetCharges(), equipslot, item->GetAugmentItemID(0), item->GetAugmentItemID(1), item->GetAugmentItemID(2), item->GetAugmentItemID(3), item->GetAugmentItemID(4)); + AddItem(item->GetItem()->ID, item->GetCharges(), equipslot, item->GetAugmentItemID(0), item->GetAugmentItemID(1), item->GetAugmentItemID(2), item->GetAugmentItemID(3), item->GetAugmentItemID(4), item->GetAugmentItemID(5), item->IsAttuned()); returnlist.push_back(equipslot); // Qualified bag slot iterations. processing bag slots that don't exist is probably not a good idea. @@ -463,7 +463,7 @@ std::list Corpse::MoveItemToCorpse(Client *client, ItemInst *item, int16 interior_item = client->GetInv().GetItem(interior_slot); if (interior_item) { - AddItem(interior_item->GetItem()->ID, interior_item->GetCharges(), interior_slot, interior_item->GetAugmentItemID(0), interior_item->GetAugmentItemID(1), interior_item->GetAugmentItemID(2), interior_item->GetAugmentItemID(3), interior_item->GetAugmentItemID(4)); + AddItem(interior_item->GetItem()->ID, interior_item->GetCharges(), interior_slot, interior_item->GetAugmentItemID(0), interior_item->GetAugmentItemID(1), interior_item->GetAugmentItemID(2), interior_item->GetAugmentItemID(3), interior_item->GetAugmentItemID(4), interior_item->GetAugmentItemID(5), item->IsAttuned()); returnlist.push_back(Inventory::CalcSlotId(equipslot, bagindex)); client->DeleteItemInInventory(interior_slot, 0, true, false); } @@ -688,7 +688,7 @@ uint32 Corpse::CountItems() { return itemlist.size(); } -void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) { +void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned) { if (!database.GetItem(itemnum)) return; @@ -705,6 +705,8 @@ void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, ui item->aug_3=aug3; item->aug_4=aug4; item->aug_5=aug5; + item->aug_6=aug6; + item->attuned=attuned; itemlist.push_back(item); } @@ -1048,7 +1050,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a if(i < corpselootlimit) { item = database.GetItem(item_data->item_id); if(client && item) { - ItemInst* inst = database.CreateItem(item, item_data->charges, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5); + ItemInst* inst = database.CreateItem(item, item_data->charges, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5, item_data->aug_6, item_data->attuned); if(inst) { // MainGeneral1 is the corpse inventory start offset for Ti(EMu) - CORPSE_END = MainGeneral1 + MainCursor client->SendItemPacket(i + EmuConstants::CORPSE_BEGIN, inst, ItemPacketLoot); @@ -1163,7 +1165,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) { if (item != 0) { if (item_data){ - inst = database.CreateItem(item, item_data ? item_data->charges : 0, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5); + inst = database.CreateItem(item, item_data ? item_data->charges : 0, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5, item_data->aug_6, item_data->attuned); } else { inst = database.CreateItem(item); diff --git a/zone/corpse.h b/zone/corpse.h index 7488a572e..9c898976c 100644 --- a/zone/corpse.h +++ b/zone/corpse.h @@ -86,7 +86,7 @@ class Corpse : public Mob { int32 GetPlayerKillItem() { return player_kill_item; } void RemoveItem(uint16 lootslot); void RemoveItem(ServerLootItem_Struct* item_data); - void AddItem(uint32 itemnum, uint16 charges, int16 slot = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0); + void AddItem(uint32 itemnum, uint16 charges, int16 slot = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0); /* Corpse: Coin */ void SetCash(uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_platinum); diff --git a/zone/embparser.cpp b/zone/embparser.cpp index c7a67c388..3a27fc42f 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -1146,7 +1146,7 @@ void PerlembParser::ExportEventVariables(std::string &package_name, QuestEventID temp_var_name = var_name; temp_var_name += "_attuned"; - ExportVar(package_name.c_str(), temp_var_name.c_str(), inst->IsInstNoDrop()); + ExportVar(package_name.c_str(), temp_var_name.c_str(), inst->IsAttuned()); } else { ExportVar(package_name.c_str(), var_name.c_str(), 0); diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 08a7ceb29..343f6e337 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -189,7 +189,7 @@ bool Client::CheckLoreConflict(const Item_Struct* item) { return (m_inv.HasItemByLoreGroup(item->LoreGroup, ~invWhereSharedBank) != INVALID_INDEX); } -bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, uint16 to_slot, uint32 ornament_icon, uint32 ornament_idfile, uint32 ornament_hero_model) { +bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, bool attuned, uint16 to_slot, uint32 ornament_icon, uint32 ornament_idfile, uint32 ornament_hero_model) { this->EVENT_ITEM_ScriptStopReturn(); // TODO: update calling methods and script apis to handle a failure return @@ -199,8 +199,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // make sure the item exists if(item == nullptr) { Message(13, "Item %u does not exist.", item_id); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -212,10 +212,10 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, return false; } // check to make sure we are augmenting an augmentable item - else if(((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5)) { + else if (((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) { Message(13, "You can not augment an augment or a non-common class item."); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", + GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -228,14 +228,14 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this item."); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", - GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, item->MinStatus); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", + GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; } */ - uint32 augments[EmuConstants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5 }; + uint32 augments[EmuConstants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 }; uint32 classes = item->Classes; uint32 races = item->Races; @@ -251,8 +251,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(augtest == nullptr) { if(augments[iter]) { Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -268,8 +268,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check that augment is an actual augment else if(augtest->AugType == 0) { Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -281,7 +281,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this augment."); mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", - GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, item->MinStatus); + GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; } @@ -291,16 +291,16 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(enforcewear) { if((item->AugSlotType[iter] == AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) { Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } if(item->AugSlotVisible[iter] == 0) { Message(13, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -476,8 +476,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(restrictfail) { Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -487,8 +487,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for class usability if(item->Classes && !(classes &= augtest->Classes)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1)); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -496,8 +496,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for race usability if(item->Races && !(races &= augtest->Races)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1)); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -505,8 +505,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for slot usability if(item->Slots && !(slots &= augtest->Slots)) { Message(13, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1)); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -532,8 +532,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(inst == nullptr) { Message(13, "An unknown server error has occurred and your item was not created."); // this goes to logfile since this is a major error - LogFile->write(EQEMuLog::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5); + LogFile->write(EQEMuLog::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -546,7 +546,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // attune item if(attuned && inst->GetItem()->Attuneable) - inst->SetInstNoDrop(true); + inst->SetAttuned(true); inst->SetOrnamentIcon(ornament_icon); inst->SetOrnamentationIDFile(ornament_idfile); @@ -558,8 +558,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(!(slots & ((uint32)1 << slottest))) { Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); to_slot = MainCursor; } @@ -858,7 +858,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI { if(bag_item_data[i] == nullptr) continue; - const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5); + const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5, bag_item_data[i]->aug_6, bag_item_data[i]->attuned); interior_slot = Inventory::CalcSlotId(slot_id, i); mlog(INVENTORY__SLOTS, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); PutLootInInventory(interior_slot, *bagitem); @@ -1622,13 +1622,13 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // Not dealing with charges - just do direct swap if(src_inst && (dst_slot_id <= EmuConstants::EQUIPMENT_END || dst_slot_id == MainPowerSource) && dst_slot_id >= EmuConstants::EQUIPMENT_BEGIN) { if (src_inst->GetItem()->Attuneable) { - src_inst->SetInstNoDrop(true); + src_inst->SetAttuned(true); } if (src_inst->IsAugmented()) { for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { if (src_inst->GetAugment(i)) { if (src_inst->GetAugment(i)->GetItem()->Attuneable) { - src_inst->GetAugment(i)->SetInstNoDrop(true); + src_inst->GetAugment(i)->SetAttuned(true); } } } diff --git a/zone/loottables.cpp b/zone/loottables.cpp index c5fda890e..ec2960579 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -201,6 +201,8 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge item->aug_3 = 0; item->aug_4 = 0; item->aug_5 = 0; + item->aug_6 = 0; + item->attuned = 0; item->min_level = minlevel; item->max_level = maxlevel; if (equipit) { diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index 22e38b21d..0f560d1bd 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -703,13 +703,13 @@ void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned) { Lua_Safe_Call_Void(); - self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, attuned); + self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attuned); } void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, int to_slot) { Lua_Safe_Call_Void(); - self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, attuned, to_slot); + self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attuned, to_slot); } void Lua_Client::SetStats(int type, int value) { diff --git a/zone/lua_iteminst.cpp b/zone/lua_iteminst.cpp index c774c332e..4ebc6908f 100644 --- a/zone/lua_iteminst.cpp +++ b/zone/lua_iteminst.cpp @@ -166,12 +166,12 @@ uint32 Lua_ItemInst::GetColor() { bool Lua_ItemInst::IsInstNoDrop() { Lua_Safe_Call_Bool(); - return self->IsInstNoDrop(); + return self->IsAttuned(); } void Lua_ItemInst::SetInstNoDrop(bool flag) { Lua_Safe_Call_Void(); - return self->SetInstNoDrop(flag); + return self->SetAttuned(flag); } std::string Lua_ItemInst::GetCustomDataString() { diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 2a0c055af..e2dae6f35 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -3134,7 +3134,7 @@ XS(XS_Client_SummonItem) slot_id = (uint16)SvUV(ST(9)); } - THIS->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, attune, slot_id); + THIS->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attune, slot_id); } XSRETURN_EMPTY; } diff --git a/zone/perl_questitem.cpp b/zone/perl_questitem.cpp index 7738b12fb..4c93d8839 100644 --- a/zone/perl_questitem.cpp +++ b/zone/perl_questitem.cpp @@ -160,7 +160,7 @@ XS(XS_QuestItem_IsAttuned) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->IsInstNoDrop(); + RETVAL = THIS->IsAttuned(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 58774f4b1..522de616a 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -287,7 +287,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob const Item_Struct* new_weapon = inst->GetItem(); user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true); container->Clear(); - user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->IsInstNoDrop(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2)); + user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2)); user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name); if (RuleB(Inventory, DeleteTransformationMold)) user->DeleteItemInInventory(in_combine->container_slot, 0, true); @@ -307,7 +307,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob const Item_Struct* new_weapon = inst->GetItem(); user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true); container->Clear(); - user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->IsInstNoDrop(), MainCursor, 0, 0); + user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, 0, 0); user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name); } else if (inst) { diff --git a/zone/trading.cpp b/zone/trading.cpp index 738e763ed..240aa23b1 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -878,14 +878,14 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const Item_Struct* item = inst->GetItem(); if(item && quest_npc == false) { // if it was not a NO DROP or Attuned item (or if a GM is trading), let the NPC have it - if(GetGM() || (item->NoDrop != 0 && inst->IsInstNoDrop() == false)) { + if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) { // pets need to look inside bags and try to equip items found there if(item->ItemClass == ItemClassContainer && item->BagSlots > 0) { for(int16 bslot = SUB_BEGIN; bslot < item->BagSlots; bslot++) { const ItemInst* baginst = inst->GetItem(bslot); if (baginst) { const Item_Struct* bagitem = baginst->GetItem(); - if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsInstNoDrop() == false))) { + if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsAttuned() == false))) { tradingWith->CastToNPC()->AddLootDrop(bagitem, &tradingWith->CastToNPC()->itemlist, baginst->GetCharges(), 1, 127, true, true); } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 17b5ff508..b56bd9a1b 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -427,7 +427,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) return; } - std::string query = StringFormat("SELECT bagidx, itemid, charges, augslot1, augslot2, augslot3, augslot4, augslot5 " + std::string query = StringFormat("SELECT bagidx, itemid, charges, augslot1, augslot2, augslot3, augslot4, augslot5, augslot6 " "FROM object_contents WHERE parentid = %i", parentid); auto results = QueryDatabase(query); if (!results.Success()) { @@ -440,11 +440,12 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) uint32 item_id = (uint32)atoi(row[1]); int8 charges = (int8)atoi(row[2]); uint32 aug[EmuConstants::ITEM_COMMON_SIZE]; - aug[0] = (uint32)atoi(row[3]); - aug[1] = (uint32)atoi(row[4]); - aug[2] = (uint32)atoi(row[5]); - aug[3] = (uint32)atoi(row[6]); - aug[4] = (uint32)atoi(row[7]); + aug[0] = (uint32)atoi(row[3]); + aug[1] = (uint32)atoi(row[4]); + aug[2] = (uint32)atoi(row[5]); + aug[3] = (uint32)atoi(row[6]); + aug[4] = (uint32)atoi(row[7]); + aug[5] = (uint32)atoi(row[8]); ItemInst* inst = database.CreateItem(item_id, charges); if (inst && inst->GetItem()->ItemClass == ItemClassCommon) { @@ -478,7 +479,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It continue; uint32 item_id = inst->GetItem()->ID; - uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) { for(int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { @@ -489,10 +490,10 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It std::string query = StringFormat("REPLACE INTO object_contents " "(zoneid, parentid, bagidx, itemid, charges, " - "augslot1, augslot2, augslot3, augslot4, augslot5, droptime) " - "VALUES (%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, now())", + "augslot1, augslot2, augslot3, augslot4, augslot5, augslot6, droptime) " + "VALUES (%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, now())", zone_id, parent_id, index, item_id, inst->GetCharges(), - augslot[0], augslot[1], augslot[2], augslot[3], augslot[4]); + augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]); auto results = QueryDatabase(query); if (!results.Success()) LogFile->write(EQEMuLog::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); @@ -3568,8 +3569,8 @@ uint32 ZoneDatabase::SaveCharacterCorpse(uint32 charid, const char* charname, ui for (unsigned int i = 0; i < dbpc->itemcount; i++) { if (first_entry != 1){ query = StringFormat("REPLACE INTO `character_corpse_items` \n" - " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, attuned) \n" - " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, aug_6, attuned) \n" + " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", last_insert_id, dbpc->items[i].equip_slot, dbpc->items[i].item_id, @@ -3578,12 +3579,14 @@ uint32 ZoneDatabase::SaveCharacterCorpse(uint32 charid, const char* charname, ui dbpc->items[i].aug_2, dbpc->items[i].aug_3, dbpc->items[i].aug_4, - dbpc->items[i].aug_5 + dbpc->items[i].aug_5, + dbpc->items[i].aug_6, + dbpc->items[i].attuned ); first_entry = 1; } else{ - query = query + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + query = query + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", last_insert_id, dbpc->items[i].equip_slot, dbpc->items[i].item_id, @@ -3592,7 +3595,9 @@ uint32 ZoneDatabase::SaveCharacterCorpse(uint32 charid, const char* charname, ui dbpc->items[i].aug_2, dbpc->items[i].aug_3, dbpc->items[i].aug_4, - dbpc->items[i].aug_5 + dbpc->items[i].aug_5, + dbpc->items[i].aug_6, + dbpc->items[i].attuned ); } } @@ -3743,6 +3748,7 @@ bool ZoneDatabase::LoadCharacterCorpseData(uint32 corpse_id, PlayerCorpse_Struct "aug_3, \n" "aug_4, \n" "aug_5, \n" + "aug_6, \n" "attuned \n" "FROM \n" "character_corpse_items \n" @@ -3765,6 +3771,8 @@ bool ZoneDatabase::LoadCharacterCorpseData(uint32 corpse_id, PlayerCorpse_Struct pcs->items[i].aug_3 = atoi(row[r++]); // aug_3, pcs->items[i].aug_4 = atoi(row[r++]); // aug_4, pcs->items[i].aug_5 = atoi(row[r++]); // aug_5, + pcs->items[i].aug_6 = atoi(row[r++]); // aug_6, + pcs->items[i].attuned = atoi(row[r++]); // attuned, r = 0; i++; } diff --git a/zone/zonedump.h b/zone/zonedump.h index 6d7e67b04..deebf9b19 100644 --- a/zone/zonedump.h +++ b/zone/zonedump.h @@ -139,6 +139,8 @@ namespace player_lootitem { uint32 aug_3; uint32 aug_4; uint32 aug_5; + uint32 aug_6; + int8 attuned; uint8 min_level; // uint8 max_level; // }; From ec43a9248b94aed6c9354bc85b7144eb4b1b99ec Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 17:57:03 -0600 Subject: [PATCH 054/153] mob_ai.cpp header cleanup --- zone/mob_ai.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 81c5f510c..dbd6d4e2d 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -15,25 +15,25 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" -#include -#include -#include -#include -#include -#include "npc.h" -#include "masterentity.h" -#include "npc_ai.h" -#include "map.h" -#include "../common/moremath.h" -#include "string_ids.h" -#include "../common/misc_functions.h" -#include "../common/string_util.h" -#include "../common/rulesys.h" #include "../common/features.h" +#include "../common/rulesys.h" +#include "../common/string_util.h" + +#include "client.h" +#include "entity.h" +#include "map.h" +#include "mob.h" +#include "npc.h" #include "quest_parser_collection.h" +#include "string_ids.h" #include "water_map.h" +#include +#include +#include + extern EntityList entity_list; extern Zone *zone; From d44e982eaf9655c74e2a459c0c9bc8ae9e85a38b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:03:33 -0600 Subject: [PATCH 055/153] object.cpp & .h header cleanup --- zone/object.cpp | 18 ++++++++---------- zone/object.h | 15 +++++++-------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/zone/object.cpp b/zone/object.cpp index b1acc53c9..fa7598d39 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -17,19 +17,17 @@ */ #include "../common/debug.h" -#include -#include - -#include "masterentity.h" -#include "zonedb.h" -#include "../common/packet_functions.h" -#include "../common/packet_dump.h" -#include "../common/misc_functions.h" #include "../common/string_util.h" -#include "../common/features.h" -#include "string_ids.h" + +#include "client.h" +#include "entity.h" +#include "mob.h" +#include "object.h" #include "quest_parser_collection.h" +#include "zonedb.h" + +#include const char DEFAULT_OBJECT_NAME[] = "IT63_ACTORDEF"; const char DEFAULT_OBJECT_NAME_SUFFIX[] = "_ACTORDEF"; diff --git a/zone/object.h b/zone/object.h index 9f5cb8cb3..9e8fae05d 100644 --- a/zone/object.h +++ b/zone/object.h @@ -21,16 +21,15 @@ // Object Class: // Represents Zone Objects (forges, ovens, brew barrels, items dropped to ground, etc) -#include "../common/types.h" -#include "../common/linked_list.h" -#include "../common/emu_opcodes.h" #include "../common/eq_packet_structs.h" -#include "../common/item.h" -#include "client.h" -#include "mob.h" -#include "npc.h" -#include "entity.h" #include "../common/timer.h" +#include "../common/types.h" + +#include "entity.h" + +class Client; +class EQApplicationPacket; +class ItemInst; /* item icon numbers (showeq) From c1baade00f9467d1e0b742d607b69a1c904cf81f Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Mon, 15 Dec 2014 19:06:38 -0500 Subject: [PATCH 056/153] Fix build failure --- zone/pathing.h | 1 + 1 file changed, 1 insertion(+) diff --git a/zone/pathing.h b/zone/pathing.h index 833a6ef96..9d3212fcf 100644 --- a/zone/pathing.h +++ b/zone/pathing.h @@ -8,6 +8,7 @@ #include class Client; +class Mob; #define PATHNODENEIGHBOURS 50 From 631d8cb0154f409d287b0ce5aa66dc50d29290c4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:10:45 -0600 Subject: [PATCH 057/153] pathing.cpp & .h header include cleanup --- zone/pathing.cpp | 20 ++++++++++---------- zone/pathing.h | 6 ++---- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 3bf02115e..5501ad2ca 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -1,22 +1,22 @@ #include "../common/debug.h" -#include -#include -#include -#include -#include -#include + +#include "client.h" +#include "doors.h" #include "pathing.h" #include "water_map.h" -#include "../common/misc_functions.h" -#include "doors.h" -#include "client.h" #include "zone.h" +#include +#include +#include +#include +#include + #ifdef _WINDOWS #define snprintf _snprintf #endif -//#define PATHDEBUG +//#define PATHDEBUG #define ABS(x) ((x)<0?-(x):(x)) extern Zone *zone; diff --git a/zone/pathing.h b/zone/pathing.h index 9d3212fcf..c01cb6853 100644 --- a/zone/pathing.h +++ b/zone/pathing.h @@ -1,11 +1,9 @@ #ifndef PATHING_H #define PATHING_H -#include + #include "map.h" -#include "../common/timer.h" + #include -#include -#include class Client; class Mob; From 250d9d1fb5cbe5128228d8f9ccc04b3c505d7de1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:14:39 -0600 Subject: [PATCH 058/153] pets.cpp & .h include header cleanup --- zone/pets.cpp | 2 -- zone/pets.h | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/zone/pets.cpp b/zone/pets.cpp index 5c2bda36d..5c1f4e0cd 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -17,7 +17,6 @@ */ #include "../common/debug.h" -#include "../common/misc_functions.h" #include "../common/spdat.h" #include "../common/string_util.h" #include "../common/types.h" @@ -27,7 +26,6 @@ #include "mob.h" #include "pets.h" -#include "worldserver.h" #include "zonedb.h" #ifndef WIN32 diff --git a/zone/pets.h b/zone/pets.h index 14e5cb722..db78accea 100644 --- a/zone/pets.h +++ b/zone/pets.h @@ -1,28 +1,31 @@ #ifndef PETS_H #define PETS_H - #define PET_BACKOFF 1 - #define PET_GETLOST 2 - #define PET_HEALTHREPORT 4 - #define PET_GUARDHERE 5 - #define PET_GUARDME 6 - #define PET_ATTACK 7 - #define PET_FOLLOWME 8 - #define PET_SITDOWN 9 - #define PET_STANDUP 10 - #define PET_TAUNT 11 - #define PET_HOLD 12 - #define PET_NOTAUNT 14 - #define PET_LEADER 16 - #define PET_SLUMBER 17 - #define PET_NOCAST 18 - #define PET_FOCUS 19 - #define PET_FOCUS_ON 25 - #define PET_FOCUS_OFF 26 - #define PET_HOLD_ON 27 - #define PET_HOLD_OFF 28 +#define PET_BACKOFF 1 +#define PET_GETLOST 2 +#define PET_HEALTHREPORT 4 +#define PET_GUARDHERE 5 +#define PET_GUARDME 6 +#define PET_ATTACK 7 +#define PET_FOLLOWME 8 +#define PET_SITDOWN 9 +#define PET_STANDUP 10 +#define PET_TAUNT 11 +#define PET_HOLD 12 +#define PET_NOTAUNT 14 +#define PET_LEADER 16 +#define PET_SLUMBER 17 +#define PET_NOCAST 18 +#define PET_FOCUS 19 +#define PET_FOCUS_ON 25 +#define PET_FOCUS_OFF 26 +#define PET_HOLD_ON 27 +#define PET_HOLD_OFF 28 - class Pet : public NPC { +class Mob; +struct NPCType; + +class Pet : public NPC { public: Pet(NPCType *type_data, Mob *owner, PetType type, uint16 spell_id, int16 power); From 24503bd0ee5f8720a2c3748ea1c57cfa257971fb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:14:56 -0600 Subject: [PATCH 059/153] petitions.cpp & .h header include cleanup --- zone/petitions.cpp | 1 + zone/petitions.h | 1 + 2 files changed, 2 insertions(+) diff --git a/zone/petitions.cpp b/zone/petitions.cpp index ad38bc04d..76f902a9d 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -33,6 +33,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) #include "../common/eq_packet_structs.h" #include "../common/servertalk.h" #include "../common/string_util.h" + #include "entity.h" #include "petitions.h" #include "worldserver.h" diff --git a/zone/petitions.h b/zone/petitions.h index 604d4ddcc..057169d45 100644 --- a/zone/petitions.h +++ b/zone/petitions.h @@ -22,6 +22,7 @@ #include "../common/misc_functions.h" #include "../common/mutex.h" #include "../common/types.h" + #include "client.h" #include "zonedb.h" From 7dc69b7755342ab4c353c3c9d168472bea19d054 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:22:27 -0600 Subject: [PATCH 060/153] qglobals.cpp & .h include header cleanup --- zone/qglobals.cpp | 5 ++--- zone/qglobals.h | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/zone/qglobals.cpp b/zone/qglobals.cpp index bc7bf680e..0dced7cb0 100644 --- a/zone/qglobals.cpp +++ b/zone/qglobals.cpp @@ -1,9 +1,8 @@ -#include "../common/debug.h" #include "../common/string_util.h" + #include "qglobals.h" -#include "masterentity.h" +#include "client.h" #include "zone.h" -#include "zonedb.h" void QGlobalCache::AddGlobal(uint32 id, QGlobal global) { diff --git a/zone/qglobals.h b/zone/qglobals.h index 5f0938a20..a4dccd2d2 100644 --- a/zone/qglobals.h +++ b/zone/qglobals.h @@ -2,9 +2,6 @@ #define __QGLOBALS__H #include -#include -#include -#include "../common/timer.h" class NPC; class Client; From e7911df8512f42a69ff2e29e0c3abfd12af6403d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:33:23 -0600 Subject: [PATCH 061/153] quest_parser_collection.cpp & .h header include cleanup --- zone/quest_parser_collection.cpp | 3 +-- zone/quest_parser_collection.h | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/zone/quest_parser_collection.cpp b/zone/quest_parser_collection.cpp index 10703c299..c0680b43f 100644 --- a/zone/quest_parser_collection.cpp +++ b/zone/quest_parser_collection.cpp @@ -19,14 +19,13 @@ #include "../common/debug.h" #include "../common/misc_functions.h" #include "../common/features.h" + #include "quest_parser_collection.h" #include "quest_interface.h" #include "zone.h" #include "questmgr.h" #include -#include -#include extern Zone* zone; extern void MapOpcodes(); diff --git a/zone/quest_parser_collection.h b/zone/quest_parser_collection.h index 006bcfe24..62cb034dc 100644 --- a/zone/quest_parser_collection.h +++ b/zone/quest_parser_collection.h @@ -20,19 +20,32 @@ #define _EQE_QUESTPARSERCOLLECTION_H #include "../common/types.h" -#include "../common/item.h" -#include "masterentity.h" +#include "beacon.h" +#include "client.h" +#include "corpse.h" +#include "doors.h" +#include "groups.h" +#include "mob.h" +#include "object.h" +#include "raids.h" +#include "trap.h" + #include "quest_interface.h" -#include -#include #include #include #define QuestFailedToLoad 0xFFFFFFFF #define QuestUnloaded 0x00 +class Client; +class ItemInst; +class Mob; +class NPC; +class QuestInterface; +namespace EQEmu { class Any; } + class QuestParserCollection { public: QuestParserCollection(); From 87fd99a3e7d7202b0c6d64864822ea9581892aff Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:33:39 -0600 Subject: [PATCH 062/153] queryserv.cpp header cleanup --- zone/queryserv.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/queryserv.cpp b/zone/queryserv.cpp index ad7de0424..1186aa241 100644 --- a/zone/queryserv.cpp +++ b/zone/queryserv.cpp @@ -23,7 +23,6 @@ Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net) #include "worldserver.h" #include "net.h" -#include extern WorldServer worldserver; extern QueryServ* QServ; From c43377100e3e0c962a5f056923066337ae20a3ee Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:35:27 -0600 Subject: [PATCH 063/153] questmgr.cpp & .h include cleanup --- zone/questmgr.cpp | 5 +++-- zone/questmgr.h | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 38f40142d..ab68f8361 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -22,18 +22,19 @@ #include "../common/skills.h" #include "../common/spdat.h" #include "../common/string_util.h" + #include "entity.h" #include "event_codes.h" #include "guild_mgr.h" -#include "net.h" #include "qglobals.h" #include "queryserv.h" -#include "questmgr.h" #include "quest_parser_collection.h" +#include "questmgr.h" #include "spawn2.h" #include "worldserver.h" #include "zone.h" #include "zonedb.h" + #include #include #include diff --git a/zone/questmgr.h b/zone/questmgr.h index dd471d74f..4749599ad 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -21,7 +21,6 @@ #include "../common/timer.h" #include "tasks.h" -#include #include #include From 34ce09afd14c87c3dc5cc0bf66388fda46b625f4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:38:54 -0600 Subject: [PATCH 064/153] raids.cpp & .h header include cleanup and forward declare --- zone/raids.cpp | 14 +++++++++----- zone/raids.h | 5 +---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/zone/raids.cpp b/zone/raids.cpp index d1e8db464..31d2b63c9 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -15,13 +15,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include "masterentity.h" -#include "npc_ai.h" -#include "../common/packet_functions.h" -#include "../common/packet_dump.h" + #include "../common/string_util.h" + +#include "client.h" +#include "entity.h" +#include "groups.h" +#include "mob.h" +#include "raids.h" + #include "worldserver.h" + extern EntityList entity_list; extern WorldServer worldserver; diff --git a/zone/raids.h b/zone/raids.h index 7c3561cd2..ca5d0ff9b 100644 --- a/zone/raids.h +++ b/zone/raids.h @@ -19,14 +19,11 @@ #define RAIDS_H #include "../common/types.h" -#include "../common/linked_list.h" #include "groups.h" -#include -#include -#include class Client; class EQApplicationPacket; +class Mob; enum { //raid packet types: raidAdd = 0, From c25e17f3bc6dd87fef6a760262a7c5951f84f67d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:42:14 -0600 Subject: [PATCH 065/153] spawn2.cpp & .h header include cleanup --- zone/spawn2.cpp | 11 ++++++----- zone/spawn2.h | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index bf7192107..eae93c8c7 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -15,16 +15,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" #include "../common/string_util.h" -#include -#include "spawn2.h" + +#include "client.h" #include "entity.h" -#include "masterentity.h" -#include "zone.h" +#include "spawn2.h" #include "spawngroup.h" -#include "zonedb.h" #include "worldserver.h" +#include "zone.h" +#include "zonedb.h" extern EntityList entity_list; extern Zone* zone; diff --git a/zone/spawn2.h b/zone/spawn2.h index e529bb65e..a626b7084 100644 --- a/zone/spawn2.h +++ b/zone/spawn2.h @@ -21,8 +21,6 @@ #include "../common/timer.h" #include "npc.h" -#include - #define SC_AlwaysEnabled 0 class SpawnCondition; From 24f9e8d1811c21dc712034e1df19456cd463be2c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:44:36 -0600 Subject: [PATCH 066/153] spawngroup.cpp & .h header include cleanup --- zone/spawngroup.cpp | 14 ++++++-------- zone/spawngroup.h | 1 - 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/zone/spawngroup.cpp b/zone/spawngroup.cpp index 6943d9349..487e66a6d 100644 --- a/zone/spawngroup.cpp +++ b/zone/spawngroup.cpp @@ -15,17 +15,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" -#include "spawngroup.h" -#include "entity.h" -#include -#include -#include -#include "../common/types.h" -#include "zonedb.h" -#include "../common/misc_functions.h" #include "../common/string_util.h" +#include "../common/types.h" + +#include "entity.h" +#include "spawngroup.h" #include "zone.h" +#include "zonedb.h" extern EntityList entity_list; extern Zone* zone; diff --git a/zone/spawngroup.h b/zone/spawngroup.h index bec6389be..b5f6d18cf 100644 --- a/zone/spawngroup.h +++ b/zone/spawngroup.h @@ -18,7 +18,6 @@ #ifndef SPAWNGROUP_H #define SPAWNGROUP_H -#include "../common/linked_list.h" #include "../common/types.h" #include From b945729d1a7aae3b1c8adea697831c0b024dab09 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:46:41 -0600 Subject: [PATCH 067/153] special_attacks.cpp header cleanup --- zone/special_attacks.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index d5b6aef6d..282eeb11e 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -16,15 +16,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - - -#include "../common/debug.h" -#include "../common/misc_functions.h" #include "../common/rulesys.h" #include "../common/string_util.h" -#include "masterentity.h" + +#include "client.h" +#include "entity.h" +#include "mob.h" #include "string_ids.h" -#include + #include From 020dfbf5384514fb1c40cee02ec03ff91a56f3a6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:47:22 -0600 Subject: [PATCH 068/153] spell_effects header include cleanup --- zone/spell_effects.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 9e7d87503..56611024b 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -23,9 +23,11 @@ #include "../common/rulesys.h" #include "../common/skills.h" #include "../common/spdat.h" + #include "quest_parser_collection.h" #include "string_ids.h" #include "worldserver.h" + #include #ifndef WIN32 From 1ec2ce7e2622c7b5dbbd8301240c1582c0f743e5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:48:42 -0600 Subject: [PATCH 069/153] spells.cpp header include cleanup --- zone/spells.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zone/spells.cpp b/zone/spells.cpp index baae446c8..ad8db3e5b 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -74,9 +74,11 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) #include "../common/skills.h" #include "../common/spdat.h" #include "../common/string_util.h" + #include "quest_parser_collection.h" #include "string_ids.h" #include "worldserver.h" + #include #include From 856eadc628cdebe370b696489a792568695c817b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:54:23 -0600 Subject: [PATCH 070/153] tasks.cpp & .h header include cleanup --- zone/tasks.cpp | 11 ++++++----- zone/tasks.h | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 924d3770b..f8f3ba9b2 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -21,20 +21,21 @@ Copyright (C) 2001-2008 EQEMu Development Team (http://eqemulator.net) #include "tasks.h" #include -#include #ifdef _WINDOWS #define strcasecmp _stricmp #endif #include "../common/misc_functions.h" -#include "../common/string_util.h" #include "../common/rulesys.h" -#include "masterentity.h" -#include "../common/features.h" -#include "quest_parser_collection.h" +#include "../common/string_util.h" + +#include "client.h" +#include "entity.h" #include "mob.h" + #include "queryserv.h" +#include "quest_parser_collection.h" extern QueryServ* QServ; diff --git a/zone/tasks.h b/zone/tasks.h index d92d6d17f..6298fcb5c 100644 --- a/zone/tasks.h +++ b/zone/tasks.h @@ -21,9 +21,8 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) #define TASKS_H #include "../common/types.h" -#include "mob.h" + #include -#include #define MAXTASKS 10000 #define MAXTASKSETS 1000 @@ -44,6 +43,7 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) #define RELOADTASKSETS 3 class Client; +class Mob; struct TaskGoalList_Struct { int ListID; From e218ebb92f0f3003251ab4ac9af812e52c239316 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:56:23 -0600 Subject: [PATCH 071/153] titles.cpp & .h header cleanup and forward declare --- zone/titles.cpp | 10 +++++++--- zone/titles.h | 2 -- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/zone/titles.cpp b/zone/titles.cpp index eeae38b8a..a9e8454f1 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -15,11 +15,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" + #include "../common/eq_packet_structs.h" -#include "masterentity.h" -#include "titles.h" #include "../common/string_util.h" + +#include "client.h" +#include "entity.h" +#include "mob.h" + +#include "titles.h" #include "worldserver.h" extern WorldServer worldserver; diff --git a/zone/titles.h b/zone/titles.h index 51d29d4d6..a942a5688 100644 --- a/zone/titles.h +++ b/zone/titles.h @@ -18,9 +18,7 @@ #ifndef TITLES_H #define TITLES_H -#include "../common/types.h" #include -#include class Client; class EQApplicationPacket; From c5c33f6f49d1b11b04e185d0ab6a3818a4dea7c0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:57:09 -0600 Subject: [PATCH 072/153] tradeskills.cpp header include cleanup --- zone/tradeskills.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 522de616a..f6112b560 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" + #include #include @@ -24,9 +25,9 @@ #include //for htonl #endif -#include "../common/misc_functions.h" #include "../common/rulesys.h" #include "../common/string_util.h" + #include "queryserv.h" #include "quest_parser_collection.h" #include "string_ids.h" From a9226c00d8b07f8a16044577c2cfb7a3feac32d2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 18:59:21 -0600 Subject: [PATCH 073/153] trading.cpp header include cleanup --- zone/trading.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/zone/trading.cpp b/zone/trading.cpp index 240aa23b1..b9b582bfe 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -15,14 +15,20 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" -#include "masterentity.h" -#include "string_ids.h" -#include "../common/string_util.h" #include "../common/rulesys.h" +#include "../common/string_util.h" + +#include "client.h" +#include "entity.h" +#include "mob.h" + #include "quest_parser_collection.h" +#include "string_ids.h" #include "worldserver.h" -#include "queryserv.h" + +class QueryServ; extern WorldServer worldserver; extern QueryServ* QServ; From 537af79c8edf141be92b29483a9cd577a8cde2ab Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:01:54 -0600 Subject: [PATCH 074/153] trap.cpp & .h header include cleanup and forward declare --- zone/trap.cpp | 12 +++++++----- zone/trap.h | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/zone/trap.cpp b/zone/trap.cpp index 7d412d7cb..27b12c26d 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -15,13 +15,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include "../common/types.h" -#include "entity.h" -#include "masterentity.h" + #include "../common/spdat.h" -#include "../common/misc_functions.h" #include "../common/string_util.h" +#include "../common/types.h" + +#include "client.h" +#include "entity.h" +#include "mob.h" +#include "trap.h" /* diff --git a/zone/trap.h b/zone/trap.h index ad2e2171a..59a1a3685 100644 --- a/zone/trap.h +++ b/zone/trap.h @@ -18,10 +18,11 @@ #ifndef _TRAP_H #define _TRAP_H -#include "../common/debug.h" - #include "entity.h" +class Mob; +class NPC; + //ID of the NPC type to spawn when a trap is set off, to do the damage #define TRAP_NPC_TYPE 1586 From 8ebfa36f00510bb5eff79a3d51ac47607ea73342 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:03:24 -0600 Subject: [PATCH 075/153] tribute.cpp header include cleanup --- zone/tribute.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 08bbf4662..bbe8c1ef9 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -15,13 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" #include "../common/eq_packet_structs.h" #include "../common/features.h" -#include "masterentity.h" -#include "../common/packet_dump.h" -#include "../common/misc_functions.h" -#include + +#include "client.h" + #include #ifdef _WINDOWS From 6fd2c2915a516574e9df589e322e9cfb0a1e19c0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:05:52 -0600 Subject: [PATCH 076/153] water_map.cpp header include cleanup --- zone/water_map.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zone/water_map.cpp b/zone/water_map.cpp index 694035815..604875ed6 100644 --- a/zone/water_map.cpp +++ b/zone/water_map.cpp @@ -1,14 +1,14 @@ -#include "../common/debug.h" -#include -#include -#include -#include -#include + #include "water_map.h" #include "water_map_v1.h" #include "water_map_v2.h" +#include +#include +#include +#include + WaterMap* WaterMap::LoadWaterMapfile(std::string zone_name) { std::transform(zone_name.begin(), zone_name.end(), zone_name.begin(), ::tolower); From 6a6e91abc5dc761ffd1ee0c10bd75cb27cca54da Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:07:31 -0600 Subject: [PATCH 077/153] waypoints.cpp header include cleanup --- zone/waypoints.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 410e76f3f..87a0d5e7e 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -21,13 +21,14 @@ #endif #include "../common/features.h" -#include "../common/misc_functions.h" #include "../common/rulesys.h" #include "../common/string_util.h" + #include "map.h" #include "npc.h" #include "quest_parser_collection.h" #include "water_map.h" + #include #include From b5c60d8123c4ae3780db8a924a7d3b7afba6cfe0 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Mon, 15 Dec 2014 20:08:46 -0500 Subject: [PATCH 078/153] Bot compile fix --- zone/attack.cpp | 4 ++++ zone/client_packet.cpp | 4 ++++ zone/entity.cpp | 4 ++++ zone/exp.cpp | 4 ++++ zone/mob.cpp | 4 ++++ zone/spells.cpp | 4 ++++ zone/zoning.cpp | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/zone/attack.cpp b/zone/attack.cpp index 68e088b02..4661a83e3 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -38,6 +38,10 @@ #include #include +#ifdef BOTS +#include "bot.h" +#endif + extern QueryServ* QServ; extern WorldServer worldserver; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index f0528501a..be7d559e5 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -58,6 +58,10 @@ #include "worldserver.h" #include "zone.h" +#ifdef BOTS +#include "bot.h" +#endif + extern QueryServ* QServ; extern Zone* zone; extern volatile bool ZoneLoaded; diff --git a/zone/entity.cpp b/zone/entity.cpp index fa029dd0f..369e1503a 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -46,6 +46,10 @@ #define strcasecmp _stricmp #endif +#ifdef BOTS +#include "bot.h" +#endif + extern Zone *zone; extern volatile bool ZoneLoaded; extern WorldServer worldserver; diff --git a/zone/exp.cpp b/zone/exp.cpp index c30ea1918..1aafb8a3f 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -30,6 +30,10 @@ #include "quest_parser_collection.h" #include "string_ids.h" +#ifdef BOTS +#include "bot.h" +#endif + extern QueryServ* QServ; diff --git a/zone/mob.cpp b/zone/mob.cpp index 73e356efb..e497ed05e 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -27,6 +27,10 @@ #include #include +#ifdef BOTS +#include "bot.h" +#endif + extern EntityList entity_list; extern Zone* zone; diff --git a/zone/spells.cpp b/zone/spells.cpp index baae446c8..01f2f4209 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -89,6 +89,10 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) #include "../common/packet_dump_file.h" #endif +#ifdef BOTS +#include "bot.h" +#endif + extern Zone* zone; diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 71ea65dc8..354ad2b33 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -25,6 +25,10 @@ #include "worldserver.h" #include "zone.h" +#ifdef BOTS +#include "bot.h" +#endif + extern QueryServ* QServ; extern WorldServer worldserver; extern Zone* zone; From de243cd5d719846efaa984f425468cf9f2274eb6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:12:04 -0600 Subject: [PATCH 079/153] worldserver.cpp header include cleanup --- zone/worldserver.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index d51cb0904..b0d958e7c 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -15,13 +15,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" #include #include #include #include -#include -#include #include #ifdef _WINDOWS @@ -32,25 +31,24 @@ #define strcasecmp _stricmp #endif -#include "../common/servertalk.h" -#include "worldserver.h" #include "../common/eq_packet_structs.h" -#include "../common/packet_dump.h" #include "../common/misc_functions.h" -#include "zonedb.h" -#include "zone.h" +#include "../common/rulesys.h" +#include "../common/servertalk.h" + +#include "client.h" +#include "corpse.h" #include "entity.h" -#include "masterentity.h" +#include "guild_mgr.h" +#include "mob.h" #include "net.h" #include "petitions.h" -#include "../common/packet_functions.h" -#include "../common/md5.h" -#include "zone_config.h" +#include "raids.h" #include "string_ids.h" -#include "guild_mgr.h" -#include "../common/rulesys.h" #include "titles.h" -#include "qglobals.h" +#include "worldserver.h" +#include "zone.h" +#include "zone_config.h" extern EntityList entity_list; From c646a6c43a50a10d2d2269fdcd69b08f13a0165b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:14:41 -0600 Subject: [PATCH 080/153] zone.cpp & .h include header cleanup --- zone/zone.cpp | 3 ++- zone/zone.h | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/zone/zone.cpp b/zone/zone.cpp index 257d8e5a7..49e7a7dee 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -35,6 +35,7 @@ #include "../common/rulesys.h" #include "../common/seperator.h" #include "../common/string_util.h" + #include "client_logs.h" #include "guild_mgr.h" #include "map.h" @@ -48,8 +49,8 @@ #include "spawngroup.h" #include "water_map.h" #include "worldserver.h" -#include "zone_config.h" #include "zone.h" +#include "zone_config.h" #ifdef _WINDOWS #define snprintf _snprintf diff --git a/zone/zone.h b/zone/zone.h index 40c3a8d11..bbf273069 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -67,10 +67,14 @@ struct item_tick_struct { std::string qglobal; }; +class Client; class Map; -class WaterMap; +class Mob; class PathManager; +class WaterMap; extern EntityList entity_list; +struct NPCType; +struct ServerZoneIncommingClient_Struct; class Zone { From def95b65842e6653871d9e22491098d59a0966cb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:16:53 -0600 Subject: [PATCH 081/153] zone_config structure clean --- zone/zone_config.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zone/zone_config.cpp b/zone/zone_config.cpp index 3775f1e4b..21c396fd5 100644 --- a/zone/zone_config.cpp +++ b/zone/zone_config.cpp @@ -15,8 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" + #include "zone_config.h" -ZoneConfig *ZoneConfig::_zone_config = nullptr; - +ZoneConfig *ZoneConfig::_zone_config = nullptr; \ No newline at end of file From 7f1ba17894eb729742f8dc0cb270c2e931a5b5c7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:17:07 -0600 Subject: [PATCH 082/153] zone_logsys structure clean --- zone/zone_logsys.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zone/zone_logsys.cpp b/zone/zone_logsys.cpp index 59b4755dc..c9ea6255d 100644 --- a/zone/zone_logsys.cpp +++ b/zone/zone_logsys.cpp @@ -19,9 +19,10 @@ #include "../common/debug.h" #include "../common/logsys.h" #include "../common/base_packet.h" + #include "mob.h" + #include -#include void log_message_mob(LogType type, Mob *who, const char *fmt, ...) { if(!who->IsLoggingEnabled()) From a3a1f0571808374771bc42b8be5a6930ffec3d23 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:17:31 -0600 Subject: [PATCH 083/153] zonedb and zoning header spacing --- zone/zonedb.cpp | 3 +++ zone/zoning.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index b56bd9a1b..deff17e91 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1,14 +1,17 @@ + #include "../common/extprofile.h" #include "../common/item.h" #include "../common/rulesys.h" #include "../common/string_util.h" + #include "client.h" #include "corpse.h" #include "groups.h" #include "merc.h" #include "zone.h" #include "zonedb.h" + #include #include diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 354ad2b33..55d4d3366 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -19,6 +19,7 @@ #include "../common/debug.h" #include "../common/rulesys.h" #include "../common/string_util.h" + #include "queryserv.h" #include "quest_parser_collection.h" #include "string_ids.h" From 53b9f8d0fd8b7880728444f9a374b70ae9c1d04e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:30:18 -0600 Subject: [PATCH 084/153] base_packet.cpp & .h header cleanup --- common/base_packet.cpp | 3 +-- common/base_packet.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/common/base_packet.cpp b/common/base_packet.cpp index 44b3643b5..e871ea71f 100644 --- a/common/base_packet.cpp +++ b/common/base_packet.cpp @@ -15,13 +15,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "debug.h" #include "base_packet.h" #include "misc.h" #include "packet_dump.h" - - BasePacket::BasePacket(const unsigned char *buf, uint32 len) { this->pBuffer=nullptr; diff --git a/common/base_packet.h b/common/base_packet.h index 4952e29d2..facd98809 100644 --- a/common/base_packet.h +++ b/common/base_packet.h @@ -21,7 +21,6 @@ #include "types.h" #include #include -#include #ifdef WIN32 #include From 00d145199b3089cea5eadf211b234f2a48da002c Mon Sep 17 00:00:00 2001 From: Trevius Date: Mon, 15 Dec 2014 19:34:42 -0600 Subject: [PATCH 085/153] Corrected check in db_update_manifest.txt --- utils/sql/db_update_manifest.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 19246c290..54c82c8d9 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -315,7 +315,7 @@ 9059|2014_12_01_mercs_table_update.sql|SHOW COLUMNS FROM `mercs` LIKE 'MercSize'|empty| 9060|2014_12_09_items_table_update.sql|SHOW COLUMNS FROM `items` LIKE 'herosforgemodel'|empty| 9061|2014_12_11_inventory_table_update.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornament_hero_model'|empty| -9062|2014_12_15_multiple_table_updates.sql|SHOW COLUMNS FROM `inventory` LIKE 'augslot6type'|empty| +9062|2014_12_15_multiple_table_updates.sql|SHOW COLUMNS FROM `items` LIKE 'augslot6type'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not From 3edda155c69f5ab3dfce6ee448807363310dddd5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:47:08 -0600 Subject: [PATCH 086/153] Linux build fix --- zone/waypoints.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 87a0d5e7e..e2604a3af 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -23,6 +23,7 @@ #include "../common/features.h" #include "../common/rulesys.h" #include "../common/string_util.h" +#include "../common/misc_functions.h" #include "map.h" #include "npc.h" From 5af34a92454d3c1e11132f9574431d1fdbc017d9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:49:12 -0600 Subject: [PATCH 087/153] classes.cpp header include cleanup --- common/classes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/classes.cpp b/common/classes.cpp index f33d0354a..6270656f4 100644 --- a/common/classes.cpp +++ b/common/classes.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + */ #include "../common/debug.h" #include "../common/classes.h" From e5f300baaffe3d107955dc7429a8a110b37d2270 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 19:49:49 -0600 Subject: [PATCH 088/153] condition.cpp header include cleanup --- common/condition.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/condition.cpp b/common/condition.cpp index 2dc90b26d..334ce5d45 100644 --- a/common/condition.cpp +++ b/common/condition.cpp @@ -16,7 +16,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" #include "condition.h" #ifdef _WINDOWS From b1623cf696cacf36b7823eaf64c523146cea9f09 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 20:02:55 -0600 Subject: [PATCH 089/153] database.cpp & .h header include cleanup and forward declaration --- common/database.cpp | 6 +++--- common/database.h | 23 ++--------------------- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 80ff355d7..3de2a308b 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -15,13 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" #include "../common/rulesys.h" -#include + #include #include #include -#include #include #include #include @@ -42,8 +42,8 @@ #include "database.h" #include "eq_packet_structs.h" -#include "string_util.h" #include "extprofile.h" +#include "string_util.h" extern Client client; diff --git a/common/database.h b/common/database.h index 8f5d7430c..1cfb88e71 100644 --- a/common/database.h +++ b/common/database.h @@ -33,23 +33,9 @@ //atoi is not uint32 or uint32 safe!!!! #define atoul(str) strtoul(str, nullptr, 10) -//class Spawn; -class Corpse; -class Spawn2; -class NPC; -class SpawnGroupList; -class Petition; -class Client; -class Merc; -class MySQLRequestResult; -struct Combine_Struct; -//struct Faction; -//struct FactionMods; -//struct FactionValue; -struct ZonePoint; -struct NPCType; class Inventory; -class ItemInst; +class MySQLRequestResult; +class Client; struct EventLogDetails_Struct { uint32 id; @@ -81,11 +67,6 @@ struct VarCache_Struct { char value[0]; }; -struct PlayerProfile_Struct; -struct GuildRankLevel_Struct; -struct GuildRanks_Struct; -struct ExtendedProfile_Struct; -struct GuildMember_Struct; class PTimerList; #pragma pack(1) From 359bbb8df1461f6bea1847c5e49f42bf4976a51c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 20:04:49 -0600 Subject: [PATCH 090/153] dbcore.cpp * .h header include cleanup --- common/dbcore.cpp | 12 +++++------- common/dbcore.h | 11 ++++------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/common/dbcore.cpp b/common/dbcore.cpp index 84d2528f0..7570fd01e 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -1,18 +1,16 @@ -#include "../common/debug.h" - #ifdef _WINDOWS #include #endif +#include "../common/misc_functions.h" + +#include "dbcore.h" + +#include #include #include -#include #include -#include -#include "dbcore.h" #include -#include "../common/misc_functions.h" -#include #ifdef _WINDOWS #define snprintf _snprintf diff --git a/common/dbcore.h b/common/dbcore.h index 0cdceb61b..b23d58a9e 100644 --- a/common/dbcore.h +++ b/common/dbcore.h @@ -6,15 +6,12 @@ #include #endif +#include "../common/mutex.h" +#include "../common/mysql_request_result.h" +#include "../common/types.h" + #include #include -#include "../common/types.h" -#include "../common/mutex.h" -#include "../common/linked_list.h" -#include "../common/queue.h" -#include "../common/timer.h" -#include "../common/condition.h" -#include "../common/mysql_request_result.h" class DBcore { public: From 41f6349804a2f5304f7e8c827813f4809a4b7203 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 20:09:36 -0600 Subject: [PATCH 091/153] linux build fix --- common/database.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/database.h b/common/database.h index 1cfb88e71..5be342482 100644 --- a/common/database.h +++ b/common/database.h @@ -26,6 +26,8 @@ #include "dbcore.h" #include "linked_list.h" #include "eq_packet_structs.h" + +#include #include #include #include From 677c6b57502140a0c3aa76323f7839dfa6559660 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 20:21:54 -0600 Subject: [PATCH 092/153] emu_tcp_connection.cpp & .h include header cleanup and forward declare --- common/emu_tcp_connection.cpp | 3 --- common/emu_tcp_connection.h | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/common/emu_tcp_connection.cpp b/common/emu_tcp_connection.cpp index 41a39d3ab..805b4b333 100644 --- a/common/emu_tcp_connection.cpp +++ b/common/emu_tcp_connection.cpp @@ -27,13 +27,10 @@ tremendously. #include #include -#include -#include #include "emu_tcp_connection.h" #include "emu_tcp_server.h" #include "../common/servertalk.h" -#include "../common/packet_dump.h" #ifdef FREEBSD //Timothy Whitman - January 7, 2003 #define MSG_NOSIGNAL 0 diff --git a/common/emu_tcp_connection.h b/common/emu_tcp_connection.h index c7d88965d..7f4d0710b 100644 --- a/common/emu_tcp_connection.h +++ b/common/emu_tcp_connection.h @@ -26,6 +26,7 @@ struct SPackSendQueue; class EmuTCPServer; +class ServerPacket; class EmuTCPConnection : public TCPConnection { public: From 1a6a50c81006e1b8029ba992ad38a8beb412dff0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 20:24:38 -0600 Subject: [PATCH 093/153] eq_packet.cpp & .h header include cleanup --- common/eq_packet.cpp | 11 +++++++---- common/eq_packet.h | 5 ----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/common/eq_packet.cpp b/common/eq_packet.cpp index 3ea622040..60d892c23 100644 --- a/common/eq_packet.cpp +++ b/common/eq_packet.cpp @@ -15,18 +15,21 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "crc16.h" #include "debug.h" -#include -#include -#include #include "eq_packet.h" #include "misc.h" #include "op_codes.h" -#include "crc16.h" #include "platform.h" +#include +#include +#include + #ifndef STATIC_OPCODE #include "opcodemgr.h" #endif + #include "packet_dump.h" #include "packet_functions.h" #include diff --git a/common/eq_packet.h b/common/eq_packet.h index 04418f733..dcd3747a0 100644 --- a/common/eq_packet.h +++ b/common/eq_packet.h @@ -19,8 +19,6 @@ #define _EQPACKET_H #include "base_packet.h" -#include "eq_stream_type.h" -#include "op_codes.h" #include "platform.h" #ifdef STATIC_OPCODE @@ -30,9 +28,6 @@ #include "emu_opcodes.h" #endif -class EQStream; -class EQStreamPair; - class EQPacket : public BasePacket { friend class EQStream; public: From 5e31b8f96e818ccf8ec9b1bbaf9a41026bed26de Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 20:28:27 -0600 Subject: [PATCH 094/153] eq_stream.cpp & .h include header cleanup --- common/eq_stream.cpp | 3 --- common/eq_stream.h | 17 ++++++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 7b69decc2..879d57664 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -19,15 +19,12 @@ #include "debug.h" #include "eq_packet.h" #include "eq_stream.h" -#include "misc.h" -#include "mutex.h" #include "op_codes.h" #include "crc16.h" #include "platform.h" #include #include -#include #include #include diff --git a/common/eq_stream.h b/common/eq_stream.h index 5a637c46e..ee797021f 100644 --- a/common/eq_stream.h +++ b/common/eq_stream.h @@ -1,22 +1,26 @@ #ifndef _EQSTREAM_H #define _EQSTREAM_H -#include #include #include #include #include + #ifndef WIN32 #include #endif -#include "eq_stream_type.h" + +#include "../common/misc.h" +#include "../common/opcodemgr.h" +#include "../common/timer.h" + #include "eq_packet.h" #include "eq_stream_intf.h" +#include "eq_stream_type.h" #include "mutex.h" -#include "../common/opcodemgr.h" -#include "../common/misc.h" -#include "../common/condition.h" -#include "../common/timer.h" + +class EQApplicationPacket; +class EQProtocolPacket; #define FLAG_COMPRESSED 0x01 #define FLAG_ENCODED 0x04 @@ -78,7 +82,6 @@ struct SessionStats { #pragma pack() class OpcodeManager; -class EQStreamPair; class EQRawApplicationPacket; class EQStream : public EQStreamInterface { From 968b0adc1d747b266350029c984375722c9fc87f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 20:30:53 -0600 Subject: [PATCH 095/153] eq_stream_factory.cpp & .h header include cleanup/forward declare --- common/eq_stream_factory.cpp | 6 +++--- common/eq_stream_factory.h | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 12828b28c..5f76a28ee 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -1,5 +1,6 @@ #include "debug.h" #include "eq_stream_factory.h" + #ifdef _WINDOWS #include #include @@ -13,11 +14,10 @@ #include #include #endif -#include + #include + #include "op_codes.h" -#include "eq_stream.h" -#include "logsys.h" ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs) { diff --git a/common/eq_stream_factory.h b/common/eq_stream_factory.h index 7aa5d66ac..58fddaa40 100644 --- a/common/eq_stream_factory.h +++ b/common/eq_stream_factory.h @@ -4,11 +4,13 @@ #include #include + #include "../common/eq_stream.h" #include "../common/condition.h" #include "../common/timeoutmgr.h" -#include "../common/opcodemgr.h" -#include "../common/timer.h" + +class EQStream; +class Timer; class EQStreamFactory : private Timeoutable { private: From e048c5cf17f707971e08c52d0bbb1d5e99428941 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 20:32:03 -0600 Subject: [PATCH 096/153] eq_stream_ident.h header include cleanup --- common/eq_stream_ident.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/eq_stream_ident.h b/common/eq_stream_ident.h index c038daf26..2020c85cf 100644 --- a/common/eq_stream_ident.h +++ b/common/eq_stream_ident.h @@ -4,13 +4,13 @@ #include "eq_stream.h" #include "timer.h" #include -#include #include #define STREAM_IDENT_WAIT_MS 10000 class OpcodeManager; class StructStrategy; +class EQStreamInterface; class EQStreamIdentifier { public: From bbea7f4f53093342788c447e1263dbe53153a115 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 21:01:52 -0600 Subject: [PATCH 097/153] eqemu_config.cpp & .h header cleanup, code style cleanup of eqemu_config.h --- common/eqemu_config.cpp | 2 + common/eqemu_config.h | 328 ++++++++++++++++++++-------------------- 2 files changed, 162 insertions(+), 168 deletions(-) diff --git a/common/eqemu_config.cpp b/common/eqemu_config.cpp index 165b0786f..abeac70c5 100644 --- a/common/eqemu_config.cpp +++ b/common/eqemu_config.cpp @@ -15,9 +15,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" #include "eqemu_config.h" #include "misc_functions.h" + #include #include diff --git a/common/eqemu_config.h b/common/eqemu_config.h index 9fa21bea6..908d66aa1 100644 --- a/common/eqemu_config.h +++ b/common/eqemu_config.h @@ -1,4 +1,4 @@ -/* EQEMu: Everquest Server Emulator +/* EQEMu: Everquest Server Emulator Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify @@ -28,200 +28,192 @@ struct LoginConfig { uint16 LoginPort; }; -class EQEmuConfig : public XMLParser { -public: - virtual std::string GetByName(const std::string &var_name) const; +class EQEmuConfig : public XMLParser +{ + public: + virtual std::string GetByName(const std::string &var_name) const; - // From - std::string ShortName; - std::string LongName; - std::string WorldAddress; - std::string LocalAddress; - std::string LoginHost; - std::string LoginAccount; - std::string LoginPassword; - uint16 LoginPort; - uint32 LoginCount; - LinkedList loginlist; - bool Locked; - uint16 WorldTCPPort; - std::string WorldIP; - bool TelnetEnabled; - int32 MaxClients; - bool WorldHTTPEnabled; - uint16 WorldHTTPPort; - std::string WorldHTTPMimeFile; - std::string SharedKey; + // From + std::string ShortName; + std::string LongName; + std::string WorldAddress; + std::string LocalAddress; + std::string LoginHost; + std::string LoginAccount; + std::string LoginPassword; + uint16 LoginPort; + uint32 LoginCount; + LinkedList loginlist; + bool Locked; + uint16 WorldTCPPort; + std::string WorldIP; + bool TelnetEnabled; + int32 MaxClients; + bool WorldHTTPEnabled; + uint16 WorldHTTPPort; + std::string WorldHTTPMimeFile; + std::string SharedKey; - // From - std::string ChatHost; - uint16 ChatPort; + // From + std::string ChatHost; + uint16 ChatPort; - // From - std::string MailHost; - uint16 MailPort; + // From + std::string MailHost; + uint16 MailPort; - // From - std::string DatabaseHost; - std::string DatabaseUsername; - std::string DatabasePassword; - std::string DatabaseDB; - uint16 DatabasePort; + // From + std::string DatabaseHost; + std::string DatabaseUsername; + std::string DatabasePassword; + std::string DatabaseDB; + uint16 DatabasePort; - // From // QueryServ - std::string QSDatabaseHost; - std::string QSDatabaseUsername; - std::string QSDatabasePassword; - std::string QSDatabaseDB; - uint16 QSDatabasePort; + // From // QueryServ + std::string QSDatabaseHost; + std::string QSDatabaseUsername; + std::string QSDatabasePassword; + std::string QSDatabaseDB; + uint16 QSDatabasePort; - // From - std::string SpellsFile; - std::string OpCodesFile; - std::string EQTimeFile; - std::string LogSettingsFile; + // From + std::string SpellsFile; + std::string OpCodesFile; + std::string EQTimeFile; + std::string LogSettingsFile; - // From - std::string MapDir; - std::string QuestDir; - std::string PluginDir; + // From + std::string MapDir; + std::string QuestDir; + std::string PluginDir; - // From - std::string LogPrefix; - std::string LogSuffix; - std::string ZoneExe; - uint32 RestartWait; - uint32 TerminateWait; - uint32 InitialBootWait; - uint32 ZoneBootInterval; + // From + std::string LogPrefix; + std::string LogSuffix; + std::string ZoneExe; + uint32 RestartWait; + uint32 TerminateWait; + uint32 InitialBootWait; + uint32 ZoneBootInterval; - // From - uint16 ZonePortLow; - uint16 ZonePortHigh; - uint8 DefaultStatus; + // From + uint16 ZonePortLow; + uint16 ZonePortHigh; + uint8 DefaultStatus; // uint16 DynamicCount; // map StaticZones; -protected: + protected: - static EQEmuConfig *_config; + static EQEmuConfig *_config; - static std::string ConfigFile; + static std::string ConfigFile; #define ELEMENT(name) \ void do_##name(TiXmlElement *ele); - #include "eqemu_config_elements.h" +#include "eqemu_config_elements.h" - EQEmuConfig() { - // import the needed handler prototypes + EQEmuConfig() + { + // import the needed handler prototypes #define ELEMENT(name) \ - Handlers[#name]=(ElementHandler)&EQEmuConfig::do_##name; - #include "eqemu_config_elements.h" + Handlers[#name]=(ElementHandler)&EQEmuConfig::do_##name; +#include "eqemu_config_elements.h" + // Set sane defaults + // Login server + LoginHost = "eqemulator.net"; + LoginPort = 5998; + // World + Locked = false; + WorldTCPPort = 9000; + TelnetEnabled = false; + WorldHTTPEnabled = false; + WorldHTTPPort = 9080; + WorldHTTPMimeFile = "mime.types"; + SharedKey = ""; //blank disables authentication + // Mail + ChatHost = "eqchat.eqemulator.net"; + ChatPort = 7778; + // Mail + MailHost = "eqmail.eqemulator.net"; + MailPort = 7779; + // Mysql + DatabaseHost = "localhost"; + DatabasePort = 3306; + DatabaseUsername = "eq"; + DatabasePassword = "eq"; + DatabaseDB = "eq"; + // QueryServ Database + QSDatabaseHost = "localhost"; + QSDatabasePort = 3306; + QSDatabaseUsername = "eq"; + QSDatabasePassword = "eq"; + QSDatabaseDB = "eq"; + // Files + SpellsFile = "spells_us.txt"; + OpCodesFile = "opcodes.conf"; + EQTimeFile = "eqtime.cfg"; + LogSettingsFile = "log.ini"; + // Dirs + MapDir = "Maps"; + QuestDir = "quests"; + PluginDir = "plugins"; + // Launcher + LogPrefix = "logs/zone-"; + LogSuffix = ".log"; + RestartWait = 10000; //milliseconds + TerminateWait = 10000; //milliseconds + InitialBootWait = 20000; //milliseconds + ZoneBootInterval = 2000; //milliseconds + #ifdef WIN32 + ZoneExe = "zone.exe"; + #else + ZoneExe = "./zone"; + #endif + // Zones + ZonePortLow = 7000; + ZonePortHigh = 7999; + DefaultStatus = 0; + // For where zones need to connect to. + WorldIP = "127.0.0.1"; + // Dynamics to start + //DynamicCount=5; + MaxClients = -1; + LoginCount = 0; + } + virtual ~EQEmuConfig() {} - // Set sane defaults + public: - // Login server - LoginHost="eqemulator.net"; - LoginPort=5998; + // Produce a const singleton + static const EQEmuConfig *get() + { + if (_config == nullptr) { + LoadConfig(); + } + return (_config); + } - // World - Locked=false; - WorldTCPPort=9000; - TelnetEnabled=false; - WorldHTTPEnabled=false; - WorldHTTPPort=9080; - WorldHTTPMimeFile="mime.types"; - SharedKey = ""; //blank disables authentication + // Allow the use to set the conf file to be used. + static void SetConfigFile(std::string file) + { + EQEmuConfig::ConfigFile = file; + } - // Mail - ChatHost="eqchat.eqemulator.net"; - ChatPort=7778; + // Load the config + static bool LoadConfig() + { + if (_config != nullptr) { + delete _config; + } + _config = new EQEmuConfig; + return _config->ParseFile(EQEmuConfig::ConfigFile.c_str(), "server"); + } - // Mail - MailHost="eqmail.eqemulator.net"; - MailPort=7779; - - // Mysql - DatabaseHost="localhost"; - DatabasePort=3306; - DatabaseUsername="eq"; - DatabasePassword="eq"; - DatabaseDB="eq"; - - // QueryServ Database - QSDatabaseHost="localhost"; - QSDatabasePort=3306; - QSDatabaseUsername="eq"; - QSDatabasePassword="eq"; - QSDatabaseDB="eq"; - - // Files - SpellsFile="spells_us.txt"; - OpCodesFile="opcodes.conf"; - EQTimeFile="eqtime.cfg"; - LogSettingsFile="log.ini"; - - // Dirs - MapDir="Maps"; - QuestDir="quests"; - PluginDir="plugins"; - - // Launcher - LogPrefix = "logs/zone-"; - LogSuffix = ".log"; - RestartWait = 10000; //milliseconds - TerminateWait = 10000; //milliseconds - InitialBootWait = 20000; //milliseconds - ZoneBootInterval = 2000; //milliseconds -#ifdef WIN32 - ZoneExe = "zone.exe"; -#else - ZoneExe = "./zone"; -#endif - - // Zones - ZonePortLow=7000; - ZonePortHigh=7999; - DefaultStatus=0; - - // For where zones need to connect to. - WorldIP="127.0.0.1"; - - // Dynamics to start - //DynamicCount=5; - - MaxClients=-1; - - LoginCount=0; - - } - virtual ~EQEmuConfig() {} - -public: - - // Produce a const singleton - static const EQEmuConfig *get() { - if (_config == nullptr) - LoadConfig(); - return(_config); - } - - // Allow the use to set the conf file to be used. - static void SetConfigFile(std::string file) { EQEmuConfig::ConfigFile = file; } - - // Load the config - static bool LoadConfig() { - if (_config != nullptr) - delete _config; - _config=new EQEmuConfig; - - return _config->ParseFile(EQEmuConfig::ConfigFile.c_str(),"server"); - } - - void Dump() const; + void Dump() const; }; #endif From 6f747c3678d66f44472c304c7c6ac62ebfed262a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 21:03:09 -0600 Subject: [PATCH 098/153] eqemu_config.cpp code structure cleanup --- common/eqemu_config.cpp | 631 +++++++++++++++++++++------------------- 1 file changed, 338 insertions(+), 293 deletions(-) diff --git a/common/eqemu_config.cpp b/common/eqemu_config.cpp index abeac70c5..2fe10ee9d 100644 --- a/common/eqemu_config.cpp +++ b/common/eqemu_config.cpp @@ -1,4 +1,4 @@ -/* EQEMu: Everquest Server Emulator +/* EQEMu: Everquest Server Emulator Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify @@ -26,53 +26,54 @@ std::string EQEmuConfig::ConfigFile = "eqemu_config.xml"; EQEmuConfig *EQEmuConfig::_config = nullptr; -void EQEmuConfig::do_world(TiXmlElement *ele) { +void EQEmuConfig::do_world(TiXmlElement *ele) +{ const char *text; TiXmlElement * sub_ele;; - - text= ParseTextBlock(ele,"shortname"); - if (text) - ShortName=text; - - text = ParseTextBlock(ele,"longname"); - if (text) - LongName=text; - - text = ParseTextBlock(ele,"address",true); - if (text) - WorldAddress=text; - - text = ParseTextBlock(ele,"localaddress",true); - if (text) - LocalAddress=text; - - text = ParseTextBlock(ele,"maxclients",true); - if (text) - MaxClients=atoi(text); - + text = ParseTextBlock(ele, "shortname"); + if (text) { + ShortName = text; + } + text = ParseTextBlock(ele, "longname"); + if (text) { + LongName = text; + } + text = ParseTextBlock(ele, "address", true); + if (text) { + WorldAddress = text; + } + text = ParseTextBlock(ele, "localaddress", true); + if (text) { + LocalAddress = text; + } + text = ParseTextBlock(ele, "maxclients", true); + if (text) { + MaxClients = atoi(text); + } // Get the element - text = ParseTextBlock(ele,"key",true); - if (text) - SharedKey=text; - + text = ParseTextBlock(ele, "key", true); + if (text) { + SharedKey = text; + } // Get the element sub_ele = ele->FirstChildElement("loginserver"); if (sub_ele) { - text=ParseTextBlock(sub_ele,"host",true); - if (text) - LoginHost=text; - - text=ParseTextBlock(sub_ele,"port",true); - if (text) - LoginPort=atoi(text); - - text=ParseTextBlock(sub_ele,"account",true); - if (text) - LoginAccount=text; - - text=ParseTextBlock(sub_ele,"password",true); - if (text) - LoginPassword=text; + text = ParseTextBlock(sub_ele, "host", true); + if (text) { + LoginHost = text; + } + text = ParseTextBlock(sub_ele, "port", true); + if (text) { + LoginPort = atoi(text); + } + text = ParseTextBlock(sub_ele, "account", true); + if (text) { + LoginAccount = text; + } + text = ParseTextBlock(sub_ele, "password", true); + if (text) { + LoginPassword = text; + } } else { char str[32]; do { @@ -80,329 +81,373 @@ void EQEmuConfig::do_world(TiXmlElement *ele) { sub_ele = ele->FirstChildElement(str); if (sub_ele) { LoginConfig* loginconfig = new LoginConfig; - text=ParseTextBlock(sub_ele,"host",true); - if (text) - loginconfig->LoginHost=text; - - text=ParseTextBlock(sub_ele,"port",true); - if (text) - loginconfig->LoginPort=atoi(text); - - text=ParseTextBlock(sub_ele,"account",true); - if (text) - loginconfig->LoginAccount=text; - - text=ParseTextBlock(sub_ele,"password",true); - if (text) - loginconfig->LoginPassword=text; + text = ParseTextBlock(sub_ele, "host", true); + if (text) { + loginconfig->LoginHost = text; + } + text = ParseTextBlock(sub_ele, "port", true); + if (text) { + loginconfig->LoginPort = atoi(text); + } + text = ParseTextBlock(sub_ele, "account", true); + if (text) { + loginconfig->LoginAccount = text; + } + text = ParseTextBlock(sub_ele, "password", true); + if (text) { + loginconfig->LoginPassword = text; + } loginlist.Insert(loginconfig); } - } while(sub_ele); + } while (sub_ele); } - // Check for locked sub_ele = ele->FirstChildElement("locked"); - if (sub_ele != nullptr) - Locked=true; - + if (sub_ele != nullptr) { + Locked = true; + } // Get the element sub_ele = ele->FirstChildElement("tcp"); - if(sub_ele != nullptr) { - + if (sub_ele != nullptr) { text = sub_ele->Attribute("ip"); - if (text) - WorldIP=text; - + if (text) { + WorldIP = text; + } text = sub_ele->Attribute("port"); - if (text) - WorldTCPPort=atoi(text); - + if (text) { + WorldTCPPort = atoi(text); + } text = sub_ele->Attribute("telnet"); - if (text && !strcasecmp(text,"enabled")) - TelnetEnabled=true; - + if (text && !strcasecmp(text, "enabled")) { + TelnetEnabled = true; + } } - // Get the element sub_ele = ele->FirstChildElement("http"); - if(sub_ele != nullptr) { - + if (sub_ele != nullptr) { // text = sub_ele->Attribute("ip"); // if (text) // WorldIP=text; - text = sub_ele->Attribute("mimefile"); - if (text) - WorldHTTPMimeFile=text; - + if (text) { + WorldHTTPMimeFile = text; + } text = sub_ele->Attribute("port"); - if (text) - WorldHTTPPort=atoi(text); - + if (text) { + WorldHTTPPort = atoi(text); + } text = sub_ele->Attribute("enabled"); - if (text && !strcasecmp(text,"true")) - WorldHTTPEnabled=true; - + if (text && !strcasecmp(text, "true")) { + WorldHTTPEnabled = true; + } } } -void EQEmuConfig::do_chatserver(TiXmlElement *ele) { +void EQEmuConfig::do_chatserver(TiXmlElement *ele) +{ const char *text; - - text=ParseTextBlock(ele,"host",true); - if (text) - ChatHost=text; - - text=ParseTextBlock(ele,"port",true); - if (text) - ChatPort=atoi(text); + text = ParseTextBlock(ele, "host", true); + if (text) { + ChatHost = text; + } + text = ParseTextBlock(ele, "port", true); + if (text) { + ChatPort = atoi(text); + } } -void EQEmuConfig::do_mailserver(TiXmlElement *ele) { +void EQEmuConfig::do_mailserver(TiXmlElement *ele) +{ const char *text; - - text=ParseTextBlock(ele,"host",true); - if (text) - MailHost=text; - - text=ParseTextBlock(ele,"port",true); - if (text) - MailPort=atoi(text); + text = ParseTextBlock(ele, "host", true); + if (text) { + MailHost = text; + } + text = ParseTextBlock(ele, "port", true); + if (text) { + MailPort = atoi(text); + } } -void EQEmuConfig::do_database(TiXmlElement *ele) { +void EQEmuConfig::do_database(TiXmlElement *ele) +{ const char *text; - - text=ParseTextBlock(ele,"host",true); - if (text) - DatabaseHost=text; - - text=ParseTextBlock(ele,"port",true); - if (text) - DatabasePort=atoi(text); - - text=ParseTextBlock(ele,"username",true); - if (text) - DatabaseUsername=text; - - text=ParseTextBlock(ele,"password",true); - if (text) - DatabasePassword=text; - - text=ParseTextBlock(ele,"db",true); - if (text) - DatabaseDB=text; + text = ParseTextBlock(ele, "host", true); + if (text) { + DatabaseHost = text; + } + text = ParseTextBlock(ele, "port", true); + if (text) { + DatabasePort = atoi(text); + } + text = ParseTextBlock(ele, "username", true); + if (text) { + DatabaseUsername = text; + } + text = ParseTextBlock(ele, "password", true); + if (text) { + DatabasePassword = text; + } + text = ParseTextBlock(ele, "db", true); + if (text) { + DatabaseDB = text; + } } -void EQEmuConfig::do_qsdatabase(TiXmlElement *ele) { +void EQEmuConfig::do_qsdatabase(TiXmlElement *ele) +{ const char *text; - - text=ParseTextBlock(ele,"host",true); - if (text) - QSDatabaseHost=text; - - text=ParseTextBlock(ele,"port",true); - if (text) - QSDatabasePort=atoi(text); - - text=ParseTextBlock(ele,"username",true); - if (text) - QSDatabaseUsername=text; - - text=ParseTextBlock(ele,"password",true); - if (text) - QSDatabasePassword=text; - - text=ParseTextBlock(ele,"db",true); - if (text) - QSDatabaseDB=text; + text = ParseTextBlock(ele, "host", true); + if (text) { + QSDatabaseHost = text; + } + text = ParseTextBlock(ele, "port", true); + if (text) { + QSDatabasePort = atoi(text); + } + text = ParseTextBlock(ele, "username", true); + if (text) { + QSDatabaseUsername = text; + } + text = ParseTextBlock(ele, "password", true); + if (text) { + QSDatabasePassword = text; + } + text = ParseTextBlock(ele, "db", true); + if (text) { + QSDatabaseDB = text; + } } -void EQEmuConfig::do_zones(TiXmlElement *ele) { +void EQEmuConfig::do_zones(TiXmlElement *ele) +{ const char *text; TiXmlElement *sub_ele; // TiXmlNode *node,*sub_node; - - text=ParseTextBlock(ele,"defaultstatus",true); - if (text) - DefaultStatus=atoi(text); - + text = ParseTextBlock(ele, "defaultstatus", true); + if (text) { + DefaultStatus = atoi(text); + } // Get the element sub_ele = ele->FirstChildElement("ports"); - if(sub_ele != nullptr) { - + if (sub_ele != nullptr) { text = sub_ele->Attribute("low"); - if (text) - ZonePortLow=atoi(text);; - + if (text) { + ZonePortLow = atoi(text); + }; text = sub_ele->Attribute("high"); - if (text) - ZonePortHigh=atoi(text); + if (text) { + ZonePortHigh = atoi(text); + } } } -void EQEmuConfig::do_files(TiXmlElement *ele) { +void EQEmuConfig::do_files(TiXmlElement *ele) +{ const char *text; - - text=ParseTextBlock(ele,"spells",true); - if (text) - SpellsFile=text; - - text=ParseTextBlock(ele,"opcodes",true); - if (text) - OpCodesFile=text; - - text=ParseTextBlock(ele,"logsettings",true); - if (text) - LogSettingsFile=text; - - text=ParseTextBlock(ele,"eqtime",true); - if (text) - EQTimeFile=text; + text = ParseTextBlock(ele, "spells", true); + if (text) { + SpellsFile = text; + } + text = ParseTextBlock(ele, "opcodes", true); + if (text) { + OpCodesFile = text; + } + text = ParseTextBlock(ele, "logsettings", true); + if (text) { + LogSettingsFile = text; + } + text = ParseTextBlock(ele, "eqtime", true); + if (text) { + EQTimeFile = text; + } } -void EQEmuConfig::do_directories(TiXmlElement *ele) { +void EQEmuConfig::do_directories(TiXmlElement *ele) +{ const char *text; - - text=ParseTextBlock(ele,"maps",true); - if (text) - MapDir=text; - - text=ParseTextBlock(ele,"quests",true); - if (text) - QuestDir=text; - - text=ParseTextBlock(ele,"plugins",true); - if (text) - PluginDir=text; - + text = ParseTextBlock(ele, "maps", true); + if (text) { + MapDir = text; + } + text = ParseTextBlock(ele, "quests", true); + if (text) { + QuestDir = text; + } + text = ParseTextBlock(ele, "plugins", true); + if (text) { + PluginDir = text; + } } -void EQEmuConfig::do_launcher(TiXmlElement *ele) { +void EQEmuConfig::do_launcher(TiXmlElement *ele) +{ const char *text; TiXmlElement *sub_ele; - - text=ParseTextBlock(ele,"logprefix",true); - if (text) + text = ParseTextBlock(ele, "logprefix", true); + if (text) { LogPrefix = text; - - text=ParseTextBlock(ele,"logsuffix",true); - if (text) + } + text = ParseTextBlock(ele, "logsuffix", true); + if (text) { LogSuffix = text; - + } // Get the element - text = ParseTextBlock(ele,"exe",true); - if (text) + text = ParseTextBlock(ele, "exe", true); + if (text) { ZoneExe = text; - + } // Get the element sub_ele = ele->FirstChildElement("timers"); - if(sub_ele != nullptr) { + if (sub_ele != nullptr) { text = sub_ele->Attribute("restart"); - if (text) + if (text) { RestartWait = atoi(text); - + } text = sub_ele->Attribute("reterminate"); - if (text) + if (text) { TerminateWait = atoi(text); - + } text = sub_ele->Attribute("initial"); - if (text) + if (text) { InitialBootWait = atoi(text); - + } text = sub_ele->Attribute("interval"); - if (text) + if (text) { ZoneBootInterval = atoi(text); + } } } -std::string EQEmuConfig::GetByName(const std::string &var_name) const { - if(var_name == "ShortName") - return(ShortName); - if(var_name == "LongName") - return(LongName); - if(var_name == "WorldAddress") - return(WorldAddress); - if(var_name == "LoginHost") - return(LoginHost); - if(var_name == "LoginAccount") - return(LoginAccount); - if(var_name == "LoginPassword") - return(LoginPassword); - if(var_name == "LoginPort") - return(itoa(LoginPort)); - if(var_name == "Locked") - return(Locked?"true":"false"); - if(var_name == "WorldTCPPort") - return(itoa(WorldTCPPort)); - if(var_name == "WorldIP") - return(WorldIP); - if(var_name == "TelnetEnabled") - return(TelnetEnabled?"true":"false"); - if(var_name == "WorldHTTPPort") - return(itoa(WorldHTTPPort)); - if(var_name == "WorldHTTPMimeFile") - return(WorldHTTPMimeFile); - if(var_name == "WorldHTTPEnabled") - return(WorldHTTPEnabled?"true":"false"); - if(var_name == "ChatHost") - return(ChatHost); - if(var_name == "ChatPort") - return(itoa(ChatPort)); - if(var_name == "MailHost") - return(MailHost); - if(var_name == "MailPort") - return(itoa(MailPort)); - if(var_name == "DatabaseHost") - return(DatabaseHost); - if(var_name == "DatabaseUsername") - return(DatabaseUsername); - if(var_name == "DatabasePassword") - return(DatabasePassword); - if(var_name == "DatabaseDB") - return(DatabaseDB); - if(var_name == "DatabasePort") - return(itoa(DatabasePort)); - if(var_name == "QSDatabaseHost") - return(QSDatabaseHost); - if(var_name == "QSDatabaseUsername") - return(QSDatabaseUsername); - if(var_name == "QSDatabasePassword") - return(QSDatabasePassword); - if(var_name == "QSDatabaseDB") - return(QSDatabaseDB); - if(var_name == "QSDatabasePort") - return(itoa(QSDatabasePort)); - if(var_name == "SpellsFile") - return(SpellsFile); - if(var_name == "OpCodesFile") - return(OpCodesFile); - if(var_name == "EQTimeFile") - return(EQTimeFile); - if(var_name == "LogSettingsFile") - return(LogSettingsFile); - if(var_name == "MapDir") - return(MapDir); - if(var_name == "QuestDir") - return(QuestDir); - if(var_name == "PluginDir") - return(PluginDir); - if(var_name == "LogPrefix") - return(LogPrefix); - if(var_name == "LogSuffix") - return(LogSuffix); - if(var_name == "ZoneExe") - return(ZoneExe); - if(var_name == "ZonePortLow") - return(itoa(ZonePortLow)); - if(var_name == "ZonePortHigh") - return(itoa(ZonePortHigh)); - if(var_name == "DefaultStatus") - return(itoa(DefaultStatus)); +std::string EQEmuConfig::GetByName(const std::string &var_name) const +{ + if (var_name == "ShortName") { + return (ShortName); + } + if (var_name == "LongName") { + return (LongName); + } + if (var_name == "WorldAddress") { + return (WorldAddress); + } + if (var_name == "LoginHost") { + return (LoginHost); + } + if (var_name == "LoginAccount") { + return (LoginAccount); + } + if (var_name == "LoginPassword") { + return (LoginPassword); + } + if (var_name == "LoginPort") { + return (itoa(LoginPort)); + } + if (var_name == "Locked") { + return (Locked ? "true" : "false"); + } + if (var_name == "WorldTCPPort") { + return (itoa(WorldTCPPort)); + } + if (var_name == "WorldIP") { + return (WorldIP); + } + if (var_name == "TelnetEnabled") { + return (TelnetEnabled ? "true" : "false"); + } + if (var_name == "WorldHTTPPort") { + return (itoa(WorldHTTPPort)); + } + if (var_name == "WorldHTTPMimeFile") { + return (WorldHTTPMimeFile); + } + if (var_name == "WorldHTTPEnabled") { + return (WorldHTTPEnabled ? "true" : "false"); + } + if (var_name == "ChatHost") { + return (ChatHost); + } + if (var_name == "ChatPort") { + return (itoa(ChatPort)); + } + if (var_name == "MailHost") { + return (MailHost); + } + if (var_name == "MailPort") { + return (itoa(MailPort)); + } + if (var_name == "DatabaseHost") { + return (DatabaseHost); + } + if (var_name == "DatabaseUsername") { + return (DatabaseUsername); + } + if (var_name == "DatabasePassword") { + return (DatabasePassword); + } + if (var_name == "DatabaseDB") { + return (DatabaseDB); + } + if (var_name == "DatabasePort") { + return (itoa(DatabasePort)); + } + if (var_name == "QSDatabaseHost") { + return (QSDatabaseHost); + } + if (var_name == "QSDatabaseUsername") { + return (QSDatabaseUsername); + } + if (var_name == "QSDatabasePassword") { + return (QSDatabasePassword); + } + if (var_name == "QSDatabaseDB") { + return (QSDatabaseDB); + } + if (var_name == "QSDatabasePort") { + return (itoa(QSDatabasePort)); + } + if (var_name == "SpellsFile") { + return (SpellsFile); + } + if (var_name == "OpCodesFile") { + return (OpCodesFile); + } + if (var_name == "EQTimeFile") { + return (EQTimeFile); + } + if (var_name == "LogSettingsFile") { + return (LogSettingsFile); + } + if (var_name == "MapDir") { + return (MapDir); + } + if (var_name == "QuestDir") { + return (QuestDir); + } + if (var_name == "PluginDir") { + return (PluginDir); + } + if (var_name == "LogPrefix") { + return (LogPrefix); + } + if (var_name == "LogSuffix") { + return (LogSuffix); + } + if (var_name == "ZoneExe") { + return (ZoneExe); + } + if (var_name == "ZonePortLow") { + return (itoa(ZonePortLow)); + } + if (var_name == "ZonePortHigh") { + return (itoa(ZonePortHigh)); + } + if (var_name == "DefaultStatus") { + return (itoa(DefaultStatus)); + } // if(var_name == "DynamicCount") // return(itoa(DynamicCount)); - return(""); + return (""); } void EQEmuConfig::Dump() const From a612f289e7c48a7c6fd85b68dba0aeacae3ac89d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 21:05:35 -0600 Subject: [PATCH 099/153] Another Linux fix --- common/eq_stream_factory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 5f76a28ee..0b940c18f 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -16,6 +16,7 @@ #endif #include +#include #include "op_codes.h" From 3d8777084cafc4bd88d33abab57af96172213e53 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 21:10:14 -0600 Subject: [PATCH 100/153] db_update_manifest.txt fix --- utils/sql/db_update_manifest.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 54c82c8d9..432d97183 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -314,7 +314,7 @@ 9058|2014_11_26_InventoryTableUpdate.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornamenticon'|empty| 9059|2014_12_01_mercs_table_update.sql|SHOW COLUMNS FROM `mercs` LIKE 'MercSize'|empty| 9060|2014_12_09_items_table_update.sql|SHOW COLUMNS FROM `items` LIKE 'herosforgemodel'|empty| -9061|2014_12_11_inventory_table_update.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornament_hero_model'|empty| +9061|2014_12_13_inventory_table_update.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornament_hero_model'|empty| 9062|2014_12_15_multiple_table_updates.sql|SHOW COLUMNS FROM `items` LIKE 'augslot6type'|empty| # Upgrade conditions: From 0c21f56ff39f8c187360ca32b2fc0702b85e3ecd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 21:57:07 -0600 Subject: [PATCH 101/153] faction.cpp & .h header include cleanup and faction.cpp code structure style change --- common/faction.cpp | 199 +++++++++++++++++++++++++-------------------- common/faction.h | 1 - 2 files changed, 113 insertions(+), 87 deletions(-) diff --git a/common/faction.cpp b/common/faction.cpp index 576971ec5..65524f623 100644 --- a/common/faction.cpp +++ b/common/faction.cpp @@ -1,4 +1,4 @@ -/* EQEMu: Everquest Server Emulator +/* EQEMu: Everquest Server Emulator Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) This program is free software; you can redistribute it and/or modify @@ -15,34 +15,35 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" + #include "faction.h" #include "races.h" -const char *FactionValueToString(FACTION_VALUE fv) { - switch(fv) { - case FACTION_ALLY: - return("Ally"); - case FACTION_WARMLY: - return("Warmly"); - case FACTION_KINDLY: - return("Kindly"); - case FACTION_AMIABLE: - return("Amiable"); - case FACTION_INDIFFERENT: - return("Indifferent"); - case FACTION_APPREHENSIVE: - return("Apprehensive"); - case FACTION_DUBIOUS: - return("Dubious"); - case FACTION_THREATENLY: - return("Threatenly"); - case FACTION_SCOWLS: - return("Scowls, ready to attack."); - default: - break; +const char *FactionValueToString(FACTION_VALUE fv) +{ + switch (fv) { + case FACTION_ALLY: + return ("Ally"); + case FACTION_WARMLY: + return ("Warmly"); + case FACTION_KINDLY: + return ("Kindly"); + case FACTION_AMIABLE: + return ("Amiable"); + case FACTION_INDIFFERENT: + return ("Indifferent"); + case FACTION_APPREHENSIVE: + return ("Apprehensive"); + case FACTION_DUBIOUS: + return ("Dubious"); + case FACTION_THREATENLY: + return ("Threatenly"); + case FACTION_SCOWLS: + return ("Scowls, ready to attack."); + default: + break; } - return("Unknown Faction Con"); + return ("Unknown Faction Con"); } @@ -55,35 +56,56 @@ const char *FactionValueToString(FACTION_VALUE fv) { FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value) { int32 character_value = tmpCharacter_value; - if (fm) + if (fm) { character_value += fm->base + fm->class_mod + fm->race_mod + fm->deity_mod; - if(character_value >= 1101) return FACTION_ALLY; - if(character_value >= 701 && character_value <= 1100) return FACTION_WARMLY; - if(character_value >= 401 && character_value <= 700) return FACTION_KINDLY; - if(character_value >= 101 && character_value <= 400) return FACTION_AMIABLE; - if(character_value >= 0 && character_value <= 100) return FACTION_INDIFFERENT; - if(character_value >= -100 && character_value <= -1) return FACTION_APPREHENSIVE; - if(character_value >= -700 && character_value <= -101) return FACTION_DUBIOUS; - if(character_value >= -999 && character_value <= -701) return FACTION_THREATENLY; - if(character_value <= -1000) return FACTION_SCOWLS; + } + if (character_value >= 1101) { + return FACTION_ALLY; + } + if (character_value >= 701 && character_value <= 1100) { + return FACTION_WARMLY; + } + if (character_value >= 401 && character_value <= 700) { + return FACTION_KINDLY; + } + if (character_value >= 101 && character_value <= 400) { + return FACTION_AMIABLE; + } + if (character_value >= 0 && character_value <= 100) { + return FACTION_INDIFFERENT; + } + if (character_value >= -100 && character_value <= -1) { + return FACTION_APPREHENSIVE; + } + if (character_value >= -700 && character_value <= -101) { + return FACTION_DUBIOUS; + } + if (character_value >= -999 && character_value <= -701) { + return FACTION_THREATENLY; + } + if (character_value <= -1000) { + return FACTION_SCOWLS; + } return FACTION_INDIFFERENT; } // this function should check if some races have more than one race define bool IsOfEqualRace(int r1, int r2) { - if (r1 == r2) + if (r1 == r2) { return true; + } // TODO: add more values - switch(r1) - { - case DARK_ELF: - if (r2 == 77) - return true; - break; - case BARBARIAN: - if (r2 == 90) - return true; + switch (r1) { + case DARK_ELF: + if (r2 == 77) { + return true; + } + break; + case BARBARIAN: + if (r2 == 90) { + return true; + } } return false; } @@ -91,50 +113,55 @@ bool IsOfEqualRace(int r1, int r2) // trolls endure ogres, dark elves, ... bool IsOfIndiffRace(int r1, int r2) { - if (r1 == r2) + if (r1 == r2) { return true; + } // TODO: add more values - switch(r1) - { - case DARK_ELF: - case OGRE: - case TROLL: - if (r2 == OGRE || r2 == TROLL || r2 == DARK_ELF) + switch (r1) { + case DARK_ELF: + case OGRE: + case TROLL: + if (r2 == OGRE || r2 == TROLL || r2 == DARK_ELF) { + return true; + } + break; + case HUMAN: + case BARBARIAN: + case HALF_ELF: + case GNOME: + case HALFLING: + case WOOD_ELF: + if (r2 == HUMAN || + r2 == BARBARIAN || + r2 == ERUDITE || + r2 == HALF_ELF || + r2 == GNOME || + r2 == HALFLING || + r2 == DWARF || + r2 == HIGH_ELF || + r2 == WOOD_ELF) { + return true; + } + break; + case ERUDITE: + if (r2 == HUMAN || r2 == HALF_ELF) { + return true; + } + break; + case DWARF: + if (r2 == HALFLING || r2 == GNOME) { + return true; + } + break; + case HIGH_ELF: + if (r2 == WOOD_ELF) { + return true; + } + break; + case VAHSHIR: return true; - break; - case HUMAN: - case BARBARIAN: - case HALF_ELF: - case GNOME: - case HALFLING: - case WOOD_ELF: - if (r2 == HUMAN || - r2 == BARBARIAN || - r2 == ERUDITE || - r2 == HALF_ELF || - r2 == GNOME || - r2 == HALFLING || - r2 == DWARF || - r2 == HIGH_ELF || - r2 == WOOD_ELF) - return true; - break; - case ERUDITE: - if (r2 == HUMAN || r2 == HALF_ELF) - return true; - break; - case DWARF: - if (r2 == HALFLING || r2 == GNOME) - return true; - break; - case HIGH_ELF: - if (r2 == WOOD_ELF) - return true; - break; - case VAHSHIR: - return true; - case IKSAR: - return false; + case IKSAR: + return false; } return false; } diff --git a/common/faction.h b/common/faction.h index c98fc0916..a455b81e6 100644 --- a/common/faction.h +++ b/common/faction.h @@ -21,7 +21,6 @@ #include "types.h" #include "features.h" #include -#include enum FACTION_VALUE { FACTION_ALLY = 1, From 20200fd028c6a6fd9632e47e6645e89f76b6ed08 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 21:59:23 -0600 Subject: [PATCH 102/153] guild_base.cpp & .h include header cleanup --- common/guild_base.cpp | 1 - common/guild_base.h | 230 ++++++++++++++++++++++-------------------- 2 files changed, 118 insertions(+), 113 deletions(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index e6df92569..06e108534 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -16,7 +16,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" #include "guild_base.h" #include "database.h" #include "logsys.h" diff --git a/common/guild_base.h b/common/guild_base.h index b59244480..bfe14205e 100644 --- a/common/guild_base.h +++ b/common/guild_base.h @@ -3,146 +3,152 @@ #include "guilds.h" #include -#include #include class Database; -class CharGuildInfo { -public: - //fields from `characer_` - uint32 char_id; - std::string char_name; - uint8 class_; - uint16 level; - uint32 time_last_on; - uint32 zone_id; +class CharGuildInfo +{ + public: + //fields from `characer_` + uint32 char_id; + std::string char_name; + uint8 class_; + uint16 level; + uint32 time_last_on; + uint32 zone_id; - //fields from `guild_members` - uint32 guild_id; - uint8 rank; - bool tribute_enable; - uint32 total_tribute; - uint32 last_tribute; //timestamp - bool banker; - bool alt; - std::string public_note; + //fields from `guild_members` + uint32 guild_id; + uint8 rank; + bool tribute_enable; + uint32 total_tribute; + uint32 last_tribute; //timestamp + bool banker; + bool alt; + std::string public_note; }; //this object holds guild functionality shared between world and zone. -class BaseGuildManager { -public: - BaseGuildManager(); - virtual ~BaseGuildManager(); +class BaseGuildManager +{ + public: + BaseGuildManager(); + virtual ~BaseGuildManager(); - //this must be called before doing anything else with this object - void SetDatabase(Database *db) { m_db = db; } + //this must be called before doing anything else with this object + void SetDatabase(Database *db) + { + m_db = db; + } - bool LoadGuilds(); - bool RefreshGuild(uint32 guild_id); + bool LoadGuilds(); + bool RefreshGuild(uint32 guild_id); - //guild edit actions. - uint32 CreateGuild(const char* name, uint32 leader_char_id); - bool DeleteGuild(uint32 guild_id); - bool RenameGuild(uint32 guild_id, const char* name); - bool SetGuildMOTD(uint32 guild_id, const char* motd, const char *setter); - bool SetGuildURL(uint32 GuildID, const char* URL); - bool SetGuildChannel(uint32 GuildID, const char* Channel); + //guild edit actions. + uint32 CreateGuild(const char* name, uint32 leader_char_id); + bool DeleteGuild(uint32 guild_id); + bool RenameGuild(uint32 guild_id, const char* name); + bool SetGuildMOTD(uint32 guild_id, const char* motd, const char *setter); + bool SetGuildURL(uint32 GuildID, const char* URL); + bool SetGuildChannel(uint32 GuildID, const char* Channel); - //character edit actions - bool SetGuildLeader(uint32 guild_id, uint32 leader_char_id); - bool SetGuild(uint32 charid, uint32 guild_id, uint8 rank); - bool SetGuildRank(uint32 charid, uint8 rank); - bool SetBankerFlag(uint32 charid, bool is_banker); - bool ForceRankUpdate(uint32 charid); - bool GetAltFlag(uint32 CharID); - bool SetAltFlag(uint32 charid, bool is_alt); - bool GetBankerFlag(uint32 CharID); - bool SetTributeFlag(uint32 charid, bool enabled); - bool SetPublicNote(uint32 charid, const char *note); + //character edit actions + bool SetGuildLeader(uint32 guild_id, uint32 leader_char_id); + bool SetGuild(uint32 charid, uint32 guild_id, uint8 rank); + bool SetGuildRank(uint32 charid, uint8 rank); + bool SetBankerFlag(uint32 charid, bool is_banker); + bool ForceRankUpdate(uint32 charid); + bool GetAltFlag(uint32 CharID); + bool SetAltFlag(uint32 charid, bool is_alt); + bool GetBankerFlag(uint32 CharID); + bool SetTributeFlag(uint32 charid, bool enabled); + bool SetPublicNote(uint32 charid, const char *note); - //queries - bool GetCharInfo(const char *char_name, CharGuildInfo &into); - bool GetCharInfo(uint32 char_id, CharGuildInfo &into); - bool GetEntireGuild(uint32 guild_id, std::vector &members); //caller is responsible for deleting each pointer in the resulting vector. - bool GuildExists(uint32 guild_id) const; - bool GetGuildMOTD(uint32 guild_id, char *motd_buffer, char *setter_buffer) const; - bool GetGuildURL(uint32 GuildID, char *URLBuffer) const; - bool GetGuildChannel(uint32 GuildID, char *ChannelBuffer) const; - const char *GetRankName(uint32 guild_id, uint8 rank) const; - const char *GetGuildName(uint32 guild_id) const; - bool GetGuildNameByID(uint32 guild_id, std::string &into) const; - uint32 GetGuildIDByName(const char *GuildName); - bool IsGuildLeader(uint32 guild_id, uint32 char_id) const; - uint8 GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 char_id) const; - bool CheckGMStatus(uint32 guild_id, uint8 status) const; - bool CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const; + //queries + bool GetCharInfo(const char *char_name, CharGuildInfo &into); + bool GetCharInfo(uint32 char_id, CharGuildInfo &into); + bool GetEntireGuild(uint32 guild_id, std::vector &members); //caller is responsible for deleting each pointer in the resulting vector. + bool GuildExists(uint32 guild_id) const; + bool GetGuildMOTD(uint32 guild_id, char *motd_buffer, char *setter_buffer) const; + bool GetGuildURL(uint32 GuildID, char *URLBuffer) const; + bool GetGuildChannel(uint32 GuildID, char *ChannelBuffer) const; + const char *GetRankName(uint32 guild_id, uint8 rank) const; + const char *GetGuildName(uint32 guild_id) const; + bool GetGuildNameByID(uint32 guild_id, std::string &into) const; + uint32 GetGuildIDByName(const char *GuildName); + bool IsGuildLeader(uint32 guild_id, uint32 char_id) const; + uint8 GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 char_id) const; + bool CheckGMStatus(uint32 guild_id, uint8 status) const; + bool CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const; // uint32 Getguild_id(uint32 eqid); - uint32 FindGuildByLeader(uint32 leader) const; + uint32 FindGuildByLeader(uint32 leader) const; // void GetGuildMembers(uint32 guild_id,GuildMember_Struct* gms); - uint32 NumberInGuild(uint32 guild_id); + uint32 NumberInGuild(uint32 guild_id); // bool GetGuildRanks(uint32 guildeqid, GuildRanks_Struct* gr); // bool EditGuild(uint32 guild_id, uint8 ranknum, GuildRankLevel_Struct* grl); - uint8 *MakeGuildList(const char *head_name, uint32 &length) const; //make a guild list packet, returns ownership of the buffer. + uint8 *MakeGuildList(const char *head_name, uint32 &length) const; //make a guild list packet, returns ownership of the buffer. - static const char *const GuildActionNames[_MaxGuildAction]; - uint32 DoesAccountContainAGuildLeader(uint32 AccountID); + static const char *const GuildActionNames[_MaxGuildAction]; + uint32 DoesAccountContainAGuildLeader(uint32 AccountID); -protected: - //the methods which must be defined by base classes. - virtual void SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) = 0; - virtual void SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) = 0; - virtual void SendRankUpdate(uint32 CharID) = 0; - virtual void SendGuildDelete(uint32 guild_id) = 0; + protected: + //the methods which must be defined by base classes. + virtual void SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) = 0; + virtual void SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) = 0; + virtual void SendRankUpdate(uint32 CharID) = 0; + virtual void SendGuildDelete(uint32 guild_id) = 0; - uint32 DBCreateGuild(const char* name, uint32 leader_char_id); - bool DBDeleteGuild(uint32 guild_id); - bool DBRenameGuild(uint32 guild_id, const char* name); - bool DBSetGuildLeader(uint32 guild_id, uint32 leader_char_id); - bool DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter); - bool DBSetGuildURL(uint32 GuildID, const char* URL); - bool DBSetGuildChannel(uint32 GuildID, const char* Channel); - bool DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank); - bool DBSetGuildRank(uint32 charid, uint8 rank); - bool DBSetBankerFlag(uint32 charid, bool is_banker); - bool DBSetAltFlag(uint32 charid, bool is_alt); - bool DBSetTributeFlag(uint32 charid, bool enabled); - bool DBSetPublicNote(uint32 charid, const char *note); - bool QueryWithLogging(std::string query, const char *errmsg); + uint32 DBCreateGuild(const char* name, uint32 leader_char_id); + bool DBDeleteGuild(uint32 guild_id); + bool DBRenameGuild(uint32 guild_id, const char* name); + bool DBSetGuildLeader(uint32 guild_id, uint32 leader_char_id); + bool DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter); + bool DBSetGuildURL(uint32 GuildID, const char* URL); + bool DBSetGuildChannel(uint32 GuildID, const char* Channel); + bool DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank); + bool DBSetGuildRank(uint32 charid, uint8 rank); + bool DBSetBankerFlag(uint32 charid, bool is_banker); + bool DBSetAltFlag(uint32 charid, bool is_alt); + bool DBSetTributeFlag(uint32 charid, bool enabled); + bool DBSetPublicNote(uint32 charid, const char *note); + bool QueryWithLogging(std::string query, const char *errmsg); // void DBSetPublicNote(uint32 guild_id,char* charname, char* note); - bool LocalDeleteGuild(uint32 guild_id); + bool LocalDeleteGuild(uint32 guild_id); - class RankInfo { - public: - RankInfo(); - std::string name; - bool permissions[_MaxGuildAction]; - }; - class GuildInfo { - public: - GuildInfo(); - std::string name; - std::string motd; - std::string motd_setter; - std::string url; - std::string channel; + class RankInfo + { + public: + RankInfo(); + std::string name; + bool permissions[_MaxGuildAction]; + }; + class GuildInfo + { + public: + GuildInfo(); + std::string name; + std::string motd; + std::string motd_setter; + std::string url; + std::string channel; - uint32 leader_char_id; - uint8 minstatus; - //tribute is not in here on purpose, since it is only valid in world! - RankInfo ranks[GUILD_MAX_RANK+1]; - }; + uint32 leader_char_id; + uint8 minstatus; + //tribute is not in here on purpose, since it is only valid in world! + RankInfo ranks[GUILD_MAX_RANK + 1]; + }; - std::map m_guilds; //we own the pointers in this map - void ClearGuilds(); //clears internal structure + std::map m_guilds; //we own the pointers in this map + void ClearGuilds(); //clears internal structure - Database *m_db; //we do not own this + Database *m_db; //we do not own this - bool _StoreGuildDB(uint32 guild_id); - GuildInfo *_CreateGuild(uint32 guild_id, const char *guild_name, uint32 account_id, uint8 minstatus, const char *guild_motd, const char *motd_setter, const char *Channel, const char *URL); - uint32 _GetFreeGuildID(); + bool _StoreGuildDB(uint32 guild_id); + GuildInfo *_CreateGuild(uint32 guild_id, const char *guild_name, uint32 account_id, uint8 minstatus, const char *guild_motd, const char *motd_setter, const char *Channel, const char *URL); + uint32 _GetFreeGuildID(); }; From edec2ad24cf23be050e1fa2ef62cae91216b350e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:04:39 -0600 Subject: [PATCH 103/153] faction.cpp linux build fix --- common/faction.cpp | 2 ++ common/guilds.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/common/faction.cpp b/common/faction.cpp index 65524f623..c387f8453 100644 --- a/common/faction.cpp +++ b/common/faction.cpp @@ -19,6 +19,8 @@ #include "faction.h" #include "races.h" +#include + const char *FactionValueToString(FACTION_VALUE fv) { switch (fv) { diff --git a/common/guilds.cpp b/common/guilds.cpp index ddd5d9a59..6098c2e1b 100644 --- a/common/guilds.cpp +++ b/common/guilds.cpp @@ -15,6 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" #include "misc_functions.h" #include "guilds.h" From 6d0b44d69e3d90794ba75c3f6f158baabe6f6e51 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:10:06 -0600 Subject: [PATCH 104/153] item.cpp & .h header include cleanup --- common/item.cpp | 13 +++++-------- common/item.h | 11 +++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/common/item.cpp b/common/item.cpp index df4997470..1b99ad779 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -16,19 +16,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" -#include "string_util.h" -#include "item.h" -#include "database.h" -#include "misc.h" -#include "races.h" -#include "shareddb.h" #include "classes.h" +#include "debug.h" +#include "item.h" +#include "races.h" #include "rulesys.h" +#include "shareddb.h" +#include "string_util.h" #include -#include #include std::list dirty_inst; diff --git a/common/item.h b/common/item.h index 995f121d6..b0aa06466 100644 --- a/common/item.h +++ b/common/item.h @@ -23,21 +23,16 @@ #ifndef __ITEM_H #define __ITEM_H -class ItemInst; // Item belonging to a client (contains info on item, dye, augments, charges, etc) -class ItemInstQueue; // Queue of ItemInst objects (i.e., cursor) -class Inventory; // Character inventory class ItemParse; // Parses item packets class EvolveInfo; // Stores information about an evolving item family -#include -#include -#include -#include -#include "../common/eq_packet_structs.h" #include "../common/eq_constants.h" #include "../common/item_struct.h" #include "../common/timer.h" +#include +#include + // Helper typedefs typedef std::list::const_iterator iter_queue; typedef std::map::const_iterator iter_inst; From 7887511589dc5fbb305c652860ba0cd38dab6806 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:12:56 -0600 Subject: [PATCH 105/153] faction linux build fix for real --- common/faction.cpp | 2 -- common/faction.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common/faction.cpp b/common/faction.cpp index c387f8453..65524f623 100644 --- a/common/faction.cpp +++ b/common/faction.cpp @@ -19,8 +19,6 @@ #include "faction.h" #include "races.h" -#include - const char *FactionValueToString(FACTION_VALUE fv) { switch (fv) { diff --git a/common/faction.h b/common/faction.h index a455b81e6..c98fc0916 100644 --- a/common/faction.h +++ b/common/faction.h @@ -21,6 +21,7 @@ #include "types.h" #include "features.h" #include +#include enum FACTION_VALUE { FACTION_ALLY = 1, From e9b72e0f7d227a18bf1326879228cb8fe7fcb1ac Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:15:17 -0600 Subject: [PATCH 106/153] logsys_eqemu .cpp & .h include cleanup --- common/logsys.cpp | 7 ++++--- common/logsys_eqemu.cpp | 3 --- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common/logsys.cpp b/common/logsys.cpp index 2b90c8b4a..c01baf04e 100644 --- a/common/logsys.cpp +++ b/common/logsys.cpp @@ -16,13 +16,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "logsys.h" #include "debug.h" +#include "eq_packet.h" +#include "logsys.h" +#include "misc.h" + #include #include #include -#include "misc.h" -#include "eq_packet.h" #define LOG_CATEGORY(category) #category , diff --git a/common/logsys_eqemu.cpp b/common/logsys_eqemu.cpp index b5f846b4a..e16de1055 100644 --- a/common/logsys_eqemu.cpp +++ b/common/logsys_eqemu.cpp @@ -21,9 +21,6 @@ #include "string_util.h" #include -#include - -#include void log_message(LogType type, const char *fmt, ...) { va_list args; From de32970d6ff0bc2bd6286edbfd5a057df3ca6561 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:16:30 -0600 Subject: [PATCH 107/153] add back in for linux --- common/guild_base.h | 1 + common/logsys_eqemu.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/common/guild_base.h b/common/guild_base.h index bfe14205e..ac8b1a895 100644 --- a/common/guild_base.h +++ b/common/guild_base.h @@ -3,6 +3,7 @@ #include "guilds.h" #include +#include #include class Database; diff --git a/common/logsys_eqemu.cpp b/common/logsys_eqemu.cpp index e16de1055..b5f846b4a 100644 --- a/common/logsys_eqemu.cpp +++ b/common/logsys_eqemu.cpp @@ -21,6 +21,9 @@ #include "string_util.h" #include +#include + +#include void log_message(LogType type, const char *fmt, ...) { va_list args; From f8a182584587c1d4330958a45c23e77dc3bdf032 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:21:44 -0600 Subject: [PATCH 108/153] misc_functions cleanup --- common/misc_functions.cpp | 4 +++- common/misc_functions.h | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/misc_functions.cpp b/common/misc_functions.cpp index 81fc2434b..18171c0a8 100644 --- a/common/misc_functions.cpp +++ b/common/misc_functions.cpp @@ -15,11 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + #include "../common/debug.h" #include "misc_functions.h" #include #include -#include + #ifndef WIN32 #include #include diff --git a/common/misc_functions.h b/common/misc_functions.h index a013423ff..610a86b04 100644 --- a/common/misc_functions.h +++ b/common/misc_functions.h @@ -19,8 +19,6 @@ #define MISCFUNCTIONS_H #include "types.h" -#include -#include #include #include From c1e5d8b7dc37a4bc63769e36bd20b95f118adae4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:21:57 -0600 Subject: [PATCH 109/153] misc cleanup --- common/misc.cpp | 3 ++- common/mysql_request_result.h | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/common/misc.cpp b/common/misc.cpp index b2e80e3bd..61ac556f5 100644 --- a/common/misc.cpp +++ b/common/misc.cpp @@ -9,13 +9,14 @@ #include #include #include + #ifndef WIN32 #include #endif + #include #include "misc.h" #include "types.h" -#include #include #define ENC(c) (((c) & 0x3f) + ' ') diff --git a/common/mysql_request_result.h b/common/mysql_request_result.h index ab84eeb18..b2d6fe3d1 100644 --- a/common/mysql_request_result.h +++ b/common/mysql_request_result.h @@ -9,9 +9,6 @@ #include #include "types.h" #include "mysql_request_row.h" -#include -#include -#include class MySQLRequestResult { private: From ffe447859a24d536016c42f1ef02a0ed46b7b8d3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:23:49 -0600 Subject: [PATCH 110/153] opcode_map.cpp readability --- common/opcode_map.cpp | 590 +++++++++++++++++++++--------------------- 1 file changed, 295 insertions(+), 295 deletions(-) diff --git a/common/opcode_map.cpp b/common/opcode_map.cpp index edb6ba64c..fdaaf3fa1 100644 --- a/common/opcode_map.cpp +++ b/common/opcode_map.cpp @@ -6,302 +6,302 @@ std::map opcode_map; std::string get_opcode_name(unsigned long opcode) { -std::map::iterator itr;; - - return (itr=opcode_map.find(opcode))!=opcode_map.end() ? itr->second : "OP_Unknown"; + std::map::iterator itr;; + return (itr = opcode_map.find(opcode)) != opcode_map.end() ? itr->second : "OP_Unknown"; } + void load_opcode_names() { - opcode_map[0x0176]="LiveOP_Heartbeat"; - opcode_map[0x02d7]="LiveOP_ReloadUI"; - opcode_map[0x01eb]="LiveOP_IncreaseStats"; - opcode_map[0x0134]="LiveOP_ApproveZone"; - opcode_map[0x01d5]="LiveOP_Dye"; - opcode_map[0x0168]="LiveOP_Stamina"; - opcode_map[0x014d]="LiveOP_ControlBoat"; - opcode_map[0x003e]="LiveOP_MobUpdate"; - opcode_map[0x0027]="LiveOP_ClientUpdate"; - opcode_map[0x0024]="LiveOP_ChannelMessage"; - opcode_map[0x01d7]="LiveOP_SimpleMessage"; - opcode_map[0x01d8]="LiveOP_FormattedMessage"; - opcode_map[0x01c6]="LiveOP_TGB"; - opcode_map[0x0285]="LiveOP_TestBuff"; - opcode_map[0x012d]="LiveOP_Bind_Wound"; - opcode_map[0x01ab]="LiveOP_Charm"; - opcode_map[0x014c]="LiveOP_Begging"; - opcode_map[0x0152]="LiveOP_MoveCoin"; - opcode_map[0x0292]="LiveOP_SpawnDoor"; - opcode_map[0x009d]="LiveOP_Sneak"; - opcode_map[0x0079]="LiveOP_ExpUpdate"; - opcode_map[0x027d]="LiveOP_DumpName"; - opcode_map[0x01ea]="LiveOP_RespondAA"; - opcode_map[0x01c9]="LiveOP_SendAAStats"; - opcode_map[0x0366]="LiveOP_SendAATable"; - opcode_map[0x01e9]="LiveOP_AAAction"; - opcode_map[0x00bb]="LiveOP_BoardBoat"; - opcode_map[0x00bc]="LiveOP_LeaveBoat"; - opcode_map[0x02b8]="LiveOP_AdventureInfoRequest"; - opcode_map[0x02b9]="LiveOP_AdventureInfo"; - opcode_map[0x02a6]="LiveOP_AdventureRequest"; - opcode_map[0x02a8]="LiveOP_AdventureDetails"; - opcode_map[0x02a9]="LiveOP_LDoNButton"; - opcode_map[0x02ba]="LiveOP_AdventureData"; - opcode_map[0x02c9]="LiveOP_AdventureFinish"; - opcode_map[0x02c6]="LiveOP_LeaveAdventure"; - opcode_map[0x02ce]="LiveOP_AdventureUpdate"; - opcode_map[0x002b]="LiveOP_SendExpZonein"; - opcode_map[0x01e4]="LiveOP_ZoneInSendName"; - opcode_map[0x01bf]="LiveOP_GuildLeader"; - opcode_map[0x009a]="LiveOP_GuildPeace"; - opcode_map[0x0132]="LiveOP_GuildRemove"; - opcode_map[0x0059]="LiveOP_GuildMemberList"; - opcode_map[0x026e]="LiveOP_GuildMemberUpdate"; - opcode_map[0x0130]="LiveOP_GuildInvite"; - opcode_map[0x01c0]="LiveOP_GuildMOTD"; - opcode_map[0x003c]="LiveOP_GuildPublicNote"; - opcode_map[0x027e]="LiveOP_GetGuildMOTD"; - opcode_map[0x0277]="LiveOP_GuildDemote"; - opcode_map[0x0131]="LiveOP_GuildInviteAccept"; - opcode_map[0x00a4]="LiveOP_GuildWar"; - opcode_map[0x0133]="LiveOP_GuildDelete"; - opcode_map[0x0233]="LiveOP_GuildManageRemove"; - opcode_map[0x022d]="LiveOP_GuildManageAdd"; - opcode_map[0x0039]="LiveOP_GuildManageStatus"; - opcode_map[0x01e8]="LiveOP_Trader"; - opcode_map[0x01e7]="LiveOP_Bazaar"; - opcode_map[0x01c4]="LiveOP_BecomeTrader"; - opcode_map[0x01f4]="LiveOP_BazaarInspect"; - opcode_map[0x006e]="LiveOP_TraderItemUpdate"; - opcode_map[0x017c]="LiveOP_TraderDelItem"; - opcode_map[0x01eb]="LiveOP_TraderShop"; - opcode_map[0x01ca]="LiveOP_TraderBuy"; - opcode_map[0x01ac]="LiveOP_PetCommands"; - opcode_map[0x0042]="LiveOP_TradeSkillCombine"; - opcode_map[0x02e5]="LiveOP_AugmentItem"; - opcode_map[0x0367]="LiveOP_ItemName"; - opcode_map[0x02cd]="LiveOP_ShopItem"; - opcode_map[0x0065]="LiveOP_ShopPlayerBuy"; - opcode_map[0x006a]="LiveOP_ShopPlayerSell"; - opcode_map[0x006d]="LiveOP_ShopDelItem"; - opcode_map[0x0f6d]="LiveOP_ShopEndConfirm"; - opcode_map[0x00f7]="LiveOP_ShopRequest"; - opcode_map[0x006c]="LiveOP_ShopEnd"; - opcode_map[0x02d1]="LiveOP_AdventureMerchantRequest"; - opcode_map[0x02d2]="LiveOP_AdventureMerchantResponse"; - opcode_map[0x02d3]="LiveOP_AdventureMerchantPurchase"; - opcode_map[0x02e3]="LiveOP_AdventurePointsUpdate"; - opcode_map[0x0270]="LiveOP_LFGCommand"; - opcode_map[0x01d0]="LiveOP_LFGAppearance"; - opcode_map[0x01b5]="LiveOP_MoneyUpdate"; - opcode_map[0x0721]="LiveOP_GroupDelete"; - opcode_map[0x0272]="LiveOP_GroupAcknowledge"; - opcode_map[0x024a]="LiveOP_GroupUpdate"; - opcode_map[0x025f]="LiveOP_GroupInvite"; - opcode_map[0x00ff]="LiveOP_GroupDisband"; - opcode_map[0x00d5]="LiveOP_GroupInvite2"; - opcode_map[0x025e]="LiveOP_GroupFollow"; - opcode_map[0x00d7]="LiveOP_GroupFollow2"; - opcode_map[0x00d6]="LiveOP_GroupCancelInvite"; - opcode_map[0x0156]="LiveOP_Split"; - opcode_map[0x00d8]="LiveOP_Jump"; - opcode_map[0x01d6]="LiveOP_ConsiderCorpse"; - opcode_map[0x0064]="LiveOP_SkillUpdate"; - opcode_map[0x0178]="LiveOP_GMEndTrainingResponse"; - opcode_map[0x013c]="LiveOP_GMEndTraining"; - opcode_map[0x0175]="LiveOP_GMTrainSkill"; - opcode_map[0x013b]="LiveOP_GMTraining"; - opcode_map[0x017b]="LiveOP_ConsumeAmmo"; - opcode_map[0x0171]="LiveOP_CombatAbility"; - opcode_map[0x009c]="LiveOP_TrackUnknown"; - opcode_map[0x0234]="LiveOP_TrackTarget"; - opcode_map[0x0286]="LiveOP_Track"; - opcode_map[0x0297]="LiveOP_ReadBook"; - opcode_map[0x001f]="LiveOP_ItemLinkClick"; - opcode_map[0x01f4]="LiveOP_ItemLinkResponse"; - opcode_map[0x01d9]="LiveOP_ItemLinkText"; - opcode_map[0x0a41]="LiveOP_RezzRequest"; - opcode_map[0x00e5]="LiveOP_RezzAnswer"; - opcode_map[0x019b]="LiveOP_RezzComplete"; - opcode_map[0x0128]="LiveOP_MoveDoor"; - opcode_map[0x0127]="LiveOP_ClickDoor"; - opcode_map[0x0247]="LiveOP_SendZonepoints"; - opcode_map[0x008c]="LiveOP_SetRunMode"; - opcode_map[0x0248]="LiveOP_InspectRequest"; - opcode_map[0x0249]="LiveOP_InspectAnswer"; - opcode_map[0x0187]="LiveOP_SenseTraps"; - opcode_map[0x018e]="LiveOP_DisarmTraps"; - opcode_map[0x01bc]="LiveOP_Assist"; - opcode_map[0x0240]="LiveOP_PickPocket"; - opcode_map[0x0119]="LiveOP_LootRequest"; - opcode_map[0x011a]="LiveOP_EndLootRequest"; - opcode_map[0x011b]="LiveOP_MoneyOnCorpse"; - opcode_map[0x0179]="LiveOP_LootComplete"; - opcode_map[0x013f]="LiveOP_LootItem"; - opcode_map[0x0151]="LiveOP_MoveItem"; - opcode_map[0x0056]="LiveOP_WhoAllRequest"; - opcode_map[0x0229]="LiveOP_WhoAllResponse"; - opcode_map[0x0167]="LiveOP_Consume"; - opcode_map[0x0172]="LiveOP_AutoAttack"; - opcode_map[0x0186]="LiveOP_AutoAttack2"; - opcode_map[0x0173]="LiveOP_TargetMouse"; - opcode_map[0x01ba]="LiveOP_TargetCommand"; - opcode_map[0x01d8]="LiveOP_TargetReject"; - opcode_map[0x009e]="LiveOP_Hide"; - opcode_map[0x012e]="LiveOP_Forage"; - opcode_map[0x0077]="LiveOP_Fishing"; - opcode_map[0x0246]="LiveOP_Bug"; - opcode_map[0x00f2]="LiveOP_Emote"; - opcode_map[0x0140]="LiveOP_EmoteAnim"; - opcode_map[0x015c]="LiveOP_Consider"; - opcode_map[0x01cb]="LiveOP_FaceChange"; - opcode_map[0x0197]="LiveOP_RandomReq"; - opcode_map[0x0087]="LiveOP_RandomReply"; - opcode_map[0x01c3]="LiveOP_Camp"; - opcode_map[0x0192]="LiveOP_YellForHelp"; - opcode_map[0x00ef]="LiveOP_SafePoint"; - opcode_map[0x0157]="LiveOP_Buff"; - opcode_map[0x00c0]="LiveOP_ColoredText"; - opcode_map[0x0440]="LiveOP_MultiLineMsg"; - opcode_map[0x021c]="LiveOP_SpecialMesg"; - opcode_map[0x0013]="LiveOP_Consent"; - opcode_map[0x029d]="LiveOP_ConsentResponse"; - opcode_map[0x02d4]="LiveOP_Deny"; - opcode_map[0x016c]="LiveOP_Stun"; - opcode_map[0x0021]="LiveOP_BeginCast"; - opcode_map[0x00be]="LiveOP_CastSpell"; - opcode_map[0x01a8]="LiveOP_InterruptCast"; - opcode_map[0x0105]="LiveOP_Death"; - opcode_map[0x023f]="LiveOP_FeignDeath"; - opcode_map[0x012b]="LiveOP_Illusion"; - opcode_map[0x0078]="LiveOP_LevelUpdate"; - opcode_map[0x0371]="LiveOP_LevelAppearance"; - opcode_map[0x00c2]="LiveOP_MemorizeSpell"; - opcode_map[0x0244]="LiveOP_HPUpdate"; - opcode_map[0x022e]="LiveOP_SendHPTarget"; - opcode_map[0x007d]="LiveOP_Mend"; - opcode_map[0x0160]="LiveOP_Taunt"; - opcode_map[0x0199]="LiveOP_GMDelCorpse"; - opcode_map[0x0047]="LiveOP_GMFind"; - opcode_map[0x0020]="LiveOP_GMServers"; - opcode_map[0x010b]="LiveOP_GMGoto"; - opcode_map[0x028c]="LiveOP_GMSummon"; - opcode_map[0x010a]="LiveOP_GMKick"; - opcode_map[0x0109]="LiveOP_GMKill"; - opcode_map[0x0b40]="LiveOP_GMNameChange"; - opcode_map[0x00a3]="LiveOP_GMLastName"; - opcode_map[0x01b3]="LiveOP_GMToggle"; - opcode_map[0x028f]="LiveOP_GMEmoteZone"; - opcode_map[0x0074]="LiveOP_GMBecomeNPC"; - opcode_map[0x00de]="LiveOP_GMHideMe"; - opcode_map[0x0184]="LiveOP_GMZoneRequest"; - opcode_map[0x0239]="LiveOP_GMZoneRequest2"; - opcode_map[0x0068]="LiveOP_Petition"; - opcode_map[0x0085]="LiveOP_PetitionRefresh"; - opcode_map[0x01ee]="LiveOP_PDeletePetition"; - opcode_map[0x0092]="LiveOP_PetitionBug"; - opcode_map[0x0069]="LiveOP_PetitionUpdate"; - opcode_map[0x0076]="LiveOP_PetitionCheckout"; - opcode_map[0x0056]="LiveOP_PetitionCheckout2"; - opcode_map[0x0091]="LiveOP_PetitionDelete"; - opcode_map[0x02b4]="LiveOP_PetitionResolve"; - opcode_map[0x007e]="LiveOP_PetitionCheckIn"; - opcode_map[0x0090]="LiveOP_PetitionUnCheckout"; - opcode_map[0x01ec]="LiveOP_PetitionQue"; - opcode_map[0x01bb]="LiveOP_SetServerFilter"; - opcode_map[0x0218]="LiveOP_NewSpawn"; - opcode_map[0x0140]="LiveOP_Animation"; - opcode_map[0x0142]="LiveOP_ZoneChange"; - opcode_map[0x00f3]="LiveOP_DeleteSpawn"; - opcode_map[0x0265]="LiveOP_CrashDump"; - opcode_map[0x00e8]="LiveOP_EnvDamage"; - opcode_map[0x0101]="LiveOP_Action"; - opcode_map[0x00e2]="LiveOP_Damage"; - opcode_map[0x00bf]="LiveOP_ManaChange"; - opcode_map[0x027c]="LiveOP_ClientError"; - opcode_map[0x00fb]="LiveOP_Save"; - opcode_map[0x0316]="LiveOP_LocInfo"; - opcode_map[0x0188]="LiveOP_Surname"; - opcode_map[0x018f]="LiveOP_SwapSpell"; - opcode_map[0x01db]="LiveOP_DeleteSpell"; - opcode_map[0x029f]="LiveOP_CloseContainer"; - opcode_map[0x029f]="LiveOP_ClickObjectAck"; - opcode_map[0x00fa]="LiveOP_CreateObject"; - opcode_map[0x00f9]="LiveOP_ClickObject"; - opcode_map[0x01c1]="LiveOP_ClearObject"; - opcode_map[0x0265]="LiveOP_ZoneUnavail"; - opcode_map[0x02e0]="LiveOP_ItemPacket"; - opcode_map[0x029a]="LiveOP_TradeRequest"; - opcode_map[0x0037]="LiveOP_TradeRequestAck"; - opcode_map[0x002d]="LiveOP_TradeAcceptClick"; - opcode_map[0x0162]="LiveOP_TradeMoneyUpdate"; - opcode_map[0x0036]="LiveOP_TradeCoins"; - opcode_map[0x002e]="LiveOP_CancelTrade"; - opcode_map[0x002f]="LiveOP_FinishTrade"; - opcode_map[0x00a1]="LiveOP_SaveOnZoneReq"; - opcode_map[0x0185]="LiveOP_Logout"; - opcode_map[0x0298]="LiveOP_RequestDuel"; - opcode_map[0x0a5d]="LiveOP_DuelResponse"; - opcode_map[0x016e]="LiveOP_DuelResponse2"; - opcode_map[0x007c]="LiveOP_InstillDoubt"; - opcode_map[0x00ac]="LiveOP_SafeFallSuccess"; - opcode_map[0x02fb]="LiveOP_DisciplineUpdate"; - opcode_map[0x02f2]="LiveOP_TributeUpdate"; - opcode_map[0x02f3]="LiveOP_TributeItem"; - opcode_map[0x02f4]="LiveOP_TributePointUpdate"; - opcode_map[0x02f5]="LiveOP_SendTributes"; - opcode_map[0x02f6]="LiveOP_TributeInfo"; - opcode_map[0x02f7]="LiveOP_SelectTribute"; - opcode_map[0x02f8]="LiveOP_TributeTimer"; - opcode_map[0x02f9]="LiveOP_StartTribute"; - opcode_map[0x02fa]="LiveOP_TributeNPC"; - opcode_map[0x02fe]="LiveOP_TributeMoney"; - opcode_map[0x0364]="LiveOP_TributeToggle"; - opcode_map[0x0322]="LiveOP_RecipesFavorite"; - opcode_map[0x01f9]="LiveOP_RecipesSearch"; - opcode_map[0x01fa]="LiveOP_RecipeReply"; - opcode_map[0x01fb]="LiveOP_RecipeDetails"; - opcode_map[0x01fc]="LiveOP_RecipeAutoCombine"; - opcode_map[0x02db]="LiveOP_FindPersonRequest"; - opcode_map[0x02dc]="LiveOP_FindPersonReply"; - opcode_map[0x01dd]="LiveOP_Shielding"; - opcode_map[0x0198]="LiveOP_SetDataRate"; - opcode_map[0x023b]="LiveOP_ZoneEntry"; - opcode_map[0x006b]="LiveOP_PlayerProfile"; - opcode_map[0x0291]="LiveOP_CharInventory"; - opcode_map[0x0170]="LiveOP_ZoneSpawns"; - opcode_map[0x0026]="LiveOP_TimeOfDay"; - opcode_map[0x015b]="LiveOP_Weather"; - opcode_map[0x00ec]="LiveOP_ReqNewZone"; - opcode_map[0x00eb]="LiveOP_NewZone"; - opcode_map[0x00fd]="LiveOP_ReqClientSpawn"; - opcode_map[0x012F]="LiveOP_SpawnAppearance"; - opcode_map[0x0086]="LiveOP_ClientReady"; - opcode_map[0x0086]="LiveOP_ZoneComplete"; - opcode_map[0x02db]="LiveOP_LoginComplete"; - opcode_map[0x0195]="LiveOP_ApproveWorld"; - opcode_map[0x035f]="LiveOP_LogServer"; - opcode_map[0x01b2]="LiveOP_MOTD"; - opcode_map[0x0251]="LiveOP_SendLoginInfo"; - opcode_map[0x00ea]="LiveOP_DeleteCharacter"; - opcode_map[0x0102]="LiveOP_SendCharInfo"; - opcode_map[0x00e1]="LiveOP_ExpansionInfo"; - opcode_map[0x0104]="LiveOP_CharacterCreate"; - opcode_map[0x02ab]="LiveOP_RandomNameGenerator"; - opcode_map[0x005d]="LiveOP_GuildsList"; - opcode_map[0x0125]="LiveOP_ApproveName"; - opcode_map[0x0261]="LiveOP_EnterWorld"; - opcode_map[0x015a]="LiveOP_World_Client_CRC1"; - opcode_map[0x015e]="LiveOP_World_Client_CRC2"; - opcode_map[0x0269]="LiveOP_SetChatServer"; - opcode_map[0x0264]="LiveOP_ZoneServerInfo"; - opcode_map[0x0017]="LiveOP_AckPacket"; - opcode_map[0x012c]="LiveOP_WearChange"; - opcode_map[0x1FA1]="LiveOP_WorldObjectsSent"; - opcode_map[0x39C4]="LiveOP_BlockedBuffs"; - opcode_map[0x4656]="LiveOP_SpawnPositionUpdate"; - opcode_map[0x4b61]="LiveOP_ManaUpdate"; - opcode_map[0x02d6]="LiveOP_EnduranceUpdate"; - opcode_map[0x2ac1]="LiveOP_MobManaUpdate"; - opcode_map[0x6c5f]="LiveOP_MobEnduranceUpdate"; - opcode_map[0x73a8]="LiveOP_SendMaxCharacters"; + opcode_map[0x0176] = "LiveOP_Heartbeat"; + opcode_map[0x02d7] = "LiveOP_ReloadUI"; + opcode_map[0x01eb] = "LiveOP_IncreaseStats"; + opcode_map[0x0134] = "LiveOP_ApproveZone"; + opcode_map[0x01d5] = "LiveOP_Dye"; + opcode_map[0x0168] = "LiveOP_Stamina"; + opcode_map[0x014d] = "LiveOP_ControlBoat"; + opcode_map[0x003e] = "LiveOP_MobUpdate"; + opcode_map[0x0027] = "LiveOP_ClientUpdate"; + opcode_map[0x0024] = "LiveOP_ChannelMessage"; + opcode_map[0x01d7] = "LiveOP_SimpleMessage"; + opcode_map[0x01d8] = "LiveOP_FormattedMessage"; + opcode_map[0x01c6] = "LiveOP_TGB"; + opcode_map[0x0285] = "LiveOP_TestBuff"; + opcode_map[0x012d] = "LiveOP_Bind_Wound"; + opcode_map[0x01ab] = "LiveOP_Charm"; + opcode_map[0x014c] = "LiveOP_Begging"; + opcode_map[0x0152] = "LiveOP_MoveCoin"; + opcode_map[0x0292] = "LiveOP_SpawnDoor"; + opcode_map[0x009d] = "LiveOP_Sneak"; + opcode_map[0x0079] = "LiveOP_ExpUpdate"; + opcode_map[0x027d] = "LiveOP_DumpName"; + opcode_map[0x01ea] = "LiveOP_RespondAA"; + opcode_map[0x01c9] = "LiveOP_SendAAStats"; + opcode_map[0x0366] = "LiveOP_SendAATable"; + opcode_map[0x01e9] = "LiveOP_AAAction"; + opcode_map[0x00bb] = "LiveOP_BoardBoat"; + opcode_map[0x00bc] = "LiveOP_LeaveBoat"; + opcode_map[0x02b8] = "LiveOP_AdventureInfoRequest"; + opcode_map[0x02b9] = "LiveOP_AdventureInfo"; + opcode_map[0x02a6] = "LiveOP_AdventureRequest"; + opcode_map[0x02a8] = "LiveOP_AdventureDetails"; + opcode_map[0x02a9] = "LiveOP_LDoNButton"; + opcode_map[0x02ba] = "LiveOP_AdventureData"; + opcode_map[0x02c9] = "LiveOP_AdventureFinish"; + opcode_map[0x02c6] = "LiveOP_LeaveAdventure"; + opcode_map[0x02ce] = "LiveOP_AdventureUpdate"; + opcode_map[0x002b] = "LiveOP_SendExpZonein"; + opcode_map[0x01e4] = "LiveOP_ZoneInSendName"; + opcode_map[0x01bf] = "LiveOP_GuildLeader"; + opcode_map[0x009a] = "LiveOP_GuildPeace"; + opcode_map[0x0132] = "LiveOP_GuildRemove"; + opcode_map[0x0059] = "LiveOP_GuildMemberList"; + opcode_map[0x026e] = "LiveOP_GuildMemberUpdate"; + opcode_map[0x0130] = "LiveOP_GuildInvite"; + opcode_map[0x01c0] = "LiveOP_GuildMOTD"; + opcode_map[0x003c] = "LiveOP_GuildPublicNote"; + opcode_map[0x027e] = "LiveOP_GetGuildMOTD"; + opcode_map[0x0277] = "LiveOP_GuildDemote"; + opcode_map[0x0131] = "LiveOP_GuildInviteAccept"; + opcode_map[0x00a4] = "LiveOP_GuildWar"; + opcode_map[0x0133] = "LiveOP_GuildDelete"; + opcode_map[0x0233] = "LiveOP_GuildManageRemove"; + opcode_map[0x022d] = "LiveOP_GuildManageAdd"; + opcode_map[0x0039] = "LiveOP_GuildManageStatus"; + opcode_map[0x01e8] = "LiveOP_Trader"; + opcode_map[0x01e7] = "LiveOP_Bazaar"; + opcode_map[0x01c4] = "LiveOP_BecomeTrader"; + opcode_map[0x01f4] = "LiveOP_BazaarInspect"; + opcode_map[0x006e] = "LiveOP_TraderItemUpdate"; + opcode_map[0x017c] = "LiveOP_TraderDelItem"; + opcode_map[0x01eb] = "LiveOP_TraderShop"; + opcode_map[0x01ca] = "LiveOP_TraderBuy"; + opcode_map[0x01ac] = "LiveOP_PetCommands"; + opcode_map[0x0042] = "LiveOP_TradeSkillCombine"; + opcode_map[0x02e5] = "LiveOP_AugmentItem"; + opcode_map[0x0367] = "LiveOP_ItemName"; + opcode_map[0x02cd] = "LiveOP_ShopItem"; + opcode_map[0x0065] = "LiveOP_ShopPlayerBuy"; + opcode_map[0x006a] = "LiveOP_ShopPlayerSell"; + opcode_map[0x006d] = "LiveOP_ShopDelItem"; + opcode_map[0x0f6d] = "LiveOP_ShopEndConfirm"; + opcode_map[0x00f7] = "LiveOP_ShopRequest"; + opcode_map[0x006c] = "LiveOP_ShopEnd"; + opcode_map[0x02d1] = "LiveOP_AdventureMerchantRequest"; + opcode_map[0x02d2] = "LiveOP_AdventureMerchantResponse"; + opcode_map[0x02d3] = "LiveOP_AdventureMerchantPurchase"; + opcode_map[0x02e3] = "LiveOP_AdventurePointsUpdate"; + opcode_map[0x0270] = "LiveOP_LFGCommand"; + opcode_map[0x01d0] = "LiveOP_LFGAppearance"; + opcode_map[0x01b5] = "LiveOP_MoneyUpdate"; + opcode_map[0x0721] = "LiveOP_GroupDelete"; + opcode_map[0x0272] = "LiveOP_GroupAcknowledge"; + opcode_map[0x024a] = "LiveOP_GroupUpdate"; + opcode_map[0x025f] = "LiveOP_GroupInvite"; + opcode_map[0x00ff] = "LiveOP_GroupDisband"; + opcode_map[0x00d5] = "LiveOP_GroupInvite2"; + opcode_map[0x025e] = "LiveOP_GroupFollow"; + opcode_map[0x00d7] = "LiveOP_GroupFollow2"; + opcode_map[0x00d6] = "LiveOP_GroupCancelInvite"; + opcode_map[0x0156] = "LiveOP_Split"; + opcode_map[0x00d8] = "LiveOP_Jump"; + opcode_map[0x01d6] = "LiveOP_ConsiderCorpse"; + opcode_map[0x0064] = "LiveOP_SkillUpdate"; + opcode_map[0x0178] = "LiveOP_GMEndTrainingResponse"; + opcode_map[0x013c] = "LiveOP_GMEndTraining"; + opcode_map[0x0175] = "LiveOP_GMTrainSkill"; + opcode_map[0x013b] = "LiveOP_GMTraining"; + opcode_map[0x017b] = "LiveOP_ConsumeAmmo"; + opcode_map[0x0171] = "LiveOP_CombatAbility"; + opcode_map[0x009c] = "LiveOP_TrackUnknown"; + opcode_map[0x0234] = "LiveOP_TrackTarget"; + opcode_map[0x0286] = "LiveOP_Track"; + opcode_map[0x0297] = "LiveOP_ReadBook"; + opcode_map[0x001f] = "LiveOP_ItemLinkClick"; + opcode_map[0x01f4] = "LiveOP_ItemLinkResponse"; + opcode_map[0x01d9] = "LiveOP_ItemLinkText"; + opcode_map[0x0a41] = "LiveOP_RezzRequest"; + opcode_map[0x00e5] = "LiveOP_RezzAnswer"; + opcode_map[0x019b] = "LiveOP_RezzComplete"; + opcode_map[0x0128] = "LiveOP_MoveDoor"; + opcode_map[0x0127] = "LiveOP_ClickDoor"; + opcode_map[0x0247] = "LiveOP_SendZonepoints"; + opcode_map[0x008c] = "LiveOP_SetRunMode"; + opcode_map[0x0248] = "LiveOP_InspectRequest"; + opcode_map[0x0249] = "LiveOP_InspectAnswer"; + opcode_map[0x0187] = "LiveOP_SenseTraps"; + opcode_map[0x018e] = "LiveOP_DisarmTraps"; + opcode_map[0x01bc] = "LiveOP_Assist"; + opcode_map[0x0240] = "LiveOP_PickPocket"; + opcode_map[0x0119] = "LiveOP_LootRequest"; + opcode_map[0x011a] = "LiveOP_EndLootRequest"; + opcode_map[0x011b] = "LiveOP_MoneyOnCorpse"; + opcode_map[0x0179] = "LiveOP_LootComplete"; + opcode_map[0x013f] = "LiveOP_LootItem"; + opcode_map[0x0151] = "LiveOP_MoveItem"; + opcode_map[0x0056] = "LiveOP_WhoAllRequest"; + opcode_map[0x0229] = "LiveOP_WhoAllResponse"; + opcode_map[0x0167] = "LiveOP_Consume"; + opcode_map[0x0172] = "LiveOP_AutoAttack"; + opcode_map[0x0186] = "LiveOP_AutoAttack2"; + opcode_map[0x0173] = "LiveOP_TargetMouse"; + opcode_map[0x01ba] = "LiveOP_TargetCommand"; + opcode_map[0x01d8] = "LiveOP_TargetReject"; + opcode_map[0x009e] = "LiveOP_Hide"; + opcode_map[0x012e] = "LiveOP_Forage"; + opcode_map[0x0077] = "LiveOP_Fishing"; + opcode_map[0x0246] = "LiveOP_Bug"; + opcode_map[0x00f2] = "LiveOP_Emote"; + opcode_map[0x0140] = "LiveOP_EmoteAnim"; + opcode_map[0x015c] = "LiveOP_Consider"; + opcode_map[0x01cb] = "LiveOP_FaceChange"; + opcode_map[0x0197] = "LiveOP_RandomReq"; + opcode_map[0x0087] = "LiveOP_RandomReply"; + opcode_map[0x01c3] = "LiveOP_Camp"; + opcode_map[0x0192] = "LiveOP_YellForHelp"; + opcode_map[0x00ef] = "LiveOP_SafePoint"; + opcode_map[0x0157] = "LiveOP_Buff"; + opcode_map[0x00c0] = "LiveOP_ColoredText"; + opcode_map[0x0440] = "LiveOP_MultiLineMsg"; + opcode_map[0x021c] = "LiveOP_SpecialMesg"; + opcode_map[0x0013] = "LiveOP_Consent"; + opcode_map[0x029d] = "LiveOP_ConsentResponse"; + opcode_map[0x02d4] = "LiveOP_Deny"; + opcode_map[0x016c] = "LiveOP_Stun"; + opcode_map[0x0021] = "LiveOP_BeginCast"; + opcode_map[0x00be] = "LiveOP_CastSpell"; + opcode_map[0x01a8] = "LiveOP_InterruptCast"; + opcode_map[0x0105] = "LiveOP_Death"; + opcode_map[0x023f] = "LiveOP_FeignDeath"; + opcode_map[0x012b] = "LiveOP_Illusion"; + opcode_map[0x0078] = "LiveOP_LevelUpdate"; + opcode_map[0x0371] = "LiveOP_LevelAppearance"; + opcode_map[0x00c2] = "LiveOP_MemorizeSpell"; + opcode_map[0x0244] = "LiveOP_HPUpdate"; + opcode_map[0x022e] = "LiveOP_SendHPTarget"; + opcode_map[0x007d] = "LiveOP_Mend"; + opcode_map[0x0160] = "LiveOP_Taunt"; + opcode_map[0x0199] = "LiveOP_GMDelCorpse"; + opcode_map[0x0047] = "LiveOP_GMFind"; + opcode_map[0x0020] = "LiveOP_GMServers"; + opcode_map[0x010b] = "LiveOP_GMGoto"; + opcode_map[0x028c] = "LiveOP_GMSummon"; + opcode_map[0x010a] = "LiveOP_GMKick"; + opcode_map[0x0109] = "LiveOP_GMKill"; + opcode_map[0x0b40] = "LiveOP_GMNameChange"; + opcode_map[0x00a3] = "LiveOP_GMLastName"; + opcode_map[0x01b3] = "LiveOP_GMToggle"; + opcode_map[0x028f] = "LiveOP_GMEmoteZone"; + opcode_map[0x0074] = "LiveOP_GMBecomeNPC"; + opcode_map[0x00de] = "LiveOP_GMHideMe"; + opcode_map[0x0184] = "LiveOP_GMZoneRequest"; + opcode_map[0x0239] = "LiveOP_GMZoneRequest2"; + opcode_map[0x0068] = "LiveOP_Petition"; + opcode_map[0x0085] = "LiveOP_PetitionRefresh"; + opcode_map[0x01ee] = "LiveOP_PDeletePetition"; + opcode_map[0x0092] = "LiveOP_PetitionBug"; + opcode_map[0x0069] = "LiveOP_PetitionUpdate"; + opcode_map[0x0076] = "LiveOP_PetitionCheckout"; + opcode_map[0x0056] = "LiveOP_PetitionCheckout2"; + opcode_map[0x0091] = "LiveOP_PetitionDelete"; + opcode_map[0x02b4] = "LiveOP_PetitionResolve"; + opcode_map[0x007e] = "LiveOP_PetitionCheckIn"; + opcode_map[0x0090] = "LiveOP_PetitionUnCheckout"; + opcode_map[0x01ec] = "LiveOP_PetitionQue"; + opcode_map[0x01bb] = "LiveOP_SetServerFilter"; + opcode_map[0x0218] = "LiveOP_NewSpawn"; + opcode_map[0x0140] = "LiveOP_Animation"; + opcode_map[0x0142] = "LiveOP_ZoneChange"; + opcode_map[0x00f3] = "LiveOP_DeleteSpawn"; + opcode_map[0x0265] = "LiveOP_CrashDump"; + opcode_map[0x00e8] = "LiveOP_EnvDamage"; + opcode_map[0x0101] = "LiveOP_Action"; + opcode_map[0x00e2] = "LiveOP_Damage"; + opcode_map[0x00bf] = "LiveOP_ManaChange"; + opcode_map[0x027c] = "LiveOP_ClientError"; + opcode_map[0x00fb] = "LiveOP_Save"; + opcode_map[0x0316] = "LiveOP_LocInfo"; + opcode_map[0x0188] = "LiveOP_Surname"; + opcode_map[0x018f] = "LiveOP_SwapSpell"; + opcode_map[0x01db] = "LiveOP_DeleteSpell"; + opcode_map[0x029f] = "LiveOP_CloseContainer"; + opcode_map[0x029f] = "LiveOP_ClickObjectAck"; + opcode_map[0x00fa] = "LiveOP_CreateObject"; + opcode_map[0x00f9] = "LiveOP_ClickObject"; + opcode_map[0x01c1] = "LiveOP_ClearObject"; + opcode_map[0x0265] = "LiveOP_ZoneUnavail"; + opcode_map[0x02e0] = "LiveOP_ItemPacket"; + opcode_map[0x029a] = "LiveOP_TradeRequest"; + opcode_map[0x0037] = "LiveOP_TradeRequestAck"; + opcode_map[0x002d] = "LiveOP_TradeAcceptClick"; + opcode_map[0x0162] = "LiveOP_TradeMoneyUpdate"; + opcode_map[0x0036] = "LiveOP_TradeCoins"; + opcode_map[0x002e] = "LiveOP_CancelTrade"; + opcode_map[0x002f] = "LiveOP_FinishTrade"; + opcode_map[0x00a1] = "LiveOP_SaveOnZoneReq"; + opcode_map[0x0185] = "LiveOP_Logout"; + opcode_map[0x0298] = "LiveOP_RequestDuel"; + opcode_map[0x0a5d] = "LiveOP_DuelResponse"; + opcode_map[0x016e] = "LiveOP_DuelResponse2"; + opcode_map[0x007c] = "LiveOP_InstillDoubt"; + opcode_map[0x00ac] = "LiveOP_SafeFallSuccess"; + opcode_map[0x02fb] = "LiveOP_DisciplineUpdate"; + opcode_map[0x02f2] = "LiveOP_TributeUpdate"; + opcode_map[0x02f3] = "LiveOP_TributeItem"; + opcode_map[0x02f4] = "LiveOP_TributePointUpdate"; + opcode_map[0x02f5] = "LiveOP_SendTributes"; + opcode_map[0x02f6] = "LiveOP_TributeInfo"; + opcode_map[0x02f7] = "LiveOP_SelectTribute"; + opcode_map[0x02f8] = "LiveOP_TributeTimer"; + opcode_map[0x02f9] = "LiveOP_StartTribute"; + opcode_map[0x02fa] = "LiveOP_TributeNPC"; + opcode_map[0x02fe] = "LiveOP_TributeMoney"; + opcode_map[0x0364] = "LiveOP_TributeToggle"; + opcode_map[0x0322] = "LiveOP_RecipesFavorite"; + opcode_map[0x01f9] = "LiveOP_RecipesSearch"; + opcode_map[0x01fa] = "LiveOP_RecipeReply"; + opcode_map[0x01fb] = "LiveOP_RecipeDetails"; + opcode_map[0x01fc] = "LiveOP_RecipeAutoCombine"; + opcode_map[0x02db] = "LiveOP_FindPersonRequest"; + opcode_map[0x02dc] = "LiveOP_FindPersonReply"; + opcode_map[0x01dd] = "LiveOP_Shielding"; + opcode_map[0x0198] = "LiveOP_SetDataRate"; + opcode_map[0x023b] = "LiveOP_ZoneEntry"; + opcode_map[0x006b] = "LiveOP_PlayerProfile"; + opcode_map[0x0291] = "LiveOP_CharInventory"; + opcode_map[0x0170] = "LiveOP_ZoneSpawns"; + opcode_map[0x0026] = "LiveOP_TimeOfDay"; + opcode_map[0x015b] = "LiveOP_Weather"; + opcode_map[0x00ec] = "LiveOP_ReqNewZone"; + opcode_map[0x00eb] = "LiveOP_NewZone"; + opcode_map[0x00fd] = "LiveOP_ReqClientSpawn"; + opcode_map[0x012F] = "LiveOP_SpawnAppearance"; + opcode_map[0x0086] = "LiveOP_ClientReady"; + opcode_map[0x0086] = "LiveOP_ZoneComplete"; + opcode_map[0x02db] = "LiveOP_LoginComplete"; + opcode_map[0x0195] = "LiveOP_ApproveWorld"; + opcode_map[0x035f] = "LiveOP_LogServer"; + opcode_map[0x01b2] = "LiveOP_MOTD"; + opcode_map[0x0251] = "LiveOP_SendLoginInfo"; + opcode_map[0x00ea] = "LiveOP_DeleteCharacter"; + opcode_map[0x0102] = "LiveOP_SendCharInfo"; + opcode_map[0x00e1] = "LiveOP_ExpansionInfo"; + opcode_map[0x0104] = "LiveOP_CharacterCreate"; + opcode_map[0x02ab] = "LiveOP_RandomNameGenerator"; + opcode_map[0x005d] = "LiveOP_GuildsList"; + opcode_map[0x0125] = "LiveOP_ApproveName"; + opcode_map[0x0261] = "LiveOP_EnterWorld"; + opcode_map[0x015a] = "LiveOP_World_Client_CRC1"; + opcode_map[0x015e] = "LiveOP_World_Client_CRC2"; + opcode_map[0x0269] = "LiveOP_SetChatServer"; + opcode_map[0x0264] = "LiveOP_ZoneServerInfo"; + opcode_map[0x0017] = "LiveOP_AckPacket"; + opcode_map[0x012c] = "LiveOP_WearChange"; + opcode_map[0x1FA1] = "LiveOP_WorldObjectsSent"; + opcode_map[0x39C4] = "LiveOP_BlockedBuffs"; + opcode_map[0x4656] = "LiveOP_SpawnPositionUpdate"; + opcode_map[0x4b61] = "LiveOP_ManaUpdate"; + opcode_map[0x02d6] = "LiveOP_EnduranceUpdate"; + opcode_map[0x2ac1] = "LiveOP_MobManaUpdate"; + opcode_map[0x6c5f] = "LiveOP_MobEnduranceUpdate"; + opcode_map[0x73a8] = "LiveOP_SendMaxCharacters"; } From 5c903c6ee343b104adb1bcd9c41b808ccac260b9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:25:46 -0600 Subject: [PATCH 111/153] opcodemgr.cpp cleanup --- common/opcodemgr.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/common/opcodemgr.cpp b/common/opcodemgr.cpp index 6e524bfa5..f7a6ad3bf 100644 --- a/common/opcodemgr.cpp +++ b/common/opcodemgr.cpp @@ -15,15 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" -#include -#include "opcodemgr.h" -#include "debug.h" -#include "emu_opcodes.h" -#include -#include +#include "emu_opcodes.h" +#include "opcodemgr.h" + +#include #include +#include #include OpcodeManager::OpcodeManager() { From 1c665653eacd2565eef64053cc475eee19793d58 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:26:58 -0600 Subject: [PATCH 112/153] packet_dump cleanup --- common/packet_dump.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/packet_dump.cpp b/common/packet_dump.cpp index 6bb412f6b..3c9dfab4f 100644 --- a/common/packet_dump.cpp +++ b/common/packet_dump.cpp @@ -15,13 +15,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" + #include #include #include #include "packet_dump.h" -#include "eq_packet.h" #include "../common/servertalk.h" void DumpPacketAscii(const uchar* buf, uint32 size, uint32 cols, uint32 skip) { From fab6b602a82c886e3a0f5e37f92ac7c3d1094f62 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:28:15 -0600 Subject: [PATCH 113/153] packet_dump_file cleanup --- common/packet_dump_file.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/packet_dump_file.cpp b/common/packet_dump_file.cpp index 32aa7d984..95a72bb60 100644 --- a/common/packet_dump_file.cpp +++ b/common/packet_dump_file.cpp @@ -15,16 +15,18 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include + #include "../common/debug.h" + +#include +#include +#include #include + //#ifdef _CRTDBG_MAP_ALLOC // #undef new // #define new new(_NORMAL_BLOCK, __FILE__, __LINE__) //#endif -#include #include #ifdef _WINDOWS From 62d8fb538b22e1827e0c39f6c7fd812657da0d7a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:42:19 -0600 Subject: [PATCH 114/153] ptimer.cpp header include cleanup --- common/ptimer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/ptimer.cpp b/common/ptimer.cpp index c9b25b1a5..b39f37a04 100644 --- a/common/ptimer.cpp +++ b/common/ptimer.cpp @@ -15,15 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "debug.h" #include "timer.h" #include "ptimer.h" #include "database.h" #include "string_util.h" -#include -#include -#include #ifdef _WINDOWS #include From 689f95b430b2f7ae229c10c5d2cb9698455cf02f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:42:34 -0600 Subject: [PATCH 115/153] shareddb.cpp & .h header include cleanup --- common/shareddb.cpp | 20 ++--- common/shareddb.h | 194 +++++++++++++++++++++++--------------------- 2 files changed, 109 insertions(+), 105 deletions(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 4ba16b441..d0f89658a 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -3,22 +3,20 @@ #include #include -#include "shareddb.h" -#include "mysql.h" -#include "item.h" #include "classes.h" -#include "rulesys.h" -#include "seperator.h" -#include "string_util.h" #include "eq_packet_structs.h" -#include "guilds.h" -#include "extprofile.h" -#include "memory_mapped_file.h" -#include "ipc_mutex.h" #include "eqemu_exception.h" -#include "loottable.h" #include "faction.h" #include "features.h" +#include "guilds.h" +#include "ipc_mutex.h" +#include "item.h" +#include "loottable.h" +#include "memory_mapped_file.h" +#include "mysql.h" +#include "rulesys.h" +#include "shareddb.h" +#include "string_util.h" SharedDatabase::SharedDatabase() : Database(), skill_caps_mmf(nullptr), items_mmf(nullptr), items_hash(nullptr), faction_mmf(nullptr), faction_hash(nullptr), diff --git a/common/shareddb.h b/common/shareddb.h index 5f0707054..073c385e8 100644 --- a/common/shareddb.h +++ b/common/shareddb.h @@ -6,128 +6,134 @@ #include "database.h" #include "skills.h" #include "spdat.h" -#include "item.h" #include "base_data.h" #include "fixed_memory_hash_set.h" #include "fixed_memory_variable_hash_set.h" #include - +class EvolveInfo; +class Inventory; +class ItemInst; +struct BaseDataStruct; +struct InspectMessage_Struct; +struct PlayerProfile_Struct; +struct SPDat_Spell_Struct; struct Item_Struct; struct NPCFactionList; -struct Faction; struct LootTable_Struct; struct LootDrop_Struct; -namespace EQEmu { +namespace EQEmu +{ class MemoryMappedFile; } /* - * This object is inherited by world and zone's DB object, - * and is mainly here to facilitate shared memory, and other - * things which only world and zone need. - */ -class SharedDatabase : public Database { -public: - SharedDatabase(); - SharedDatabase(const char* host, const char* user, const char* passwd, const char* database,uint32 port); - virtual ~SharedDatabase(); + This object is inherited by world and zone's DB object, + and is mainly here to facilitate shared memory, and other + things which only world and zone need. +*/ +class SharedDatabase : public Database +{ + public: + SharedDatabase(); + SharedDatabase(const char* host, const char* user, const char* passwd, const char* database, uint32 port); + virtual ~SharedDatabase(); - /* - * General Character Related Stuff - */ - bool SetGMSpeed(uint32 account_id, uint8 gmspeed); - uint8 GetGMSpeed(uint32 account_id); - bool SetHideMe(uint32 account_id, uint8 hideme); - int32 DeleteStalePlayerCorpses(); - void LoadCharacterInspectMessage(uint32 character_id, InspectMessage_Struct* message); - void SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* message); - void GetBotInspectMessage(uint32 botid, InspectMessage_Struct* message); - void SetBotInspectMessage(uint32 botid, const InspectMessage_Struct* message); - bool GetCommandSettings(std::map &commands); - uint32 GetTotalTimeEntitledOnAccount(uint32 AccountID); + /* + General Character Related Stuff + */ + bool SetGMSpeed(uint32 account_id, uint8 gmspeed); + uint8 GetGMSpeed(uint32 account_id); + bool SetHideMe(uint32 account_id, uint8 hideme); + int32 DeleteStalePlayerCorpses(); + void LoadCharacterInspectMessage(uint32 character_id, InspectMessage_Struct* message); + void SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* message); + void GetBotInspectMessage(uint32 botid, InspectMessage_Struct* message); + void SetBotInspectMessage(uint32 botid, const InspectMessage_Struct* message); + bool GetCommandSettings(std::map &commands); + uint32 GetTotalTimeEntitledOnAccount(uint32 AccountID); - /* - * Character Inventory - */ - bool SaveCursor(uint32 char_id, std::list::const_iterator &start, std::list::const_iterator &end); - bool SaveInventory(uint32 char_id, const ItemInst* inst, int16 slot_id); - bool DeleteSharedBankSlot(uint32 char_id, int16 slot_id); - bool DeleteInventorySlot(uint32 char_id, int16 slot_id); - bool UpdateInventorySlot(uint32 char_id, const ItemInst* inst, int16 slot_id); - bool UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, int16 slot_id); - bool VerifyInventory(uint32 account_id, int16 slot_id, const ItemInst* inst); - bool GetSharedBank(uint32 id, Inventory* inv, bool is_charid); - int32 GetSharedPlatinum(uint32 account_id); - bool SetSharedPlatinum(uint32 account_id, int32 amount_to_add); - bool GetInventory(uint32 char_id, Inventory* inv); - bool GetInventory(uint32 account_id, char* name, Inventory* inv); - bool SetStartingItems(PlayerProfile_Struct* pp, Inventory* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin); + /* + Character Inventory + */ + bool SaveCursor(uint32 char_id, std::list::const_iterator &start, std::list::const_iterator &end); + bool SaveInventory(uint32 char_id, const ItemInst* inst, int16 slot_id); + bool DeleteSharedBankSlot(uint32 char_id, int16 slot_id); + bool DeleteInventorySlot(uint32 char_id, int16 slot_id); + bool UpdateInventorySlot(uint32 char_id, const ItemInst* inst, int16 slot_id); + bool UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, int16 slot_id); + bool VerifyInventory(uint32 account_id, int16 slot_id, const ItemInst* inst); + bool GetSharedBank(uint32 id, Inventory* inv, bool is_charid); + int32 GetSharedPlatinum(uint32 account_id); + bool SetSharedPlatinum(uint32 account_id, int32 amount_to_add); + bool GetInventory(uint32 char_id, Inventory* inv); + bool GetInventory(uint32 account_id, char* name, Inventory* inv); + bool SetStartingItems(PlayerProfile_Struct* pp, Inventory* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin); - std::string GetBook(const char *txtfile); + std::string GetBook(const char *txtfile); - /* - * Item Methods - */ - ItemInst* CreateItem(uint32 item_id, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0); - ItemInst* CreateItem(const Item_Struct* item, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0); - ItemInst* CreateBaseItem(const Item_Struct* item, int16 charges=0); + /* + Item Methods + */ + ItemInst* CreateItem(uint32 item_id, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0); + ItemInst* CreateItem(const Item_Struct* item, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0); + ItemInst* CreateBaseItem(const Item_Struct* item, int16 charges = 0); - /* - * Shared Memory crap - */ + /* + Shared Memory crap + */ - //items - void GetItemsCount(int32 &item_count, uint32 &max_id); - void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id); - bool LoadItems(); - const Item_Struct* IterateItems(uint32* id); - const Item_Struct* GetItem(uint32 id); - const EvolveInfo* GetEvolveInfo(uint32 loregroup); + //items + void GetItemsCount(int32 &item_count, uint32 &max_id); + void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id); + bool LoadItems(); + const Item_Struct* IterateItems(uint32* id); + const Item_Struct* GetItem(uint32 id); + const EvolveInfo* GetEvolveInfo(uint32 loregroup); - //faction lists - void GetFactionListInfo(uint32 &list_count, uint32 &max_lists); - const NPCFactionList* GetNPCFactionEntry(uint32 id); - void LoadNPCFactionLists(void *data, uint32 size, uint32 list_count, uint32 max_lists); - bool LoadNPCFactionLists(); + //faction lists + void GetFactionListInfo(uint32 &list_count, uint32 &max_lists); + const NPCFactionList* GetNPCFactionEntry(uint32 id); + void LoadNPCFactionLists(void *data, uint32 size, uint32 list_count, uint32 max_lists); + bool LoadNPCFactionLists(); - //loot - void GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot_table, uint32 &loot_table_entries); - void GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_drop, uint32 &loot_drop_entries); - void LoadLootTables(void *data, uint32 size); - void LoadLootDrops(void *data, uint32 size); - bool LoadLoot(); - const LootTable_Struct* GetLootTable(uint32 loottable_id); - const LootDrop_Struct* GetLootDrop(uint32 lootdrop_id); + //loot + void GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot_table, uint32 &loot_table_entries); + void GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_drop, uint32 &loot_drop_entries); + void LoadLootTables(void *data, uint32 size); + void LoadLootDrops(void *data, uint32 size); + bool LoadLoot(); + const LootTable_Struct* GetLootTable(uint32 loottable_id); + const LootDrop_Struct* GetLootDrop(uint32 lootdrop_id); - void LoadSkillCaps(void *data); - bool LoadSkillCaps(); - uint16 GetSkillCap(uint8 Class_, SkillUseTypes Skill, uint8 Level); - uint8 GetTrainLevel(uint8 Class_, SkillUseTypes Skill, uint8 Level); + void LoadSkillCaps(void *data); + bool LoadSkillCaps(); + uint16 GetSkillCap(uint8 Class_, SkillUseTypes Skill, uint8 Level); + uint8 GetTrainLevel(uint8 Class_, SkillUseTypes Skill, uint8 Level); - int GetMaxSpellID(); - void LoadSpells(void *data, int max_spells); - void LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpellID); + int GetMaxSpellID(); + void LoadSpells(void *data, int max_spells); + void LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpellID); - int GetMaxBaseDataLevel(); - bool LoadBaseData(); - void LoadBaseData(void *data, int max_level); - const BaseDataStruct* GetBaseData(int lvl, int cl); + int GetMaxBaseDataLevel(); + bool LoadBaseData(); + void LoadBaseData(void *data, int max_level); + const BaseDataStruct* GetBaseData(int lvl, int cl); -protected: + protected: - EQEmu::MemoryMappedFile *skill_caps_mmf; - EQEmu::MemoryMappedFile *items_mmf; - EQEmu::FixedMemoryHashSet *items_hash; - EQEmu::MemoryMappedFile *faction_mmf; - EQEmu::FixedMemoryHashSet *faction_hash; - EQEmu::MemoryMappedFile *loot_table_mmf; - EQEmu::FixedMemoryVariableHashSet *loot_table_hash; - EQEmu::MemoryMappedFile *loot_drop_mmf; - EQEmu::FixedMemoryVariableHashSet *loot_drop_hash; - EQEmu::MemoryMappedFile *base_data_mmf; + EQEmu::MemoryMappedFile *skill_caps_mmf; + EQEmu::MemoryMappedFile *items_mmf; + EQEmu::FixedMemoryHashSet *items_hash; + EQEmu::MemoryMappedFile *faction_mmf; + EQEmu::FixedMemoryHashSet *faction_hash; + EQEmu::MemoryMappedFile *loot_table_mmf; + EQEmu::FixedMemoryVariableHashSet *loot_table_hash; + EQEmu::MemoryMappedFile *loot_drop_mmf; + EQEmu::FixedMemoryVariableHashSet *loot_drop_hash; + EQEmu::MemoryMappedFile *base_data_mmf; }; #endif /*SHAREDDB_H_*/ From 12206c0e501c31c0f37b6b150a9d377e651f2f35 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:42:44 -0600 Subject: [PATCH 116/153] races.cpp header include cleanup --- common/races.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/races.cpp b/common/races.cpp index d088ce185..6322b50af 100644 --- a/common/races.cpp +++ b/common/races.cpp @@ -15,8 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include "../common/eq_packet_structs.h" + #include "../common/races.h" const char* GetRaceName(uint16 race) { From f3ebb2e5d8afafae99546c90ae464c1f54e39039 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:42:59 -0600 Subject: [PATCH 117/153] rdtsc.cpp header include cleanup --- common/rdtsc.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/rdtsc.cpp b/common/rdtsc.cpp index 1d66c0254..53962f1d5 100644 --- a/common/rdtsc.cpp +++ b/common/rdtsc.cpp @@ -15,10 +15,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" + #include "rdtsc.h" #include "types.h" -#include #ifdef _WINDOWS #include From b687fb2439729b26d08816921eea3ce1ad315849 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:43:58 -0600 Subject: [PATCH 118/153] shareddb.cpp header include cleanup --- common/shareddb.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index d0f89658a..cd8fd49e0 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1,14 +1,11 @@ #include #include -#include -#include #include "classes.h" #include "eq_packet_structs.h" #include "eqemu_exception.h" #include "faction.h" #include "features.h" -#include "guilds.h" #include "ipc_mutex.h" #include "item.h" #include "loottable.h" From a55b2ca5577543f85342fe49b12626447a158641 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:45:37 -0600 Subject: [PATCH 119/153] spdat.cpp header include cleanup --- common/spdat.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/common/spdat.cpp b/common/spdat.cpp index 3f8ae4849..8bceec249 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -70,15 +70,12 @@ */ -#include "debug.h" -#include "spdat.h" -#include "packet_dump.h" -#include "moremath.h" -#include "item.h" -#include "skills.h" -#include "bodytypes.h" +#include "../common/logsys.h" +#include "../common/logtypes.h" + #include "classes.h" -#include +#include "spdat.h" + #ifndef WIN32 #include #include "unix.h" From 40377447acf06db3af2122cef986330ebb06c0d5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:47:48 -0600 Subject: [PATCH 120/153] string_util.cpp & .h header include cleanup --- common/skills.cpp | 1 + common/string_util.cpp | 3 --- common/string_util.h | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/common/skills.cpp b/common/skills.cpp index 24a32196e..ceb726d8c 100644 --- a/common/skills.cpp +++ b/common/skills.cpp @@ -15,6 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "types.h" #include "skills.h" diff --git a/common/string_util.cpp b/common/string_util.cpp index 2fcb59e05..63da1b08c 100644 --- a/common/string_util.cpp +++ b/common/string_util.cpp @@ -16,9 +16,6 @@ #include "string_util.h" -#include // for strncpy -#include - #ifdef _WINDOWS #include diff --git a/common/string_util.h b/common/string_util.h index 34f08b5e2..31ba4c587 100644 --- a/common/string_util.h +++ b/common/string_util.h @@ -19,7 +19,6 @@ #include #include #include -#include #include "types.h" From 6b485273d19b1ed8114437aa020a1774ca49da2c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:50:33 -0600 Subject: [PATCH 121/153] tcp_connection.cpp & .h header include cleanup --- common/tcp_connection.cpp | 5 +---- common/tcp_connection.h | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index ea57a6301..890a46adc 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -15,17 +15,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" #include #include -#include #include #include "tcp_connection.h" -#include "../common/servertalk.h" -#include "../common/timer.h" -#include "../common/packet_dump.h" #ifdef FREEBSD //Timothy Whitman - January 7, 2003 #define MSG_NOSIGNAL 0 diff --git a/common/tcp_connection.h b/common/tcp_connection.h index 2e5b7e883..db38c941b 100644 --- a/common/tcp_connection.h +++ b/common/tcp_connection.h @@ -48,8 +48,6 @@ #include "queue.h" #include "misc_functions.h" -class BaseTCPServer; -class ServerPacket; #define TCPConnection_ErrorBufferSize 1024 #define MaxTCPReceiveBuffferSize 524288 From f4609101d50c3c1d5cd51769287cfb09b500070c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:52:03 -0600 Subject: [PATCH 122/153] tcp_server.cpp include header cleanup --- common/tcp_server.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/tcp_server.cpp b/common/tcp_server.cpp index 415f76fa1..e424947d2 100644 --- a/common/tcp_server.cpp +++ b/common/tcp_server.cpp @@ -1,8 +1,6 @@ #include "debug.h" #include "tcp_server.h" #include -#include -#include #ifdef _WINDOWS #include From ef3d4ae51a7d1a6fdb719188542a940f696c47a7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:56:29 -0600 Subject: [PATCH 123/153] string_util linux build fix --- common/string_util.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/string_util.h b/common/string_util.h index 31ba4c587..70e888bdf 100644 --- a/common/string_util.h +++ b/common/string_util.h @@ -17,8 +17,10 @@ #define _STRINGUTIL_H_ #include +#include #include #include + #include "types.h" From 25ee643aeb364b2ac4a5c599cab47b8d1ccb7f43 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:56:44 -0600 Subject: [PATCH 124/153] timer.cpp include header cleanup --- common/timer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/timer.cpp b/common/timer.cpp index eb6a081c2..c1c94a7f6 100644 --- a/common/timer.cpp +++ b/common/timer.cpp @@ -15,7 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" + + // Disgrace: for windows compile #ifndef WIN32 #include @@ -23,8 +24,6 @@ #include #endif -#include - #include "timer.h" uint32 current_time = 0; From 5b49ecf07244ee7b5c9e53695af42d397c08bca3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 22:56:55 -0600 Subject: [PATCH 125/153] worldconn.cpp header include cleanup --- common/worldconn.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/common/worldconn.cpp b/common/worldconn.cpp index 73946d6f5..d43009b23 100644 --- a/common/worldconn.cpp +++ b/common/worldconn.cpp @@ -17,18 +17,11 @@ */ #include "../common/debug.h" -#include -#include -#include #include -#include -#include -#include #include "worldconn.h" #include "eqemu_config.h" #include "md5.h" -#include "database.h" #include "servertalk.h" WorldConnection::WorldConnection(EmuTCPConnection::ePacketMode mode, const char *password) From 0b89c95ab2eaea9ee9ff32d8c9ddd05735a2fb74 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 23:00:29 -0600 Subject: [PATCH 126/153] tcp_server.cpp linux build fix for not fake --- common/tcp_server.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/tcp_server.cpp b/common/tcp_server.cpp index e424947d2..f99fb256d 100644 --- a/common/tcp_server.cpp +++ b/common/tcp_server.cpp @@ -1,6 +1,9 @@ #include "debug.h" #include "tcp_server.h" + #include +#include +#include #ifdef _WINDOWS #include From ad8e834fe8bd3aadd4a9c3de50d4c0b1733c040f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 15 Dec 2014 23:14:55 -0600 Subject: [PATCH 127/153] Dropping client 6.2 support --- common/CMakeLists.txt | 12 - common/eq_dictionary.cpp | 7 - common/eq_dictionary.h | 1 - common/patches/client62.cpp | 1341 ----------- common/patches/client62.h | 37 - common/patches/client62_constants.h | 212 -- common/patches/client62_itemfields.h | 166 -- common/patches/client62_ops.h | 54 - common/patches/client62_structs.h | 3163 -------------------------- common/patches/patches.cpp | 3 - utils/patches/patch_6.2.conf | 539 ----- world/clientlist.cpp | 6 +- zone/lua_general.cpp | 1 - zone/tasks.cpp | 14 - 14 files changed, 2 insertions(+), 5554 deletions(-) delete mode 100644 common/patches/client62.cpp delete mode 100644 common/patches/client62.h delete mode 100644 common/patches/client62_constants.h delete mode 100644 common/patches/client62_itemfields.h delete mode 100644 common/patches/client62_ops.h delete mode 100644 common/patches/client62_structs.h delete mode 100644 utils/patches/patch_6.2.conf diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 06547f418..d547c4c88 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -67,7 +67,6 @@ SET(common_sources worldconn.cpp xml_parser.cpp platform.cpp - patches/client62.cpp patches/patches.cpp patches/sod.cpp patches/sof.cpp @@ -193,11 +192,6 @@ SET(common_headers worldconn.h xml_parser.h zone_numbers.h - patches/client62.h - patches/client62_constants.h - patches/client62_itemfields.h - patches/client62_ops.h - patches/client62_structs.h patches/patches.h patches/sod.h patches/sod_constants.h @@ -251,11 +245,6 @@ SET(common_headers ) SOURCE_GROUP(Patches FILES - patches/client62.h - patches/client62_itemfields.h - patches/client62_ops.h - patches/client62_constants.h - patches/client62_structs.h patches/patches.h patches/sod.h patches/sod_itemfields.h @@ -291,7 +280,6 @@ SOURCE_GROUP(Patches FILES patches/underfoot_ops.h patches/underfoot_constants.h patches/underfoot_structs.h - patches/client62.cpp patches/patches.cpp patches/sod.cpp patches/sof.cpp diff --git a/common/eq_dictionary.cpp b/common/eq_dictionary.cpp index 3756ca8fe..37414853e 100644 --- a/common/eq_dictionary.cpp +++ b/common/eq_dictionary.cpp @@ -548,7 +548,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapBank] /*Unknown*/ NOT_USED, -/*62*/ Client62::consts::MAP_BANK_SIZE, /*Titanium*/ Titanium::consts::MAP_BANK_SIZE, /*SoF*/ EmuConstants::MAP_BANK_SIZE, /*SoD*/ EmuConstants::MAP_BANK_SIZE, @@ -698,7 +697,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapCorpse] /*Unknown*/ NOT_USED, -/*62*/ Client62::consts::MAP_CORPSE_SIZE, /*Titanium*/ Titanium::consts::MAP_CORPSE_SIZE, /*SoF*/ SoF::consts::MAP_CORPSE_SIZE, /*SoD*/ SoD::consts::MAP_CORPSE_SIZE, @@ -728,7 +726,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapInspect] /*Unknown*/ NOT_USED, -/*62*/ Client62::consts::MAP_INSPECT_SIZE, /*Titanium*/ Titanium::consts::MAP_INSPECT_SIZE, /*SoF*/ SoF::consts::MAP_INSPECT_SIZE, /*SoD*/ SoD::consts::MAP_INSPECT_SIZE, @@ -1006,7 +1003,6 @@ uint64 EQLimits::CursorBitmask(uint32 version) { bool EQLimits::AllowsEmptyBagInBag(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ false, -/*62*/ Client62::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*Titanium*/ Titanium::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*SoF*/ SoF::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*SoD*/ SoD::limits::ALLOWS_EMPTY_BAG_IN_BAG, @@ -1027,8 +1023,6 @@ bool EQLimits::AllowsEmptyBagInBag(uint32 version) { bool EQLimits::AllowsClickCastFromBag(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ false, -/*62*/ Client62::limits::ALLOWS_CLICK_CAST_FROM_BAG, -/*Titanium*/ Titanium::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*SoF*/ SoF::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*SoD*/ SoD::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*Underfoot*/ Underfoot::limits::ALLOWS_CLICK_CAST_FROM_BAG, @@ -1088,7 +1082,6 @@ uint16 EQLimits::ItemContainerSize(uint32 version) { bool EQLimits::CoinHasWeight(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ true, -/*62*/ Client62::limits::COIN_HAS_WEIGHT, /*Titanium*/ Titanium::limits::COIN_HAS_WEIGHT, /*SoF*/ SoF::limits::COIN_HAS_WEIGHT, /*SoD*/ SoD::limits::COIN_HAS_WEIGHT, diff --git a/common/eq_dictionary.h b/common/eq_dictionary.h index a17ade924..43511072f 100644 --- a/common/eq_dictionary.h +++ b/common/eq_dictionary.h @@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "eq_constants.h" #include "clientversions.h" #include -#include "../common/patches/client62_constants.h" #include "../common/patches/titanium_constants.h" #include "../common/patches/sof_constants.h" #include "../common/patches/sod_constants.h" diff --git a/common/patches/client62.cpp b/common/patches/client62.cpp deleted file mode 100644 index 102414b16..000000000 --- a/common/patches/client62.cpp +++ /dev/null @@ -1,1341 +0,0 @@ -#include "../debug.h" -#include "client62.h" -#include "../opcodemgr.h" -#include "../logsys.h" -#include "../eq_stream_ident.h" -#include "../crc32.h" - -#include "../eq_packet_structs.h" -#include "../misc_functions.h" -#include "../string_util.h" -#include "../item.h" -#include "../clientversions.h" -#include "client62_structs.h" - -namespace Client62 -{ - static const char *name = "6.2"; - static OpcodeManager *opcodes = nullptr; - static Strategy struct_strategy; - - char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint8 depth); - - // server to client inventory location converters - static inline int16 ServerToClient62Slot(uint32 ServerSlot); - static inline int16 ServerToClient62CorpseSlot(uint32 ServerCorpse); - - // client to server inventory location converters - static inline uint32 Client62ToServerSlot(int16 Client62Slot); - static inline uint32 Client62ToServerCorpseSlot(int16 Client62Corpse); - - void Register(EQStreamIdentifier &into) - { - //create our opcode manager if we havent already - if (opcodes == nullptr) { - //TODO: get this file name from the config file - std::string opfile = "patch_"; - opfile += name; - opfile += ".conf"; - //load up the opcode manager. - //TODO: figure out how to support shared memory with multiple patches... - opcodes = new RegularOpcodeManager(); - if (!opcodes->LoadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); - return; - } - } - - //ok, now we have what we need to register. - - EQStream::Signature signature; - std::string pname; - - //register our world signature. - pname = std::string(name) + "_world"; - signature.ignore_eq_opcode = 0; - signature.first_length = sizeof(structs::LoginInfo_Struct); - signature.first_eq_opcode = opcodes->EmuToEQ(OP_SendLoginInfo); - into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy); - - //register our zone signature. - pname = std::string(name) + "_zone"; - signature.ignore_eq_opcode = opcodes->EmuToEQ(OP_AckPacket); - signature.first_length = sizeof(structs::ClientZoneEntry_Struct); - signature.first_eq_opcode = opcodes->EmuToEQ(OP_ZoneEntry); - into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy); - - _log(NET__IDENTIFY, "Registered patch %s", name); - } - - void Reload() - { - //we have a big problem to solve here when we switch back to shared memory - //opcode managers because we need to change the manager pointer, which means - //we need to go to every stream and replace it's manager. - - if (opcodes != nullptr) { - //TODO: get this file name from the config file - std::string opfile = "patch_"; - opfile += name; - opfile += ".conf"; - if (!opcodes->ReloadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); - return; - } - _log(NET__OPCODES, "Reloaded opcodes for patch %s", name); - } - } - - Strategy::Strategy() : StructStrategy() - { - //all opcodes default to passthrough. -#include "ss_register.h" -#include "client62_ops.h" - } - - std::string Strategy::Describe() const - { - std::string r; - r += "Patch "; - r += name; - return(r); - } - - const EQClientVersion Strategy::ClientVersion() const - { - return EQClient62; - } - -#include "ss_define.h" - -// ENCODE methods - EAT_ENCODE(OP_GuildMemberLevelUpdate); // added ; - - EAT_ENCODE(OP_ZoneServerReady); // added ; - - ENCODE(OP_Action) - { - ENCODE_LENGTH_EXACT(Action_Struct); - SETUP_DIRECT_ENCODE(Action_Struct, structs::Action_Struct); - - OUT(target); - OUT(source); - OUT(level); - OUT(instrument_mod); - OUT(sequence); - OUT(type); - //OUT(damage); - OUT(spell); - OUT(buff_unknown); // if this is 4, a buff icon is made - - FINISH_ENCODE(); - } - - ENCODE(OP_AdventureMerchantSell) - { - ENCODE_LENGTH_EXACT(Adventure_Sell_Struct); - SETUP_DIRECT_ENCODE(Adventure_Sell_Struct, structs::Adventure_Sell_Struct); - - eq->unknown000 = 1; - OUT(npcid); - eq->slot = ServerToClient62Slot(emu->slot); - OUT(charges); - OUT(sell_price); - - FINISH_ENCODE(); - } - - ENCODE(OP_ApplyPoison) - { - ENCODE_LENGTH_EXACT(ApplyPoison_Struct); - SETUP_DIRECT_ENCODE(ApplyPoison_Struct, structs::ApplyPoison_Struct); - - eq->inventorySlot = ServerToClient62Slot(emu->inventorySlot); - OUT(success); - - FINISH_ENCODE(); - } - - ENCODE(OP_BazaarSearch) - { - EQApplicationPacket *in = *p; - *p = nullptr; - - char *Buffer = (char *)in->pBuffer; - - uint8 SubAction = VARSTRUCT_DECODE_TYPE(uint8, Buffer); - - if (SubAction != BazaarSearchResults) - { - dest->FastQueuePacket(&in, ack_req); - - return; - } - - unsigned char *__emu_buffer = in->pBuffer; - - BazaarSearchResults_Struct *emu = (BazaarSearchResults_Struct *)__emu_buffer; - - int EntryCount = in->size / sizeof(BazaarSearchResults_Struct); - - if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) - { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); - delete in; - return; - } - in->size = EntryCount * sizeof(structs::BazaarSearchResults_Struct); - - in->pBuffer = new unsigned char[in->size]; - - memset(in->pBuffer, 0, in->size); - - structs::BazaarSearchResults_Struct *eq = (structs::BazaarSearchResults_Struct *)in->pBuffer; - - for (int i = 0; i < EntryCount; ++i, ++emu, ++eq) - { - OUT(Beginning.Action); - OUT(NumItems); - OUT(SerialNumber); - OUT(SellerID); - OUT(Cost); - OUT(ItemStat); - memcpy(eq->ItemName, emu->ItemName, sizeof(eq->ItemName)); - } - - delete[] __emu_buffer; - dest->FastQueuePacket(&in, ack_req); - } - - ENCODE(OP_BecomeTrader) - { - ENCODE_LENGTH_EXACT(BecomeTrader_Struct); - SETUP_DIRECT_ENCODE(BecomeTrader_Struct, structs::BecomeTrader_Struct); - - OUT(ID); - OUT(Code); - - FINISH_ENCODE(); - } - - ENCODE(OP_CharInventory) - { - //consume the packet - EQApplicationPacket *in = *p; - *p = nullptr; - - //store away the emu struct - unsigned char *__emu_buffer = in->pBuffer; - - int itemcount = in->size / sizeof(InternalSerializedItem_Struct); - if (itemcount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); - delete in; - return; - } - InternalSerializedItem_Struct *eq = (InternalSerializedItem_Struct *)in->pBuffer; - - //do the transform... - int r; - std::string serial_string; - for (r = 0; r < itemcount; r++, eq++) { - uint32 length; - char *serialized = SerializeItem((ItemInst*)eq->inst, eq->slot_id, &length, 0); - if (serialized) { - serial_string.append(serialized, length + 1); - safe_delete_array(serialized); - } - else { - _log(NET__STRUCTS, "Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); - } - - } - - in->size = serial_string.length(); - in->pBuffer = new unsigned char[in->size]; - memcpy(in->pBuffer, serial_string.c_str(), serial_string.length()); - - delete[] __emu_buffer; - dest->FastQueuePacket(&in, ack_req); - } - - ENCODE(OP_DeleteCharge) { ENCODE_FORWARD(OP_MoveItem); } - - ENCODE(OP_DeleteItem) - { - ENCODE_LENGTH_EXACT(DeleteItem_Struct); - SETUP_DIRECT_ENCODE(DeleteItem_Struct, structs::DeleteItem_Struct); - - eq->from_slot = ServerToClient62Slot(emu->from_slot); - eq->to_slot = ServerToClient62Slot(emu->to_slot); - OUT(number_in_stack); - - FINISH_ENCODE(); - } - - ENCODE(OP_DeleteSpawn) - { - SETUP_DIRECT_ENCODE(DeleteSpawn_Struct, structs::DeleteSpawn_Struct); - - OUT(spawn_id); - - FINISH_ENCODE(); - } - - ENCODE(OP_GuildMemberList) - { - //consume the packet - EQApplicationPacket *in = *p; - *p = nullptr; - - //store away the emu struct - unsigned char *__emu_buffer = in->pBuffer; - Internal_GuildMembers_Struct *emu = (Internal_GuildMembers_Struct *)in->pBuffer; - - //make a new EQ buffer. - uint32 pnl = strlen(emu->player_name); - uint32 length = sizeof(structs::GuildMembers_Struct) + pnl + - emu->count * sizeof(structs::GuildMemberEntry_Struct) - + emu->name_length + emu->note_length; - in->pBuffer = new uint8[length]; - in->size = length; - //no memset since we fill every byte. - - uint8 *buffer; - buffer = in->pBuffer; - - //easier way to setup GuildMembers_Struct - //set prefix name - strcpy((char *)buffer, emu->player_name); - buffer += pnl; - *buffer = '\0'; - buffer++; - - //add member count. - *((uint32 *)buffer) = htonl(emu->count); - buffer += sizeof(uint32); - - if (emu->count > 0) { - Internal_GuildMemberEntry_Struct *emu_e = emu->member; - const char *emu_name = (const char *)(__emu_buffer + - sizeof(Internal_GuildMembers_Struct)+ //skip header - emu->count * sizeof(Internal_GuildMemberEntry_Struct) //skip static length member data - ); - const char *emu_note = (emu_name + - emu->name_length + //skip name contents - emu->count //skip string terminators - ); - - structs::GuildMemberEntry_Struct *e = (structs::GuildMemberEntry_Struct *) buffer; - - uint32 r; - for (r = 0; r < emu->count; r++, emu_e++) { - - //the order we set things here must match the struct - - //nice helper macro - /*#define SlideStructString(field, str) \ - strcpy(e->field, str.c_str()); \ - e = (GuildMemberEntry_Struct *) ( ((uint8 *)e) + str.length() )*/ -#define SlideStructString(field, str) \ - { \ - int sl = strlen(str); \ - memcpy(e->field, str, sl+1); \ - e = (structs::GuildMemberEntry_Struct *) ( ((uint8 *)e) + sl ); \ - str += sl + 1; \ - } -#define PutFieldN(field) e->field = htonl(emu_e->field) - - SlideStructString(name, emu_name); - PutFieldN(level); - PutFieldN(banker); - PutFieldN(class_); - PutFieldN(rank); - PutFieldN(time_last_on); - PutFieldN(tribute_enable); - PutFieldN(total_tribute); - PutFieldN(last_tribute); - SlideStructString(public_note, emu_note); - e->zoneinstance = 0; - e->zone_id = htons(emu_e->zone_id); -#undef SlideStructString -#undef PutFieldN - - e++; - } - } - - delete[] __emu_buffer; - dest->FastQueuePacket(&in, ack_req); - } - - ENCODE(OP_Illusion) - { - ENCODE_LENGTH_EXACT(Illusion_Struct); - SETUP_DIRECT_ENCODE(Illusion_Struct, structs::Illusion_Struct); - - OUT(spawnid); - OUT_str(charname); - - if (emu->race > 473) - eq->race = 1; - else - OUT(race); - - OUT(gender); - OUT(texture); - OUT(helmtexture); - OUT(face); - OUT(hairstyle); - OUT(haircolor); - OUT(beard); - OUT(beardcolor); - OUT(size); - - FINISH_ENCODE(); - } - - ENCODE(OP_ItemLinkResponse) { ENCODE_FORWARD(OP_ItemPacket); } - - ENCODE(OP_ItemPacket) - { - //consume the packet - EQApplicationPacket *in = *p; - *p = nullptr; - - //store away the emu struct - unsigned char *__emu_buffer = in->pBuffer; - ItemPacket_Struct *old_item_pkt = (ItemPacket_Struct *)__emu_buffer; - InternalSerializedItem_Struct *int_struct = (InternalSerializedItem_Struct *)(old_item_pkt->SerializedItem); - - uint32 length; - char *serialized = SerializeItem((const ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); - - if (!serialized) { - _log(NET__STRUCTS, "Serialization failed on item slot %d.", int_struct->slot_id); - delete in; - return; - } - in->size = length + 5; // ItemPacketType + Serialization + \0 - in->pBuffer = new unsigned char[in->size]; - ItemPacket_Struct *new_item_pkt = (ItemPacket_Struct *)in->pBuffer; - new_item_pkt->PacketType = old_item_pkt->PacketType; - memcpy(new_item_pkt->SerializedItem, serialized, length + 1); - - delete[] __emu_buffer; - safe_delete_array(serialized); - dest->FastQueuePacket(&in, ack_req); - } - - ENCODE(OP_LeadershipExpUpdate) - { - SETUP_DIRECT_ENCODE(LeadershipExpUpdate_Struct, structs::LeadershipExpUpdate_Struct); - - OUT(group_leadership_exp); - OUT(group_leadership_points); - OUT(raid_leadership_exp); - OUT(raid_leadership_points); - - FINISH_ENCODE(); - } - - ENCODE(OP_LootItem) - { - ENCODE_LENGTH_EXACT(LootingItem_Struct); - SETUP_DIRECT_ENCODE(LootingItem_Struct, structs::LootingItem_Struct); - - OUT(lootee); - OUT(looter); - eq->slot_id = ServerToClient62CorpseSlot(emu->slot_id); - OUT(auto_loot); - - FINISH_ENCODE(); - } - - ENCODE(OP_MoveItem) - { - ENCODE_LENGTH_EXACT(MoveItem_Struct); - SETUP_DIRECT_ENCODE(MoveItem_Struct, structs::MoveItem_Struct); - - eq->from_slot = ServerToClient62Slot(emu->from_slot); - eq->to_slot = ServerToClient62Slot(emu->to_slot); - OUT(number_in_stack); - - FINISH_ENCODE(); - } - - ENCODE(OP_NewSpawn) { ENCODE_FORWARD(OP_ZoneSpawns); } - - ENCODE(OP_OnLevelMessage) - { - ENCODE_LENGTH_EXACT(OnLevelMessage_Struct); - SETUP_DIRECT_ENCODE(OnLevelMessage_Struct, structs::OnLevelMessage_Struct); - - OUT_str(Title); - OUT_str(Text); - OUT(Buttons); - OUT(Duration); - OUT(PopupID); - - eq->unknown4236 = 0x00000000; - eq->unknown4240 = 0xffffffff; - - FINISH_ENCODE(); - } - - ENCODE(OP_PetBuffWindow) - { - ENCODE_LENGTH_EXACT(PetBuff_Struct); - SETUP_DIRECT_ENCODE(PetBuff_Struct, PetBuff_Struct); - - OUT(petid); - OUT(buffcount); - - int EQBuffSlot = 0; - - for (uint32 EmuBuffSlot = 0; EmuBuffSlot < BUFF_COUNT; ++EmuBuffSlot) - { - if (emu->spellid[EmuBuffSlot]) - { - eq->spellid[EQBuffSlot] = emu->spellid[EmuBuffSlot]; - eq->ticsremaining[EQBuffSlot++] = emu->ticsremaining[EmuBuffSlot]; - } - } - - FINISH_ENCODE(); - } - - ENCODE(OP_PlayerProfile) - { - SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct); - - uint32 r; - - memset(eq->unknown3224, 0xff, 448); - memset(eq->unknown3704, 0xff, 32); - - // OUT(checksum); - OUT(gender); - OUT(race); - OUT(class_); - OUT(level); - eq->level2 = emu->level; - - eq->bind_zone_id = emu->binds[0].zoneId; - eq->bind_x[0] = emu->binds[0].x; - eq->bind_y[0] = emu->binds[0].y; - eq->bind_z[0] = emu->binds[0].z; - eq->bind_heading[0] = emu->binds[0].heading; - //just making this up base on organization of struct: - eq->zone_safe_x = emu->binds[4].x; - eq->zone_safe_y = emu->binds[4].y; - eq->zone_safe_z = emu->binds[4].z; - eq->zone_safe_heading = emu->binds[4].heading; - - OUT(deity); - OUT(intoxication); - OUT_array(spellSlotRefresh, structs::MAX_PP_MEMSPELL); - OUT(abilitySlotRefresh); - // OUT(unknown0166[4]); - OUT(haircolor); - OUT(beardcolor); - OUT(eyecolor1); - OUT(eyecolor2); - OUT(hairstyle); - OUT(beard); - for (r = 0; r < 9; r++) { - OUT(item_material[r]); - OUT(item_tint[r].color); - - } - for (r = 0; r < structs::MAX_PP_AA_ARRAY; r++) { - OUT(aa_array[r].AA); - OUT(aa_array[r].value); - } - OUT(points); - OUT(mana); - OUT(cur_hp); - OUT(STR); - OUT(STA); - OUT(CHA); - OUT(DEX); - OUT(INT); - OUT(AGI); - OUT(WIS); - OUT(face); - OUT_array(spell_book, structs::MAX_PP_SPELLBOOK); - OUT_array(mem_spells, structs::MAX_PP_MEMSPELL); - OUT(platinum); - OUT(gold); - OUT(silver); - OUT(copper); - OUT(platinum_cursor); - OUT(gold_cursor); - OUT(silver_cursor); - OUT(copper_cursor); - - OUT_array(skills, structs::MAX_PP_SKILL); // 1:1 direct copy (100 dword) - - OUT(toxicity); - OUT(thirst_level); - OUT(hunger_level); - for (r = 0; r < structs::BUFF_COUNT; r++) { - OUT(buffs[r].slotid); - OUT(buffs[r].level); - OUT(buffs[r].bard_modifier); - OUT(buffs[r].effect); - OUT(buffs[r].spellid); - OUT(buffs[r].duration); - OUT(buffs[r].counters); - // OUT(buffs[r].player_id); - } - for (r = 0; r < structs::MAX_PP_DISCIPLINES; r++) { - OUT(disciplines.values[r]); - } - // OUT_array(recastTimers, structs::MAX_RECAST_TYPES); - OUT(endurance); - OUT(aapoints_spent); - OUT(aapoints); - for (r = 0; r < structs::MAX_PLAYER_BANDOLIER; r++) { - OUT_str(bandoliers[r].name); - uint32 k; - for (k = 0; k < structs::MAX_PLAYER_BANDOLIER_ITEMS; k++) { - OUT(bandoliers[r].items[k].item_id); - OUT(bandoliers[r].items[k].icon); - OUT_str(bandoliers[r].items[k].item_name); - } - } - for (r = 0; r < structs::MAX_PLAYER_BANDOLIER_ITEMS; r++) { - OUT(potionbelt.items[r].item_id); - OUT(potionbelt.items[r].icon); - OUT_str(potionbelt.items[r].item_name); - } - // OUT(available_slots); - OUT_str(name); - OUT_str(last_name); - OUT(guild_id); - OUT(birthday); - OUT(lastlogin); - OUT(timePlayedMin); - OUT(pvp); - OUT(anon); - OUT(gm); - OUT(guildrank); - OUT(exp); - OUT_array(languages, structs::MAX_PP_LANGUAGE); - OUT(x); - OUT(y); - OUT(z); - OUT(heading); - OUT(platinum_bank); - OUT(gold_bank); - OUT(silver_bank); - OUT(copper_bank); - OUT(platinum_shared); - OUT(expansions); - OUT(autosplit); - OUT(zone_id); - OUT(zoneInstance); - for (r = 0; r < structs::MAX_GROUP_MEMBERS; r++) { - OUT_str(groupMembers[r]); - } - // OUT_str(groupLeader); //this is prolly right after groupMembers, but I dont feel like checking. - // OUT(leadAAActive); - OUT(ldon_points_guk); - OUT(ldon_points_mir); - OUT(ldon_points_mmc); - OUT(ldon_points_ruj); - OUT(ldon_points_tak); - OUT(ldon_points_available); - OUT(tribute_time_remaining); - OUT(career_tribute_points); - OUT(tribute_points); - OUT(tribute_active); - for (r = 0; r < structs::MAX_PLAYER_TRIBUTES; r++) { - OUT(tributes[r].tribute); - OUT(tributes[r].tier); - } - OUT(group_leadership_exp); - OUT(raid_leadership_exp); - OUT(group_leadership_points); - OUT(raid_leadership_points); - OUT_array(leader_abilities.ranks, structs::MAX_LEADERSHIP_AA_ARRAY); - OUT(air_remaining); - OUT(entityid); - OUT(leadAAActive); - OUT(expAA); - OUT(currentRadCrystals); - OUT(careerRadCrystals); - OUT(currentEbonCrystals); - OUT(careerEbonCrystals); - OUT(groupAutoconsent); - OUT(raidAutoconsent); - OUT(guildAutoconsent); - // OUT(showhelm); - - //set the checksum... - CRC32::SetEQChecksum(__packet->pBuffer, sizeof(structs::PlayerProfile_Struct) - 4); - - FINISH_ENCODE(); - } - - ENCODE(OP_ReadBook) - { - // no apparent slot translation needed -U - EQApplicationPacket *in = *p; - *p = nullptr; - - unsigned char *__emu_buffer = in->pBuffer; - - BookText_Struct *emu_BookText_Struct = (BookText_Struct *)__emu_buffer; - - in->size = sizeof(structs::BookText_Struct) + strlen(emu_BookText_Struct->booktext); - - in->pBuffer = new unsigned char[in->size]; - - structs::BookText_Struct *eq_BookText_Struct = (structs::BookText_Struct*)in->pBuffer; - - eq_BookText_Struct->window = emu_BookText_Struct->window; - eq_BookText_Struct->type = emu_BookText_Struct->type; - strcpy(eq_BookText_Struct->booktext, emu_BookText_Struct->booktext); - - delete[] __emu_buffer; - dest->FastQueuePacket(&in, ack_req); - } - - ENCODE(OP_RespondAA) - { - ENCODE_LENGTH_EXACT(AATable_Struct); - SETUP_DIRECT_ENCODE(AATable_Struct, structs::AATable_Struct); - - unsigned int r; - for (r = 0; r < MAX_PP_AA_ARRAY; r++) { - OUT(aa_list[r].aa_skill); - OUT(aa_list[r].aa_value); - } - - FINISH_ENCODE(); - } - - ENCODE(OP_SendAATable) - { - ENCODE_LENGTH_ATLEAST(SendAA_Struct); - - SETUP_VAR_ENCODE(SendAA_Struct); - ALLOC_VAR_ENCODE(structs::SendAA_Struct, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability)); - - // Check clientver field to verify this AA should be sent for SoF - // clientver 1 is for all clients and 2 is for 6.2 - if (emu->clientver <= 2) - { - OUT(id); - OUT(hotkey_sid); - OUT(hotkey_sid2); - OUT(title_sid); - OUT(desc_sid); - OUT(class_type); - OUT(cost); - OUT(seq); - OUT(current_level); - OUT(prereq_skill); - OUT(prereq_minpoints); - OUT(type); - OUT(spellid); - OUT(spell_type); - OUT(spell_refresh); - OUT(classes); - OUT(berserker); - OUT(max_level); - OUT(last_id); - OUT(next_id); - OUT(cost2); - OUT(unknown80[0]); - OUT(unknown80[1]); - OUT(total_abilities); - unsigned int r; - for (r = 0; r < emu->total_abilities; r++) { - OUT(abilities[r].skill_id); - OUT(abilities[r].base1); - OUT(abilities[r].base2); - OUT(abilities[r].slot); - } - } - - FINISH_ENCODE(); - } - - ENCODE(OP_SendCharInfo) - { - ENCODE_LENGTH_EXACT(CharacterSelect_Struct); - SETUP_DIRECT_ENCODE(CharacterSelect_Struct, structs::CharacterSelect_Struct); - - int r; - for (r = 0; r < 10; r++) { - OUT(zone[r]); - OUT(eyecolor1[r]); - OUT(eyecolor2[r]); - OUT(hairstyle[r]); - OUT(primary[r]); - OUT(race[r]); - OUT(class_[r]); - OUT_str(name[r]); - OUT(gender[r]); - OUT(level[r]); - OUT(secondary[r]); - OUT(face[r]); - OUT(beard[r]); - int k; - for (k = 0; k < 9; k++) { - eq->equip[r][k] = emu->equip[r][k].material; - eq->cs_colors[r][k].color = emu->equip[r][k].color.color; - } - OUT(haircolor[r]); - OUT(gohome[r]); - OUT(deity[r]); - OUT(beardcolor[r]); - } - - FINISH_ENCODE(); - } - - ENCODE(OP_ShopPlayerSell) - { - ENCODE_LENGTH_EXACT(Merchant_Purchase_Struct); - SETUP_DIRECT_ENCODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct); - - OUT(npcid); - eq->itemslot = ServerToClient62Slot(emu->itemslot); - OUT(quantity); - OUT(price); - - FINISH_ENCODE(); - } - - ENCODE(OP_Track) - { - EQApplicationPacket *in = *p; - *p = nullptr; - - unsigned char *__emu_buffer = in->pBuffer; - Track_Struct *emu = (Track_Struct *)__emu_buffer; - - int EntryCount = in->size / sizeof(Track_Struct); - - if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) - { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); - delete in; - return; - } - - in->size = sizeof(structs::Track_Struct) * EntryCount; - in->pBuffer = new unsigned char[in->size]; - structs::Track_Struct *eq = (structs::Track_Struct *) in->pBuffer; - - for (int i = 0; i < EntryCount; ++i, ++eq, ++emu) - { - OUT(entityid); - OUT(padding002); - OUT(distance); - } - - delete[] __emu_buffer; - dest->FastQueuePacket(&in, ack_req); - } - - ENCODE(OP_TributeItem) - { - ENCODE_LENGTH_EXACT(TributeItem_Struct); - SETUP_DIRECT_ENCODE(TributeItem_Struct, structs::TributeItem_Struct); - - eq->slot = ServerToClient62Slot(emu->slot); - OUT(quantity); - OUT(tribute_master_id); - OUT(tribute_points); - - FINISH_ENCODE(); - } - - ENCODE(OP_WearChange) - { - ENCODE_LENGTH_EXACT(WearChange_Struct); - SETUP_DIRECT_ENCODE(WearChange_Struct, structs::WearChange_Struct); - - OUT(spawn_id); - OUT(material); - OUT(color.color); - OUT(wear_slot_id); - - FINISH_ENCODE(); - } - - ENCODE(OP_ZoneEntry) { ENCODE_FORWARD(OP_ZoneSpawns); } - - ENCODE(OP_ZoneSpawns) - { - //consume the packet - EQApplicationPacket *in = *p; - *p = nullptr; - - //store away the emu struct - unsigned char *__emu_buffer = in->pBuffer; - Spawn_Struct *emu = (Spawn_Struct *)__emu_buffer; - - //determine and verify length - int entrycount = in->size / sizeof(Spawn_Struct); - if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); - delete in; - return; - } - - //make the EQ struct. - in->size = sizeof(structs::Spawn_Struct)*entrycount; - in->pBuffer = new unsigned char[in->size]; - structs::Spawn_Struct *eq = (structs::Spawn_Struct *) in->pBuffer; - - //zero out the packet. We could avoid this memset by setting all fields (including unknowns) - //in the loop. - memset(in->pBuffer, 0, in->size); - - //do the transform... - int r; - int k; - for (r = 0; r < entrycount; r++, eq++, emu++) { - eq->gm = emu->gm; - eq->aaitle = emu->aaitle; - eq->anon = emu->anon; - eq->face = emu->face; - strcpy(eq->name, emu->name); - eq->deity = emu->deity; - eq->size = emu->size; - eq->NPC = emu->NPC; - eq->invis = emu->invis; - eq->haircolor = emu->haircolor; - eq->curHp = emu->curHp; - eq->max_hp = emu->max_hp; - eq->findable = emu->findable; - eq->deltaHeading = emu->deltaHeading; - eq->x = emu->x; - eq->y = emu->y; - eq->animation = emu->animation; - eq->z = emu->z; - eq->deltaY = emu->deltaY; - eq->deltaX = emu->deltaX; - eq->heading = emu->heading; - eq->deltaZ = emu->deltaZ; - eq->eyecolor1 = emu->eyecolor1; - // eq->showhelm = emu->showhelm; - eq->is_npc = emu->is_npc; - eq->hairstyle = emu->hairstyle; - eq->beard = emu->beard; - eq->level = emu->level; - eq->beardcolor = emu->beardcolor; - strcpy(eq->suffix, emu->suffix); - eq->petOwnerId = emu->petOwnerId; - eq->guildrank = emu->guildrank; - for (k = 0; k < 9; k++) { - eq->equipment[k] = emu->equipment[k].material; - eq->colors[k].color = emu->colors[k].color; - } - for (k = 0; k < 8; k++) { - eq->set_to_0xFF[k] = 0xFF; - } - eq->runspeed = emu->runspeed; - eq->afk = emu->afk; - eq->guildID = emu->guildID; - strcpy(eq->title, emu->title); - eq->helm = emu->helm; - eq->race = emu->race; - strcpy(eq->lastName, emu->lastName); - eq->walkspeed = emu->walkspeed; - eq->is_pet = emu->is_pet; - eq->light = emu->light; - eq->class_ = emu->class_; - eq->eyecolor2 = emu->eyecolor2; - eq->gender = emu->gender; - eq->bodytype = emu->bodytype; - eq->equip_chest2 = emu->equip_chest2; - eq->spawnId = emu->spawnId; - eq->lfg = emu->lfg; - eq->flymode = emu->flymode; - } - - //kill off the emu structure and send the eq packet. - delete[] __emu_buffer; - dest->FastQueuePacket(&in, ack_req); - } - -// DECODE methods - DECODE(OP_AdventureMerchantSell) - { - DECODE_LENGTH_EXACT(structs::Adventure_Sell_Struct); - SETUP_DIRECT_DECODE(Adventure_Sell_Struct, structs::Adventure_Sell_Struct); - - IN(npcid); - emu->slot = Client62ToServerSlot(eq->slot); - IN(charges); - IN(sell_price); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_ApplyPoison) - { - DECODE_LENGTH_EXACT(structs::ApplyPoison_Struct); - SETUP_DIRECT_DECODE(ApplyPoison_Struct, structs::ApplyPoison_Struct); - - emu->inventorySlot = Client62ToServerSlot(eq->inventorySlot); - IN(success); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_AugmentItem) - { - DECODE_LENGTH_EXACT(structs::AugmentItem_Struct); - SETUP_DIRECT_DECODE(AugmentItem_Struct, structs::AugmentItem_Struct); - - emu->container_slot = Client62ToServerSlot(eq->container_slot); - emu->augment_slot = eq->augment_slot; - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_CastSpell) - { - DECODE_LENGTH_EXACT(structs::CastSpell_Struct); - SETUP_DIRECT_DECODE(CastSpell_Struct, structs::CastSpell_Struct); - - IN(slot); - IN(spell_id); - emu->inventoryslot = Client62ToServerSlot(eq->inventoryslot); - IN(target_id); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_CharacterCreate) - { - DECODE_LENGTH_EXACT(structs::CharCreate_Struct); - SETUP_DIRECT_DECODE(CharCreate_Struct, structs::CharCreate_Struct); - - IN(class_); - IN(beardcolor); - IN(beard); - IN(haircolor); - IN(gender); - IN(race); - IN(start_zone); - IN(hairstyle); - IN(deity); - IN(STR); - IN(STA); - IN(AGI); - IN(DEX); - IN(WIS); - IN(INT); - IN(CHA); - IN(face); - IN(eyecolor1); - IN(eyecolor2); - IN(tutorial); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_Consume) - { - DECODE_LENGTH_EXACT(structs::Consume_Struct); - SETUP_DIRECT_DECODE(Consume_Struct, structs::Consume_Struct); - - emu->slot = Client62ToServerSlot(eq->slot); - IN(auto_consumed); - IN(type); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_DeleteItem) - { - DECODE_LENGTH_EXACT(structs::DeleteItem_Struct); - SETUP_DIRECT_DECODE(DeleteItem_Struct, structs::DeleteItem_Struct); - - emu->from_slot = Client62ToServerSlot(eq->from_slot); - emu->to_slot = Client62ToServerSlot(eq->to_slot); - IN(number_in_stack); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_FaceChange) - { - DECODE_LENGTH_EXACT(structs::FaceChange_Struct); - SETUP_DIRECT_DECODE(FaceChange_Struct, structs::FaceChange_Struct); - - IN(haircolor); - IN(beardcolor); - IN(eyecolor1); - IN(eyecolor2); - IN(hairstyle); - IN(beard); - IN(face); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_ItemLinkClick) - { - DECODE_LENGTH_EXACT(structs::ItemViewRequest_Struct); - SETUP_DIRECT_DECODE(ItemViewRequest_Struct, structs::ItemViewRequest_Struct); - MEMSET_IN(ItemViewRequest_Struct); - - IN(item_id); - int r; - for (r = 0; r < 5; r++) { - IN(augments[r]); - } - IN(link_hash); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_LootItem) - { - DECODE_LENGTH_EXACT(structs::LootingItem_Struct); - SETUP_DIRECT_DECODE(LootingItem_Struct, structs::LootingItem_Struct); - - IN(lootee); - IN(looter); - emu->slot_id = Client62ToServerCorpseSlot(eq->slot_id); - IN(auto_loot); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_MoveItem) - { - DECODE_LENGTH_EXACT(structs::MoveItem_Struct); - SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - - _log(NET__ERROR, "Moved item from %u to %u", eq->from_slot, eq->to_slot); - - emu->from_slot = Client62ToServerSlot(eq->from_slot); - emu->to_slot = Client62ToServerSlot(eq->to_slot); - IN(number_in_stack); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_ReadBook) - { - // no apparent slot translation needed -U - DECODE_LENGTH_ATLEAST(structs::BookRequest_Struct); - SETUP_DIRECT_DECODE(BookRequest_Struct, structs::BookRequest_Struct); - - IN(window); - IN(type); - strn0cpy(emu->txtfile, eq->txtfile, sizeof(emu->txtfile)); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_SetServerFilter) - { - DECODE_LENGTH_EXACT(structs::SetServerFilter_Struct); - SETUP_DIRECT_DECODE(SetServerFilter_Struct, structs::SetServerFilter_Struct); - - int r; - for (r = 0; r < 25; r++) { - IN(filters[r]); - } - emu->filters[25] = 1; - emu->filters[26] = 1; - emu->filters[27] = 1; - emu->filters[28] = 1; - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_ShopPlayerSell) - { - DECODE_LENGTH_EXACT(structs::Merchant_Purchase_Struct); - SETUP_DIRECT_DECODE(Merchant_Purchase_Struct, structs::Merchant_Purchase_Struct); - - IN(npcid); - emu->itemslot = Client62ToServerSlot(eq->itemslot); - IN(quantity); - IN(price); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_TradeSkillCombine) - { - DECODE_LENGTH_EXACT(structs::NewCombine_Struct); - SETUP_DIRECT_DECODE(NewCombine_Struct, structs::NewCombine_Struct); - - emu->container_slot = Client62ToServerSlot(eq->container_slot); - IN(guildtribute_slot); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_TributeItem) - { - DECODE_LENGTH_EXACT(structs::TributeItem_Struct); - SETUP_DIRECT_DECODE(TributeItem_Struct, structs::TributeItem_Struct); - - emu->slot = Client62ToServerSlot(eq->slot); - IN(quantity); - IN(tribute_master_id); - IN(tribute_points); - - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_WearChange) - { - DECODE_LENGTH_EXACT(structs::WearChange_Struct); - SETUP_DIRECT_DECODE(WearChange_Struct, structs::WearChange_Struct); - IN(spawn_id); - IN(material); - IN(color.color); - IN(wear_slot_id); - FINISH_DIRECT_DECODE(); - } - - DECODE(OP_WhoAllRequest) - { - DECODE_LENGTH_EXACT(structs::Who_All_Struct); - SETUP_DIRECT_DECODE(Who_All_Struct, structs::Who_All_Struct); - - memcpy(emu->whom, eq->whom, sizeof(emu->whom)); - IN(wrace); - IN(wclass); - IN(lvllow); - IN(lvlhigh); - IN(gmlookup); - emu->type = 3; - - FINISH_DIRECT_DECODE(); - } - -// file scope helper methods - char *SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint8 depth) - { - char *serialization = nullptr; - char *instance = nullptr; - const char *protection = (const char *)"\\\\\\\\\\"; - char *sub_items[10] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; - bool stackable = inst->IsStackable(); - int16 slot_id = ServerToClient62Slot(slot_id_in); - uint32 merchant_slot = inst->GetMerchantSlot(); - int16 charges = inst->GetCharges(); - const Item_Struct *item = inst->GetUnscaledItem(); - int i; - uint32 sub_length; - - // not sure if 6.2 has a recast timer timestamp field..but, something seems amiss between this and Ti's ordering - MakeAnyLenString(&instance, - "%i|%i|%i|%i|%i|%i|%i|%i|%i|%i|", - stackable ? charges : 1, - 0, - //(merchant_slot == 0) ? slot_id : merchant_slot, // change when translator activated - (merchant_slot == 0) ? slot_id_in : merchant_slot, - inst->GetPrice(), - (merchant_slot == 0) ? 1 : inst->GetMerchantCount(), - inst->IsScaling() ? inst->GetExp() / 100 : 0, - //merchant_slot, //instance ID, bullshit for now - // The 'Merchant Slot' needs to be some unique id for bazaar to work properly - (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot, - inst->IsAttuned() ? 1 : 0, //not sure where this field is - (stackable ? ((inst->GetItem()->ItemType == ItemTypePotion) ? charges : 0) : charges), - 0 - ); - - for (i = 0; i<10; i++) { - ItemInst *sub = inst->GetItem(i); - if (sub) { - sub_items[i] = SerializeItem(sub, 0, &sub_length, depth + 1); - } - } - - - *length = MakeAnyLenString(&serialization, - "%.*s%s" // For leading quotes (and protection) if a subitem; - "%s" // Instance data - "%.*s\"" // Quotes (and protection, if needed) around static data - "%i" // item->ItemClass so we can do |%s instead of %s| -#define I(field) "|%i" -#define C(field) "|%s" -#define S(field) "|%s" -#define F(field) "|%f" -#include "client62_itemfields.h" - "%.*s\"" // Quotes (and protection, if needed) around static data - "|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s" // Sub items - "%.*s%s" // For trailing quotes (and protection) if a subitem; - , depth ? depth - 1 : 0, protection, (depth) ? "\"" : "" - , instance - , depth, protection - , item->ItemClass -#define I(field) ,item->field -#define C(field) ,field -#define S(field) ,item->field -#define F(field) ,item->field -#include "client62_itemfields.h" - , depth, protection - , sub_items[0] ? sub_items[0] : "" - , sub_items[1] ? sub_items[1] : "" - , sub_items[2] ? sub_items[2] : "" - , sub_items[3] ? sub_items[3] : "" - , sub_items[4] ? sub_items[4] : "" - , sub_items[5] ? sub_items[5] : "" - , sub_items[6] ? sub_items[6] : "" - , sub_items[7] ? sub_items[7] : "" - , sub_items[8] ? sub_items[8] : "" - , sub_items[9] ? sub_items[9] : "" - , (depth) ? depth - 1 : 0, protection, (depth) ? "\"" : "" - ); - - for (i = 0; i < 10; i++) { - if (sub_items[i]) - safe_delete_array(sub_items[i]); - } - - safe_delete_array(instance); - - return serialization; - } - - static inline int16 ServerToClient62Slot(uint32 ServerSlot) - { - //int16 Client62Slot; - if (ServerSlot == INVALID_INDEX) - return INVALID_INDEX; - - return ServerSlot; // deprecated - } - - static inline int16 ServerToClient62CorpseSlot(uint32 ServerCorpse) - { - //int16 Client62Corpse; - return ServerCorpse; - } - - static inline uint32 Client62ToServerSlot(int16 Client62Slot) - { - //uint32 ServerSlot; - if (Client62Slot == INVALID_INDEX) - return INVALID_INDEX; - - return Client62Slot; // deprecated - } - - static inline uint32 Client62ToServerCorpseSlot(int16 Client62Corpse) - { - //uint32 ServerCorpse; - return Client62Corpse; - } -} -// end namespace Client62 diff --git a/common/patches/client62.h b/common/patches/client62.h deleted file mode 100644 index 08d1a9716..000000000 --- a/common/patches/client62.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef CLIENT62_H_ -#define CLIENT62_H_ - -#include "../struct_strategy.h" -#include "../item.h" - -class EQStreamIdentifier; - -namespace Client62 { - - //these are the only public member of this namespace. - extern void Register(EQStreamIdentifier &into); - extern void Reload(); - - - - //you should not directly access anything below.. - //I just dont feel like making a seperate header for it. - - class Strategy : public StructStrategy { - public: - Strategy(); - - protected: - - virtual std::string Describe() const; - virtual const EQClientVersion ClientVersion() const; - - //magic macro to declare our opcode processors - #include "ss_declare.h" - #include "client62_ops.h" - - }; - -}; - -#endif /*CLIENT62_H_*/ diff --git a/common/patches/client62_constants.h b/common/patches/client62_constants.h deleted file mode 100644 index 0e672a5de..000000000 --- a/common/patches/client62_constants.h +++ /dev/null @@ -1,212 +0,0 @@ -/* -EQEMu: Everquest Server Emulator - -Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net) - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY except by those people which sell it, which -are required to give you total support for your newly bought product; -without even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - -#ifndef CLIENT62_CONSTANTS_H_ -#define CLIENT62_CONSTANTS_H_ - -#include "../types.h" - -namespace Client62 { - namespace maps { - typedef enum : int16 { - // this needs work to match actual client equivilents - MapPossessions = 0, - MapBank, - MapSharedBank, - MapTrade, - MapWorld, - MapLimbo, - MapTribute, - MapTrophyTribute, - MapGuildTribute, - MapMerchant, - MapDeleted, - MapCorpse, - MapBazaar, - MapInspect, - MapRealEstate, - MapViewMODPC, - MapViewMODBank, - MapViewMODSharedBank, - MapViewMODLimbo, - MapAltStorage, - MapArchived, - MapMail, - MapGuildTrophyTribute, - MapOther, - _MapCount - } InventoryMaps; - } - - namespace slots { - typedef enum : int16 { - MainCharm = 0, - MainEar1, - MainHead, - MainFace, - MainEar2, - MainNeck, - MainShoulders, - MainArms, - MainBack, - MainWrist1, - MainWrist2, - MainRange, - MainHands, - MainPrimary, - MainSecondary, - MainFinger1, - MainFinger2, - MainChest, - MainLegs, - MainFeet, - MainWaist, - MainAmmo, - MainGeneral1, - MainGeneral2, - MainGeneral3, - MainGeneral4, - MainGeneral5, - MainGeneral6, - MainGeneral7, - MainGeneral8, - MainCursor, - _MainCount, - _MainEquipmentBegin = MainCharm, - _MainEquipmentEnd = MainAmmo, - _MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1), - _MainGeneralBegin = MainGeneral1, - _MainGeneralEnd = MainGeneral8, - _MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1) - } EquipmentSlots; - } - - namespace consts { - static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount; - static const uint16 MAP_BANK_SIZE = 16; - static const uint16 MAP_SHARED_BANK_SIZE = 2; - static const uint16 MAP_TRADE_SIZE = 8; - static const uint16 MAP_WORLD_SIZE = 10; - static const uint16 MAP_LIMBO_SIZE = 36; - static const uint16 MAP_TRIBUTE_SIZE = 0; //? - static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0; - static const uint16 MAP_MERCHANT_SIZE = 0; - static const uint16 MAP_DELETED_SIZE = 0; - static const uint16 MAP_CORPSE_SIZE = slots::_MainCount; - static const uint16 MAP_BAZAAR_SIZE = 80; - static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount; - static const uint16 MAP_REAL_ESTATE_SIZE = 0; - static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE; - static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE; - static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE; - static const uint16 MAP_ALT_STORAGE_SIZE = 0; - static const uint16 MAP_ARCHIVED_SIZE = 0; - static const uint16 MAP_MAIL_SIZE = 0; - static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0; - static const uint16 MAP_KRONO_SIZE = NOT_USED; - static const uint16 MAP_OTHER_SIZE = 0; - - static const int16 EQUIPMENT_BEGIN = slots::MainCharm; - static const int16 EQUIPMENT_END = slots::MainAmmo; - static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount; - - static const int16 GENERAL_BEGIN = slots::MainGeneral1; - static const int16 GENERAL_END = slots::MainGeneral8; - static const uint16 GENERAL_SIZE = slots::_MainGeneralCount; - static const int16 GENERAL_BAGS_BEGIN = 251; - static const int16 GENERAL_BAGS_END_OFFSET = 79; - static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET; - - static const int16 CURSOR = slots::MainCursor; - static const int16 CURSOR_BAG_BEGIN = 331; - static const int16 CURSOR_BAG_END_OFFSET = 9; - static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET; - - static const int16 BANK_BEGIN = 2000; - static const int16 BANK_END = 2015; - static const int16 BANK_BAGS_BEGIN = 2031; - static const int16 BANK_BAGS_END_OFFSET = 159; - static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET; - - static const int16 SHARED_BANK_BEGIN = 2500; - static const int16 SHARED_BANK_END = 2501; - static const int16 SHARED_BANK_BAGS_BEGIN = 2531; - static const int16 SHARED_BANK_BAGS_END_OFFSET = 19; - static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET; - - static const int16 TRADE_BEGIN = 3000; - static const int16 TRADE_END = 3007; - static const int16 TRADE_NPC_END = 3003; - static const int16 TRADE_BAGS_BEGIN = 3031; - static const int16 TRADE_BAGS_END_OFFSET = 79; - static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET; - - static const int16 WORLD_BEGIN = 4000; - static const int16 WORLD_END = 4009; - - static const int16 TRIBUTE_BEGIN = 400; - static const int16 TRIBUTE_END = 404; - - static const int16 CORPSE_BEGIN = slots::MainGeneral1; - static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor; - - static const uint16 ITEM_COMMON_SIZE = 5; - static const uint16 ITEM_CONTAINER_SIZE = 10; - - static const uint32 BANDOLIERS_COUNT = 4; // count = number of bandolier instances - static const uint32 BANDOLIER_SIZE = 4; // size = number of equipment slots in bandolier instance - static const uint32 POTION_BELT_SIZE = 4; - } - - namespace limits { - static const bool ALLOWS_EMPTY_BAG_IN_BAG = false; - static const bool ALLOWS_CLICK_CAST_FROM_BAG = false; - static const bool COIN_HAS_WEIGHT = true; - } - -}; //end namespace Client62 - -#endif /*CLIENT62_CONSTANTS_H_*/ - -/* -Client62 Notes: - ** Integer-based inventory ** -ok Possessions: 0 - 30 (Corpse: 22 - 52 [Offset 22]) -ok [Equipment: 0 - 21] -ok [General: 22 - 29] -ok [Cursor: 30] -ok General Bags: 251 - 330 -ok Cursor Bags: 331 - 340 - -ok Bank: 2000 - 2015 -ok Bank Bags: 2031 - 2190 - -ok Shared Bank: 2500 - 2501 -ok Shared Bank Bags: 2531 - 2550 - - Trade: 3000 - 3007 - (Trade Bags: 3031 - 3110 -- server values) - - World: 4000 - 4009 - -*/ diff --git a/common/patches/client62_itemfields.h b/common/patches/client62_itemfields.h deleted file mode 100644 index 22419208b..000000000 --- a/common/patches/client62_itemfields.h +++ /dev/null @@ -1,166 +0,0 @@ -/* - - -These fields must be in the order of how they are serialized! - - - -*/ - - -/* 000 */ //I(ItemClass) Leave this one off on purpose -/* 001 */ S(Name) -/* 002 */ S(Lore) -/* 003 */ S(IDFile) -/* 004 */ I(ID) -/* 005 */ I(Weight) -/* 006 */ I(NoRent) -/* 007 */ I(NoDrop) -/* 008 */ I(Size) -/* 009 */ I(Slots) -/* 010 */ I(Price) -/* 011 */ I(Icon) -/* 012 */ C("0") -/* 013 */ C("0") -/* 014 */ I(BenefitFlag) -/* 015 */ I(Tradeskills) -/* 016 */ I(CR) -/* 017 */ I(DR) -/* 018 */ I(PR) -/* 019 */ I(MR) -/* 020 */ I(FR) -/* 021 */ I(AStr) -/* 022 */ I(ASta) -/* 023 */ I(AAgi) -/* 024 */ I(ADex) -/* 025 */ I(ACha) -/* 026 */ I(AInt) -/* 027 */ I(AWis) -/* 028 */ I(HP) -/* 029 */ I(Mana) -/* 030 */ I(AC) -/* 031 */ I(Deity) -/* 032 */ C("0") -/* 033 */ I(SkillModValue) -/* 034 */ I(SkillModType) -/* 035 */ I(BaneDmgRace) -/* 036 */ I(BaneDmgAmt) -/* 037 */ I(BaneDmgBody) -/* 038 */ I(Magic) -/* 039 */ I(CastTime_) -/* 040 */ I(ReqLevel) -/* 041 */ I(BardType) -/* 042 */ I(BardValue) -/* 043 */ I(Light) -/* 044 */ I(Delay) -/* 045 */ I(RecLevel) -/* 046 */ I(RecSkill) -/* 047 */ I(ElemDmgType) -/* 048 */ I(ElemDmgAmt) -/* 049 */ I(Range) -/* 050 */ I(Damage) -/* 051 */ I(Color) -/* 052 */ I(Classes) -/* 053 */ I(Races) -/* 054 */ C("0") -/* 055 */ I(MaxCharges) -/* 056 */ I(ItemType) -/* 057 */ I(Material) -/* 058 */ F(SellRate) -/* 059 */ C("0") -/* 060 */ I(CastTime_) -/* 061 */ C("0") -/* 062 */ I(ProcRate) -/* 063 */ I(CombatEffects) -/* 064 */ I(Shielding) -/* 065 */ I(StunResist) -/* 066 */ I(StrikeThrough) -/* 067 */ I(ExtraDmgSkill) -/* 068 */ I(ExtraDmgAmt) -/* 069 */ I(SpellShield) -/* 070 */ I(Avoidance) -/* 071 */ I(Accuracy) -/* 072 */ I(CharmFileID) -/* 073 */ I(FactionMod1) -/* 074 */ I(FactionMod2) -/* 075 */ I(FactionMod3) -/* 076 */ I(FactionMod4) -/* 077 */ I(FactionAmt1) -/* 078 */ I(FactionAmt2) -/* 079 */ I(FactionAmt3) -/* 080 */ I(FactionAmt4) -/* 081 */ S(CharmFile) -/* 082 */ I(AugType) -/* 083 */ I(AugSlotType[0]) -/* 084 */ I(AugSlotType[1]) -/* 085 */ I(AugSlotType[2]) -/* 086 */ I(AugSlotType[3]) -/* 087 */ I(AugSlotType[4]) -/* 088 */ I(LDoNTheme) -/* 089 */ I(LDoNPrice) -/* 090 */ I(LDoNSold) -/* 091 */ I(BagType) -/* 092 */ I(BagSlots) -/* 093 */ I(BagSize) -/* 094 */ I(BagWR) -/* 095 */ I(Book) -/* 096 */ I(BookType) -/* 097 */ S(Filename) -/* 098 */ I(BaneDmgRaceAmt) -/* 099 */ I(AugRestrict) -/* 100 */ I(LoreFlag) -/* 101 */ I(PendingLoreFlag) -/* 102 */ I(ArtifactFlag) -/* 103 */ I(SummonedFlag) -/* 104 */ I(Favor) -/* 105 */ I(FVNoDrop) -/* 106 */ I(Endur) -/* 107 */ I(DotShielding) -/* 108 */ I(Attack) -/* 109 */ I(Regen) -/* 110 */ I(ManaRegen) -/* 111 */ I(Haste) -/* 112 */ I(DamageShield) -/* 113 */ I(RecastDelay) -/* 114 */ I(RecastType) -/* 115 */ I(GuildFavor) -/* 116 */ I(AugDistiller) -/* 117 */ C("0") -/* 118 */ C("0") -/* 119 */ I(Attuneable) -/* 120 */ I(NoPet) -/* 121 */ C("0") -/* 122 */ I(PointType) -/* 123 */ I(PotionBelt) -/* 124 */ I(PotionBeltSlots) -/* 125 */ I(StackSize) -/* 126 */ I(Click.Effect) -/* 127 */ I(Click.Type) -/* 128 */ I(Click.Level2) -/* 129 */ I(Click.Level) -/* 130 */ C("0") -/* 131 */ I(Proc.Effect) -/* 132 */ I(Proc.Type) -/* 133 */ I(Proc.Level2) -/* 134 */ I(Proc.Level) -/* 135 */ C("0") -/* 136 */ I(Worn.Effect) -/* 137 */ I(Worn.Type) -/* 138 */ I(Worn.Level2) -/* 139 */ I(Worn.Level) -/* 140 */ C("0") -/* 141 */ I(Focus.Effect) -/* 142 */ I(Focus.Type) -/* 143 */ I(Focus.Level2) -/* 144 */ I(Focus.Level) -/* 145 */ C("0") -/* 146 */ I(Scroll.Effect) -/* 147 */ I(Scroll.Type) -/* 148 */ I(Scroll.Level2) -/* 149 */ I(Scroll.Level) -/* 150 */ C("0") -#undef I -#undef C -#undef S -#undef F - diff --git a/common/patches/client62_ops.h b/common/patches/client62_ops.h deleted file mode 100644 index eb7ff2205..000000000 --- a/common/patches/client62_ops.h +++ /dev/null @@ -1,54 +0,0 @@ -// out-going packets that require an ENCODE translation: -E(OP_Action) -E(OP_AdventureMerchantSell) -E(OP_ApplyPoison) -E(OP_BazaarSearch) -E(OP_BecomeTrader) -E(OP_CharInventory) -E(OP_DeleteCharge) -E(OP_DeleteItem) -E(OP_DeleteSpawn) -E(OP_GuildMemberLevelUpdate) -E(OP_GuildMemberList) -E(OP_Illusion) -E(OP_ItemLinkResponse) -E(OP_ItemPacket) -E(OP_LeadershipExpUpdate) -E(OP_LootItem) -E(OP_MoveItem) -E(OP_NewSpawn) -E(OP_OnLevelMessage) -E(OP_PetBuffWindow) -E(OP_PlayerProfile) -E(OP_ReadBook) -E(OP_RespondAA) -E(OP_SendAATable) -E(OP_SendCharInfo) -E(OP_ShopPlayerSell) -E(OP_Track) -E(OP_TributeItem) -E(OP_WearChange) -E(OP_ZoneEntry) -E(OP_ZoneServerReady) -E(OP_ZoneSpawns) -// incoming packets that require a DECODE translation: -D(OP_AdventureMerchantSell) -D(OP_ApplyPoison) -D(OP_AugmentItem) -D(OP_CastSpell) -D(OP_CharacterCreate) -D(OP_Consume) -D(OP_DeleteItem) -D(OP_FaceChange) -D(OP_ItemLinkClick) -D(OP_LootItem) -D(OP_MoveItem) -D(OP_ReadBook) -D(OP_SetServerFilter) -D(OP_ShopPlayerSell) -D(OP_TradeSkillCombine) -D(OP_TributeItem) -D(OP_WearChange) -D(OP_WhoAllRequest) -#undef E -#undef D diff --git a/common/patches/client62_structs.h b/common/patches/client62_structs.h deleted file mode 100644 index 691eeba21..000000000 --- a/common/patches/client62_structs.h +++ /dev/null @@ -1,3163 +0,0 @@ -#ifndef CLIENT62_STRUCTS_H_ -#define CLIENT62_STRUCTS_H_ - -namespace Client62 { - namespace structs { - - -static const uint32 BUFF_COUNT = 25; -/* -** Compiler override to ensure -** byte aligned structures -*/ -#pragma pack(1) - -struct LoginInfo_Struct { -/*000*/ char login_info[64]; -/*064*/ uint8 unknown064[124]; -/*188*/ uint8 zoning; // 01 if zoning, 00 if not -/*189*/ uint8 unknown189[275]; -/*488*/ -}; - -struct EnterWorld_Struct { -/*000*/ char name[64]; -/*064*/ uint32 tutorial; // 01 on "Enter Tutorial", 00 if not -/*068*/ uint32 return_home; // 01 on "Return Home", 00 if not -}; - -/* Name Approval Struct */ -/* Len: */ -/* Opcode: 0x8B20*/ -struct NameApproval -{ - char name[64]; - uint32 race; - uint32 class_; - uint32 deity; -}; - -/* -** Entity identification struct -** Size: 4 bytes -** OPCodes: OP_DeleteSpawn, OP_Assist -*/ -struct EntityId_Struct -{ -/*00*/ uint32 entity_id; -/*04*/ -}; - -struct Duel_Struct -{ - uint32 duel_initiator; - uint32 duel_target; -}; - -struct DuelResponse_Struct -{ - uint32 target_id; - uint32 entity_id; - uint32 unknown; -}; -/* - Cofruben: - Adventure stuff,not a net one,just one for our use -*/ -static const uint32 ADVENTURE_COLLECT = 0; -static const uint32 ADVENTURE_MASSKILL = 1; -static const uint32 ADVENTURE_NAMED = 2; -static const uint32 ADVENTURE_RESCUE = 3; - -struct AdventureInfo { - uint32 QuestID; - uint32 NPCID; - bool in_use; - uint32 status; - bool ShowCompass; - uint32 Objetive;// can be item to collect,mobs to kill,boss to kill and someone to rescue. - uint32 ObjetiveValue;// number of items,or number of needed mob kills. - char text[512]; - uint8 type; - uint32 minutes; - uint32 points; - float x; - float y; - uint32 zoneid; - uint32 zonedungeonid; -}; -/////////////////////////////////////////////////////////////////////////////// - - -/* -** Color_Struct -** Size: 4 bytes -** Used for convenience -** Merth: Gave struct a name so gcc 2.96 would compile -** -*/ -struct Color_Struct -{ - union - { - struct - { - uint8 blue; - uint8 green; - uint8 red; - uint8 use_tint; // if there's a tint this is FF - } rgb; - uint32 color; - }; -}; - -/* -** Character Selection Struct -** Length: 1676 Bytes -** -*/ -struct CharacterSelect_Struct { -/*0000*/ uint32 zone[10]; // Characters Current Zone -/*0040*/ uint8 eyecolor1[10]; // Characters Eye Color -/*0050*/ uint8 eyecolor2[10]; // Characters Eye 2 Color -/*0060*/ uint8 hairstyle[10]; // Characters hair style -/*0070*/ uint8 unknown0070[2]; -/*0072*/ uint32 primary[10]; // Characters primary IDFile number -/*0112*/ uint32 race[10]; // Characters Race -/*0152*/ uint8 class_[10]; // Characters Classes -/*0162*/ char name[10][64]; // Characters Names -/*0802*/ uint8 gender[10]; // Characters Gender -/*0812*/ uint8 level[10]; // Characters Levels -/*0822*/ uint8 unknown0822[2]; -/*0824*/ uint32 secondary[10]; // Characters secondary IDFile number -/*0864*/ uint8 face[10]; // Characters Face Type -/*0874*/ uint8 beard[10]; // Characters Beard Type -/*0884*/ uint32 equip[10][9]; // 0=helm, 1=chest, 2=arm, 3=bracer, 4=hand, 5=leg, 6=boot, 7=melee1, 8=melee2 (Might not be) -/*1244*/ uint8 haircolor[10]; // Characters Hair Color -/*1254*/ uint8 gohome[10]; // 1=Go Home available, 0=not -/*1264*/ Color_Struct cs_colors[10][9]; // Characters Equipment Colors -/*1624*/ uint32 deity[10]; // Characters Deity -/*1664*/ uint8 beardcolor[10]; // Characters beard Color -/*1674*/ uint8 unknown1674[2]; -/*1676*/ -}; - -/* -** Generic Spawn Struct -** Length: 257 Bytes -** Fields from old struct not yet found: -** float size; -** float walkspeed; // probably one of the ff 33 33 33 3f -** float runspeed; // probably one of the ff 33 33 33 3f -** uint8 traptype; // 65 is disarmable trap, 66 and 67 are invis triggers/traps -** uint8 npc_armor_graphic; // 0xFF=Player, 0=none, 1=leather, 2=chain, 3=steelplate -** uint8 npc_helm_graphic; // 0xFF=Player, 0=none, 1=leather, 2=chain, 3=steelplate -** -*/ - -/* -** Generic Spawn Struct -** Length: 383 Octets -** Used in: -** spawnZoneStruct -** dbSpawnStruct -** petStruct -** newSpawnStruct -*/ -struct Spawn_Struct -{ -/*0000*/ uint8 NPC; // 0=player,1=npc,2=pc corpse,3=npc corpse,a -/*0001*/ uint8 set_to_0xFF[8]; // ***Placeholder (all ff) -/*0009*/ uint8 curHp; // Current hp -/*0010*/ char lastName[32]; // Player's Lastname -/*0042*/ uint8 bodytype; // Bodytype -/*0043*/ uint8 unknown0042[7]; -/*0050*/ uint32 petOwnerId; // If this is a pet, the spawn id of owner -/*0054*/ signed deltaHeading:10;// change in heading - signed x:19; // x coord - signed padding0054:3; // ***Placeholder -/*0058*/ signed y:19; // y coord - signed animation:10; // ***Placeholder (seems like speed) - signed padding0058:3; // animation -/*0062*/ signed z:19; // z coord - signed deltaY:13; // change in y -/*0066*/ signed deltaX:13; // change in x - unsigned heading:12; // heading - signed padding0066:7; // ***Placeholder -/*0070*/ signed deltaZ:13; // change in z - signed padding0070:19; // ***Placeholder -/*0074*/ uint16 deity; // Player's Deity -/*0076*/ uint8 unknown[2]; -/*0078*/ union - { - struct - { - /*0078*/ uint32 equip_helmet; // Equipment: Helmet Visual - /*0082*/ uint32 equip_chest; // Equipment: Chest Visual - /*0086*/ uint32 equip_arms; // Equipment: Arms Visual - /*0090*/ uint32 equip_bracers; // Equipment: Bracers Visual - /*0094*/ uint32 equip_hands; // Equipment: Hands Visual - /*0098*/ uint32 equip_legs; // Equipment: Legs Visual - /*0102*/ uint32 equip_feet; // Equipment: Feet Visual - /*0106*/ uint32 equip_primary; // Equipment: Primary Visual - /*0110*/ uint32 equip_secondary; // Equipment: Secondary Visual - } equip; - /*0078*/ uint32 equipment[9]; // Array elements correspond to struct equipment above - }; -/*0114*/ uint8 unknown0114[5]; -/*0119*/ uint8 afk; // 0=no, 1=afk -/*0120*/ uint32 spawnId; // Spawn Id -/*0124*/ uint8 is_pet; // 0=no, 1=yes -/*0125*/ uint8 gm; // 0=no, 1=gm -/*0126*/ uint8 unknown0126[4]; -/*0130*/ uint8 aaitle; // 0=none, 1=general, 2=archtype, 3=class -/*0131*/ uint8 unknown0132[24]; -/*0155*/ uint8 anon; // 0=normal, 1=anon, 2=roleplay -/*0156*/ uint8 unknown0156; -/*0157*/ uint8 face; // Face id for players -/*0159*/ uint8 helm; -/*0159*/ uint8 unknown0159; -/*0160*/ float runspeed; // Speed when running -/*0164*/ uint8 eyecolor1; // Player's left eye color -/*0165*/ uint8 beard; //not 100% verified, but slightly verified -/*0166*/ uint8 is_npc; // 0=no, 1=yes -/*0167*/ uint8 flymode; //seems to be 3 for 'useable' npc classes -/*0168*/ uint32 guildID; // Current guild -/*0172*/ union - { - struct - { - /*0172*/ Color_Struct color_helmet; // Color of helmet item - /*0176*/ Color_Struct color_chest; // Color of chest item - /*0180*/ Color_Struct color_arms; // Color of arms item - /*0184*/ Color_Struct color_bracers; // Color of bracers item - /*0188*/ Color_Struct color_hands; // Color of hands item - /*0192*/ Color_Struct color_legs; // Color of legs item - /*0196*/ Color_Struct color_feet; // Color of feet item - /*0200*/ Color_Struct color_primary; // Color of primary item - /*0204*/ Color_Struct color_secondary; // Color of secondary item - } equipment_colors; - /*0172*/ Color_Struct colors[9]; // Array elements correspond to struct equipment_colors above - }; -/*0208*/ uint8 hairstyle; -/*0209*/ float walkspeed; // Speed when walking -/*0213*/ uint8 unknown0213[3]; -/*0216*/ uint8 class_; // Player's class -/*0217*/ uint8 beardcolor; // Beard color -/*0218*/ float size; // Model size -/*0222*/ uint8 findable; // 0=can't be found, 1=can be found -/*0223*/ float unknown_float; -/*0227*/ char suffix[32]; // Player's suffix (of Veeshan, etc.) -/*0259*/ uint8 unknown0259[4]; //[0] is sometimes 100 -/*0263*/ uint8 guildrank; // 0=normal, 1=officer, 2=leader -/*0264*/ uint8 unknown0264[3]; -union -{ -/*0267*/ uint8 equip_chest2; // Second place in packet for chest texture (usually 0xFF in live packets) - // Not sure why there are 2 of them, but it effects chest texture! -/*0267*/ uint8 mount_color; // drogmor: 0=white, 1=black, 2=green, 3=red - // horse: 0=brown, 1=white, 2=black, 3=tan -}; -/*0268*/ uint32 race; // Spawn race -/*0272*/ uint8 invis; // Invis (0=not, 1=invis) -/*0273*/ uint8 unknown0276[5]; -/*0278*/ uint8 lfg; // 0=off, 1=lfg on -/*0279*/ uint8 level; // Spawn Level -/*0280*/ uint8 haircolor; // Hair color -/*0281*/ uint8 max_hp; //(name prolly wrong)takes on the value 100 for players, 100 or 110 for NPCs and 120 for PC corpses... -/*0282*/ uint8 light; // Spawn's lightsource -/*0283*/ uint8 gender; // Gender (0=male, 1=female) -/*0284*/ char name[64]; // Player's Name -/*0348*/ uint8 eyecolor2; // Left eye color -/*0349*/ char title[32]; // Title -/*0381*/ uint8 unknown0381[2]; -}; /*0383*/ - -/* -** New Spawn -** Length: 176 Bytes -** OpCode: 4921 -*/ -struct NewSpawn_Struct -{ - struct Spawn_Struct spawn; // Spawn Information -}; - -struct ClientZoneEntry_Struct { -/*0000*/ uint32 unknown00; -/*0004*/ char char_name[64]; // Character Name -}; - -/* -** Server Zone Entry Struct -** Length: 452 Bytes -** OPCodes: OP_ServerZoneEntry -** -*/ -struct ServerZoneEntry_Struct -{ - struct NewSpawn_Struct player; -}; - -struct NewZone_Struct { -/*0000*/ char char_name[64]; // Character Name -/*0064*/ char zone_short_name[32]; // Zone Short Name -/*0096*/ char zone_long_name[278]; // Zone Long Name -/*0374*/ uint8 ztype; // Zone type (usually FF) -/*0375*/ uint8 fog_red[4]; // Zone fog (red) -/*0379*/ uint8 fog_green[4]; // Zone fog (green) -/*0383*/ uint8 fog_blue[4]; // Zone fog (blue) -/*0387*/ uint8 unknown323; -/*0388*/ float fog_minclip[4]; -/*0404*/ float fog_maxclip[4]; -/*0420*/ float gravity; -/*0424*/ uint8 time_type; -/*0425*/ uint8 rain_chance[4]; -/*0429*/ uint8 rain_duration[4]; -/*0433*/ uint8 snow_chance[4]; -/*0437*/ uint8 snow_duration[4]; -/*0441*/ uint8 unknown360[33]; -/*0474*/ uint8 sky; // Sky Type -/*0475*/ uint8 unknown331[13]; // ***Placeholder -/*0488*/ float zone_exp_multiplier; // Experience Multiplier -/*0492*/ float safe_y; // Zone Safe Y -/*0496*/ float safe_x; // Zone Safe X -/*0500*/ float safe_z; // Zone Safe Z -/*0504*/ float max_z; // Guessed -/*0508*/ float underworld; // Underworld, min z (Not Sure?) -/*0512*/ float minclip; // Minimum View Distance -/*0516*/ float maxclip; // Maximum View DIstance -/*0520*/ uint8 unknown_end[84]; // ***Placeholder -/*0604*/ char zone_short_name2[68]; -/*0672*/ char unknown672[12]; -/*0684*/ uint16 zone_id; -/*0686*/ uint16 zone_instance; -/*0688*/ uint32 unknown688; -/*0682*/ uint8 unknown692[4]; -}; - -/* -** Memorize Spell Struct -** Length: 12 Bytes -** -*/ -struct MemorizeSpell_Struct { -uint32 slot; // Spot in the spell book/memorized slot -uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) -uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming -uint32 unknown12; -}; - -/* -** Make Charmed Pet -** Length: 12 Bytes -** -*/ -struct Charm_Struct { -/*00*/ uint32 owner_id; -/*04*/ uint32 pet_id; -/*08*/ uint32 command; // 1: make pet, 0: release pet -/*12*/ -}; - -struct InterruptCast_Struct -{ - uint32 spawnid; - uint32 messageid; - char message[0]; -}; - -struct DeleteSpell_Struct -{ -/*000*/int16 spell_slot; -/*002*/uint8 unknowndss002[2]; -/*004*/uint8 success; -/*005*/uint8 unknowndss006[3]; -/*008*/ -}; - -struct ManaChange_Struct -{ - uint32 new_mana; // New Mana AMount - uint32 stamina; - uint32 spell_id; - uint32 unknown12; -}; - -struct SwapSpell_Struct -{ - uint32 from_slot; - uint32 to_slot; - - -}; - -struct BeginCast_Struct -{ - // len = 8 -/*000*/ uint16 caster_id; -/*002*/ uint16 spell_id; -/*004*/ uint32 cast_time; // in miliseconds -}; - -struct CastSpell_Struct -{ - uint32 slot; - uint32 spell_id; - uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast - uint32 target_id; - uint8 cs_unknown[4]; -}; - -/* -** SpawnAppearance_Struct -** Changes client appearance for all other clients in zone -** Size: 8 bytes -** Used in: OP_SpawnAppearance -** -*/ -struct SpawnAppearance_Struct -{ -/*0000*/ uint16 spawn_id; // ID of the spawn -/*0002*/ uint16 type; // Values associated with the type -/*0004*/ uint32 parameter; // Type of data sent -/*0008*/ -}; - - -// solar: this is used inside profile -struct SpellBuff_Struct -{ -/*000*/ uint8 slotid; //badly named... seems to be 2 for a real buff, 0 otherwise -/*001*/ uint8 level; -/*002*/ uint8 bard_modifier; -/*003*/ uint8 effect; //not real -/*004*/ uint32 spellid; -/*008*/ uint32 duration; -/*012*/ uint32 counters; -/*014*/ uint8 Unknown012[4]; -}; - -struct SpellBuffFade_Struct { -/*000*/ uint32 entityid; -/*004*/ uint8 slot; -/*005*/ uint8 level; -/*006*/ uint8 effect; -/*007*/ uint8 unknown7; -/*008*/ uint32 spellid; -/*012*/ uint32 duration; -/*016*/ uint32 unknown016; -/*020*/ uint32 unknown020; //prolly global player ID -/*024*/ uint32 slotid; -/*028*/ uint32 bufffade; -/*032*/ -}; - -struct ItemNamePacket_Struct { -/*000*/ uint32 item_id; -/*004*/ uint32 unkown004; -/*008*/ char name[64]; -/*072*/ -}; - -// Length: 10 -struct ItemProperties_Struct { - -uint8 unknown01[2]; -uint8 charges; -uint8 unknown02[13]; -}; - -struct GMTrainee_Struct -{ - /*000*/ uint32 npcid; - /*004*/ uint32 playerid; - /*008*/ uint32 skills[PACKET_SKILL_ARRAY_SIZE]; - /*408*/ uint8 unknown408[40]; - /*448*/ -}; - -struct GMTrainEnd_Struct -{ - /*000*/ uint32 npcid; - /*004*/ uint32 playerid; - /*008*/ -}; - -struct GMSkillChange_Struct { -/*000*/ uint16 npcid; -/*002*/ uint8 unknown1[2]; // something like PC_ID, but not really. stays the same thru the session though -/*002*/ uint16 skillbank; // 0 if normal skills, 1 if languages -/*002*/ uint8 unknown2[2]; -/*008*/ uint16 skill_id; -/*010*/ uint8 unknown3[2]; -}; -struct ConsentResponse_Struct { - char grantname[64]; - char ownername[64]; - uint8 permission; - char zonename[32]; -}; - -/* -** Name Generator Struct -** Length: 72 bytes -** OpCode: 0x0290 -*/ -struct NameGeneration_Struct -{ -/*0000*/ uint32 race; -/*0004*/ uint32 gender; -/*0008*/ char name[64]; -/*0072*/ -}; - -/* -** Character Creation struct -** Length: 140 Bytes -** OpCode: 0x0113 -*/ -struct CharCreate_Struct -{ - /*0000*/ uint32 class_; //guess - /*0004*/ char name[64]; - /*0068*/ uint32 beardcolor; // credit goes to vesuvias for appearance stuff - /*0072*/ uint32 beard; - /*0076*/ uint32 haircolor; - /*0080*/ int32 gender; - /*0084*/ int32 race; - /*0088*/ int32 start_zone; - /*0092*/ int32 hairstyle; - /*0096*/ uint32 deity; - ///*0072*/ int32 deity; - - - // 0 = odus - // 1 = qeynos - // 2 = halas - // 3 = rivervale - // 4 = freeport - // 5 = neriak - // 6 = gukta/grobb - // 7 = ogguk - // 8 = kaladim - // 9 = gfay - // 10 = felwithe - // 11 = akanon - // 12 = cabalis - // 13 = shar vahl - - -/*0100*/ int32 STR; -/*0104*/ int32 STA; -/*0108*/ int32 AGI; -/*0112*/ int32 DEX; -/*0116*/ int32 WIS; -/*0120*/ int32 INT; -/*0124*/ int32 CHA; -/*0128*/ uint32 face; -/*0132*/ uint32 eyecolor1; //its possiable we could have these switched -/*0136*/ uint32 eyecolor2; //since setting one sets the other we really can't check -/*0140*/ uint32 tutorial; //assumptions are bad! But guessed -}; - -/* - *Used in PlayerProfile - */ -struct AA_Array -{ - uint32 AA; - uint32 value; -}; - - -static const uint32 MAX_PP_DISCIPLINES = 100; - -struct Disciplines_Struct { - uint32 values[MAX_PP_DISCIPLINES]; -}; - -static const uint32 MAX_PLAYER_TRIBUTES = 5; -static const uint32 MAX_PLAYER_BANDOLIER = 4; -static const uint32 MAX_PLAYER_BANDOLIER_ITEMS = 4; -static const uint32 TRIBUTE_NONE = 0xFFFFFFFF; -struct Tribute_Struct { - uint32 tribute; - uint32 tier; -}; - -//len = 72 -struct BandolierItem_Struct { - uint32 item_id; - uint32 icon; - char item_name[64]; -}; - -//len = 320 -enum { //bandolier item positions - bandolierMainHand = 0, - bandolierOffHand, - bandolierRange, - bandolierAmmo -}; -struct Bandolier_Struct { - char name[32]; - BandolierItem_Struct items[MAX_PLAYER_BANDOLIER_ITEMS]; -}; -struct PotionBelt_Struct { - BandolierItem_Struct items[MAX_PLAYER_BANDOLIER_ITEMS]; -}; - -static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16; -static const uint32 MAX_RAID_LEADERSHIP_AA_ARRAY = 16; -static const uint32 MAX_LEADERSHIP_AA_ARRAY = (MAX_GROUP_LEADERSHIP_AA_ARRAY+MAX_RAID_LEADERSHIP_AA_ARRAY); -struct GroupLeadershipAA_Struct { - union { - struct { - uint32 groupAAMarkNPC; - uint32 groupAANPCHealth; - uint32 groupAADelegateMainAssist; - uint32 groupAADelegateMarkNPC; - uint32 groupAA4; - uint32 groupAA5; - uint32 groupAAInspectBuffs; - uint32 groupAA7; - uint32 groupAASpellAwareness; - uint32 groupAAOffenseEnhancement; - uint32 groupAAManaEnhancement; - uint32 groupAAHealthEnhancement; - uint32 groupAAHealthRegeneration; - uint32 groupAAFindPathToPC; - uint32 groupAAHealthOfTargetsTarget; - uint32 groupAA15; - }; - uint32 ranks[MAX_GROUP_LEADERSHIP_AA_ARRAY]; - }; -}; - -struct RaidLeadershipAA_Struct { - union { - struct { - uint32 raidAAMarkNPC; - uint32 raidAANPCHealth; - uint32 raidAADelegateMainAssist; - uint32 raidAADelegateMarkNPC; - uint32 raidAA4; - uint32 raidAA5; - uint32 raidAA6; - uint32 raidAASpellAwareness; - uint32 raidAAOffenseEnhancement; - uint32 raidAAManaEnhancement; - uint32 raidAAHealthEnhancement; - uint32 raidAAHealthRegeneration; - uint32 raidAAFindPathToPC; - uint32 raidAAHealthOfTargetsTarget; - uint32 raidAA14; - uint32 raidAA15; - }; - uint32 ranks[MAX_RAID_LEADERSHIP_AA_ARRAY]; - }; -}; - -struct LeadershipAA_Struct { - union { - struct { - GroupLeadershipAA_Struct group; - RaidLeadershipAA_Struct raid; - }; - uint32 ranks[MAX_LEADERSHIP_AA_ARRAY]; - }; -}; - -/* -** Player Profile -** -** Length: 4308 bytes -** OpCode: 0x006a - */ -static const uint32 MAX_PP_LANGUAGE = 28; -static const uint32 MAX_PP_SPELLBOOK = 400; -static const uint32 MAX_PP_MEMSPELL = 9; -static const uint32 MAX_PP_SKILL = PACKET_SKILL_ARRAY_SIZE; // 100 - actual skills buffer size -static const uint32 MAX_PP_AA_ARRAY = 240; -static const uint32 MAX_GROUP_MEMBERS = 6; -struct PlayerProfile_Struct -{ -/*0000*/ uint32 checksum; // Checksum from CRC32::SetEQChecksum -/*0004*/ char name[64]; // Name of player sizes not right -/*0068*/ char last_name[32]; // Last name of player sizes not right -/*0100*/ uint32 gender; // Player Gender - 0 Male, 1 Female -/*0104*/ uint32 race; // Player race -/*0108*/ uint32 class_; // Player class -/*0112*/ uint32 unknown0112; // -/*0116*/ uint32 level; // Level of player (might be one byte) -/*0120*/ uint32 bind_zone_id; // Zone player is bound in -/*0124*/ uint32 unknown0124[4]; -/*0140*/ float bind_x[4]; // Bind loc x coord -/*0156*/ float zone_safe_x; -/*0160*/ float bind_y[4]; // Bind loc y coord -/*0176*/ float zone_safe_y; -/*0180*/ float bind_z[4]; // Bind loc z coord -/*0196*/ float zone_safe_z; -/*0200*/ float bind_heading[4]; // -/*0216*/ float zone_safe_heading; -/*0220*/ uint32 deity; // deity -/*0224*/ uint32 guild_id; -/*0228*/ uint32 birthday; // characters bday -/*0232*/ uint32 lastlogin; // last login or zone time -/*0236*/ uint32 timePlayedMin; // in minutes -/*0240*/ uint8 pvp; -/*0241*/ uint8 level2; //no idea why this is here, but thats how it is on live -/*0242*/ uint8 anon; // 2=roleplay, 1=anon, 0=not anon -/*0243*/ uint8 gm; -/*0244*/ uint8 guildrank; -/*0245*/ uint8 unknown0245[7]; // -/*0252*/ uint32 intoxication; -/*0256*/ uint32 spellSlotRefresh[MAX_PP_MEMSPELL]; //in ms -/*0292*/ uint32 abilitySlotRefresh; -/*0296*/ uint8 haircolor; // Player hair color -/*0297*/ uint8 beardcolor; // Player beard color -/*0298*/ uint8 eyecolor1; // Player left eye color -/*0299*/ uint8 eyecolor2; // Player right eye color -/*0300*/ uint8 hairstyle; // Player hair style -/*0301*/ uint8 beard; // Beard type -/*0302*/ uint8 ability_time_seconds; //The following four spots are unknown right now..... -/*0303*/ uint8 ability_number; //ability used -/*0304*/ uint8 ability_time_minutes; -/*0305*/ uint8 ability_time_hours;//place holder -/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag? -/*0312*/ uint32 item_material[9]; // Item texture/material of worn/held items -/*0348*/ uint8 unknown0256[44]; -/*0396*/ Color_Struct item_tint[9]; -/*0432*/ AA_Array aa_array[MAX_PP_AA_ARRAY]; -/*2348*/ float unknown2348; //seen ~128, ~47 -/*2352*/ char servername[32]; // length probably not right -/*2384*/ char title[32]; //length might be wrong -/*2416*/ char suffix[32]; //length might be wrong -/*2448*/ uint32 guildid2; // -/*2452*/ uint32 exp; // Current Experience -/*2456*/ uint32 unknown1496; -/*2460*/ uint32 points; // Unspent Practice points -/*2464*/ uint32 mana; // current mana -/*2468*/ uint32 cur_hp; // current hp -/*2472*/ uint32 unknown1512; // 0x05 -/*2476*/ uint32 STR; // Strength -/*2480*/ uint32 STA; // Stamina -/*2484*/ uint32 CHA; // Charisma -/*2488*/ uint32 DEX; // Dexterity -/*2492*/ uint32 INT; // Intelligence -/*2496*/ uint32 AGI; // Agility -/*2500*/ uint32 WIS; // Wisdom -/*2504*/ uint8 face; // Player face -/*2505*/ uint8 unknown1545[47]; // ? -/*2552*/ uint8 languages[MAX_PP_LANGUAGE]; -/*2580*/ uint8 unknown1620[4]; -/*2584*/ uint32 spell_book[MAX_PP_SPELLBOOK]; -/*4184*/ uint8 unknown3224[448]; // all 0xff -/*4632*/ uint32 mem_spells[MAX_PP_MEMSPELL]; -/*4668*/ uint8 unknown3704[32]; // -/*4700*/ float y; // Player y position -/*4704*/ float x; // Player x position -/*4708*/ float z; // Player z position -/*4712*/ float heading; // Direction player is facing -/*4716*/ uint8 unknown3756[4]; // -/*4720*/ int32 platinum; // Platinum Pieces on player -/*4724*/ int32 gold; // Gold Pieces on player -/*4728*/ int32 silver; // Silver Pieces on player -/*4732*/ int32 copper; // Copper Pieces on player -/*4736*/ int32 platinum_bank; // Platinum Pieces in Bank -/*4740*/ int32 gold_bank; // Gold Pieces in Bank -/*4744*/ int32 silver_bank; // Silver Pieces in Bank -/*4748*/ int32 copper_bank; // Copper Pieces in Bank -/*4752*/ int32 platinum_cursor; // Platinum on cursor -/*4756*/ int32 gold_cursor; // Gold on cursor -/*4760*/ int32 silver_cursor; // Silver on cursor -/*4764*/ int32 copper_cursor; // Copper on cursor -/*4768*/ int32 platinum_shared; // Platinum shared between characters -/*4772*/ uint8 unknown3812[24]; -/*4796*/ uint32 skills[MAX_PP_SKILL]; // 100 dword buffer -/*5196*/ uint8 unknown5096[184]; -/*5380*/ uint32 pvp2; // -/*5384*/ uint32 unknown4420; // -/*5388*/ uint32 pvptype; // -/*5392*/ uint32 unknown4428; // -/*5396*/ uint32 ability_down; // Doodman - Guessing -/*5400*/ uint8 unknown4436[8]; // -/*5408*/ uint32 autosplit; //not used right now -/*5412*/ uint8 unknown4448[8]; -/*5420*/ uint32 zone_change_count; // Number of times user has zoned in their career (guessing) -/*5424*/ uint8 unknown4460[28]; // -/*5452*/ uint32 expansions; // expansion setting, bit field of expansions avaliable -/*5456*/ int32 toxicity; //from drinking potions, seems to increase by 3 each time you drink -/*5460*/ char unknown4496[16]; // -/*5476*/ int32 hunger_level; -/*5480*/ int32 thirst_level; -/*5484*/ uint32 ability_up; -/*5488*/ char unknown4524[16]; -/*5504*/ uint16 zone_id; // Current zone of the player -/*5506*/ uint16 zoneInstance; // Instance ID -/*5508*/ SpellBuff_Struct buffs[BUFF_COUNT]; // Buffs currently on the player -/*6008*/ char groupMembers[6][64]; // -/*6392*/ char unknown6392[656]; -/*7048*/ uint32 entityid; -/*7052*/ uint32 leadAAActive; -/*7056*/ uint32 unknown7056; -/*7060*/ int32 ldon_points_guk; //client uses these as signed -/*7064*/ int32 ldon_points_mir; -/*7068*/ int32 ldon_points_mmc; -/*7072*/ int32 ldon_points_ruj; -/*7076*/ int32 ldon_points_tak; -/*7080*/ int32 ldon_points_available; -/*7084*/ uint8 unknown5940[112]; -/*7196*/ uint32 tribute_time_remaining; //in miliseconds -/*7200*/ uint32 unknown6048; -/*7204*/ uint32 career_tribute_points; -/*7208*/ uint32 unknown6056; -/*7212*/ uint32 tribute_points; -/*7216*/ uint32 unknown6064; -/*7220*/ uint32 tribute_active; //1=active -/*7224*/ Tribute_Struct tributes[MAX_PLAYER_TRIBUTES]; -/*7264*/ Disciplines_Struct disciplines; //fathernitwit: 10-06-04 -/*7664*/ char unknown7464[240]; -/*7904*/ uint32 endurance; -/*7908*/ uint32 group_leadership_exp; //0-1000 -/*7912*/ uint32 raid_leadership_exp; //0-2000 -/*7916*/ uint32 group_leadership_points; -/*7920*/ uint32 raid_leadership_points; -/*7924*/ LeadershipAA_Struct leader_abilities; -/*8052*/ uint8 unknown8052[132]; -/*8184*/ uint32 air_remaining; -/*8188*/ uint8 unknown8188[4608]; -/*12796*/ uint32 aapoints_spent; -/*12800*/ uint32 expAA; -/*12804*/ uint32 aapoints; //avaliable, unspent -/*12808*/ uint8 unknown12808[36]; -/*12844*/ Bandolier_Struct bandoliers[MAX_PLAYER_BANDOLIER]; -/*14124*/ uint8 unknown14124[5120]; -/*19244*/ PotionBelt_Struct potionbelt; //there should be 3 more of these -/*19532*/ uint8 unknown19532[8]; -/*19540*/ uint32 currentRadCrystals; // Current count of radiant crystals -/*19544*/ uint32 careerRadCrystals; // Total count of radiant crystals ever -/*19548*/ uint32 currentEbonCrystals; // Current count of ebon crystals -/*19552*/ uint32 careerEbonCrystals; // Total count of ebon crystals ever -/*19556*/ uint8 groupAutoconsent; // 0=off, 1=on -/*19557*/ uint8 raidAutoconsent; // 0=off, 1=on -/*19558*/ uint8 guildAutoconsent; // 0=off, 1=on -/*19559*/ uint8 unknown19559[5]; // ***Placeholder (6/29/2005) -/*19564*/ uint32 unknown15964; -/*19568*/ -}; - -/* -** Client Target Struct -** Length: 2 Bytes -** OpCode: 6221 -*/ -struct ClientTarget_Struct { -/*000*/ uint32 new_target; // Target ID -}; - -/* -** Target Rejection Struct -** Length: 12 Bytes -** OpCode: OP_TargetReject -*/ -struct TargetReject_Struct { -/*00*/ uint8 unknown00[12]; -}; - -struct PetCommand_Struct { -/*000*/ uint32 command; -/*004*/ uint32 unknown; -}; - -/* -** Delete Spawn -** Length: 4 Bytes -** OpCode: OP_DeleteSpawn -*/ -struct DeleteSpawn_Struct -{ -/*00*/ uint32 spawn_id; // Spawn ID to delete -/*04*/ -}; - -/* -** Channel Message received or sent -** Length: 144 Bytes + Variable Length + 1 -** OpCode: OP_ChannelMessage -** -*/ -struct ChannelMessage_Struct -{ -/*000*/ char targetname[64]; // Tell recipient -/*064*/ char sender[64]; // The senders name (len might be wrong) -/*128*/ uint32 language; // Language -/*132*/ uint32 chan_num; // Channel -/*136*/ uint32 cm_unknown4[2]; // ***Placeholder -/*144*/ uint32 skill_in_language; // The players skill in this language? might be wrong -/*148*/ char message[0]; // Variable length message -}; - -/* -** Special Message -** Length: 4 Bytes + Variable Text Length + 1 -** OpCode: OP_SpecialMesg -** -*/ -/* - Theres something wrong with this... example live packet: -Server->Client: [ Opcode: OP_SpecialMesg (0x0fab) Size: 244 ] - 0: 01 02 00 0A 00 00 00 09 - 05 00 00 42 61 72 73 74 | ...........Barst - 16: 72 65 20 53 6F 6E 67 77 - 65 61 76 65 72 00 7C F9 | re Songweaver.|. - 32: FF FF 84 FF FF FF 03 00 - 00 00 47 72 65 65 74 69 | ..........Greeti - -*/ -struct SpecialMesg_Struct -{ -/*00*/ char header[3]; // 04 04 00 <-- for #emote style msg -/*03*/ uint32 msg_type; // Color of text (see MT_*** below) -/*07*/ uint32 target_spawn_id; // Who is it being said to? -/*11*/ char sayer[1]; // Who is the source of the info -/*12*/ uint8 unknown12[12]; -/*24*/ char message[1]; // What is being said? -}; - -/* -** When somebody changes what they're wearing -** or give a pet a weapon (model changes) -** Length: 16 Bytes -** Opcode: 9220 -*/ -struct WearChange_Struct{ -/*000*/ uint16 spawn_id; -/*002*/ uint16 material; -/*004*/ Color_Struct color; -/*009*/ uint8 wear_slot_id; -}; - -/* -** Type: Bind Wound Structure -** Length: 8 Bytes -*/ -//Fixed for 7-14-04 patch -struct BindWound_Struct -{ -/*002*/ uint16 to; // TargetID -/*004*/ uint16 unknown2; // ***Placeholder -/*006*/ uint16 type; -/*008*/ uint16 unknown6; -}; - - -/* -** Type: Zone Change Request (before hand) -** Length: 88 bytes -** OpCode: a320 -*/ - -struct ZoneChange_Struct { -/*000*/ char char_name[64]; // Character Name -/*064*/ uint16 zoneID; -/*066*/ uint16 instanceID; -/*068*/ float y; -/*072*/ float x; -/*076*/ float z; -/*080*/ uint32 zone_reason; //0x0A == death, I think -/*084*/ int32 success; // =0 client->server, =1 server->client, -X=specific error -/*088*/ -}; - -struct RequestClientZoneChange_Struct { -/*00*/ uint16 zone_id; -/*02*/ uint16 instance_id; -/*04*/ float y; -/*08*/ float x; -/*12*/ float z; -/*16*/ float heading; -/*20*/ uint32 type; //unknown... values -}; - -struct Animation_Struct { -/*00*/ uint16 spawnid; -/*02*/ uint8 action; -/*03*/ uint8 value; -/*04*/ -}; - -// solar: this is what causes the caster to animate and the target to -// get the particle effects around them when a spell is cast -// also causes a buff icon -struct Action_Struct -{ - /* 00 */ uint16 target; // id of target - /* 02 */ uint16 source; // id of caster - /* 04 */ uint16 level; // level of caster - /* 06 */ uint16 instrument_mod; - /* 08 */ uint32 unknown08; - /* 12 */ uint16 unknown16; -// some kind of sequence that's the same in both actions -// as well as the combat damage, to tie em together? - /* 14 */ uint32 sequence; - /* 18 */ uint32 unknown18; - /* 22 */ uint8 type; // 231 (0xE7) for spells - /* 23 */ uint32 unknown23; - /* 27 */ uint16 spell; // spell id being cast - /* 29 */ uint8 unknown29; -// this field seems to be some sort of success flag, if it's 4 - /* 30 */ uint8 buff_unknown; // if this is 4, a buff icon is made - /* 31 */ -}; - -// solar: this is what prints the You have been struck. and the regular -// melee messages like You try to pierce, etc. It's basically the melee -// and spell damage message -struct CombatDamage_Struct -{ -/* 00 */ uint16 target; -/* 02 */ uint16 source; -/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells -/* 05 */ uint16 spellid; -/* 07 */ uint32 damage; -/* 11 */ uint32 unknown11; -/* 15 */ uint32 sequence; // see above notes in Action_Struct -/* 19 */ uint32 unknown19; -/* 23 */ -}; - -/* -** Consider Struct -** Length: 24 Bytes -** OpCode: 3721 -*/ -struct Consider_Struct{ -/*000*/ uint32 playerid; // PlayerID -/*004*/ uint32 targetid; // TargetID -/*008*/ uint32 faction; // Faction -/*0012*/ uint32 level; // Level -/*016*/ int32 cur_hp; // Current Hitpoints -/*020*/ int32 max_hp; // Maximum Hitpoints -/*024*/ uint8 pvpcon; // Pvp con flag 0/1 -/*025*/ uint8 unknown3[3]; -}; - -/* -** Spawn Death Blow -** Length: 32 Bytes -** OpCode: 0114 -*/ -struct Death_Struct -{ -/*000*/ uint32 spawn_id; -/*004*/ uint32 killer_id; -/*008*/ uint32 corpseid; // was corpseid -/*012*/ uint32 attack_skill; // was type -/*016*/ uint32 spell_id; -/*020*/ uint32 bindzoneid; //bindzoneid? -/*024*/ uint32 damage; -/*028*/ uint32 unknown028; -}; - -struct BecomeCorpse_Struct { - uint32 spawn_id; - float y; - float x; - float z; -}; - -/* -** Spawn position update -** Struct sent from server->client to update position of -** another spawn's position update in zone (whether NPC or PC) -** -*/ -struct PlayerPositionUpdateServer_Struct -{ -/*0000*/ uint16 spawn_id; -/*0002*/ int32 delta_heading:10, // change in heading - x_pos:19, // x coord - padding0002:3; // ***Placeholder -/*0006*/ int32 y_pos:19, // y coord - animation:10, // animation - padding0006:3; // ***Placeholder -/*0010*/ int32 z_pos:19, // z coord - delta_y:13; // change in y -/*0014*/ int32 delta_x:13, // change in x - heading:12, // heading - padding0014:7; // ***Placeholder -/*0018*/ int32 delta_z:13, // change in z - padding0018:19; // ***Placeholder -/*0022*/ -}; - -/* -** Player position update -** Struct sent from client->server to update -** player position on server -** -*/ -struct PlayerPositionUpdateClient_Struct -{ -/*0000*/ uint16 spawn_id; -/*0022*/ uint16 sequence; //increments one each packet -/*0004*/ float y_pos; // y coord -/*0008*/ float delta_z; // Change in z -/*0016*/ float delta_x; // Change in x -/*0012*/ float delta_y; // Change in y -/*0020*/ int32 animation:10, // animation - delta_heading:10, // change in heading - padding0020:12; // ***Placeholder (mostly 1) -/*0024*/ float x_pos; // x coord -/*0028*/ float z_pos; // z coord -/*0034*/ uint16 heading:12, // Directional heading - padding0004:4; // ***Placeholder -/*0032*/ uint8 unknown0006[2]; // ***Placeholder -/*0036*/ -}; - -/* -** Spawn HP Update -** Length: 10 Bytes -** OpCode: OP_HPUpdate -*/ -struct SpawnHPUpdate_Struct -{ -/*00*/ uint32 cur_hp; // Id of spawn to update -/*04*/ int32 max_hp; // Maximum hp of spawn -/*08*/ int16 spawn_id; // Current hp of spawn -/*10*/ -}; -struct SpawnHPUpdate_Struct2 -{ -/*01*/ int16 spawn_id; -/*00*/ uint8 hp; -}; -/* -** Stamina -** Length: 8 Bytes -** OpCode: 5721 -*/ -struct Stamina_Struct { -/*00*/ uint32 food; // (low more hungry 127-0) -/*02*/ uint32 water; // (low more thirsty 127-0) -}; - -/* -** Level Update -** Length: 12 Bytes -*/ -struct LevelUpdate_Struct -{ -/*00*/ uint32 level; // New level -/*04*/ uint32 level_old; // Old level -/*08*/ uint32 exp; // Current Experience -}; - -/* -** Experience Update -** Length: 14 Bytes -** OpCode: 9921 -*/ -struct ExpUpdate_Struct -{ -/*0000*/ uint32 exp; // Current experience ratio from 0 to 330 -/*0004*/ uint32 aaxp; // @BP ?? -}; - -/* -** Item Packet Struct - Works on a variety of opcodes -** Packet Types: See ItemPacketType enum -** -*/ -enum ItemPacketType -{ - ItemPacketViewLink = 0x00, - ItemPacketTradeView = 0x65, - ItemPacketLoot = 0x66, - ItemPacketTrade = 0x67, - ItemPacketCharInventory = 0x69, - ItemPacketSummonItem = 0x6A, - ItemPacketTributeItem = 0x6C, - ItemPacketMerchant = 0x64, - ItemPacketWorldContainer = 0x6B -}; -struct ItemPacket_Struct -{ -/*00*/ ItemPacketType PacketType; -/*04*/ char SerializedItem[1]; -/*xx*/ -}; - -struct BulkItemPacket_Struct -{ -/*00*/ char SerializedItem[0]; -/*xx*/ -}; - -struct Consume_Struct -{ -/*0000*/ uint32 slot; -/*0004*/ uint32 auto_consumed; // 0xffffffff when auto eating e7030000 when right click -/*0008*/ uint8 c_unknown1[4]; -/*0012*/ uint8 type; // 0x01=Food 0x02=Water -/*0013*/ uint8 unknown13[3]; -}; - -struct DeleteItem_Struct -{ -/*0000*/ uint32 from_slot; -/*0004*/ uint32 to_slot; -/*0008*/ uint32 number_in_stack; -/*0012*/ -}; - -struct MoveItem_Struct -{ -/*0000*/ uint32 from_slot; -/*0004*/ uint32 to_slot; -/*0008*/ uint32 number_in_stack; -/*0012*/ -}; - -// -// from_slot/to_slot -// -1 - destroy -// 0 - cursor -// 1 - inventory -// 2 - bank -// 3 - trade -// 4 - shared bank -// -// cointype -// 0 - copeer -// 1 - silver -// 2 - gold -// 3 - platinum -// -static const uint32 COINTYPE_PP = 3; -static const uint32 COINTYPE_GP = 2; -static const uint32 COINTYPE_SP = 1; -static const uint32 COINTYPE_CP = 0; - -struct MoveCoin_Struct -{ - int32 from_slot; - int32 to_slot; - int32 cointype1; - int32 cointype2; - int32 amount; -}; -struct TradeCoin_Struct{ - uint32 trader; - uint8 slot; - uint16 unknown5; - uint8 unknown7; - uint32 amount; -}; -struct TradeMoneyUpdate_Struct{ - uint32 trader; - uint32 type; - uint32 amount; -}; -/* -** Surname struct -** Size: 100 bytes -*/ -struct Surname_Struct -{ -/*0000*/ char name[64]; -/*0064*/ uint32 unknown0064; -/*0068*/ char lastname[32]; -/*0100*/ -}; - -struct GuildsListEntry_Struct { - char name[64]; -}; - -static const uint32 MAX_NUMBER_GUILDS = 1500; -struct GuildsList_Struct { - uint8 head[64]; // First on guild list seems to be empty... - GuildsListEntry_Struct Guilds[MAX_NUMBER_GUILDS]; -}; - -struct GuildUpdate_Struct { - uint32 guildID; - GuildsListEntry_Struct entry; -}; - -/* -** Money Loot -** Length: 22 Bytes -** OpCode: 5020 -*/ -struct moneyOnCorpseStruct { -/*0000*/ uint8 response; // 0 = someone else is, 1 = OK, 2 = not at this time -/*0001*/ uint8 unknown1; // = 0x5a -/*0002*/ uint8 unknown2; // = 0x40 -/*0003*/ uint8 unknown3; // = 0 -/*0004*/ uint32 platinum; // Platinum Pieces -/*0008*/ uint32 gold; // Gold Pieces - -/*0012*/ uint32 silver; // Silver Pieces -/*0016*/ uint32 copper; // Copper Pieces -}; - -//opcode = 0x5220 -// size 292 - - -struct LootingItem_Struct { -/*000*/ uint32 lootee; -/*002*/ uint32 looter; -/*004*/ uint16 slot_id; -/*006*/ uint8 unknown3[2]; -/*008*/ uint32 auto_loot; -}; - -struct GuildManageStatus_Struct{ - uint32 guildid; - uint32 oldrank; - uint32 newrank; - char name[64]; -}; -// Guild invite, remove -struct GuildJoin_Struct{ -/*000*/ uint32 guildid; -/*004*/ uint32 unknown04; -/*008*/ uint32 level; -/*012*/ uint32 class_; -/*016*/ uint32 rank;//0 member, 1 officer, 2 leader -/*020*/ uint32 zoneid; -/*024*/ uint32 unknown24; -/*028*/ char name[64]; -/*092*/ -}; -struct GuildInviteAccept_Struct { - char inviter[64]; - char newmember[64]; - uint32 response; - uint32 guildeqid; -}; -struct GuildManageRemove_Struct { - uint32 guildeqid; - char member[64]; -}; -struct GuildCommand_Struct { - char othername[64]; - char myname[64]; - uint16 guildeqid; - uint8 unknown[2]; // for guildinvite all 0's, for remove 0=0x56, 2=0x02 - uint32 officer; -}; - -// 4244 bytes. Is not really an 'OnLevelMessage', it causes a popup box to display in the client -// Text looks like HTML. -struct OnLevelMessage_Struct { -/*0000*/ char Title[128]; -/*0128*/ char Text[4096]; -/*4224*/ uint32 Buttons; -/*4228*/ uint32 Duration; -/*4232*/ uint32 PopupID; -/*4236*/ uint32 unknown4236; -/*4240*/ uint32 unknown4240; -/*4244*/ -}; - -// Opcode OP_GMZoneRequest -// Size = 88 bytes -struct GMZoneRequest_Struct { -/*0000*/ char charname[64]; -/*0064*/ uint32 zone_id; -/*0068*/ float x; -/*0072*/ float y; -/*0076*/ float z; -/*0080*/ char unknown0080[4]; -/*0084*/ uint32 success; // 0 if command failed, 1 if succeeded? -/*0088*/ -// /*072*/ int8 success; // =0 client->server, =1 server->client, -X=specific error -// /*073*/ uint8 unknown0073[3]; // =0 ok, =ffffff error -}; - -struct GMSummon_Struct { -/* 0*/ char charname[64]; -/* 30*/ char gmname[64]; -/* 60*/ uint32 success; -/* 61*/ uint32 zoneID; -/*92*/ int32 y; -/*96*/ int32 x; -/*100*/ int32 z; -/*104*/ uint32 unknown2; // E0 E0 56 00 -}; - -struct GMGoto_Struct { // x,y is swapped as compared to summon and makes sense as own packet -/* 0*/ char charname[64]; - -/* 64*/ char gmname[64]; -/* 128*/ uint32 success; -/* 132*/ uint32 zoneID; - -/*136*/ int32 y; -/*140*/ int32 x; -/*144*/ int32 z; -/*148*/ uint32 unknown2; // E0 E0 56 00 -}; - -struct GMLastName_Struct { - char name[64]; - char gmname[64]; - char lastname[64]; - uint16 unknown[4]; // 0x00, 0x00 - // 0x01, 0x00 = Update the clients -}; - -//Combat Abilities -struct CombatAbility_Struct { - uint32 m_target; //the ID of the target mob - uint32 m_atk; - uint32 m_skill; -}; - -//Instill Doubt -struct Instill_Doubt_Struct { - uint8 i_id; - uint8 ia_unknown; - uint8 ib_unknown; - uint8 ic_unknown; - uint8 i_atk; - - uint8 id_unknown; - uint8 ie_unknown; - uint8 if_unknown; - uint8 i_type; - uint8 ig_unknown; - uint8 ih_unknown; - uint8 ii_unknown; -}; - -struct GiveItem_Struct { - uint16 to_entity; - int16 to_equipSlot; - uint16 from_entity; - int16 from_equipSlot; -}; - -struct RandomReq_Struct { - uint32 low; - uint32 high; -}; - -/* solar: 9/23/03 reply to /random command; struct from Zaphod */ -struct RandomReply_Struct { -/* 00 */ uint32 low; -/* 04 */ uint32 high; -/* 08 */ uint32 result; -/* 12 */ char name[64]; -/* 76 */ -}; - -struct LFG_Struct { -/* -Wrong size on OP_LFG. Got: 80, Expected: 68 - 0: 00 00 00 00 01 00 00 00 - 00 00 00 00 64 00 00 00 | ............d... - 16: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 | ................ - 32: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 | ................ - 48: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 | ................ - 64: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 | ................ -Wrong size on OP_LFG. Got: 80, Expected: 68 - 0: 00 00 00 00 01 00 00 00 - 3F 00 00 00 41 00 00 00 | ........?...A... - 16: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 | ................ - 32: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 | ................ - 48: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 | ................ - 64: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 | ................ -Wrong size on OP_LFG. Got: 80, Expected: 68 - 0: 00 00 00 00 01 00 00 00 - 3F 00 00 00 41 00 00 00 | ........?...A... - 16: 46 72 75 62 20 66 72 75 - 62 20 66 72 75 62 00 00 | Frub frub frub.. - 32: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 | ................ - 48: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 | ................ - 64: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 | ................ -*/ -/*000*/ uint32 unknown000; -/*004*/ uint32 value; // 0x00 = off 0x01 = on -/*008*/ uint32 unknown008; -/*012*/ uint32 unknown012; -/*016*/ char name[64]; -}; - -/* -** LFG_Appearance_Struct -** Packet sent to clients to notify when someone in zone toggles LFG flag -** Size: 8 bytes -** Used in: OP_LFGAppearance -** -*/ -struct LFG_Appearance_Struct -{ -/*0000*/ uint32 spawn_id; // ID of the client -/*0004*/ uint8 lfg; // 1=LFG, 0=Not LFG -/*0005*/ char unknown0005[3]; // -/*0008*/ -}; - - -// EverQuest Time Information: -// 72 minutes per EQ Day -// 3 minutes per EQ Hour -// 6 seconds per EQ Tick (2 minutes EQ Time) -// 3 seconds per EQ Minute - -struct TimeOfDay_Struct { - uint8 hour; - uint8 minute; - uint8 day; - uint8 month; - uint32 year; -}; - -// Darvik: shopkeeper structs -struct Merchant_Click_Struct { -/*000*/ uint32 npcid; // Merchant NPC's entity id -/*004*/ uint32 playerid; -/*008*/ uint32 command; //1=open, 0=cancel/close -/*012*/ float rate; //cost multiplier, dosent work anymore -}; -/* -Unknowns: -0 is e7 from 01 to // MAYBE SLOT IN PURCHASE -1 is 03 -2 is 00 -3 is 00 -4 is ?? -5 is ?? -6 is 00 from a0 to -7 is 00 from 3f to */ -/* -0 is F6 to 01 -1 is CE CE -4A 4A -00 00 -00 E0 -00 CB -00 90 -00 3F -*/ - - - -struct Merchant_Sell_Struct { -/*000*/ uint32 npcid; // Merchant NPC's entity id -/*004*/ uint32 playerid; // Player's entity id -/*008*/ uint32 itemslot; - uint32 unknown12; -/*016*/ uint8 quantity; // Already sold -/*017*/ uint8 Unknown016[3]; -/*020*/ uint32 price; -}; -struct Merchant_Purchase_Struct { -/*000*/ uint32 npcid; // Merchant NPC's entity id -/*004*/ uint32 itemslot; // Player's entity id -/*008*/ uint32 quantity; -/*012*/ uint32 price; -}; -struct Merchant_DelItem_Struct{ -/*000*/ uint32 npcid; // Merchant NPC's entity id -/*004*/ uint32 playerid; // Player's entity id -/*008*/ uint32 itemslot; -}; -struct Adventure_Purchase_Struct { -/*000*/ uint32 some_flag; //set to 1 generally... -/*000*/ uint32 npcid; -/*004*/ uint32 itemid; -/*008*/ uint32 variable; -}; - -struct Adventure_Sell_Struct { -/*000*/ uint32 unknown000; //0x01 -/*004*/ uint32 npcid; -/*008*/ uint32 slot; -/*012*/ uint32 charges; -/*016*/ uint32 sell_price; -}; - -struct AdventurePoints_Update_Struct { -/*000*/ uint32 ldon_available_points; // Total available points -/*004*/ uint8 unkown_apu004[20]; -/*024*/ uint32 ldon_guk_points; // Earned Deepest Guk points -/*028*/ uint32 ldon_mirugal_points; // Earned Mirugal' Mebagerie points -/*032*/ uint32 ldon_mistmoore_points; // Earned Mismoore Catacombs Points -/*036*/ uint32 ldon_rujarkian_points; // Earned Rujarkian Hills points -/*040*/ uint32 ldon_takish_points; // Earned Takish points -/*044*/ uint8 unknown_apu042[216]; -}; - - -struct AdventureFinish_Struct{ - uint32 win_lose;//Cofruben: 00 is a lose,01 is win. - uint32 points; -}; -//OP_AdventureRequest -struct AdventureRequest_Struct{ - uint32 risk;//1 normal,2 hard. - uint32 entity_id; -}; -struct AdventureRequestResponse_Struct{ - uint32 unknown000; - char text[2048]; - uint32 timetoenter; - uint32 timeleft; - uint32 risk; - float x; - float y; - float z; - uint32 showcompass; - uint32 unknown2080; -}; - - - -/*struct Item_Shop_Struct { - uint16 merchantid; - uint8 itemtype; - Item_Struct item; - uint8 iss_unknown001[6]; -};*/ - -/* -** Illusion_Struct -** Changes client visible features -** Size: 168 bytes -** Used In: OP_Illusion, #face, Mob::SendIllusionPacket() -** Fields from the deprecated struct: -** uint8 unknown_26; //Always 26 -** uint8 haircolor; -** uint8 beardcolor; -** uint8 eyecolor1; // the eyecolors always seem to be the same, maybe left and right eye? -** uint8 eyecolor2; -** uint8 hairstyle; -** uint8 aa_title; -** uint8 luclinface; // and beard -** Updated by Father Nitwit for 7-14-04 patch -** -*/ - -struct Illusion_Struct { -/*000*/ uint32 spawnid; -/*004*/ char charname[64]; -/*068*/ uint16 race; -/*070*/ char unknown070[2]; -/*072*/ uint8 gender; -/*073*/ uint8 texture; -/*074*/ uint8 helmtexture; -/*075*/ uint8 unknown075; -/*076*/ uint32 face; -/*080*/ uint8 hairstyle; -/*081*/ uint8 haircolor; -/*082*/ uint8 beard; -/*083*/ uint8 beardcolor; -/*084*/ float size; -/*088*/ char unknown084[80]; -/*168*/ -}; - - -struct ZonePoint_Entry { -/*0000*/ uint32 iterator; -/*0004*/ float y; -/*0008*/ float x; -/*0012*/ float z; -/*0016*/ float heading; -/*0020*/ uint16 zoneid; -/*0022*/ uint16 zoneinstance; // LDoN instance -}; - -struct ZonePoints { -/*0000*/ uint32 count; -/*0004*/ struct ZonePoint_Entry zpe[0]; // Always add one extra to the end after all zonepoints -}; - -struct SkillUpdate_Struct { -/*00*/ uint32 skillId; -/*04*/ uint32 value; -/*08*/ -}; - -struct ZoneUnavail_Struct { - //This actually varies, but... - char zonename[16]; - int16 unknown[4]; -}; - -struct GroupGeneric_Struct { - char name1[64]; - char name2[64]; -}; - -struct GroupCancel_Struct { - char name1[64]; - char name2[64]; - uint8 toggle; -}; - -struct GroupUpdate_Struct { -/*0000*/ uint32 action; -/*0004*/ char yourname[64]; -/*0068*/ char membername[5][64]; -/*0388*/ char leadersname[64]; -}; - -struct GroupUpdate2_Struct { -/*0000*/ uint32 action; -/*0004*/ char yourname[64]; -/*0068*/ char membername[5][64]; -/*0388*/ char leadersname[64]; -/*0452*/ GroupLeadershipAA_Struct leader_aas; -/*0580*/ uint8 unknown[188]; -/*0768*/ -}; -struct GroupJoin_Struct { -/*0000*/ uint32 action; -/*0004*/ char yourname[64]; -/*0068*/ char membername[64]; -/*0132*/ uint8 unknown[84]; -}; - -struct FaceChange_Struct { -/*000*/ uint8 haircolor; -/*001*/ uint8 beardcolor; -/*002*/ uint8 eyecolor1; // the eyecolors always seem to be the same, maybe left and right eye? -/*003*/ uint8 eyecolor2; -/*004*/ uint8 hairstyle; -/*005*/ uint8 beard; // vesuvias -/*006*/ uint8 face; -//vesuvias: -//there are only 10 faces for barbs changing woad just -//increase the face value by ten so if there were 8 woad -//designs then there would be 80 barb faces -}; - -/* -** Trade request from one client to another -** Used to initiate a trade -** Size: 8 bytes -** Used in: OP_TradeRequest -*/ -struct TradeRequest_Struct { -/*00*/ uint32 to_mob_id; -/*04*/ uint32 from_mob_id; -/*08*/ -}; - -struct TradeAccept_Struct { -/*00*/ uint32 from_mob_id; -/*04*/ uint32 unknown4; //seems to be garbage -/*08*/ -}; - -/* -** Cancel Trade struct -** Sent when a player cancels a trade -** Size: 8 bytes -** Used In: OP_CancelTrade -** -*/ -struct CancelTrade_Struct { -/*00*/ uint32 fromid; -/*04*/ uint32 action; -/*08*/ -}; - -struct PetitionUpdate_Struct { - uint32 petnumber; // Petition Number - uint32 color; // 0x00 = green, 0x01 = yellow, 0x02 = red - uint32 status; - uint32 senttime; // 4 has to be 0x1F - char accountid[32]; - char gmsenttoo[64]; - int32 quetotal; - char charname[64]; -}; - -struct Petition_Struct { - uint32 petnumber; - uint32 urgency; - char accountid[32]; - char lastgm[32]; - uint32 zone; - //char zone[32]; - char charname[64]; - uint32 charlevel; - uint32 charclass; - uint32 charrace; - uint32 unknown; - //time_t senttime; // Time? - uint32 checkouts; - uint32 unavail; - //uint8 unknown5[4]; - uint32 senttime; - uint32 unknown2; - char petitiontext[1024]; - char gmtext[1024]; -}; - - -struct Who_All_Struct { // 76 length total -/*000*/ char whom[64]; -/*064*/ uint32 wrace; // FF FF = no race - -/*066*/ uint32 wclass; // FF FF = no class -/*068*/ uint32 lvllow; // FF FF = no numbers -/*070*/ uint32 lvlhigh; // FF FF = no numbers -/*072*/ uint32 gmlookup; // FF FF = not doing /who all gm -/*074*/ uint32 unknown074; -/*076*/ uint8 unknown076[64]; -/*140*/ -}; - -struct Stun_Struct { // 4 bytes total - uint32 duration; // Duration of stun -}; - -struct AugmentItem_Struct { -/*00*/ int16 container_slot; -/*02*/ char unknown02[2]; -/*04*/ int32 augment_slot; -/*08*/ -}; - -// OP_Emote -struct Emote_Struct { -/*0000*/ uint32 unknown01; -/*0004*/ char message[1024]; -/*1028*/ -}; - -// Inspect -struct Inspect_Struct { - uint16 TargetID; - uint16 PlayerID; -}; -//OP_InspectAnswer -struct InspectResponse_Struct{//Cofruben:need to send two of this for the inspect response. -/*000*/ uint32 TargetID; -/*004*/ uint32 playerid; -/*008*/ char itemnames[21][64]; -/*1352*/char unknown_zero[64];//fill with zero's. -/*1416*/uint32 itemicons[21]; -/*1500*/uint32 unknown_zero2; -/*1504*/char text[288]; -}; - -//OP_SetDataRate -struct SetDataRate_Struct { - float newdatarate; -}; - -//OP_SetServerFilter -struct SetServerFilter_Struct { - uint32 filters[25]; //see enum eqFilterType -}; - -//Op_SetServerFilterAck -struct SetServerFilterAck_Struct { - uint8 blank[8]; -}; -struct IncreaseStat_Struct{ - /*0000*/ uint8 unknown0; - /*0001*/ uint8 str; - /*0002*/ uint8 sta; - /*0003*/ uint8 agi; - /*0004*/ uint8 dex; - /*0005*/ uint8 int_; - /*0006*/ uint8 wis; - /*0007*/ uint8 cha; - /*0008*/ uint8 fire; - /*0009*/ uint8 cold; - /*0010*/ uint8 magic; - /*0011*/ uint8 poison; - /*0012*/ uint8 disease; - /*0013*/ char unknown13[116]; - /*0129*/ uint8 str2; - /*0130*/ uint8 sta2; - /*0131*/ uint8 agi2; - /*0132*/ uint8 dex2; - /*0133*/ uint8 int_2; - /*0134*/ uint8 wis2; - /*0135*/ uint8 cha2; - /*0136*/ uint8 fire2; - /*0137*/ uint8 cold2; - /*0138*/ uint8 magic2; - /*0139*/ uint8 poison2; - /*0140*/ uint8 disease2; -}; - -struct GMName_Struct { - char oldname[64]; - char gmname[64]; - char newname[64]; - uint8 badname; - uint8 unknown[3]; -}; - -struct GMDelCorpse_Struct { - char corpsename[64]; - char gmname[64]; - uint8 unknown; -}; - -struct GMKick_Struct { - char name[64]; - char gmname[64]; - uint8 unknown; -}; - - -struct GMKill_Struct { - char name[64]; - char gmname[64]; - uint8 unknown; -}; - - -struct GMEmoteZone_Struct { - char text[512]; -}; - -// This is where the Text is sent to the client. -// Use ` as a newline character in the text. -// Variable length. -struct BookText_Struct { - uint8 window; // where to display the text (0xFF means new window) - uint8 type; //type: 0=scroll, 1=book, 2=item info.. prolly others. - char booktext[1]; // Variable Length -}; -// This is the request to read a book. -// This is just a "text file" on the server -// or in our case, the 'name' column in our books table. -struct BookRequest_Struct { - uint8 window; // where to display the text (0xFF means new window) - uint8 type; //type: 0=scroll, 1=book, 2=item info.. prolly others. - char txtfile[1]; // Variable Length -}; - -/* -** Object/Ground Spawn struct -** Used for Forges, Ovens, ground spawns, items dropped to ground, etc -** Size: 92 bytes -** OpCodes: OP_CreateObject -** Last Updated: Oct-17-2003 -** -*/ -struct Object_Struct { -/*00*/ uint32 linked_list_addr[2];// They are, get this, prev and next, ala linked list -/*08*/ uint16 unknown008[2]; // -/*12*/ uint32 drop_id; // Unique object id for zone -/*16*/ uint16 zone_id; // Redudant, but: Zone the object appears in -/*18*/ uint16 zone_instance; // -/*20*/ uint32 unknown020; // -/*24*/ uint32 unknown024; // -/*28*/ float heading; // heading -/*32*/ float z; // z coord -/*36*/ float x; // x coord -/*40*/ float y; // y coord -/*44*/ char object_name[20]; // Name of object, usually something like IT63_ACTORDEF -/*64*/ float unknown064; // seems like coords, not always valid, all 0 on most world objects -/*68*/ float unknown068; // seems like coords, not always valid, all 0 on most world objects -/*72*/ float unknown072; // seems like coords, not always valid, all 0 on most world objects -/*76*/ uint32 unknown076; // -/*80*/ uint32 object_type; // Type of object, not directly translated to OP_OpenObject -/*84*/ uint32 unknown084; //set to 0xFF -/*88*/ uint32 spawn_id; // Spawn Id of client interacting with object -/*92*/ -}; -// 01 = generic drop, 02 = armor, 19 = weapon -//[13:40] and 0xff seems to be indicative of the tradeskill/openable items that end up returning the old style item type in the OP_OpenObject - -/* -** Click Object Struct -** Client clicking on zone object (forge, groundspawn, etc) -** Size: 8 bytes -** Last Updated: Oct-17-2003 -** -*/ -struct ClickObject_Struct { -/*00*/ uint32 drop_id; -/*04*/ uint32 player_id; -/*08*/ -}; - -struct Shielding_Struct { - uint32 target_id; -}; - -/* -** Click Object Acknowledgement Struct -** Response to client clicking on a World Container (ie, forge) -** -*/ -struct ClickObjectAck_Struct { -/*00*/ uint32 player_id; // Entity Id of player who clicked object -/*04*/ uint32 drop_id; // Zone-specified unique object identifier -/*08*/ uint32 open; // 1=opening, 0=closing -/*12*/ uint32 type; // See object.h, "Object Types" -/*16*/ uint32 unknown16; // -/*20*/ uint32 icon; // Icon to display for tradeskill containers -/*24*/ uint32 unknown24; // -/*28*/ char object_name[64]; // Object name to display -/*92*/ -}; - -/* -** This is different now, mostly unknown -** -*/ -struct CloseContainer_Struct { -/*00*/ uint32 player_id; // Entity Id of player who clicked object -/*04*/ uint32 drop_id; // Zone-specified unique object identifier -/*08*/ uint32 open; // 1=opening, 0=closing -/*12*/ uint32 unknown12[12]; -}; - -/* -** Generic Door Struct -** Length: 52 Octets -** Used in: -** cDoorSpawnsStruct(f721) -** -*/ -struct Door_Struct -{ -/*0000*/ char name[32]; // Filename of Door // Was 10char long before... added the 6 in the next unknown to it: Daeken M. BlackBlade -/*0032*/ float yPos; // y loc -/*0036*/ float xPos; // x loc -/*0040*/ float zPos; // z loc -/*0044*/ float heading; -/*0048*/ uint32 incline; // rotates the whole door -/*0052*/ uint16 size; // 100 is normal, smaller number = smaller model -/*0054*/ uint8 unknown0038[6]; -/*0060*/ uint8 doorId; // door's id # -/*0061*/ uint8 opentype; -/* - * Open types: - * 66 = PORT1414 (Qeynos) - * 55 = BBBOARD (Qeynos) - * 100 = QEYLAMP (Qeynos) - * 56 = CHEST1 (Qeynos) - * 5 = DOOR1 (Qeynos) - */ -/*0062*/ uint8 state_at_spawn; -/*0063*/ uint8 invert_state; // if this is 1, the door is normally open -/*0064*/ uint32 door_param; //this may index zone_points, representing the destination -/*0068*/ uint8 unknown0052[12]; // mostly 0s, the last 3 bytes are something tho -/*0080*/ -}; - - - -struct DoorSpawns_Struct { - struct Door_Struct doors[0]; -}; - -/* - OP Code: Op_ClickDoor - Size: 16 -*/ -struct ClickDoor_Struct { -/*000*/ uint8 doorid; -/*001*/ uint8 unknown001; // This may be some type of action setting -/*002*/ uint8 unknown002; // This is sometimes set after a lever is closed -/*003*/ uint8 unknown003; // Seen 0 -/*004*/ uint8 picklockskill; -/*005*/ uint8 unknown005[3]; -/*008*/ uint32 item_id; -/*012*/ uint16 player_id; -/*014*/ uint8 unknown014[2]; -/*016*/ -}; - -struct MoveDoor_Struct { - uint8 doorid; - uint8 action; -}; - - -struct BecomeNPC_Struct { - uint32 id; - int32 maxlevel; -}; - -struct Underworld_Struct { - float speed; - float y; - float x; - float z; -}; - -struct Resurrect_Struct { - uint32 unknown00; - uint16 zone_id; - uint16 instance_id; - float y; - float x; - float z; - char your_name[64]; - uint32 unknown88; - char rezzer_name[64]; - uint32 spellid; - char corpse_name[64]; - uint32 action; -/* 228 */ -}; - -struct SetRunMode_Struct { - uint8 mode; - uint8 unknown[3]; -}; - -//EnvDamage is EnvDamage2 without a few bytes at the end. - -struct EnvDamage2_Struct { -/*0000*/ uint32 id; -/*0004*/ uint16 unknown4; -/*0006*/ uint32 damage; -/*0010*/ uint8 unknown10[12]; -/*0022*/ uint8 dmgtype; //FA = Lava; FC = Falling -/*0023*/ uint8 unknown2[4]; -/*0027*/ uint16 constant; //Always FFFF -/*0029*/ uint16 unknown29; -}; - -//Bazaar Stuff =D - -struct BazaarWindowStart_Struct { - uint8 Action; - uint8 Unknown001; - uint16 Unknown002; -}; - - -struct BazaarWelcome_Struct { - BazaarWindowStart_Struct beginning; - uint32 traders; - uint32 items; - uint8 unknown1[8]; -}; - -struct BazaarSearch_Struct { - BazaarWindowStart_Struct beginning; - uint32 traderid; - uint32 class_; - uint32 race; - uint32 stat; - uint32 slot; - uint32 type; - char name[64]; - uint32 minprice; - uint32 maxprice; -}; -struct BazaarInspect_Struct{ - uint32 item_id; - uint32 unknown; - char name[64]; -}; -struct BazaarReturnDone_Struct{ - uint32 type; - uint32 traderid; - uint32 unknown8; - uint32 unknown12; - uint32 unknown16; -}; - -struct BazaarSearchResults_Struct { -/*000*/ BazaarWindowStart_Struct Beginning; -/*004*/ uint32 NumItems; -/*008*/ uint32 SerialNumber; -/*012*/ uint32 SellerID; -/*016*/ uint32 Cost; -/*020*/ uint32 ItemStat; -/*024*/ char ItemName[64]; -/*088*/ -}; - -struct ServerSideFilters_Struct { -uint8 clientattackfilters; // 0) No, 1) All (players) but self, 2) All (players) but group -uint8 npcattackfilters; // 0) No, 1) Ignore NPC misses (all), 2) Ignore NPC Misses + Attacks (all but self), 3) Ignores NPC Misses + Attacks (all but group) -uint8 clientcastfilters; // 0) No, 1) Ignore PC Casts (all), 2) Ignore PC Casts (not directed towards self) -uint8 npccastfilters; // 0) No, 1) Ignore NPC Casts (all), 2) Ignore NPC Casts (not directed towards self) -}; - -/* -** Client requesting item statistics -** Size: 32 bytes -** Used In: OP_ItemLinkClick -** Last Updated: 2/15/2009 -** -*/ -struct ItemViewRequest_Struct { -/*000*/ uint32 item_id; -/*004*/ uint32 augments[5]; -/*024*/ uint32 link_hash; -/*028*/ char unknown028[4]; -/*032*/ -}; - - -/* - * Client to server packet - */ -struct PickPocket_Struct { -// Size 18 - uint32 to; - uint32 from; - uint16 myskill; - uint8 type; // -1 you are being picked, 0 failed , 1 = plat, 2 = gold, 3 = silver, 4 = copper, 5 = item - uint8 unknown1; // 0 for response, unknown for input - uint32 coin; - uint8 lastsix[2]; -}; -/* - * Server to client packet - */ - -struct sPickPocket_Struct { - // Size 28 = coin/fail - uint32 to; - uint32 from; - uint32 myskill; - uint32 type; - uint32 coin; - char itemname[64]; -}; - -struct LogServer_Struct { -// Op_Code OP_LOGSERVER -/*000*/ uint32 unknown000; -/*004*/ uint32 unknown004; -/*008*/ uint32 unknown008; -/*012*/ uint32 unknown012; // htonl(1) on live -/*016*/ uint32 unknown016; // htonl(1) on live -/*020*/ uint8 unknown020[12]; -/*032*/ char worldshortname[32]; -/*064*/ uint8 unknown064[32]; -/*096*/ char unknown096[16]; // 'pacman' on live -/*112*/ char unknown112[16]; // '64.37,148,36' on live -/*126*/ uint8 unknown128[48]; -/*176*/ uint32 unknown176; // htonl(0x00002695) -/*180*/ char unknown180[80]; // 'eqdataexceptions@mail.station.sony.com' on live -/*260*/ uint8 unknown260; // 0x01 on live -/*261*/ uint8 unknown261; // 0x01 on live -/*262*/ uint8 unknown262[2]; -/*264*/ -}; - -struct ApproveWorld_Struct { -// Size 544 -// Op_Code OP_ApproveWorld - uint8 unknown544[544]; -}; - -struct ClientError_Struct -{ -/*00001*/ char type; -/*00001*/ char unknown0001[69]; -/*00069*/ char character_name[64]; -/*00134*/ char unknown134[192]; -/*00133*/ char message[31994]; -/*32136*/ -}; - -struct MobHealth -{ - /*0000*/ uint8 hp; //health percent - /*0001*/ uint16 id;//mobs id -}; - -struct Track_Struct { - uint16 entityid; - uint16 padding002; - float distance; -}; - -struct Tracking_Struct { - Track_Struct Entrys[0]; -}; - -/* -** ZoneServerInfo_Struct -** Zone server information -** Size: 130 bytes -** Used In: OP_ZoneServerInfo -** -*/ -struct ZoneServerInfo_Struct -{ -/*0000*/ char ip[128]; -/*0128*/ uint16 port; -}; - -struct WhoAllPlayer{ - uint32 formatstring; - uint32 pidstring; - char* name; - uint32 rankstring; - char* guild; - uint32 unknown80[2]; - uint32 zonestring; - uint32 zone; - uint32 class_; - uint32 level; - uint32 race; - char* account; - uint32 unknown100; -}; - -struct WhoAllReturnStruct { - uint32 id; - uint32 playerineqstring; - char line[27]; - uint8 unknown35; //0A - uint32 unknown36;//0s - uint32 playersinzonestring; - uint32 unknown44[2]; //0s - uint32 unknown52;//1 - uint32 unknown56;//1 - uint32 playercount;//1 - struct WhoAllPlayer player[0]; -}; - -struct Trader_Struct { - uint32 code; - uint32 itemid[160]; - uint32 unknown; - uint32 itemcost[80]; -}; - -struct ClickTrader_Struct { - uint32 code; - uint32 unknown[161];//damn soe this is totally pointless :/ but at least your finally using memset! Good job :) -LE - uint32 itemcost[80]; -}; - -struct GetItems_Struct{ - uint32 items[80]; -}; - -struct BecomeTrader_Struct -{ - uint32 ID; - uint32 Code; -}; - -struct Trader_ShowItems_Struct{ - uint32 code; - uint32 traderid; - uint32 unknown08[3]; -}; - -struct TraderBuy_Struct{ - uint32 unknown0; - uint32 traderid; - uint32 itemid; - uint32 unknown8; - uint32 price; - uint32 quantity; - uint32 slot_num; - char itemname[60]; -}; - -struct TraderItemUpdate_Struct{ - uint32 unknown0; - uint32 traderid; - uint8 fromslot; - uint8 toslot; //7? - uint16 charges; -}; - -struct MoneyUpdate_Struct{ - int32 platinum; - int32 gold; - int32 silver; - int32 copper; -}; - -struct TraderDelItem_Struct{ - uint32 slotid; - uint32 quantity; - uint32 unknown; -}; - -struct TraderClick_Struct{ - uint32 traderid; - uint32 unknown4[2]; - uint32 approval; -}; - -struct FormattedMessage_Struct{ - uint32 unknown0; - uint32 string_id; - uint32 type; - char message[0]; -}; -struct SimpleMessage_Struct{ - uint32 string_id; - uint32 color; - uint32 unknown8; -}; - -struct GuildMemberEntry_Struct { - char name[1]; //variable length - uint32 level; //network byte order - uint32 banker; //1=yes, 0=no, network byte order - uint32 class_; //network byte order - uint32 rank; //network byte order - uint32 time_last_on; //network byte order - uint32 tribute_enable; //network byte order - uint32 total_tribute; //total guild tribute donated, network byte order - uint32 last_tribute; //unix timestamp - char public_note[1]; //variable length. - uint16 zoneinstance; //network byte order - uint16 zone_id; //network byte order -/* 38 + strings */ -}; - -struct GuildMembers_Struct { //just for display purposes, this is not actually used in the message encoding. - char player_name[1]; //variable length. - uint32 count; //network byte order - GuildMemberEntry_Struct member[0]; -}; - -struct GuildMOTD_Struct{ -/*0000*/ uint32 unknown0; -/*0004*/ char name[64]; -/*0068*/ char setby_name[64]; -/*0132*/ uint32 unknown132; -/*0136*/ char motd[512]; -}; -struct GuildUpdate_PublicNote{ - uint32 unknown0; - char name[64]; - char target[64]; - char note[100]; //we are cutting this off at 100, actually around 252 -}; -struct GuildDemoteStruct{ - char name[64]; - char target[64]; -}; -struct GuildRemoveStruct{ - char target[64]; - char name[64]; - uint32 unknown128; - uint32 leaderstatus; //? -}; -struct GuildMakeLeader{ - char name[64]; - char target[64]; -}; -struct BugStruct{ -/*0000*/ char chartype[64]; -/*0064*/ char name[96]; -/*0160*/ char ui[128]; -/*0288*/ float x; -/*0292*/ float y; -/*0296*/ float z; -/*0300*/ float heading; -/*0304*/ uint32 unknown304; -/*0308*/ uint32 type; -/*0312*/ char unknown312[2144]; -/*2456*/ char bug[1024]; -/*3480*/ char placeholder[2]; -/*3482*/ char system_info[4098]; -}; - -struct Ground_Spawn{ - float max_x; - float max_y; - float min_x; - float min_y; - float max_z; - float heading; - char name[16]; - uint32 item; - uint32 max_allowed; - uint32 respawntimer; -}; -struct Ground_Spawns { - struct Ground_Spawn spawn[50]; //Assigned max number to allow -}; -struct PetitionBug_Struct{ - uint32 petition_number; - uint32 unknown4; - char accountname[64]; - uint32 zoneid; - char name[64]; - uint32 level; - uint32 class_; - uint32 race; - uint32 unknown152[3]; - uint32 time; - uint32 unknown168; - char text[1028]; -}; - -struct DyeStruct -{ - union - { - struct - { - struct Color_Struct head; - struct Color_Struct chest; - struct Color_Struct arms; - struct Color_Struct wrists; - struct Color_Struct hands; - struct Color_Struct legs; - struct Color_Struct feet; - struct Color_Struct primary; // you can't actually dye this - struct Color_Struct secondary; // or this - } - dyes; - struct Color_Struct dye[9]; - }; -}; - -struct ApproveZone_Struct { - char name[64]; - uint32 zoneid; - uint32 approve; -}; -struct ZoneInSendName_Struct { - uint32 unknown0; - char name[64]; - char name2[64]; - uint32 unknown132; -}; -struct ZoneInSendName_Struct2 { - uint32 unknown0; - char name[64]; - uint32 unknown68[145]; -}; - -static const uint32 MAX_TRIBUTE_TIERS = 10; - -struct StartTribute_Struct { - uint32 client_id; - uint32 tribute_master_id; - uint32 response; -}; - -struct TributeLevel_Struct { - uint32 level; //backwards byte order! - uint32 tribute_item_id; //backwards byte order! - uint32 cost; //backwards byte order! -}; - -struct TributeAbility_Struct { - uint32 tribute_id; //backwards byte order! - uint32 tier_count; //backwards byte order! - TributeLevel_Struct tiers[MAX_TRIBUTE_TIERS]; - char name[0]; -}; - -struct GuildTributeAbility_Struct { - uint32 guild_id; - TributeAbility_Struct ability; -}; - -struct SelectTributeReq_Struct { - uint32 client_id; //? maybe action ID? - uint32 tribute_id; - uint32 unknown8; //seen E3 00 00 00 -}; - -struct SelectTributeReply_Struct { - uint32 client_id; //echoed from request. - uint32 tribute_id; - char desc[0]; -}; - -struct TributeInfo_Struct { - uint32 active; //0 == inactive, 1 == active - uint32 tributes[MAX_PLAYER_TRIBUTES]; //-1 == NONE - uint32 tiers[MAX_PLAYER_TRIBUTES]; //all 00's - uint32 tribute_master_id; -}; - -struct TributeItem_Struct { - uint32 slot; - uint32 quantity; - uint32 tribute_master_id; - int32 tribute_points; -}; - -struct TributePoint_Struct { - int32 tribute_points; - uint32 unknown04; - int32 career_tribute_points; - uint32 unknown12; -}; - -struct TributeMoney_Struct { - uint32 platinum; - uint32 tribute_master_id; - int32 tribute_points; -}; - - -struct Split_Struct -{ - uint32 platinum; - uint32 gold; - uint32 silver; - uint32 copper; -}; - - -/* -** New Combine Struct -** Client requesting to perform a tradeskill combine -** Size: 4 bytes -** Used In: OP_TradeSkillCombine -** Last Updated: Oct-15-2003 -** -*/ -struct NewCombine_Struct { -/*00*/ int16 container_slot; -/*02*/ int16 guildtribute_slot; -/*04*/ -}; - - -//client requesting favorite recipies -struct TradeskillFavorites_Struct { - uint32 object_type; - uint32 some_id; - uint32 favorite_recipes[500]; -}; - -//search request -struct RecipesSearch_Struct { - uint32 object_type; //same as in favorites - uint32 some_id; //same as in favorites - uint32 mintrivial; - uint32 maxtrivial; - char query[56]; - uint32 unknown4; //is set to 00 03 00 00 - uint32 unknown5; //is set to 4C DD 12 00 -/*80*/ -}; - -//one sent for each item, from server in reply to favorites or search -struct RecipeReply_Struct { - uint32 object_type; - uint32 some_id; //same as in favorites - uint32 component_count; - uint32 recipe_id; - uint32 trivial; - char recipe_name[64]; -/*84*/ -}; - -//received and sent back as an ACK with different reply_code -struct RecipeAutoCombine_Struct { - uint32 object_type; - uint32 some_id; - uint32 unknown1; //echoed in reply - uint32 recipe_id; - uint32 reply_code; // 93 64 e1 00 (junk) in request - // 00 00 00 00 in successful reply - // f5 ff ff ff in 'you dont have all the stuff' reply -}; - -struct LevelAppearance_Struct { //Sends a little graphic on level up - uint32 spawn_id; - uint32 parm1; - uint32 value1a; - uint32 value1b; - uint32 parm2; - uint32 value2a; - uint32 value2b; - uint32 parm3; - uint32 value3a; - uint32 value3b; - uint32 parm4; - uint32 value4a; - uint32 value4b; - uint32 parm5; - uint32 value5a; - uint32 value5b; -/*64*/ -}; -struct MerchantList{ - uint32 id; - uint32 slot; - uint32 item; -}; -struct TempMerchantList{ - uint32 npcid; - uint32 slot; - uint32 item; - uint32 charges; //charges/quantity - uint32 origslot; -}; - - -struct FindPerson_Point { - float y; - float x; - float z; -}; - -struct FindPersonRequest_Struct { - uint32 npc_id; - FindPerson_Point client_pos; -}; - -//variable length packet of points -struct FindPersonResult_Struct { - FindPerson_Point dest; - FindPerson_Point path[0]; //last element must be the same as dest -}; - -struct MobRename_Struct { -/*000*/ char old_name[64]; -/*064*/ char old_name_again[64]; //not sure what the difference is -/*128*/ char new_name[64]; -/*192*/ uint32 unknown192; //set to 0 -/*196*/ uint32 unknown196; //set to 1 -/*200*/ -}; - -struct PlayMP3_Struct { - char filename[0]; -}; - -//this is for custom title display in the skill window -struct TitleEntry_Struct { - uint32 skill_id; - uint32 skill_value; - char title[1]; -}; - -struct Titles_Struct { - uint32 title_count; - TitleEntry_Struct titles[0]; -}; - -//this is for title selection by the client -struct TitleListEntry_Struct { - uint32 unknown0; //title ID - char prefix[1]; //variable length, null terminated - char postfix[1]; //variable length, null terminated -}; - -struct TitleList_Struct { - uint32 title_count; - TitleListEntry_Struct titles[0]; //list of title structs - //uint32 unknown_ending; seen 0x7265, 0 -}; - -struct SetTitle_Struct { - uint32 is_suffix; //guessed: 0 = prefix, 1 = suffix - uint32 title_id; -}; - -struct SetTitleReply_Struct { - uint32 is_suffix; //guessed: 0 = prefix, 1 = suffix - char title[32]; - uint32 entity_id; -}; - -struct TaskDescription_Struct { -/*000*/ uint32 activity_count; //not right. -/*004*/ uint32 taskid; -/*008*/ uint8 unk; -/*009*/ uint32 id3; -/*013*/ uint32 unknown13; -/*017*/ char name[1]; //variable length, 0 terminated -/*018*/ uint32 unknown18; -/*022*/ uint32 unknown22; -/*026*/ char desc[1]; //variable length, 0 terminated -/*027*/ uint32 reward_count; //not sure -/*031*/ uint32 unknown31; -/*035*/ uint32 unknown35; -/*039*/ uint16 unknown39; -/*041*/ char reward_link[1]; //variable length, 0 terminated -/*042*/ uint32 unknown43; //maybe crystal count? -}; - -struct TaskMemberList_Struct { -/*00*/ uint32 gopher_id; -/*04*/ uint32 unknown04; -/*08*/ uint32 member_count; //1 less than the number of members -/*12*/ char list_pointer[0]; -/* list is of the form: - char member_name[1] //null terminated string - uint8 task_leader //boolean flag -*/ -}; - - -struct TaskActivity_Struct { -/*000*/ uint32 activity_count; //not right -/*004*/ uint32 id3; -/*008*/ uint32 taskid; -/*012*/ uint32 activity_id; -/*016*/ uint32 unknown016; -/*020*/ uint32 activity_type; -/*024*/ uint32 unknown024; -/*028*/ uint32 unknown28; -/*032*/ char mob_name[1]; //variable length, 0 terminated -/*033*/ char item_name[1]; //variable length, 0 terminated -/*034*/ uint32 goal_count; -/*038*/ uint32 unknown38; //0xFFFFFFFF -/*042*/ uint32 unknown42; //0xFFFFFFFF -/*046*/ uint32 unknown46; //saw 0x151,0x156 -/*050*/ uint32 unknown50; //saw 0x404,0 -/*054*/ char activity_name[1]; //variable length, 0 terminated... commonly empty -/*055*/ uint32 done_count; -/*059*/ uint32 unknown59; //=1 except on unknown and terminal activities? -/*063*/ -}; - -struct TaskHistoryEntry_Struct { - uint32 task_id; - char name[1]; - uint32 completed_time; -}; -struct TaskHistory_Struct { - uint32 completed_count; - TaskHistoryEntry_Struct entries[0]; -}; - -struct AcceptNewTask_Struct { - uint32 task_id; //set to 0 for 'decline' - uint32 task_master_id; //entity ID -}; - -//was all 0's from client, server replied with same op, all 0's -struct CancelTask_Struct { - uint32 unknown0; - uint32 unknown4; -}; - -struct AvaliableTask_Struct { - uint32 task_index; //no idea, seen 0x1 - uint32 task_master_id; //entity ID - uint32 task_id; - uint32 unknown012; - uint32 activity_count; //not sure, seen 2 - char desc[1]; //variable length, 0 terminated - uint32 reward_platinum;//not sure on these - uint32 reward_gold; - uint32 reward_silver; - uint32 reward_copper; - char some_name[1]; //variable length, 0 terminated - uint8 unknown1; - uint32 unknown2; //0xFFFFFFFF - uint32 unknown3; //0xFFFFFFFF - uint32 unknown4; //seen 0x16 - uint8 unknown5; -}; - - -struct BankerChange_Struct { - uint32 platinum; - uint32 gold; - uint32 silver; - uint32 copper; - uint32 platinum_bank; - uint32 gold_bank; - uint32 silver_bank; - uint32 copper_bank; -}; - -struct LeadershipExpUpdate_Struct { -/*00*/ uint32 group_leadership_exp; -/*04*/ uint32 group_leadership_points; -/*08*/ uint32 raid_leadership_exp; -/*12*/ uint32 raid_leadership_points; -}; - -struct UpdateLeadershipAA_Struct { -/*00*/ uint32 ability_id; -/*04*/ uint32 new_rank; -/*08*/ uint32 pointsleft; -/*12*/ -}; - - -struct RaidGeneral_Struct { -/*00*/ uint32 action; //=10 -/*04*/ char player_name[64]; //should both be the player's name -/*04*/ char leader_name[64]; -/*132*/ uint32 parameter; -}; - -struct RaidAdd_Struct { -/*000*/ uint32 action; //=0 -/*004*/ char player_name[64]; //should both be the player's name -/*068*/ char leader_name[64]; -/*132*/ uint8 _class; -/*133*/ uint8 level; -/*134*/ uint8 has_group; -/*135*/ uint8 unknown135; //seems to be 0x42 or 0 -}; - -struct RaidCreate_Struct { -/*00*/ uint32 action; //=8 -/*04*/ char leader_name[64]; -/*68*/ uint32 leader_id; -}; - -struct RaidMemberInfo_Struct { -/*00*/ uint8 group_number; -/*01*/ char member_name[1]; //dyanmic length, null terminated '\0' -/*00*/ uint8 unknown00; -/*01*/ uint8 _class; -/*02*/ uint8 level; -/*03*/ uint8 is_raid_leader; -/*04*/ uint8 is_group_leader; -/*05*/ uint8 main_tank; //not sure -/*06*/ uint8 unknown06[5]; //prolly more flags -}; - -struct RaidDetails_Struct { -/*000*/ uint32 action; //=6,20 -/*004*/ char leader_name[64]; -/*068*/ uint32 unknown68[4]; -/*084*/ LeadershipAA_Struct abilities; //ranks in backwards byte order -/*128*/ uint8 unknown128[142]; -/*354*/ uint32 leader_id; -}; - -struct RaidMembers_Struct { -/*000*/ RaidDetails_Struct details; -/*358*/ uint32 member_count; //including leader -/*362*/ RaidMemberInfo_Struct members[1]; -/*...*/ RaidMemberInfo_Struct empty; //seem to have an extra member with a 0 length name on the end -}; - -struct DynamicWall_Struct { -/*00*/ char name[32]; -/*32*/ float y; -/*36*/ float x; -/*40*/ float z; -/*44*/ uint32 something; -/*48*/ uint32 unknown48; //0 -/*52*/ uint32 one_hundred; //0x64 -/*56*/ uint32 unknown56; //0 -/*60*/ uint32 something2; -/*64*/ int32 unknown64; //-1 -/*68*/ uint32 unknown68; //0 -/*72*/ uint32 unknown72; //0 -/*76*/ uint32 unknown76; //0x100 -/*80*/ -}; - -enum { //bandolier actions - BandolierCreate = 0, - BandolierRemove = 1, - BandolierSet = 2 -}; - -struct BandolierCreate_Struct { -/*00*/ uint32 action; //0 for create -/*04*/ uint8 number; -/*05*/ char name[32]; -/*37*/ uint16 unknown37; //seen 0x93FD -/*39*/ uint8 unknown39; //0 -}; - -struct BandolierDelete_Struct { -/*00*/ uint32 action; -/*04*/ uint8 number; -/*05*/ uint8 unknown05[35]; -}; - -struct BandolierSet_Struct { -/*00*/ uint32 action; -/*04*/ uint8 number; -/*05*/ uint8 unknown05[35]; -}; - -struct Arrow_Struct { -/*000*/ uint32 type; //unsure on name, seems to be 0x1, dosent matter -/*005*/ uint8 unknown004[12]; -/*016*/ float src_y; -/*020*/ float src_x; -/*024*/ float src_z; -/*028*/ uint8 unknown028[12]; -/*040*/ float velocity; //4 is normal, 20 is quite fast -/*044*/ float launch_angle; //0-450ish, not sure the units, 140ish is straight -/*048*/ float tilt; //on the order of 125 -/*052*/ uint8 unknown052[8]; -/*060*/ float arc; -/*064*/ uint8 unknown064[12]; -/*076*/ uint32 source_id; -/*080*/ uint32 target_id; //entity ID -/*084*/ uint32 item_id; //1 to about 150ish -/*088*/ uint32 unknown088; //seen 125, dosent seem to change anything.. -/*092*/ uint32 unknown092; //seen 16, dosent seem to change anything -/*096*/ uint8 unknown096[5]; -/*101*/ char model_name[16]; -/*117*/ uint8 unknown117[19]; -}; - -//made a bunch of trivial structs for stuff for opcode finder to use -struct Consent_Struct { - char name[1]; //always at least a null -}; - -struct AdventureMerchant_Struct { - uint32 unknown_flag; //seems to be 1 - uint32 entity_id; -}; - -struct Save_Struct { - uint8 unknown00[192]; -}; - -struct GMToggle_Struct { - uint8 unknown0[64]; - uint32 toggle; -}; - -struct GroupInvite_Struct { - char invitee_name[64]; - char inviter_name[64]; -// uint8 unknown128[65]; -}; - -struct ColoredText_Struct { - uint32 color; - char msg[1]; -}; - -struct UseAA_Struct { - uint32 begin; - uint32 ability; - uint32 end; -}; - -struct AA_Ability { -/*00*/ uint32 skill_id; -/*04*/ uint32 base1; -/*08*/ uint32 base2; -/*12*/ uint32 slot; -}; - -struct SendAA_Struct { -/*0000*/ uint32 id; -/*0004*/ uint32 hotkey_sid; -/*0008*/ uint32 hotkey_sid2; -/*0012*/ uint32 title_sid; -/*0016*/ uint32 desc_sid; -/*0020*/ uint32 class_type; -/*0024*/ uint32 cost; -/*0028*/ uint32 seq; -/*0032*/ uint32 current_level; //1s, MQ2 calls this AARankRequired -/*0036*/ uint32 prereq_skill; //is < 0, abs() is category # -/*0040*/ uint32 prereq_minpoints; //min points in the prereq -/*0044*/ uint32 type; -/*0048*/ uint32 spellid; -/*0052*/ uint32 spell_type; -/*0056*/ uint32 spell_refresh; -/*0060*/ uint16 classes; -/*0062*/ uint16 berserker; //seems to be 1 if its a berserker ability -/*0064*/ uint32 max_level; -/*0068*/ uint32 last_id; -/*0072*/ uint32 next_id; -/*0076*/ uint32 cost2; -/*0080*/ uint32 unknown80[2]; //0s -/*0084*/ uint32 total_abilities; -/*0088*/ AA_Ability abilities[0]; -}; - -struct AA_List { - SendAA_Struct* aa[0]; -}; - -struct AA_Action { -/*00*/ uint32 action; -/*04*/ uint32 ability; -/*08*/ uint32 unknown08; -/*12*/ uint32 exp_value; -}; - -struct AA_Skills { //this should be removed and changed to AA_Array -/*00*/ uint32 aa_skill; -/*04*/ uint32 aa_value; -}; - -struct AAExpUpdate_Struct { -/*00*/ uint32 unknown00; //seems to be a value from AA_Action.ability -/*04*/ uint32 aapoints_unspent; -/*08*/ uint8 aaxp_percent; //% of exp that goes to AAs -/*09*/ uint8 unknown09[3]; //live dosent always zero these, so they arnt part of aaxp_percent -}; - - -struct AltAdvStats_Struct { -/*000*/ uint32 experience; -/*004*/ uint16 unspent; -/*006*/ uint16 unknown006; -/*008*/ uint8 percentage; -/*009*/ uint8 unknown009[3]; -}; - -struct PlayerAA_Struct { - AA_Skills aa_list[MAX_PP_AA_ARRAY]; -}; - -struct AATable_Struct { - AA_Skills aa_list[MAX_PP_AA_ARRAY]; -}; - -struct Weather_Struct { - uint32 val1; //generall 0x000000FF - uint32 type; //0x31=rain, 0x02=snow(i think), 0 = normal - uint32 mode; -}; - -struct ZoneInUnknown_Struct { - uint32 val1; - uint32 val2; - uint32 val3; -}; - -struct MobHealth_Struct { - uint16 entity_id; - uint8 hp; -}; - -struct AnnoyingZoneUnknown_Struct { - uint32 entity_id; - uint32 value; //always 4 -}; - -struct ApplyPoison_Struct { - uint32 inventorySlot; - uint32 success; -}; - -struct GuildMemberUpdate_Struct { -/*00*/ uint32 guild_id; //not sure -/*04*/ char member_name[64]; -/*68*/ uint16 zone_id; -/*70*/ uint16 instance_id; -/*72*/ uint32 unknown072; -}; - - }; //end namespace structs -}; //end namespace Client62 - -#endif /*CLIENT62_STRUCTS_H_*/ - - - - - - - - - - diff --git a/common/patches/patches.cpp b/common/patches/patches.cpp index 50d77a43f..b993b57dd 100644 --- a/common/patches/patches.cpp +++ b/common/patches/patches.cpp @@ -2,7 +2,6 @@ #include "../debug.h" #include "patches.h" -#include "client62.h" #include "titanium.h" #include "underfoot.h" #include "sof.h" @@ -11,7 +10,6 @@ #include "rof2.h" void RegisterAllPatches(EQStreamIdentifier &into) { - Client62::Register(into); Titanium::Register(into); SoF::Register(into); SoD::Register(into); @@ -21,7 +19,6 @@ void RegisterAllPatches(EQStreamIdentifier &into) { } void ReloadAllPatches() { - Client62::Reload(); Titanium::Reload(); SoF::Reload(); SoD::Reload(); diff --git a/utils/patches/patch_6.2.conf b/utils/patches/patch_6.2.conf deleted file mode 100644 index 8eca3dd4e..000000000 --- a/utils/patches/patch_6.2.conf +++ /dev/null @@ -1,539 +0,0 @@ -#ShowEQ Import Notes: -# ZERO THE FILE first -# sed 's/0x[0-9a-fA-F]{4}/0x0000/g' -#Unknown Mapping: -#OP_Action2 -> OP_Damage -#OP_EnvDamage -> OP_Damage ---> might have been a one time mistake -#Name Differences: -#OP_CancelInvite -> OP_GroupCancelInvite -#OP_GMFind -> OP_FindPersonRequest - -OP_Unknown=0x0000 -OP_ExploreUnknown=0x0292 #used for unknown explorer -#world packets -OP_ApproveWorld=0x41b1 # ShowEQ 06/29/05 -OP_LogServer=0x4668 # EQEmu 06/29/05 -OP_MOTD=0x7fea # EQEmu 06/29/05 -OP_SendLoginInfo=0x2792 # EQEmu 06/29/05 -OP_DeleteCharacter=0x0920 # ShowEQ 06/29/05 -OP_SendCharInfo=0x732c # EQEmu 06/29/05 -OP_ExpansionInfo=0x5c78 # EQEmu 06/29/05 -OP_CharacterCreate=0x6160 # EQEmu 06/29/05 -OP_RandomNameGenerator=0x23d4 # ShowEQ 06/29/05 -OP_GuildsList=0x6957 # ShowEQ 06/29/05 -OP_ApproveName=0x46b1 # EQEmu 06/29/05 -OP_EnterWorld=0x7262 # EQEmu 06/29/05 -OP_PostEnterWorld=0x0df0 # EQEmu 06/29/05 -OP_World_Client_CRC1=0x254d # ShowEQ 06/29/05 -OP_World_Client_CRC2=0x16c9 # ShowEQ 06/29/05 -OP_SetChatServer=0x6238 # EQEmu 06/29/05 -OP_SetChatServer2=0x6536 # EQEmu 06/29/05 -OP_ZoneServerInfo=0x407c # EQEmu 06/29/05 -OP_WorldComplete=0x509d # EQEmu 06/29/05 -OP_WorldClientReady=0x5e99 # EQEmu 06/29/05 (Guess - Doodman) -OP_WorldUnknown001=0x7510 # EQEmu 06/29/05 (New to 6/29) -OP_SendSystemStats=0x681b # anonymous system stats reporting -OP_WorldLogout=0x7186 -OP_ZoneUnavail=0x6d95 -OP_WorldLevelTooHigh=0x583b # world->client. Cancels zone in. -OP_CharInacessable=0x28aa # world->client. Cancels zone in. -#OP_InvalidLoginPassword=0x52A4 - -#Zone in opcodes -OP_ZoneEntry=0x2ec9 # ShowEQ 06/29/05 -OP_ZoneInUnknown=0x0000 -OP_AckPacket=0x7752 # ShowEQ 06/29/05 -OP_NewZone=0x7ac5 # ShowEQ 06/29/05 -OP_ReqClientSpawn=0x0e76 # ShowEQ 06/29/05 -OP_ZoneSpawns=0x5ee8 # ShowEQ 06/29/05 -OP_CharInventory=0x15ff # EQEmu 06/29/05 -OP_SetServerFilter=0x7709 # ShowEQ 06/29/05 -OP_LockoutTimerInfo=0x7c12 # EQEmu 06/29/05 -OP_SendZonepoints=0x775d # EQEmu 06/29/05 -OP_SpawnDoor=0x4c24 # ShowEQ 06/29/05 -OP_ReqNewZone=0x47c9 # ShowEQ 06/29/05 -OP_PlayerProfile=0x75df # ShowEQ 06/29/05 -OP_TimeOfDay=0x1580 # ShowEQ 06/29/05 -OP_SendAATable=0x367d # ShowEQ 06/29/05 -OP_ZoneServerReady=0x0000 #dosent exist in this version - - -OP_Logout=0x0701 # EQEmu 06/29/05 -OP_LogoutReply=0x48c2 # ShowEQ 06/29/05 (OP_Logout) -OP_PreLogoutReply=0x711e #0 len packet sent during logout/zoning -OP_LevelUpdate=0x6d44 # ShowEQ 06/29/05 -OP_MobUpdate=0x0000 -OP_Stamina=0x74ab # ShowEQ 06/29/05 - -#Petition Opcodes -OP_PetitionSearch=0x2aec #search term for petition -OP_PetitionSearchResults=0x2aec #(list of?) matches from search -OP_PetitionSearchText=0x0000 #text results of search -OP_Petition=0x251f #0x73cb -OP_PetitionUpdate=0x3813 #guess -OP_PetitionCheckout=0x0000 -OP_PetitionCheckIn=0x0000 -OP_PetitionQue=0x0000 -OP_PetitionUnCheckout=0x0000 -OP_PetitionDelete=0x0000 -OP_DeletePetition=0x0000 -OP_PetitionResolve=0x6ea9 #0x688f # ShowEQ 5/11/05 -OP_PDeletePetition=0x0000 -OP_PetitionBug=0x0000 -OP_PetitionRefresh=0x0000 -OP_PetitionCheckout2=0x0000 -OP_PetitionViewPetition=0x0000 - -#Guild Opcodes -OP_ZoneGuildList=0x68AC -OP_GuildMemberList=0x147d # ShowEQ 06/29/05 -OP_GuildMemberUpdate=0x4cc7 # ShowEQ 06/29/05 -OP_GuildMemberLevelUpdate=0x0000 #dosent exist in this version. -OP_GuildRemove=0x6cce # EQEmu - Doodman (found 8/26/05 -OP_GuildPeace=0x0e37 # EQEmu - Doodman (found 8/26/05 -OP_GuildWar=0x186d # EQEmu - Doodman (found 8/26/05 -OP_GuildLeader=0x1ef1 # EQEmu - Doodman (found 8/26/05) -OP_GuildDemote=0x1f46 # EQEmu - Doodman (found 8/26/05) -OP_GuildMOTD=0x21ed # ShowEQ 06/29/05 -OP_SetGuildMOTD=0x475a # EQEmu - Doodman (found 8/26/05) -OP_GetGuildsList=0x7fec # ShowEQ 06/29/05 -OP_GuildInvite=0x61d0 # EQEmu - Doodman (found 8/26/05) -OP_GuildPublicNote=0x17a2 # EQEmu - Doodman (found 8/26/05) -OP_GuildDelete=0x5a4d # EQEmu - Doodman (found 8/26/05 -OP_GuildInviteAccept=0x0179 # EQEmu - Doodman (found 8/26/05) -OP_GetGuildMOTD=0x3246 -OP_GetGuildMOTDReply=0x5B14 -OP_GuildManageBanker=0x3d1e -OP_GuildBank=0x0000 -#guild opcodes: 549F (clear guild?), 0x0695, 0x0AC0, 0x1864, 0x32cf, 0x4cc7, -# 0x461A, 0x6966, 0x7085 - - -#GM/guide opcodes -OP_GMServers=0x3387 #/servers -OP_GMBecomeNPC=0x7864 #/becomenpc -OP_GMZoneRequest=0x61ff #/zone -OP_GMSearchCorpse=0x7f3e #/searchcorpse -OP_GMHideMe=0x0581 #/hideme -OP_GMGoto=0x69c8 #/goto -OP_GMDelCorpse=0x727a #/delcorpse -OP_GMApproval=0x0000 -OP_GMToggle=0x5ce2 #/toggle -OP_GMZoneRequest2=0x0000 -OP_GMSummon=0x3383 #/summon -OP_GMEmoteZone=0x3905 #/emotezone -OP_GMFind=0x5e6a #/find -OP_GMKick=0x1cee #/kick -OP_GMNameChange=0x0000 - -OP_SafePoint=0x0000 -OP_Bind_Wound=0x4796 -OP_GMTraining=0x613d -OP_GMEndTraining=0x181c -OP_GMTrainSkill=0x3838 -OP_GMEndTrainingResponse=0x0a94 -OP_Animation=0x0b71 # EQEmu 06/29/05 -OP_Taunt=0x5306 -OP_Stun=0x7DCF -OP_MoneyUpdate=0x425c -OP_SendAAStats=0x5966 # EQEmu 06/29/05 -OP_SendExpZonein=0x0587 # ShowEQ 06/29/05 -OP_RespondAA=0x35e8 -OP_UpdateAA=0x0000 -OP_IncreaseStats=0x0000 -OP_ReadBook=0x1496 -OP_CombatAbility=0x5e55 -OP_Dye=0x773f # ShowEQ 06/29/05 -OP_Consume=0x7a83 # ShowEQ 06/29/05 -OP_Begging=0x2c81 # ShowEQ 06/29/05 -OP_InspectRequest=0x2403 -OP_Action2=0x0000 # ShowEQ 06/29/05 -OP_BeginCast=0x3990 # ShowEQ 06/29/05 -OP_WhoAllRequest=0x5cdd # ShowEQ 06/29/05 -OP_ColoredText=0x4bc6 # ShowEQ 06/29/05 -OP_Consent=0x1081 # ShowEQ 06/29/05 -OP_LFGCommand=0x022f # ShowEQ 06/29/05 -OP_LFGGetMatchesRequest=0x6f82 # ShowEQ 06/29/05 -OP_LFGAppearance=0x024d -OP_LFGResponse=0x1fe1 # ShowEQ 5/11/05 -OP_LFGGetMatchesResponse=0x06c5 # ShowEQ 06/29/05 -OP_LootItem=0x2acf # ShowEQ 06/29/05 -OP_Bug=0x3eba # ShowEQ 06/29/05 -OP_BoardBoat=0x67c9 # ShowEQ 06/29/05 -OP_Save=0x6d9b # ShowEQ 06/29/05 -OP_Camp=0x2844 # ShowEQ 06/29/05 -OP_EndLootRequest=0x7fe4 # ShowEQ 06/29/05 -OP_LoadSpellSet=0x403e # ShowEQ 06/29/05 -OP_AutoAttack=0x6c47 # ShowEQ 06/29/05 -OP_AutoFire=0x6c53 -OP_Consider=0x2717 # ShowEQ 06/29/05 -OP_Emote=0x55bc # ShowEQ 06/29/05 -OP_PetCommands=0x58b2 # ShowEQ 06/29/05 -OP_PetBuffWindow=0x4e31 -OP_SpawnAppearance=0x18b7 # ShowEQ 06/29/05 -OP_DeleteSpawn=0x1a64 # ShowEQ 06/29/05 -OP_FormattedMessage=0x42cd # ShowEQ 06/29/05 -OP_WhoAllResponse=0x6686 # ShowEQ 06/29/05 -OP_AutoAttack2=0x0fa6 # ShowEQ 06/29/05 -OP_SetRunMode=0x0342 # ShowEQ 06/29/05 -OP_SimpleMessage=0x5a48 # ShowEQ 06/29/05 -OP_SaveOnZoneReq=0x2baf # ShowEQ 06/29/05 -OP_MoveDoor=0x0ef7 # ShowEQ 06/29/05 -OP_SenseHeading=0x5666 # ShowEQ 06/29/05 -OP_Buff=0x33dc # ShowEQ 06/29/05 -OP_LootComplete=0x20b2 # ShowEQ 06/29/05 -OP_EnvDamage=0x0990 -OP_Split=0x6a53 # ShowEQ 06/29/05 -OP_Surname=0x48fe # ShowEQ 06/29/05 -OP_ClearSurname=0x0000 -OP_MoveItem=0x7657 # ShowEQ 06/29/05 -OP_FaceChange=0x763b # ShowEQ 06/29/05 -OP_ItemPacket=0x3397 # ShowEQ 06/29/05 -OP_ItemLinkResponse=0x1d43 # ShowEQ 06/29/05 -OP_ClientReady=0x5e20 # ShowEQ 06/29/05 -OP_ZoneChange=0x60ef # ShowEQ 06/29/05 -OP_MemorizeSpell=0x05ac # ShowEQ 06/29/05 -OP_ItemLinkClick=0x53e5 # ShowEQ 06/29/05 -OP_SwapSpell=0x36b2 # ShowEQ 06/29/05 -OP_Forage=0x7c32 # ShowEQ 06/29/05 -OP_ConsentResponse=0x6380 # ShowEQ 06/29/05 -OP_BazaarSearch=0x524e # ShowEQ 06/29/05 -OP_NewSpawn=0x4f11 # ShowEQ 06/29/05 -OP_WearChange=0x601d # ShowEQ 06/29/05 -OP_Action=0x4513 # ShowEQ 06/29/05 -OP_SpecialMesg=0x5ef7 # ShowEQ 06/29/05 -OP_Bazaar=0x0000 -OP_LeaveBoat=0x7187 # ShowEQ 06/29/05 -OP_Weather=0x65ca # ShowEQ 06/29/05 -OP_LFPGetMatchesRequest=0x45d0 # ShowEQ 06/29/05 -OP_Illusion=0x7441 # ShowEQ 06/29/05 -OP_TargetMouse=0x2274 # ShowEQ 06/29/05 -OP_InspectAnswer=0x2dd6 # ShowEQ 06/29/05 -OP_GMKill=0x692c # ShowEQ 06/29/05 -OP_MoneyOnCorpse=0x2fca # ShowEQ 06/29/05 -OP_ClickDoor=0x700d # ShowEQ 06/29/05 -OP_LootRequest=0x2316 # ShowEQ 06/29/05 -OP_YellForHelp=0x2e20 # ShowEQ 06/29/05 -OP_ManaChange=0x0b2d # ShowEQ 06/29/05 -OP_ConsentDeny=0x4e8c # ShowEQ 06/29/05 -OP_LFPCommand=0x35a6 # ShowEQ 06/29/05 -OP_RandomReply=0x6cd5 # ShowEQ 06/29/05 -OP_DenyResponse=0x7c66 # ShowEQ 06/29/05 -OP_ConsiderCorpse=0x673c # ShowEQ 06/29/05 -OP_CorpseDrag=0x50c0 # -OP_CorpseDrop=0x7c7c # -OP_ConfirmDelete=0x28f2 # ShowEQ 06/29/05 -OP_MobHealth=0x3d2d # ShowEQ 06/29/05 -OP_SkillUpdate=0x6a93 # ShowEQ 06/29/05 -OP_RandomReq=0x21e0 # ShowEQ 06/29/05 -OP_CastSpell=0x4839 # ShowEQ 06/29/05 -OP_ClientUpdate=0x14cb # ShowEQ 06/29/05 -OP_MobUpdate=0x0000 #not used anymore, here for backwards compat -OP_Report=0x0375 # ShowEQ 06/29/05 -OP_GroundSpawn=0x736b # ShowEQ 06/29/05 -OP_TargetCommand=0x6563 #0x0dfe # ShowEQ 06/29/05 -OP_TargetHoTT=0x3ef6 -OP_LFPGetMatchesResponse=0x63fe # ShowEQ 06/29/05 -OP_Jump=0x4dbc # ShowEQ 06/29/05 -OP_ExpUpdate=0x5ecd # ShowEQ 06/29/05 -OP_AAAction=0x3af4 # ShowEQ 06/29/05 -OP_Death=0x5188 # ShowEQ 06/29/05 -OP_BecomeCorpse=0x128c -OP_GMLastName=0x0c81 # ShowEQ 06/29/05 -OP_InitialMobHealth=0x2ecc # ShowEQ 06/29/05 -OP_Mend=0x14ef # ShowEQ 06/29/05 -OP_MendHPUpdate=0x1ffa # ShowEQ 5/11/05 -OP_Feedback=0x224d # ShowEQ 06/29/05 -OP_TGB=0x5e51 # ShowEQ 06/29/05 -OP_InterruptCast=0x0db3 -OP_Damage=0x1848 # ShowEQ 06/29/05 (OP_Action2) -OP_ChannelMessage=0x1004 # ShowEQ 06/29/05 (OP_CommonMessage) -OP_LevelAppearance=0x358e -OP_MultiLineMsg=0x0000 -OP_Charm=0x10a1 -OP_DeleteSpell=0x3fe6 -OP_ApproveZone=0x0000 -OP_Assist=0x5D02 -OP_AugmentItem=0x539b -OP_BazaarInspect=0x0000 -OP_AAExpUpdate=0x6dd8 # ShowEQ 06/29/05 -OP_ClientError=0x0000 -OP_DeleteItem=0x1c4a -OP_DeleteCharge=0x0841 -OP_ControlBoat=0x0000 -OP_DumpName=0x0000 -OP_FeignDeath=0x2ad8 -OP_Fishing=0x0b36 -OP_Heartbeat=0x0000 -OP_InstillDoubt=0x389e -OP_ItemName=0x0000 -OP_LDoNButton=0x0000 -OP_LDoNOpen=0x083b -OP_MoveCoin=0x1dd9 -OP_ReloadUI=0x0000 -OP_ZonePlayerToBind=0x385e # FNW Discovered on Feb 9, 2007 -OP_Translocate=0x78c1 -OP_Sacrifice=0x5f62 -OP_ApplyPoison=0x4298 - -#bazaar trader stuff stuff: -#become and buy from -#Server->Client: [ Opcode: OP_Unknown (0x2403) Size: 8 ] -# 0: 46 01 00 00 39 01 00 00 | F...9... -OP_TraderDelItem=0x0da9 -OP_BecomeTrader=0x66f9 -OP_TraderShop=0x19d8 -OP_TraderItemUpdate=0x0000 -OP_Trader=0x0681 -OP_ShopItem=0x0000 -OP_TraderBuy=0x0f8e # ShowEQ 06/29/05 -OP_Barter=0x7460 - -#pc/npc trading -OP_TradeRequest=0x372f # ShowEQ 06/29/05 -OP_TradeAcceptClick=0x0065 # ShowEQ 06/29/05 -OP_TradeRequestAck=0x4048 # ShowEQ 06/29/05 -OP_TradeCoins=0x34c1 -OP_FinishTrade=0x6014 -OP_CancelTrade=0x2dc1 # ShowEQ 06/29/05 -OP_TradeMoneyUpdate=0x3e63 #not sure - -#merchant crap -OP_ShopPlayerSell=0x0e13 # ShowEQ 06/29/05 -OP_ShopEnd=0x7e03 # ShowEQ 06/29/05 -OP_ShopEndConfirm=0x0000 -OP_ShopPlayerBuy=0x221e -OP_ShopRequest=0x3c4b # ShowEQ 06/29/05 -OP_ShopDelItem=0x0000 #0x0da9 maybe, 16 bytes though - -#tradeskill stuff: -OP_ClickObject=0x0f47 # ShowEQ 06/29/05 -OP_ClickObjectAction=0x6937 # EQEMu 06/29/05 -OP_RecipeDetails=0x0353 # EQEMu 06/29/05 -OP_RecipesFavorite=0x23f0 -OP_RecipesSearch=0x31f8 # EQEmu 06/29/05 -OP_RecipeReply=0x4ea2 # EQEmu 06/29/05 -OP_RecipeAutoCombine=0x7822 -OP_TradeSkillCombine=0x0b40 # ShowEQ 06/29/05 - -OP_RequestDuel=0x28e1 -OP_DuelResponse=0x2e78 -OP_DuelResponse2=0x3bad #when accepted - -OP_RezzComplete=0x60fa -OP_RezzRequest=0x417a -OP_RezzAnswer=0x6219 -OP_SafeFallSuccess=0x5309 -OP_Shielding=0x0000 -OP_TargetReject=0x0000 -OP_TestBuff=0x0000 -OP_Track=0x5205 # ShowEQ 06/29/05 -OP_TrackTarget=0x71ae -OP_TrackUnknown=0x74e1 #size 0 right after OP_Track - -#Tribute Packets: -OP_OpenGuildTributeMaster=0x60b6 #open guild tribute master window -OP_OpenTributeMaster=0x512e #open tribute master window -OP_OpenTributeReply=0x0000 #reply to open request -OP_SelectTribute=0x625d #clicking on a tribute, and text reply -OP_TributeItem=0x6f6c #donating an item -OP_TributeMoney=0x27b3 #donating money -OP_TributeNPC=0x0000 #seems to be missing now -OP_TributeToggle=0x2688 #activating/deactivating tribute -OP_TributeTimer=0x4665 #a 4 byte tier update, 10 minutes for seconds -OP_TributePointUpdate=0x6463 #16 byte point packet -OP_TributeUpdate=0x5639 # ShowEQ 06/29/05 -OP_GuildTributeInfo=0x5e3d # EQEmu 06/29/05 -OP_TributeInfo=0x152d # EQEmu 06/29/05 -OP_SendGuildTributes=0x5e3a # request packet, 4 bytes -OP_SendTributes=0x067a # request packet, 4 bytes, migth be backwards -OP_CloseTributeMaster=0x7f25 #sent by client when they close window - -#Adventure packets: -OP_LeaveAdventure=0x0c0d -OP_AdventureFinish=0x3906 -OP_AdventureInfoRequest=0x2aaf #right click adventure recruiter -OP_AdventureInfo=0x1db5 #text reply to right click -OP_AdventureRequest=0x43fd -OP_AdventureDetails=0x3f26 -OP_AdventureData=0x0677 -OP_AdventureUpdate=0x64ac -OP_AdventureMerchantRequest=0x0950 -OP_AdventureMerchantResponse=0x4416 -OP_AdventureMerchantPurchase=0x413d -OP_AdventureMerchantSell=0x0097 -OP_AdventurePointsUpdate=0x420a #not sure, followed purchase -OP_AdventureStatsRequest=0x5fc7 -OP_AdventureStatsReply=0x56cd -OP_AdventureLeaderboardRequest=0x230a -OP_AdventureLeaderboardReply=0x0d0f -# request stats: 0x5fc7, reply 0x56cd -# request leaderboard: 0x230a, reply 0x0d0f - -#Group Opcodes -OP_GroupDisband=0x4033 # ShowEQ 06/29/05 -OP_GroupInvite=0x3853 # ShowEQ 06/29/05 -OP_GroupFollow=0x1b48 # ShowEQ 06/29/05 -OP_GroupUpdate=0x66ba # ShowEQ 06/29/05 -OP_GroupAcknowledge=0x0797 -OP_GroupCancelInvite=0x42c9 # ShowEQ 06/29/05 -OP_GroupDelete=0x0000 -OP_GroupFollow2=0x0000 #used with GroupInvite2 -OP_GroupInvite2=0x1f27 #this is sometimes sent instead of OP_GroupInvite -OP_CancelInvite=0x0000 - -OP_RaidJoin=0x0000 # ShowEQ 06/29/05 -OP_RaidInvite=0x1f21 # ShowEQ 06/29/05 -OP_RaidUpdate=0x1974 # EQEmu 06/29/05 - - -OP_ZoneComplete=0x0000 -OP_ItemLinkText=0x0000 -OP_ClearObject=0x8258 -OP_DisciplineUpdate=0x7180 -OP_DisciplineTimer=0x53df -OP_LocInfo=0x0000 -OP_FindPersonRequest=0x3c41 # ShowEQ 06/29/05 -OP_FindPersonReply=0x5711 -OP_ForceFindPerson=0x0000 -OP_LoginComplete=0x0000 -OP_Sound=0x4a1d -#OP_Zone_MissingName01=0x0000 #remove on recompile -OP_MobRename=0x3230 -OP_BankerChange=0x6a5b - -#Rogue packets -OP_SenseTraps=0x24ab # ShowEQ 06/29/05 -OP_PickPocket=0x4a2a -OP_DisarmTraps=0x0000 -OP_Disarm=0x17d9 -OP_Hide=0x6f64 # ShowEQ 06/29/05 -OP_Sneak=0x4312 # ShowEQ 06/29/05 - -#Task packets -#task complete related: 0x54eb (24 bytes), 0x4c8c (8 bytes), 0x6a1d (4 bytes) -OP_TaskActivityComplete=0x54eb -OP_CompletedTasks=0x53c4 # ShowEQ 06/29/05 -OP_TaskDescription=0x682d # ShowEQ 06/29/05 -OP_TaskActivity=0x3ba8 # ShowEQ 06/29/05 -OP_TaskMemberList=0x09b6 #not sure -OP_OpenNewTasksWindow=0x5e7c #combined with OP_AvaliableTask I think -OP_AvaliableTask=0x0000 -OP_AcceptNewTask=0x207f -OP_TaskHistoryRequest=0x3274 -OP_TaskHistoryReply=0x009c -OP_CancelTask=0x4c8c -OP_DeclineAllTasks=0x207f #not sure, 12 bytes - - -OP_RequestClientZoneChange=0x1235 -OP_PurchaseLeadershipAA=0x07f1 -OP_UpdateLeadershipAA=0x3eec -OP_LeadershipExpUpdate=0x7416 -OP_LeadershipExpToggle=0x17bf -OP_GroupUpdateLeaderAA=0x4c3f -OP_MarkNPC=0x5b37 -OP_ClearNPCMarks=0x1794 -OP_DoGroupLeadershipAbility=0x4ffe -OP_DelegateAbility=0x56eb - -#The following 4 Opcodes are for SoF only: -OP_FinishWindow=0x0000 #Trevius 03/15/09 -OP_FinishWindow2=0x0000 #Trevius 03/15/09 -OP_ItemVerifyRequest=0x0000 #Trevius 03/15/09 -OP_ItemVerifyReply=0x0000 #Trevius 03/15/09 - -#discovered opcodes not yet used: -OP_CrashDump=0x6d5d -OP_PlayMP3=0x0000 -OP_FriendsWho=0x41db -OP_MoveLogRequest=0x78e8 #gone I think -OP_MoveLogDisregard=0x0000 #gone I think -OP_ReclaimCrystals=0x12fd -OP_CrystalCountUpdate=0x0000 -OP_DynamicWall=0x0000 -OP_CustomTitles=0x2a28 # ShowEQ 06/29/05 -OP_RequestTitles=0x5eba # EQEmu 06/29/05 -OP_SendTitleList=0x3e89 # EQEmu 06/29/05 -OP_SetTitle=0x1f22 # EQEmu 06/29/05 -OP_SetTitleReply=0x5eab # EQEmu 06/29/05 -OP_Bandolier=0x6f0c -OP_PotionBelt=0x0719 -OP_OpenDiscordMerchant=0x0000 #8 bytes -OP_DiscordMerchantInventory=0x0000 #long item packet -OP_GiveMoney=0x56d4 #16 bytes, pp, gp, sp, cp. -OP_OnLevelMessage=0x1dde -OP_PopupResponse=0x3816 -OP_RequestKnowledgeBase=0x7584 -OP_KnowledgeBase=0x4a52 -OP_PlayerUnderWorld=0x46d9 -OP_PVPStats=0x5cc0 -OP_PVPLeaderBoardRequest=0x61d2 -OP_PVPLeaderBoardReply=0x1a59 -OP_PVPLeaderBoardDetailsRequest=0x06a2 -OP_PVPLeaderBoardDetailsReply=0x246a -OP_WeaponEquip1=0x6c5e -OP_WeaponEquip2=0x63da -OP_WeaponUnequip2=0x381d -OP_VoiceMacroIn=0x2866 -OP_VoiceMacroOut=0x2ec6 - -#named unknowns, to make looking for real unknown easier -OP_AnnoyingZoneUnknown=0x0000 # EQEmu 06/29/05 -OP_Some6ByteHPUpdate=0x0000 #seems to happen when you target group members -OP_SomeItemPacketMaybe=0x497c # EQEmu 06/29/05 -OP_QueryResponseThing=0x6379 -OP_FloatListThing=0x7510 # EQEmu 06/29/05 - -#Login opcodes -OP_SessionReady=0x0001 -OP_Login=0x0002 -OP_ServerListRequest=0x0004 -OP_PlayEverquestRequest=0x000d -OP_PlayEverquestResponse=0x0021 -OP_ChatMessage=0x0016 -OP_LoginAccepted=0x0017 -OP_ServerListResponse=0x0018 -OP_Poll=0x0029 -OP_EnterChat=0x000f -OP_PollResponse=0x0011 - -#raw opcodes -OP_RAWSessionRequest=0x0000 -OP_RAWSessionResponse=0x0000 -OP_RAWCombined=0x0000 -OP_RAWSessionDisconnect=0x0000 -OP_RAWKeepAlive=0x0000 -OP_RAWSessionStatRequest=0x0000 -OP_RAWSessionStatResponse=0x0000 -OP_RAWPacket=0x0000 -OP_RAWFragment=0x0000 -OP_RAWOutOfOrderAck=0x0000 -OP_RAWAck=0x0000 -OP_RAWAppCombined=0x0000 -OP_RAWOutOfSession=0x0000 - -#mail opcodes -OP_Command=0x0000 -OP_MailboxHeader=0x0000 -OP_MailHeader=0x0000 -OP_MailBody=0x0000 -OP_NewMail=0x0000 -OP_SentConfirm=0x0000 - - -#we need to document the differences between these packets to make identifying them easier -OP_MobHealth=0x3d2d # ShowEQ 06/29/05 -OP_HPUpdate=0x217b # ShowEQ 06/29/05 -OP_Some3ByteHPUpdate=0x0000 #initial HP update for mobs -OP_InitialHPUpdate=0x7ac2 # ShowEQ 06/29/05 - -#remove these -#junk -OP_0x0193=0x0000 -OP_0x0347=0x0000 -OP_ConsumeAmmo=0x0000 -OP_EmoteAnim=0x0000 -OP_Deny=0x0000 -OP_SetDataRate=0x0000 - diff --git a/world/clientlist.cpp b/world/clientlist.cpp index a18a9cafc..d0b90a266 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -1296,7 +1296,6 @@ void ClientList::GetClients(const char *zone_name, std::vector(EQClientUnknown)), - luabind::value("62", static_cast(EQClient62)), luabind::value("Titanium", static_cast(EQClientTitanium)), luabind::value("SoF", static_cast(EQClientSoF)), luabind::value("SoD", static_cast(EQClientSoD)), diff --git a/zone/tasks.cpp b/zone/tasks.cpp index f8f3ba9b2..1e73e3150 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -2773,13 +2773,6 @@ void TaskManager::SendActiveTaskDescription(Client *c, int TaskID, int SequenceN if(strlen(Tasks[TaskID]->Reward) != 0) { switch(c->GetClientVersion()) { - - case EQClient62: - { - MakeAnyLenString(&RewardTmp, "%c%07i-00001-00001-00001-00001-000013E0ABA6B%s%c", - 0x12, ItemID, Tasks[TaskID]->Reward,0x12); - break; - } case EQClientTitanium: { MakeAnyLenString(&RewardTmp, "%c%06X000000000000000000000000000000014505DC2%s%c", @@ -2807,13 +2800,6 @@ void TaskManager::SendActiveTaskDescription(Client *c, int TaskID, int SequenceN if(Item) { switch(c->GetClientVersion()) { - - case EQClient62: - { - MakeAnyLenString(&RewardTmp, "%c%07i-00001-00001-00001-00001-000013E0ABA6B%s%c", - 0x12, ItemID, Item->Name,0x12); - break; - } case EQClientTitanium: { MakeAnyLenString(&RewardTmp, "%c%06X000000000000000000000000000000014505DC2%s%c", From 7d39ea59e8fecb5fbb7e89fdebba0db7f0b4c93b Mon Sep 17 00:00:00 2001 From: Leere Date: Wed, 17 Dec 2014 00:24:47 +0100 Subject: [PATCH 128/153] Fix for stackable items being unmoveable when charges=0 --- common/shareddb.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index cd8fd49e0..7dff17b43 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -565,7 +565,9 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { if(charges==0x7FFF) inst->SetCharges(-1); - else + else if (charges == 0 && inst->IsStackable()) // Stackable items need a minimum charge of 1 remain moveable. + inst->SetCharges(1); + else inst->SetCharges(charges); if (item->ItemClass == ItemClassCommon) @@ -1234,6 +1236,9 @@ ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges) // set it to 1 charge so that it is usable on creation if (charges == 0 && item->MaxCharges == -1) charges = 1; + // Stackable items need a minimum charge of 1 to remain moveable. + if(charges <= 0 && item->Stackable) + charges = 1; inst = new ItemInst(item, charges); From fc306bbc1d64ee796fdc2038f9fc02aa03159b14 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Tue, 16 Dec 2014 18:53:15 -0500 Subject: [PATCH 129/153] Fix for special attack NPC_CHASE_DISTANCE to now work correctly Perl export: NPC GetAttackDelay Perl export: NPC GetAvoidanceRating Perl export: NPC AddMeleeProc Special Attacks will no longer be able to hit immune to melee / bane only flagged NPCs. --- zone/mob.cpp | 166 ++++++++++++++++++++------------------- zone/npc.cpp | 1 + zone/npc.h | 1 + zone/perl_npc.cpp | 80 +++++++++++++++++++ zone/special_attacks.cpp | 3 + 5 files changed, 169 insertions(+), 82 deletions(-) diff --git a/zone/mob.cpp b/zone/mob.cpp index e497ed05e..03f845184 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -542,6 +542,8 @@ float Mob::_GetMovementSpeed(int mod) const // http://everquest.allakhazam.com/db/item.html?item=1721;page=1;howmany=50#m10822246245352 if (IsRooted()) return 0.0f; + else if (IsPseudoRooted()) + return 0.000001f; float speed_mod = runspeed; @@ -5307,98 +5309,98 @@ int32 Mob::GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot) } if (slot < 16){ - if (id == "classes") {stat = spells[spell_id].classes[slot]; } - else if (id == "dieties") {stat = spells[spell_id].deities[slot];} + if (id == "classes") {return spells[spell_id].classes[slot]; } + else if (id == "dieties") {return spells[spell_id].deities[slot];} } if (slot < 12){ - if (id == "base") {stat = spells[spell_id].base[slot];} - else if (id == "base2") {stat = spells[spell_id].base2[slot];} - else if (id == "max") {stat = spells[spell_id].max[slot];} - else if (id == "formula") {spells[spell_id].formula[slot];} - else if (id == "effectid") {spells[spell_id].effectid[slot];} + if (id == "base") {return spells[spell_id].base[slot];} + else if (id == "base2") {return spells[spell_id].base2[slot];} + else if (id == "max") {return spells[spell_id].max[slot];} + else if (id == "formula") {return spells[spell_id].formula[slot];} + else if (id == "effectid") {return spells[spell_id].effectid[slot];} } if (slot < 4){ - if (id == "components") { spells[spell_id].components[slot];} - else if (id == "component_counts") {spells[spell_id].component_counts[slot];} - else if (id == "NoexpendReagent") {spells[spell_id].NoexpendReagent[slot];} + if (id == "components") { return spells[spell_id].components[slot];} + else if (id == "component_counts") { return spells[spell_id].component_counts[slot];} + else if (id == "NoexpendReagent") {return spells[spell_id].NoexpendReagent[slot];} } - if (id == "range") {stat = static_cast(spells[spell_id].range); } - else if (id == "aoerange") {stat = static_cast(spells[spell_id].aoerange);} - else if (id == "pushback") {stat = static_cast(spells[spell_id].pushback);} - else if (id == "pushup") {stat = static_cast(spells[spell_id].pushup);} - else if (id == "cast_time") {stat = spells[spell_id].cast_time;} - else if (id == "recovery_time") {stat = spells[spell_id].recovery_time;} - else if (id == "recast_time") {stat = spells[spell_id].recast_time;} - else if (id == "buffdurationformula") {stat = spells[spell_id].buffdurationformula;} - else if (id == "buffduration") {stat = spells[spell_id].buffduration;} - else if (id == "AEDuration") {stat = spells[spell_id].AEDuration;} - else if (id == "mana") {stat = spells[spell_id].mana;} + if (id == "range") {return static_cast(spells[spell_id].range); } + else if (id == "aoerange") {return static_cast(spells[spell_id].aoerange);} + else if (id == "pushback") {return static_cast(spells[spell_id].pushback);} + else if (id == "pushup") {return static_cast(spells[spell_id].pushup);} + else if (id == "cast_time") {return spells[spell_id].cast_time;} + else if (id == "recovery_time") {return spells[spell_id].recovery_time;} + else if (id == "recast_time") {return spells[spell_id].recast_time;} + else if (id == "buffdurationformula") {return spells[spell_id].buffdurationformula;} + else if (id == "buffduration") {return spells[spell_id].buffduration;} + else if (id == "AEDuration") {return spells[spell_id].AEDuration;} + else if (id == "mana") {return spells[spell_id].mana;} //else if (id == "LightType") {stat = spells[spell_id].LightType;} - Not implemented - else if (id == "goodEffect") {stat = spells[spell_id].goodEffect;} - else if (id == "Activated") {stat = spells[spell_id].Activated;} - else if (id == "resisttype") {stat = spells[spell_id].resisttype;} - else if (id == "targettype") {stat = spells[spell_id].targettype;} - else if (id == "basedeiff") {stat = spells[spell_id].basediff;} - else if (id == "skill") {stat = spells[spell_id].skill;} - else if (id == "zonetype") {stat = spells[spell_id].zonetype;} - else if (id == "EnvironmentType") {stat = spells[spell_id].EnvironmentType;} - else if (id == "TimeOfDay") {stat = spells[spell_id].TimeOfDay;} - else if (id == "CastingAnim") {stat = spells[spell_id].CastingAnim;} - else if (id == "SpellAffectIndex") {stat = spells[spell_id].SpellAffectIndex; } - else if (id == "disallow_sit") {stat = spells[spell_id].disallow_sit; } + else if (id == "goodEffect") {return spells[spell_id].goodEffect;} + else if (id == "Activated") {return spells[spell_id].Activated;} + else if (id == "resisttype") {return spells[spell_id].resisttype;} + else if (id == "targettype") {return spells[spell_id].targettype;} + else if (id == "basedeiff") {return spells[spell_id].basediff;} + else if (id == "skill") {return spells[spell_id].skill;} + else if (id == "zonetype") {return spells[spell_id].zonetype;} + else if (id == "EnvironmentType") {return spells[spell_id].EnvironmentType;} + else if (id == "TimeOfDay") {return spells[spell_id].TimeOfDay;} + else if (id == "CastingAnim") {return spells[spell_id].CastingAnim;} + else if (id == "SpellAffectIndex") {return spells[spell_id].SpellAffectIndex; } + else if (id == "disallow_sit") {return spells[spell_id].disallow_sit; } //else if (id == "spellanim") {stat = spells[spell_id].spellanim; } - Not implemented - else if (id == "uninterruptable") {stat = spells[spell_id].uninterruptable; } - else if (id == "ResistDiff") {stat = spells[spell_id].ResistDiff; } - else if (id == "dot_stacking_exemp") {stat = spells[spell_id].dot_stacking_exempt; } - else if (id == "RecourseLink") {stat = spells[spell_id].RecourseLink; } - else if (id == "no_partial_resist") {stat = spells[spell_id].no_partial_resist; } - else if (id == "short_buff_box") {stat = spells[spell_id].short_buff_box; } - else if (id == "descnum") {stat = spells[spell_id].descnum; } - else if (id == "effectdescnum") {stat = spells[spell_id].effectdescnum; } - else if (id == "npc_no_los") {stat = spells[spell_id].npc_no_los; } - else if (id == "reflectable") {stat = spells[spell_id].reflectable; } - else if (id == "bonushate") {stat = spells[spell_id].bonushate; } - else if (id == "EndurCost") {stat = spells[spell_id].EndurCost; } - else if (id == "EndurTimerIndex") {stat = spells[spell_id].EndurTimerIndex; } - else if (id == "IsDisciplineBuf") {stat = spells[spell_id].IsDisciplineBuff; } - else if (id == "HateAdded") {stat = spells[spell_id].HateAdded; } - else if (id == "EndurUpkeep") {stat = spells[spell_id].EndurUpkeep; } - else if (id == "numhitstype") {stat = spells[spell_id].numhitstype; } - else if (id == "numhits") {stat = spells[spell_id].numhits; } - else if (id == "pvpresistbase") {stat = spells[spell_id].pvpresistbase; } - else if (id == "pvpresistcalc") {stat = spells[spell_id].pvpresistcalc; } - else if (id == "pvpresistcap") {stat = spells[spell_id].pvpresistcap; } - else if (id == "spell_category") {stat = spells[spell_id].spell_category; } - else if (id == "can_mgb") {stat = spells[spell_id].can_mgb; } - else if (id == "dispel_flag") {stat = spells[spell_id].dispel_flag; } - else if (id == "MinResist") {stat = spells[spell_id].MinResist; } - else if (id == "MaxResist") {stat = spells[spell_id].MaxResist; } - else if (id == "viral_targets") {stat = spells[spell_id].viral_targets; } - else if (id == "viral_timer") {stat = spells[spell_id].viral_timer; } - else if (id == "NimbusEffect") {stat = spells[spell_id].NimbusEffect; } - else if (id == "directional_start") {stat = static_cast(spells[spell_id].directional_start); } - else if (id == "directional_end") {stat = static_cast(spells[spell_id].directional_end); } - else if (id == "not_extendable") {stat = spells[spell_id].not_extendable; } - else if (id == "suspendable") {stat = spells[spell_id].suspendable; } - else if (id == "viral_range") {stat = spells[spell_id].viral_range; } - else if (id == "spellgroup") {stat = spells[spell_id].spellgroup; } - else if (id == "rank") {stat = spells[spell_id].rank; } - else if (id == "powerful_flag") {stat = spells[spell_id].powerful_flag; } - else if (id == "CastRestriction") {stat = spells[spell_id].CastRestriction; } - else if (id == "AllowRest") {stat = spells[spell_id].AllowRest; } - else if (id == "InCombat") {stat = spells[spell_id].InCombat; } - else if (id == "OutofCombat") {stat = spells[spell_id].OutofCombat; } - else if (id == "aemaxtargets") {stat = spells[spell_id].aemaxtargets; } - else if (id == "maxtargets") {stat = spells[spell_id].maxtargets; } - else if (id == "persistdeath") {stat = spells[spell_id].persistdeath; } - else if (id == "min_dist") {stat = static_cast(spells[spell_id].min_dist); } - else if (id == "min_dist_mod") {stat = static_cast(spells[spell_id].min_dist_mod); } - else if (id == "max_dist") {stat = static_cast(spells[spell_id].max_dist); } - else if (id == "min_range") {stat = static_cast(spells[spell_id].min_range); } - else if (id == "DamageShieldType") {stat = spells[spell_id].DamageShieldType; } + else if (id == "uninterruptable") {return spells[spell_id].uninterruptable; } + else if (id == "ResistDiff") {return spells[spell_id].ResistDiff; } + else if (id == "dot_stacking_exemp") {return spells[spell_id].dot_stacking_exempt; } + else if (id == "RecourseLink") {return spells[spell_id].RecourseLink; } + else if (id == "no_partial_resist") {return spells[spell_id].no_partial_resist; } + else if (id == "short_buff_box") {return spells[spell_id].short_buff_box; } + else if (id == "descnum") {return spells[spell_id].descnum; } + else if (id == "effectdescnum") {return spells[spell_id].effectdescnum; } + else if (id == "npc_no_los") {return spells[spell_id].npc_no_los; } + else if (id == "reflectable") {return spells[spell_id].reflectable; } + else if (id == "bonushate") {return spells[spell_id].bonushate; } + else if (id == "EndurCost") {return spells[spell_id].EndurCost; } + else if (id == "EndurTimerIndex") {return spells[spell_id].EndurTimerIndex; } + else if (id == "IsDisciplineBuf") {return spells[spell_id].IsDisciplineBuff; } + else if (id == "HateAdded") {return spells[spell_id].HateAdded; } + else if (id == "EndurUpkeep") {return spells[spell_id].EndurUpkeep; } + else if (id == "numhitstype") {return spells[spell_id].numhitstype; } + else if (id == "numhits") {return spells[spell_id].numhits; } + else if (id == "pvpresistbase") {return spells[spell_id].pvpresistbase; } + else if (id == "pvpresistcalc") {return spells[spell_id].pvpresistcalc; } + else if (id == "pvpresistcap") {return spells[spell_id].pvpresistcap; } + else if (id == "spell_category") {return spells[spell_id].spell_category; } + else if (id == "can_mgb") {return spells[spell_id].can_mgb; } + else if (id == "dispel_flag") {return spells[spell_id].dispel_flag; } + else if (id == "MinResist") {return spells[spell_id].MinResist; } + else if (id == "MaxResist") {return spells[spell_id].MaxResist; } + else if (id == "viral_targets") {return spells[spell_id].viral_targets; } + else if (id == "viral_timer") {return spells[spell_id].viral_timer; } + else if (id == "NimbusEffect") {return spells[spell_id].NimbusEffect; } + else if (id == "directional_start") {return static_cast(spells[spell_id].directional_start); } + else if (id == "directional_end") {return static_cast(spells[spell_id].directional_end); } + else if (id == "not_extendable") {return spells[spell_id].not_extendable; } + else if (id == "suspendable") {return spells[spell_id].suspendable; } + else if (id == "viral_range") {return spells[spell_id].viral_range; } + else if (id == "spellgroup") {return spells[spell_id].spellgroup; } + else if (id == "rank") {return spells[spell_id].rank; } + else if (id == "powerful_flag") {return spells[spell_id].powerful_flag; } + else if (id == "CastRestriction") {return spells[spell_id].CastRestriction; } + else if (id == "AllowRest") {return spells[spell_id].AllowRest; } + else if (id == "InCombat") {return spells[spell_id].InCombat; } + else if (id == "OutofCombat") {return spells[spell_id].OutofCombat; } + else if (id == "aemaxtargets") {return spells[spell_id].aemaxtargets; } + else if (id == "maxtargets") {return spells[spell_id].maxtargets; } + else if (id == "persistdeath") {return spells[spell_id].persistdeath; } + else if (id == "min_dist") {return static_cast(spells[spell_id].min_dist); } + else if (id == "min_dist_mod") {return static_cast(spells[spell_id].min_dist_mod); } + else if (id == "max_dist") {return static_cast(spells[spell_id].max_dist); } + else if (id == "min_range") {return static_cast(spells[spell_id].min_range); } + else if (id == "DamageShieldType") {return spells[spell_id].DamageShieldType; } return stat; } diff --git a/zone/npc.cpp b/zone/npc.cpp index 6fdab645c..d9833d856 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1942,6 +1942,7 @@ void NPC::ModifyNPCStat(const char *identifier, const char *newValue) else if(id == "special_attacks") { NPCSpecialAttacks(val.c_str(), 0, 1); return; } else if(id == "special_abilities") { ProcessSpecialAbilities(val.c_str()); return; } else if(id == "attack_speed") { attack_speed = (float)atof(val.c_str()); CalcBonuses(); return; } + else if(id == "attack_delay") { attack_delay = atoi(val.c_str()); CalcBonuses(); return; } else if(id == "atk") { ATK = atoi(val.c_str()); return; } else if(id == "accuracy") { accuracy_rating = atoi(val.c_str()); return; } else if(id == "avoidance") { avoidance_rating = atoi(val.c_str()); return; } diff --git a/zone/npc.h b/zone/npc.h index 081fca514..1e378d2ad 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -259,6 +259,7 @@ public: uint32 GetMinDMG() const {return min_dmg;} int16 GetSlowMitigation() const {return slow_mitigation;} float GetAttackSpeed() const {return attack_speed;} + uint8 GetAttackDelay() const {return attack_delay;} bool IsAnimal() const { return(bodytype == BT_Animal); } uint16 GetPetSpellID() const {return pet_spell_id;} void SetPetSpellID(uint16 amt) {pet_spell_id = amt;} diff --git a/zone/perl_npc.cpp b/zone/perl_npc.cpp index c1f8d8828..736db9565 100644 --- a/zone/perl_npc.cpp +++ b/zone/perl_npc.cpp @@ -2119,6 +2119,32 @@ XS(XS_NPC_GetAttackSpeed) XSRETURN(1); } +XS(XS_NPC_GetAttackDelay); /* prototype to pass -Wmissing-prototypes */ +XS(XS_NPC_GetAttackDelay) +{ + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: NPC::GetAttackDelay(THIS)"); + { + NPC * THIS; + float RETVAL; + dXSTARG; + + if (sv_derived_from(ST(0), "NPC")) { + IV tmp = SvIV((SV*)SvRV(ST(0))); + THIS = INT2PTR(NPC *,tmp); + } + else + Perl_croak(aTHX_ "THIS is not of type NPC"); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + + RETVAL = THIS->GetAttackDelay(); + XSprePUSH; PUSHn((double)RETVAL); + } + XSRETURN(1); +} + XS(XS_NPC_GetAccuracyRating); /* prototype to pass -Wmissing-prototypes */ XS(XS_NPC_GetAccuracyRating) { @@ -2145,6 +2171,32 @@ XS(XS_NPC_GetAccuracyRating) XSRETURN(1); } +XS(XS_NPC_GetAvoidanceRating); /* prototype to pass -Wmissing-prototypes */ +XS(XS_NPC_GetAvoidanceRating) +{ + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: NPC::GetAvoidanceyRating(THIS)"); + { + NPC * THIS; + int32 RETVAL; + dXSTARG; + + if (sv_derived_from(ST(0), "NPC")) { + IV tmp = SvIV((SV*)SvRV(ST(0))); + THIS = INT2PTR(NPC *,tmp); + } + else + Perl_croak(aTHX_ "THIS is not of type NPC"); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + + RETVAL = THIS->GetAvoidanceRating(); + XSprePUSH; PUSHu((UV)RETVAL); + } + XSRETURN(1); +} + XS(XS_NPC_GetSpawnKillCount); /* prototype to pass -Wmissing-prototypes */ XS(XS_NPC_GetSpawnKillCount) { @@ -2245,6 +2297,31 @@ XS(XS_NPC_GetMerchantProbability) { XSRETURN(1); } +XS(XS_NPC_AddMeleeProc); +XS(XS_NPC_AddMeleeProc) { + dXSARGS; + if (items != 3) + Perl_croak(aTHX_ "Usage: NPC::AddMeleePro(THIS,spellid,chance)"); + { + NPC * THIS; + int spell_id = (int)SvIV(ST(1)); + int chance = (int)SvIV(ST(2)); + dXSTARG; + + if (sv_derived_from(ST(0), "NPC")) { + IV tmp = SvIV((SV*)SvRV(ST(0))); + THIS = INT2PTR(NPC *,tmp); + } + else + Perl_croak(aTHX_ "THIS is not of type NPC"); + if(THIS == NULL) + Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + + THIS->AddProcToWeapon(spell_id, true, chance); + } + XSRETURN_EMPTY; +} + #ifdef __cplusplus extern "C" #endif @@ -2342,11 +2419,14 @@ XS(boot_NPC) newXSproto(strcpy(buf, "GetSpellFocusHeal"), XS_NPC_GetSpellFocusHeal, file, "$"); newXSproto(strcpy(buf, "GetSlowMitigation"), XS_NPC_GetSlowMitigation, file, "$"); newXSproto(strcpy(buf, "GetAttackSpeed"), XS_NPC_GetAttackSpeed, file, "$"); + newXSproto(strcpy(buf, "GetAttackDelay"), XS_NPC_GetAttackDelay, file, "$"); newXSproto(strcpy(buf, "GetAccuracyRating"), XS_NPC_GetAccuracyRating, file, "$"); + newXSproto(strcpy(buf, "GetAvoidanceRating"), XS_NPC_GetAvoidanceRating, file, "$"); newXSproto(strcpy(buf, "GetSpawnKillCount"), XS_NPC_GetSpawnKillCount, file, "$"); newXSproto(strcpy(buf, "GetScore"), XS_NPC_GetScore, file, "$"); newXSproto(strcpy(buf, "SetMerchantProbability"), XS_NPC_SetMerchantProbability, file, "$$"); newXSproto(strcpy(buf, "GetMerchantProbability"), XS_NPC_GetMerchantProbability, file, "$"); + newXSproto(strcpy(buf, "AddMeleeProc"), XS_NPC_AddMeleeProc, file, "$$$"); XSRETURN_YES; } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 282eeb11e..0f57a7147 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -103,6 +103,9 @@ void Mob::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, if (!who) return; + if(who->GetInvul() || who->GetSpecialAbility(IMMUNE_MELEE) || who->GetSpecialAbility(IMMUNE_MELEE_EXCEPT_BANE)) + return; //-5? + int32 hate = max_damage; if(hate_override > -1) hate = hate_override; From ab5d0ad43f7b68ddbec02ab4a92869cc2a11967c Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Tue, 16 Dec 2014 20:20:22 -0500 Subject: [PATCH 130/153] Fix for NPC ranged procs --- zone/mob_ai.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index dbd6d4e2d..e289f41d2 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -2731,7 +2731,7 @@ DBnpcspells_Struct* ZoneDatabase::GetNPCSpells(uint32 iDBSpellsID) { npc_spells_cache[iDBSpellsID]->attack_proc = tmpattack_proc; npc_spells_cache[iDBSpellsID]->proc_chance = tmpproc_chance; npc_spells_cache[iDBSpellsID]->range_proc = tmprange_proc; - npc_spells_cache[iDBSpellsID]->rproc_chance = tmpdproc_chance; + npc_spells_cache[iDBSpellsID]->rproc_chance = tmprproc_chance; npc_spells_cache[iDBSpellsID]->defensive_proc = tmpdefensive_proc; npc_spells_cache[iDBSpellsID]->dproc_chance = tmpdproc_chance; npc_spells_cache[iDBSpellsID]->fail_recast = tmppfail_recast; From a14f8058dae53d2f1dc4f0b83dbe146a38f3666b Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 17 Dec 2014 01:52:00 -0500 Subject: [PATCH 131/153] Switch path stuff to vectors This should be more CPU cache friendly compared to lists so should be faster. (profiling looked promising) --- changelog.txt | 3 +++ zone/client_packet.cpp | 4 +-- zone/entity.cpp | 2 +- zone/fearpath.cpp | 2 +- zone/mob.h | 2 +- zone/pathing.cpp | 58 ++++++++++++++++++++---------------------- zone/pathing.h | 6 ++--- 7 files changed, 39 insertions(+), 38 deletions(-) diff --git a/changelog.txt b/changelog.txt index 1a0be1590..d1184037d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/17/2014 == +demonstar55: Use vectors for route stuff, should be more CPU cache friendly so faster + == 12/15/2014 == Trevius: (RoF+) Implemented the 6th Augment Slot for Items. Trevius: Player Corpses now saved attuned settings for Items. diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index be7d559e5..82147ca43 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -5714,7 +5714,7 @@ void Client::Handle_OP_FindPersonRequest(const EQApplicationPacket *app) } else { - std::list pathlist = zone->pathing->FindRoute(Start, End); + std::vector pathlist = zone->pathing->FindRoute(Start, End); if (pathlist.size() == 0) { @@ -5753,7 +5753,7 @@ void Client::Handle_OP_FindPersonRequest(const EQApplicationPacket *app) p.z = GetZ(); points.push_back(p); - for (std::list::iterator Iterator = pathlist.begin(); Iterator != pathlist.end(); ++Iterator) + for (auto Iterator = pathlist.begin(); Iterator != pathlist.end(); ++Iterator) { if ((*Iterator) == -1) // Teleporter { diff --git a/zone/entity.cpp b/zone/entity.cpp index 369e1503a..c7a980f3d 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2636,7 +2636,7 @@ void EntityList::FindPathsToAllNPCs() while (it != npc_list.end()) { Map::Vertex Node0 = zone->pathing->GetPathNodeCoordinates(0, false); Map::Vertex Dest(it->second->GetX(), it->second->GetY(), it->second->GetZ()); - std::list Route = zone->pathing->FindRoute(Node0, Dest); + std::vector Route = zone->pathing->FindRoute(Node0, Dest); if (Route.size() == 0) printf("Unable to find a route to %s\n", it->second->GetName()); else diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index 89b34c444..2e8e146aa 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -158,7 +158,7 @@ void Mob::CalculateNewFearpoint() Map::Vertex CurrentPosition(GetX(), GetY(), GetZ()); - std::list Route = zone->pathing->FindRoute(CurrentPosition, Loc); + std::vector Route = zone->pathing->FindRoute(CurrentPosition, Loc); if(Route.size() > 0) { diff --git a/zone/mob.h b/zone/mob.h index e0a969fc4..cb7b82948 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -1225,7 +1225,7 @@ protected: Map::Vertex PathingLastPosition; int PathingLoopCount; int PathingLastNodeVisited; - std::list Route; + std::vector Route; LOSType PathingLOSState; Timer *PathingLOSCheckTimer; Timer *PathingRouteUpdateTimerShort; diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 5501ad2ca..309d6c0ed 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -205,15 +205,15 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) } -std::list PathManager::FindRoute(int startID, int endID) +std::vector PathManager::FindRoute(int startID, int endID) { _log(PATHING__DEBUG, "FindRoute from node %i to %i", startID, endID); memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); - std::list OpenList, ClosedList; + std::vector OpenList, ClosedList; - std::listRoute; + std::vectorRoute; AStarNode AStarEntry, CurrentNode; @@ -235,7 +235,7 @@ std::list PathManager::FindRoute(int startID, int endID) ClosedListFlag[CurrentNode.PathNodeID] = true; - OpenList.pop_front(); + OpenList.erase(OpenList.begin()); for(int i = 0; i < PATHNODENEIGHBOURS; ++i) { @@ -251,7 +251,7 @@ std::list PathManager::FindRoute(int startID, int endID) Route.push_back(endID); - std::list::iterator RouteIterator; + std::vector::iterator RouteIterator; while(CurrentNode.PathNodeID != startID) { @@ -300,7 +300,7 @@ std::list PathManager::FindRoute(int startID, int endID) bool AlreadyInOpenList = false; - std::list::iterator OpenListIterator, InsertionPoint = OpenList.end(); + std::vector::iterator OpenListIterator, InsertionPoint = OpenList.end(); for(OpenListIterator = OpenList.begin(); OpenListIterator != OpenList.end(); ++OpenListIterator) { @@ -350,11 +350,11 @@ bool SortPathNodesByDistance(PathNodeSortStruct n1, PathNodeSortStruct n2) return n1.Distance < n2.Distance; } -std::list PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) +std::vector PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { _log(PATHING__DEBUG, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); - std::list noderoute; + std::vector noderoute; float CandidateNodeRangeXY = RuleR(Pathing, CandidateNodeRangeXY); @@ -365,7 +365,7 @@ std::list PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) // int ClosestPathNodeToStart = -1; - std::list SortedByDistance; + std::vector SortedByDistance; PathNodeSortStruct TempNode; @@ -382,9 +382,9 @@ std::list PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } } - SortedByDistance.sort(SortPathNodesByDistance); + std::sort(SortedByDistance.begin(), SortedByDistance.end(), SortPathNodesByDistance); - for(std::list::iterator Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) + for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { _log(PATHING__DEBUG, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); @@ -420,9 +420,9 @@ std::list PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } } - SortedByDistance.sort(SortPathNodesByDistance); + std::sort(SortedByDistance.begin(), SortedByDistance.end(), SortPathNodesByDistance); - for(std::list::iterator Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) + for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { _log(PATHING__DEBUG, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); _log(PATHING__DEBUG, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", @@ -456,7 +456,7 @@ std::list PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { int CulledNodes = 0; - std::list::iterator First, Second; + std::vector::iterator First, Second; while((noderoute.size() >= 2) && (CulledNodes < NodesToAttemptToCull)) { @@ -487,7 +487,7 @@ std::list PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { int CulledNodes = 0; - std::list::iterator First, Second; + std::vector::iterator First, Second; while((noderoute.size() >= 2) && (CulledNodes < NodesToAttemptToCull)) { @@ -611,7 +611,7 @@ void PathManager::MeshTest() if(j == i) continue; - std::list Route = FindRoute(PathNodes[i].id, PathNodes[j].id); + std::vector Route = FindRoute(PathNodes[i].id, PathNodes[j].id); if(Route.size() == 0) { @@ -638,7 +638,7 @@ void PathManager::SimpleMeshTest() for(uint32 j = 1; j < Head.PathNodeCount; ++j) { - std::list Route = FindRoute(PathNodes[0].id, PathNodes[j].id); + std::vector Route = FindRoute(PathNodes[0].id, PathNodes[j].id); if(Route.size() == 0) { @@ -695,7 +695,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); - Route.pop_front(); + Route.erase(Route.begin()); ++PathingTraversedNodes; @@ -784,7 +784,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } // We are on the same route, no LOS (or not checking this time, so pop off the node we just reached // - Route.pop_front(); + Route.erase(Route.begin()); ++PathingTraversedNodes; @@ -798,7 +798,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(NextNode == -1) { // -1 indicates a teleport to the next node - Route.pop_front(); + Route.erase(Route.begin()); if(Route.size() == 0) { @@ -814,7 +814,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & mlog(PATHING__DEBUG, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); - Route.pop_front(); + Route.erase(Route.begin()); if(Route.size() == 0) return To; @@ -962,7 +962,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLastNodeVisited = Route.front(); - Route.pop_front(); + Route.erase(Route.begin()); ++PathingTraversedNodes; @@ -975,7 +975,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(NextNode == -1) { // -1 indicates a teleport to the next node - Route.pop_front(); + Route.erase(Route.begin()); if(Route.size() == 0) { @@ -991,7 +991,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & mlog(PATHING__DEBUG, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); - Route.pop_front(); + Route.erase(Route.begin()); if(Route.size() == 0) return To; @@ -1103,7 +1103,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) int ClosestPathNodeToStart = -1; - std::list SortedByDistance; + std::vector SortedByDistance; PathNodeSortStruct TempNode; @@ -1120,9 +1120,9 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) } } - SortedByDistance.sort(SortPathNodesByDistance); + std::sort(SortedByDistance.begin(), SortedByDistance.end(), SortPathNodesByDistance); - for(std::list::iterator Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) + for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { _log(PATHING__DEBUG, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); @@ -1262,9 +1262,7 @@ void Mob::PrintRoute() printf("Route is : "); - std::list::iterator Iterator; - - for(Iterator = Route.begin(); Iterator !=Route.end(); ++Iterator) + for(auto Iterator = Route.begin(); Iterator !=Route.end(); ++Iterator) { printf("%i, ", (*Iterator)); } diff --git a/zone/pathing.h b/zone/pathing.h index c01cb6853..8c131dbc3 100644 --- a/zone/pathing.h +++ b/zone/pathing.h @@ -3,7 +3,7 @@ #include "map.h" -#include +#include class Client; class Mob; @@ -60,8 +60,8 @@ public: static PathManager *LoadPathFile(const char *ZoneName); bool loadPaths(FILE *fp); void PrintPathing(); - std::list FindRoute(Map::Vertex Start, Map::Vertex End); - std::list FindRoute(int startID, int endID); + std::vector FindRoute(Map::Vertex Start, Map::Vertex End); + std::vector FindRoute(int startID, int endID); Map::Vertex GetPathNodeCoordinates(int NodeNumber, bool BestZ = true); bool CheckLosFN(Map::Vertex a, Map::Vertex b); From ad61eda7e0d4dee0680456aba35c2090df94fb30 Mon Sep 17 00:00:00 2001 From: Trevius Date: Wed, 17 Dec 2014 01:27:30 -0600 Subject: [PATCH 132/153] RoF2 fix for being unable to close bags by right clicking or open multiple bags. --- common/eq_packet_structs.h | 10 +- common/patches/rof.cpp | 3 +- common/patches/rof2.cpp | 27 ++--- common/patches/rof2_structs.h | 201 +++++++++++++++++----------------- utils/patches/patch_RoF2.conf | 2 +- 5 files changed, 119 insertions(+), 124 deletions(-) diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index ed62bb183..cec29178d 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -1380,19 +1380,19 @@ struct PlayerPositionUpdateServer_Struct struct PlayerPositionUpdateClient_Struct { /*0000*/ uint16 spawn_id; -/*0022*/ uint16 sequence; //increments one each packet +/*0002*/ uint16 sequence; //increments one each packet /*0004*/ float y_pos; // y coord /*0008*/ float delta_z; // Change in z -/*0016*/ float delta_x; // Change in x -/*0012*/ float delta_y; // Change in y +/*0012*/ float delta_x; // Change in x +/*0016*/ float delta_y; // Change in y /*0020*/ int32 animation:10, // animation delta_heading:10, // change in heading padding0020:12; // ***Placeholder (mostly 1) /*0024*/ float x_pos; // x coord /*0028*/ float z_pos; // z coord -/*0034*/ uint16 heading:12, // Directional heading +/*0032*/ uint16 heading:12, // Directional heading padding0004:4; // ***Placeholder -/*0032*/ uint8 unknown0006[2]; // ***Placeholder +/*0034*/ uint8 unknown0006[2]; // ***Placeholder /*0036*/ }; diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 1659dbd1c..890fa88aa 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -4878,7 +4878,8 @@ namespace RoF uint16 ornaIcon = 0; int32 heroModel = 0; /* - if (inst->GetOrnamentationAug(ornamentationAugtype)) { + if (inst->GetOrnamentationAug(ornamentationAugtype)) + { const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem(); //Mainhand ss.write(aug_weap->IDFile, strlen(aug_weap->IDFile)); diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index fbbceda2c..0f66184ee 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -1696,6 +1696,8 @@ namespace RoF2 eq->unknown932 = -1; // Set from PoK Example eq->unknown936 = -1; // Set from PoK Example eq->unknown944 = 1.0; // Set from PoK Example + eq->unknown948 = 0; // New on Live as of Dec 15 2014 + eq->unknown952 = 100; // New on Live as of Dec 15 2014 FINISH_ENCODE(); } @@ -2339,7 +2341,6 @@ 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 @@ -2387,12 +2388,7 @@ 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++) @@ -2408,6 +2404,11 @@ namespace RoF2 outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown + // Begin RoF2 Test + //for (uint32 r = 0; r < 8000; r++) + //outapp->WriteUInt8(0); // Unknown + // End RoF2 Test + // Unknown String ? outapp->WriteUInt32(64); // Unknown for (uint32 r = 0; r < 64; r++) @@ -2535,7 +2536,6 @@ namespace RoF2 outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown - */ outapp->WriteUInt8(emu->groupAutoconsent); outapp->WriteUInt8(emu->raidAutoconsent); @@ -4860,8 +4860,8 @@ namespace RoF2 hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0; hdr.unknown044 = 0; - hdr.unknown048 = 7300 + Inventory::CalcMaterialFromSlot(slot_id_in); //0; - hdr.unknown052 = 7300 + Inventory::CalcMaterialFromSlot(slot_id_in); //0; + hdr.unknown048 = 0; + hdr.unknown052 = 0; hdr.isEvolving = item->EvolvingLevel > 0 ? 1 : 0; ss.write((const char*)&hdr, sizeof(RoF2::structs::ItemSerializationHeader)); @@ -5325,13 +5325,8 @@ namespace RoF2 iqbs.SpellDmg = item->SpellDmg; iqbs.clairvoyance = item->Clairvoyance; iqbs.unknown28 = 0; - - - // Begin RoF2 Test - iqbs.unknown_TEST1 = 0; - // End RoF2 Test - iqbs.unknown30 = 0; + iqbs.unknown37a = 0; iqbs.unknown39 = 1; iqbs.subitem_count = 0; diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index 90ea4f287..efd80d0e8 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -520,72 +520,73 @@ struct ServerZoneEntry_Struct //Adjusted from SEQ Everquest.h Struct //New Zone Struct - Size: 948 struct NewZone_Struct { -/*0000*/ char char_name[64]; // Character Name -/*0064*/ char zone_short_name[32]; // Zone Short Name -/*0096*/ char unknown0096[96]; -/*0192*/ char zone_long_name[278]; // Zone Long Name -/*0470*/ uint8 ztype; // Zone type (usually FF) -/*0471*/ uint8 fog_red[4]; // Zone fog (red) -/*0475*/ uint8 fog_green[4]; // Zone fog (green) -/*0479*/ uint8 fog_blue[4]; // Zone fog (blue) -/*0483*/ uint8 unknown323; -/*0484*/ float fog_minclip[4]; -/*0500*/ float fog_maxclip[4]; -/*0516*/ float gravity; -/*0520*/ uint8 time_type; -/*0521*/ uint8 rain_chance[4]; -/*0525*/ uint8 rain_duration[4]; -/*0529*/ uint8 snow_chance[4]; -/*0533*/ uint8 snow_duration[4]; -/*0537*/ uint8 unknown537[33]; -/*0570*/ uint8 sky; // Sky Type -/*0571*/ uint8 unknown571[13]; // ***Placeholder -/*0584*/ float zone_exp_multiplier; // Experience Multiplier -/*0588*/ float safe_y; // Zone Safe Y -/*0592*/ float safe_x; // Zone Safe X -/*0596*/ float safe_z; // Zone Safe Z -/*0600*/ float min_z; // Guessed - NEW - Seen 0 -/*0604*/ float max_z; // Guessed -/*0608*/ float underworld; // Underworld, min z (Not Sure?) -/*0612*/ float minclip; // Minimum View Distance -/*0616*/ float maxclip; // Maximum View DIstance -/*0620*/ uint8 unknown620[84]; // ***Placeholder -/*0704*/ char zone_short_name2[96]; //zone file name? excludes instance number which can be in previous version. -/*0800*/ int32 unknown800; //seen -1 -/*0804*/ char unknown804[40]; // -/*0844*/ int32 unknown844; //seen 600 -/*0848*/ int32 unknown848; -/*0852*/ uint16 zone_id; -/*0854*/ uint16 zone_instance; -/*0856*/ char unknown856[20]; -/*0876*/ uint32 SuspendBuffs; -/*0880*/ uint32 unknown880; // Seen 50 -/*0884*/ uint32 unknown884; // Seen 10 -/*0888*/ uint8 unknown888; // Seen 1 -/*0889*/ uint8 unknown889; // Seen 0 (POK) or 1 (rujj) -/*0890*/ uint8 unknown890; // Seen 1 -/*0891*/ uint8 unknown891; // Seen 0 -/*0892*/ uint8 unknown892; // Seen 0 -/*0893*/ uint8 unknown893; // Seen 0 - 00 -/*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off -/*0895*/ uint8 unknown895; // Seen 0 - 00 -/*0896*/ uint32 unknown896; // Seen 180 -/*0900*/ uint32 unknown900; // Seen 180 -/*0904*/ uint32 unknown904; // Seen 180 -/*0908*/ uint32 unknown908; // Seen 2 -/*0912*/ uint32 unknown912; // Seen 2 -/*0916*/ float FogDensity; // Most zones have this set to 0.33 Blightfire had 0.16 -/*0920*/ uint32 unknown920; // Seen 0 -/*0924*/ uint32 unknown924; // Seen 0 -/*0928*/ uint32 unknown928; // Seen 0 -/*0932*/ int32 unknown932; // Seen -1 -/*0936*/ int32 unknown936; // Seen -1 -/*0940*/ uint32 unknown940; // Seen 0 -/*0944*/ float unknown944; // Seen 1.0 -/*0948*/ + /*0000*/ char char_name[64]; // Character Name + /*0064*/ char zone_short_name[32]; // Zone Short Name + /*0096*/ char unknown0096[96]; + /*0192*/ char zone_long_name[278]; // Zone Long Name + /*0470*/ uint8 ztype; // Zone type (usually FF) + /*0471*/ uint8 fog_red[4]; // Zone fog (red) + /*0475*/ uint8 fog_green[4]; // Zone fog (green) + /*0479*/ uint8 fog_blue[4]; // Zone fog (blue) + /*0483*/ uint8 unknown323; + /*0484*/ float fog_minclip[4]; + /*0500*/ float fog_maxclip[4]; + /*0516*/ float gravity; + /*0520*/ uint8 time_type; + /*0521*/ uint8 rain_chance[4]; + /*0525*/ uint8 rain_duration[4]; + /*0529*/ uint8 snow_chance[4]; + /*0533*/ uint8 snow_duration[4]; + /*0537*/ uint8 unknown537[33]; + /*0570*/ uint8 sky; // Sky Type + /*0571*/ uint8 unknown571[13]; // ***Placeholder + /*0584*/ float zone_exp_multiplier; // Experience Multiplier + /*0588*/ float safe_y; // Zone Safe Y + /*0592*/ float safe_x; // Zone Safe X + /*0596*/ float safe_z; // Zone Safe Z + /*0600*/ float min_z; // Guessed - NEW - Seen 0 + /*0604*/ float max_z; // Guessed + /*0608*/ float underworld; // Underworld, min z (Not Sure?) + /*0612*/ float minclip; // Minimum View Distance + /*0616*/ float maxclip; // Maximum View DIstance + /*0620*/ uint8 unknown620[84]; // ***Placeholder + /*0704*/ char zone_short_name2[96]; //zone file name? excludes instance number which can be in previous version. + /*0800*/ int32 unknown800; //seen -1 + /*0804*/ char unknown804[40]; // + /*0844*/ int32 unknown844; //seen 600 + /*0848*/ int32 unknown848; + /*0852*/ uint16 zone_id; + /*0854*/ uint16 zone_instance; + /*0856*/ char unknown856[20]; + /*0876*/ uint32 SuspendBuffs; + /*0880*/ uint32 unknown880; // Seen 50 + /*0884*/ uint32 unknown884; // Seen 10 + /*0888*/ uint8 unknown888; // Seen 1 + /*0889*/ uint8 unknown889; // Seen 0 (POK) or 1 (rujj) + /*0890*/ uint8 unknown890; // Seen 1 + /*0891*/ uint8 unknown891; // Seen 0 + /*0892*/ uint8 unknown892; // Seen 0 + /*0893*/ uint8 unknown893; // Seen 0 - 00 + /*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off + /*0895*/ uint8 unknown895; // Seen 0 - 00 + /*0896*/ uint32 unknown896; // Seen 180 + /*0900*/ uint32 unknown900; // Seen 180 + /*0904*/ uint32 unknown904; // Seen 180 + /*0908*/ uint32 unknown908; // Seen 2 + /*0912*/ uint32 unknown912; // Seen 2 + /*0916*/ float FogDensity; // Most zones have this set to 0.33 Blightfire had 0.16 + /*0920*/ uint32 unknown920; // Seen 0 + /*0924*/ uint32 unknown924; // Seen 0 + /*0928*/ uint32 unknown928; // Seen 0 + /*0932*/ int32 unknown932; // Seen -1 + /*0936*/ int32 unknown936; // Seen -1 + /*0940*/ uint32 unknown940; // Seen 0 + /*0944*/ float unknown944; // Seen 1.0 + /*0948*/ uint32 unknown948; // Seen 0 - New on Live as of Dec 15 2014 + /*0952*/ uint32 unknown952; // Seen 100 - New on Live as of Dec 15 2014 + /*0956*/ }; - /* ** Memorize Spell Struct ** Length: 16 Bytes @@ -1598,23 +1599,24 @@ struct RespawnWindow_Struct { */ struct PlayerPositionUpdateServer_Struct { - uint16 spawn_id; - uint16 spawnId2; - signed padding0004:12; - signed y_pos:19; // y coord - unsigned padding:1; - signed delta_z:13; // change in z - signed delta_x:13; // change in x - signed padding0008:6; - signed x_pos:19; // x coord - unsigned heading:12; // heading - signed padding0016:1; - signed delta_heading:10; // change in heading - signed z_pos:19; // z coord - signed padding0020:3; - signed animation:10; // animation - signed delta_y:13; // change in y - signed padding0024:9; + /*0000*/ uint16 spawn_id; + /*0002*/ uint16 spawnId2; + /*0004*/ signed padding0004 : 12; + signed y_pos : 19; // y coord + unsigned padding : 1; + /*0008*/ signed delta_z : 13; // change in z + signed delta_x : 13; // change in x + signed padding0008 : 6; + /*0012*/ signed x_pos : 19; // x coord + unsigned heading : 12; // heading + signed padding0016 : 1; + /*0016*/ signed delta_heading : 10; // change in heading + signed z_pos : 19; // z coord + signed padding0020 : 3; + /*0020*/ signed animation : 10; // animation + signed delta_y : 13; // change in y + signed padding0024 : 9; + /*0024*/ }; /* @@ -1625,21 +1627,22 @@ struct PlayerPositionUpdateServer_Struct */ struct PlayerPositionUpdateClient_Struct { - uint16 sequence; // increments one each packet - Verified - uint16 spawn_id; // Player's spawn id - uint8 unknown0004[6]; // ***Placeholder - float delta_x; // Change in x - unsigned heading:12; // Directional heading - unsigned padding0040:20; // ***Placeholder - float x_pos; // x coord (2nd loc value) - float delta_z; // Change in z - float z_pos; // z coord (3rd loc value) - float y_pos; // y coord (1st loc value) - unsigned animation:10; // ***Placeholder - unsigned padding0024:22; // animation - float delta_y; // Change in y - signed delta_heading:10; // change in heading - unsigned padding0041:22; // ***Placeholder + /*0000*/ uint16 sequence; // increments one each packet - Verified + /*0002*/ uint16 spawn_id; // Player's spawn id + /*0004*/ uint8 unknown0004[6]; // ***Placeholder + /*0010*/ float delta_x; // Change in x + /*0014*/ unsigned heading : 12; // Directional heading + unsigned padding0040 : 20; // ***Placeholder + /*0018*/ float x_pos; // x coord (2nd loc value) + /*0022*/ float delta_z; // Change in z + /*0026*/ float z_pos; // z coord (3rd loc value) + /*0030*/ float y_pos; // y coord (1st loc value) + /*0034*/ unsigned animation : 10; // ***Placeholder + unsigned padding0024 : 22; // animation + /*0038*/ float delta_y; // Change in y + /*0042*/ signed delta_heading : 10; // change in heading + unsigned padding0041 : 22; // ***Placeholder + /*0046*/ }; /* @@ -4687,11 +4690,7 @@ struct ItemQuaternaryBodyStruct uint32 unknown37; uint32 unknown_RoF27; uint32 unknown_RoF28; - - // Begin RoF2 Test - uint8 unknown_TEST1; - // End RoF2 Test - + uint8 unknown37a; // (guessed position) New to RoF2 uint8 unknown38; // 0 uint8 unknown39; // 1 uint32 subitem_count; diff --git a/utils/patches/patch_RoF2.conf b/utils/patches/patch_RoF2.conf index d2ed7f651..6bc63253e 100644 --- a/utils/patches/patch_RoF2.conf +++ b/utils/patches/patch_RoF2.conf @@ -257,9 +257,9 @@ OP_MoveDoor=0x08e8 OP_RemoveAllDoors=0x700c OP_EnvDamage=0x51fd OP_BoardBoat=0x4211 -OP_Forage=0x5306 OP_LeaveBoat=0x7617 OP_ControlBoat=0x0ae7 +OP_Forage=0x5306 OP_SafeFallSuccess=0x2219 OP_RezzComplete=0x760d OP_RezzRequest=0x3c21 From d69552d4df58507c86ae7b814cc818028b094056 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Wed, 17 Dec 2014 05:57:16 -0500 Subject: [PATCH 133/153] Perl: NPC AddRangedProc(spellid, chance) Perl: NPC AddDefensiveProc(spellid, chance) --- zone/perl_npc.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/zone/perl_npc.cpp b/zone/perl_npc.cpp index 736db9565..279b64330 100644 --- a/zone/perl_npc.cpp +++ b/zone/perl_npc.cpp @@ -2301,7 +2301,57 @@ XS(XS_NPC_AddMeleeProc); XS(XS_NPC_AddMeleeProc) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: NPC::AddMeleePro(THIS,spellid,chance)"); + Perl_croak(aTHX_ "Usage: NPC::AddMeleeProc(THIS,spellid,chance)"); + { + NPC * THIS; + int spell_id = (int)SvIV(ST(1)); + int chance = (int)SvIV(ST(2)); + dXSTARG; + + if (sv_derived_from(ST(0), "NPC")) { + IV tmp = SvIV((SV*)SvRV(ST(0))); + THIS = INT2PTR(NPC *,tmp); + } + else + Perl_croak(aTHX_ "THIS is not of type NPC"); + if(THIS == NULL) + Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + + THIS->AddProcToWeapon(spell_id, true, chance); + } + XSRETURN_EMPTY; +} + +XS(XS_NPC_AddRangedProc); +XS(XS_NPC_AddRangedProc) { + dXSARGS; + if (items != 3) + Perl_croak(aTHX_ "Usage: NPC::AddRangedProc(THIS,spellid,chance)"); + { + NPC * THIS; + int spell_id = (int)SvIV(ST(1)); + int chance = (int)SvIV(ST(2)); + dXSTARG; + + if (sv_derived_from(ST(0), "NPC")) { + IV tmp = SvIV((SV*)SvRV(ST(0))); + THIS = INT2PTR(NPC *,tmp); + } + else + Perl_croak(aTHX_ "THIS is not of type NPC"); + if(THIS == NULL) + Perl_croak(aTHX_ "THIS is NULL, avoiding crash."); + + THIS->AddDefensiveProc(spell_id,chance); + } + XSRETURN_EMPTY; +} + +XS(XS_NPC_AddDefensiveProc); +XS(XS_NPC_AddDefensiveProc) { + dXSARGS; + if (items != 3) + Perl_croak(aTHX_ "Usage: NPC::AddDefensiveProc(THIS,spellid,chance)"); { NPC * THIS; int spell_id = (int)SvIV(ST(1)); @@ -2427,6 +2477,8 @@ XS(boot_NPC) newXSproto(strcpy(buf, "SetMerchantProbability"), XS_NPC_SetMerchantProbability, file, "$$"); newXSproto(strcpy(buf, "GetMerchantProbability"), XS_NPC_GetMerchantProbability, file, "$"); newXSproto(strcpy(buf, "AddMeleeProc"), XS_NPC_AddMeleeProc, file, "$$$"); + newXSproto(strcpy(buf, "AddRangedProc"), XS_NPC_AddRangedProc, file, "$$$"); + newXSproto(strcpy(buf, "AddDefensiveProc"), XS_NPC_AddDefensiveProc, file, "$$$"); XSRETURN_YES; } From 29ef1527e7b3ad15a5bdffe002ce97ad0f636859 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Wed, 17 Dec 2014 06:09:04 -0500 Subject: [PATCH 134/153] update --- zone/mob.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/mob.cpp b/zone/mob.cpp index 03f845184..af7c5a8c7 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -543,7 +543,7 @@ float Mob::_GetMovementSpeed(int mod) const if (IsRooted()) return 0.0f; else if (IsPseudoRooted()) - return 0.000001f; + return 0.00001f; float speed_mod = runspeed; From cd33307975df11b85aca34cc9fc8105b2a47f6f4 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Wed, 17 Dec 2014 10:59:23 -0500 Subject: [PATCH 135/153] NPC ranged attack projectiles will now do damage on impact. Uses same rule as the client version. --- zone/npc.h | 1 + zone/special_attacks.cpp | 186 ++++++++++++++++++++++----------------- 2 files changed, 105 insertions(+), 82 deletions(-) diff --git a/zone/npc.h b/zone/npc.h index 1e378d2ad..59fbcc3fd 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -155,6 +155,7 @@ public: virtual void RangedAttack(Mob* other); virtual void ThrowingAttack(Mob* other) { } int32 GetNumberOfAttacks() const { return attack_count; } + void DoRangedAttackDmg(Mob* other, bool Launch=true, int16 damage_mod=0, int16 chance_mod=0, SkillUseTypes skill=SkillArchery, float speed=4.0f, const char *IDFile = nullptr); bool DatabaseCastAccepted(int spell_id); bool IsFactionListAlly(uint32 other_faction); diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 0f57a7147..f74949a0b 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -1062,8 +1062,8 @@ bool Mob::TryProjectileAttack(Mob* other, const Item_Struct *item, SkillUseTypes if(item) SendItemAnimation(other, item, skillInUse, speed); - else if (IsNPC()) - ProjectileAnimation(other, 0,false,speed,0,0,0,CastToNPC()->GetAmmoIDfile(),skillInUse); + //else if (IsNPC()) + //ProjectileAnimation(other, 0,false,speed,0,0,0,CastToNPC()->GetAmmoIDfile(),skillInUse); return true; } @@ -1100,12 +1100,19 @@ void Mob::ProjectileAttack() if (ProjectileAtk[i].hit_increment <= ProjectileAtk[i].increment){ if (target){ - if (ProjectileAtk[i].skill == SkillArchery) - DoArcheryAttackDmg(target, nullptr, nullptr,ProjectileAtk[i].wpn_dmg,0,0,0,ProjectileAtk[i].ranged_id, ProjectileAtk[i].ammo_id, nullptr, ProjectileAtk[i].ammo_slot); - else if (ProjectileAtk[i].skill == SkillThrowing) - DoThrowingAttackDmg(target, nullptr, nullptr,ProjectileAtk[i].wpn_dmg,0,0,0, ProjectileAtk[i].ranged_id, ProjectileAtk[i].ammo_slot); - else if (ProjectileAtk[i].skill == SkillConjuration && IsValidSpell(ProjectileAtk[i].wpn_dmg)) - SpellOnTarget(ProjectileAtk[i].wpn_dmg, target, false, true, spells[ProjectileAtk[i].wpn_dmg].ResistDiff, true); + + if (IsNPC()) + CastToNPC()->DoRangedAttackDmg(target, false, ProjectileAtk[i].wpn_dmg,0, static_cast(ProjectileAtk[i].skill)); + + else + { + if (ProjectileAtk[i].skill == SkillArchery) + DoArcheryAttackDmg(target, nullptr, nullptr,ProjectileAtk[i].wpn_dmg,0,0,0,ProjectileAtk[i].ranged_id, ProjectileAtk[i].ammo_id, nullptr, ProjectileAtk[i].ammo_slot); + else if (ProjectileAtk[i].skill == SkillThrowing) + DoThrowingAttackDmg(target, nullptr, nullptr,ProjectileAtk[i].wpn_dmg,0,0,0, ProjectileAtk[i].ranged_id, ProjectileAtk[i].ammo_slot); + else if (ProjectileAtk[i].skill == SkillConjuration && IsValidSpell(ProjectileAtk[i].wpn_dmg)) + SpellOnTarget(ProjectileAtk[i].wpn_dmg, target, false, true, spells[ProjectileAtk[i].wpn_dmg].ResistDiff, true); + } } ProjectileAtk[i].increment = 0; @@ -1190,14 +1197,8 @@ void NPC::RangedAttack(Mob* other) attacks = attacks > 0 ? attacks : 1; for(int i = 0; i < attacks; ++i) { - //if we have SPECATK_RANGED_ATK set then we range attack without weapon or ammo - const Item_Struct* weapon = nullptr; - const Item_Struct* ammo = nullptr; if(!GetSpecialAbility(SPECATK_RANGED_ATK)) - { - //find our bow and ammo return if we can't find them... return; - } int sa_min_range = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 4); //Min Range of NPC attack int sa_max_range = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 1); //Max Range of NPC attack @@ -1211,16 +1212,11 @@ void NPC::RangedAttack(Mob* other) if (sa_min_range) min_range = static_cast(sa_min_range); - mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", max_range); max_range *= max_range; - if(DistNoRootNoZ(*other) > max_range) { - mlog(COMBAT__RANGED, "Ranged attack out of range...%.2f vs %.2f", DistNoRootNoZ(*other), max_range); - //target is out of range, client does a message + if(DistNoRoot(*other) > max_range) return; - } - else if(DistNoRootNoZ(*other) < (min_range * min_range)) + else if(DistNoRoot(*other) < (min_range * min_range)) return; - if(!other || !IsAttackAllowed(other) || IsCasting() || @@ -1232,74 +1228,100 @@ void NPC::RangedAttack(Mob* other) return; } - SkillUseTypes skillinuse = SkillArchery; - skillinuse = static_cast(GetRangedSkill()); - - if(!ammo && !GetAmmoIDfile()) - ammo = database.GetItem(8005); - - if(ammo) - SendItemAnimation(other, ammo, SkillArchery); - else - ProjectileAnimation(other, 0,false,0,0,0,0,GetAmmoIDfile(),skillinuse); - FaceTarget(other); - if (!other->CheckHitChance(this, skillinuse, MainRange, GetSpecialAbilityParam(SPECATK_RANGED_ATK, 2))) - { - mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName()); - other->Damage(this, 0, SPELL_UNKNOWN, skillinuse); - } - else - { - int16 WDmg = GetWeaponDamage(other, weapon); - int16 ADmg = GetWeaponDamage(other, ammo); - int32 TotalDmg = 0; - if(WDmg > 0 || ADmg > 0) - { - mlog(COMBAT__RANGED, "Ranged attack hit %s.", other->GetName()); - - int32 MaxDmg = max_dmg * RuleR(Combat, ArcheryNPCMultiplier); // should add a field to npc_types - int32 MinDmg = min_dmg * RuleR(Combat, ArcheryNPCMultiplier); - - if(RuleB(Combat, UseIntervalAC)) - TotalDmg = MaxDmg; - else - TotalDmg = zone->random.Int(MinDmg, MaxDmg); - - TotalDmg += TotalDmg * GetSpecialAbilityParam(SPECATK_RANGED_ATK, 3) / 100; //Damage modifier - - other->AvoidDamage(this, TotalDmg, false); - other->MeleeMitigation(this, TotalDmg, MinDmg); - if (TotalDmg > 0) - CommonOutgoingHitSuccess(other, TotalDmg, skillinuse); - } - - else - TotalDmg = -5; - - if (TotalDmg > 0) - other->AddToHateList(this, TotalDmg, 0, false); - else - other->AddToHateList(this, 0, 0, false); - - other->Damage(this, TotalDmg, SPELL_UNKNOWN, skillinuse); - - if (TotalDmg > 0 && HasSkillProcSuccess() && GetTarget() && !other->HasDied()) - TrySkillProc(other, skillinuse, 0, true, MainRange); - } - - //try proc on hits and misses - if(other && !other->HasDied()) - TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, MainRange); - - if (HasSkillProcs() && other && !other->HasDied()) - TrySkillProc(other, skillinuse, 0, false, MainRange); + DoRangedAttackDmg(other); CommonBreakInvisible(); } } +void NPC::DoRangedAttackDmg(Mob* other, bool Launch, int16 damage_mod, int16 chance_mod, SkillUseTypes skill, float speed, const char *IDFile) { + + if ((other == nullptr || + (other->HasDied())) || + HasDied() || + (!IsAttackAllowed(other)) || + (other->GetInvul() || + other->GetSpecialAbility(IMMUNE_MELEE))) + { + return; + } + + SkillUseTypes skillInUse = static_cast(GetRangedSkill()); + + if (skill != skillInUse) + skillInUse = skill; + + if (Launch) + { + const char *ammo = "IT10"; + + if (IDFile != nullptr) + ammo = IDFile; + else if (GetAmmoIDfile()) + ammo = GetAmmoIDfile(); + + ProjectileAnimation(other, 0,false,speed,0,0,0,ammo,skillInUse); + + if (RuleB(Combat, ProjectileDmgOnImpact)) + { + TryProjectileAttack(other, nullptr, skillInUse, damage_mod, nullptr, nullptr, 0, speed); + return; + } + } + + if (!chance_mod) + chance_mod = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 2); + + if (!other->CheckHitChance(this, skillInUse, MainRange, chance_mod)) + { + other->Damage(this, 0, SPELL_UNKNOWN, skillInUse); + } + else + { + int32 TotalDmg = 0; + int32 MaxDmg = max_dmg * RuleR(Combat, ArcheryNPCMultiplier); // should add a field to npc_types + int32 MinDmg = min_dmg * RuleR(Combat, ArcheryNPCMultiplier); + + if(RuleB(Combat, UseIntervalAC)) + TotalDmg = MaxDmg; + else + TotalDmg = zone->random.Int(MinDmg, MaxDmg); + + + if (!damage_mod) + damage_mod = GetSpecialAbilityParam(SPECATK_RANGED_ATK, 3);//Damage modifier + + TotalDmg += TotalDmg * damage_mod / 100; + + other->AvoidDamage(this, TotalDmg, false); + other->MeleeMitigation(this, TotalDmg, MinDmg); + + if (TotalDmg > 0) + CommonOutgoingHitSuccess(other, TotalDmg, skillInUse); + else + TotalDmg = -5; + + if (TotalDmg > 0) + other->AddToHateList(this, TotalDmg, 0, false); + else + other->AddToHateList(this, 0, 0, false); + + other->Damage(this, TotalDmg, SPELL_UNKNOWN, skillInUse); + + if (TotalDmg > 0 && HasSkillProcSuccess() && !other->HasDied()) + TrySkillProc(other, skillInUse, 0, true, MainRange); + } + + //try proc on hits and misses + if(other && !other->HasDied()) + TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, MainRange); + + if (HasSkillProcs() && other && !other->HasDied()) + TrySkillProc(other, skillInUse, 0, false, MainRange); +} + uint16 Mob::GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg) { uint16 MaxDmg = (((2 * wDmg) * GetDamageTable(SkillThrowing)) / 100); From d721580c9f103f77fb77a930bf0c277c943404d9 Mon Sep 17 00:00:00 2001 From: SecretsOTheP Date: Wed, 17 Dec 2014 17:55:21 -0500 Subject: [PATCH 136/153] EQStream changes as recommended by a community member in private. --- changelog.txt | 1 + common/eq_stream.cpp | 28 +++++++++++++++++++--------- common/eq_stream.h | 14 ++++++++++++-- common/eq_stream_ident.cpp | 3 +++ 4 files changed, 35 insertions(+), 11 deletions(-) diff --git a/changelog.txt b/changelog.txt index d1184037d..8c2630b6f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 12/17/2014 == demonstar55: Use vectors for route stuff, should be more CPU cache friendly so faster +Secrets: EQStream changes as recommended by a community member in private. == 12/15/2014 == Trevius: (RoF+) Implemented the 6th Augment Slot for Items. diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 879d57664..594f3b5bc 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -47,7 +47,13 @@ uint16 EQStream::MaxWindowSize=2048; -void EQStream::init() { +void EQStream::init(bool resetSession) { + // we only reset these statistics if it is a 'new' connection + if ( resetSession ) + { + streamactive = false; + sessionAttempts = 0; + } active_users = 0; Session=0; Key=0; @@ -313,18 +319,22 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } #ifndef COLLECTOR if (GetState()==ESTABLISHED) { - _log(NET__ERROR, _L "Received OP_SessionRequest in ESTABLISHED state (%d)" __L, GetState()); + _log(NET__ERROR, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); - /*RemoveData(); - init(); - State=UNESTABLISHED;*/ - _SendDisconnect(); - SetState(CLOSED); - break; + // client seems to try a max of 30 times (initial+3 retries) then gives up, giving it a few more attempts just in case + // streamactive means we identified the opcode for the stream, we cannot re-establish this connection + if ( streamactive || ( sessionAttempts > MAX_SESSION_RETRIES ) ) + { + _SendDisconnect(); + SetState(CLOSED); + break; + } } #endif //std::cout << "Got OP_SessionRequest" << std::endl; - init(); + sessionAttempts++; + // we set established below, so statistics will not be reset for session attempts/stream active. + init(GetState()!=ESTABLISHED); OutboundQueueClear(); SessionRequest *Request=(SessionRequest *)p->pBuffer; Session=ntohl(Request->Session); diff --git a/common/eq_stream.h b/common/eq_stream.h index ee797021f..bcbb548e9 100644 --- a/common/eq_stream.h +++ b/common/eq_stream.h @@ -49,6 +49,10 @@ class EQProtocolPacket; #define RETRANSMIT_ACKED_PACKETS true #endif +#ifndef MAX_SESSION_RETRIES +#define MAX_SESSION_RETRIES 30 +#endif + #pragma pack(1) struct SessionRequest { uint32 UnknownA; @@ -104,6 +108,9 @@ class EQStream : public EQStreamInterface { uint32 retransmittimer; uint32 retransmittimeout; + uint16 sessionAttempts; + bool streamactive; + //uint32 buffer_len; uint32 Session, Key; @@ -197,9 +204,9 @@ class EQStream : public EQStreamInterface { void _SendDisconnect(); - void init(); + void init(bool resetSession=true); public: - EQStream() { init(); remote_ip = 0; remote_port = 0; State=UNESTABLISHED; StreamType=UnknownStream; compressed=true; encoded=false; app_opcode_size=2; bytes_sent=0; bytes_recv=0; create_time=Timer::GetTimeSeconds(); } + EQStream() { init(); remote_ip = 0; remote_port = 0; State=UNESTABLISHED; StreamType=UnknownStream; compressed=true; encoded=false; app_opcode_size=2; bytes_sent=0; bytes_recv=0; create_time=Timer::GetTimeSeconds(); sessionAttempts = 0; streamactive=false; } EQStream(sockaddr_in addr) { init(); remote_ip=addr.sin_addr.s_addr; remote_port=addr.sin_port; State=UNESTABLISHED; StreamType=UnknownStream; compressed=true; encoded=false; app_opcode_size=2; bytes_sent=0; bytes_recv=0; create_time=Timer::GetTimeSeconds(); } virtual ~EQStream() { RemoveData(); SetState(CLOSED); } void SetMaxLen(uint32 length) { MaxLen=length; } @@ -224,6 +231,9 @@ class EQStream : public EQStreamInterface { void SetLastPacketTime(uint32 t) {LastPacket=t;} void Write(int eq_fd); + // whether or not the stream has been assigned (we passed our stream match) + void SetActive(bool val) { streamactive = val; } + // inline bool IsInUse() { bool flag; MInUse.lock(); flag=(active_users>0); MInUse.unlock(); return flag; } inline void PutInUse() { MInUse.lock(); active_users++; MInUse.unlock(); } diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index b60ac28d0..97fdd2c48 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -110,6 +110,9 @@ void EQStreamIdentifier::Process() { _log(NET__IDENTIFY, "Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + // before we assign the eqstream to an interface, let the stream recognize it is in use and the session should not be reset any further + r->stream->SetActive(true); + //might want to do something less-specific here... some day.. EQStreamInterface *s = new EQStreamProxy(r->stream, p->structs, p->opcodes); m_identified.push(s); From 7dad77c0805da0c75843a8f0e5c68d9f61719a71 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Wed, 17 Dec 2014 20:09:41 -0500 Subject: [PATCH 137/153] Clients will now receive exp / faction from their swarm pets kills ect. --- zone/attack.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zone/attack.cpp b/zone/attack.cpp index 4661a83e3..9ecfaa8a3 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -2103,6 +2103,18 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack #endif //BOTS } + if(give_exp && give_exp->IsTempPet() && give_exp->IsPetOwnerClient()) { + + if (give_exp->IsNPC() && give_exp->CastToNPC()->GetSwarmOwner()){ + Mob* temp_owner = nullptr; + temp_owner = entity_list.GetMobID(give_exp->CastToNPC()->GetSwarmOwner()); + + if (temp_owner) + give_exp = temp_owner; + } + } + + int PlayerCount = 0; // QueryServ Player Counting Client *give_exp_client = nullptr; From fe4872c92167baedba854bcfe0df987b0688750b Mon Sep 17 00:00:00 2001 From: Uleat Date: Wed, 17 Dec 2014 20:09:53 -0500 Subject: [PATCH 138/153] Debug >= 11 compile fail fix --- zone/bonuses.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index aa89856a1..b9f35c9ff 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -538,9 +538,9 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAu } void Client::CalcEdibleBonuses(StatBonuses* newbon) { -#if EQDEBUG >= 11 - std::cout<<"Client::CalcEdibleBonuses(StatBonuses* newbon)"<= 11 +// std::cout<<"Client::CalcEdibleBonuses(StatBonuses* newbon)"< Date: Thu, 18 Dec 2014 02:20:03 -0500 Subject: [PATCH 139/153] std::deque is a much better fit, should have bit better performance --- zone/client_packet.cpp | 2 +- zone/entity.cpp | 2 +- zone/fearpath.cpp | 2 +- zone/mob.h | 2 +- zone/pathing.cpp | 42 +++++++++++++++++++++--------------------- zone/pathing.h | 6 +++--- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 82147ca43..fa6b4f249 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -5714,7 +5714,7 @@ void Client::Handle_OP_FindPersonRequest(const EQApplicationPacket *app) } else { - std::vector pathlist = zone->pathing->FindRoute(Start, End); + std::deque pathlist = zone->pathing->FindRoute(Start, End); if (pathlist.size() == 0) { diff --git a/zone/entity.cpp b/zone/entity.cpp index c7a980f3d..b2951407b 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2636,7 +2636,7 @@ void EntityList::FindPathsToAllNPCs() while (it != npc_list.end()) { Map::Vertex Node0 = zone->pathing->GetPathNodeCoordinates(0, false); Map::Vertex Dest(it->second->GetX(), it->second->GetY(), it->second->GetZ()); - std::vector Route = zone->pathing->FindRoute(Node0, Dest); + std::deque Route = zone->pathing->FindRoute(Node0, Dest); if (Route.size() == 0) printf("Unable to find a route to %s\n", it->second->GetName()); else diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index 2e8e146aa..f4354e709 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -158,7 +158,7 @@ void Mob::CalculateNewFearpoint() Map::Vertex CurrentPosition(GetX(), GetY(), GetZ()); - std::vector Route = zone->pathing->FindRoute(CurrentPosition, Loc); + std::deque Route = zone->pathing->FindRoute(CurrentPosition, Loc); if(Route.size() > 0) { diff --git a/zone/mob.h b/zone/mob.h index cb7b82948..431b3ac31 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -1225,7 +1225,7 @@ protected: Map::Vertex PathingLastPosition; int PathingLoopCount; int PathingLastNodeVisited; - std::vector Route; + std::deque Route; LOSType PathingLOSState; Timer *PathingLOSCheckTimer; Timer *PathingRouteUpdateTimerShort; diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 309d6c0ed..2ddd7d94b 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -205,15 +205,15 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) } -std::vector PathManager::FindRoute(int startID, int endID) +std::deque PathManager::FindRoute(int startID, int endID) { _log(PATHING__DEBUG, "FindRoute from node %i to %i", startID, endID); memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); - std::vector OpenList, ClosedList; + std::deque OpenList, ClosedList; - std::vectorRoute; + std::dequeRoute; AStarNode AStarEntry, CurrentNode; @@ -235,7 +235,7 @@ std::vector PathManager::FindRoute(int startID, int endID) ClosedListFlag[CurrentNode.PathNodeID] = true; - OpenList.erase(OpenList.begin()); + OpenList.pop_front(); for(int i = 0; i < PATHNODENEIGHBOURS; ++i) { @@ -251,7 +251,7 @@ std::vector PathManager::FindRoute(int startID, int endID) Route.push_back(endID); - std::vector::iterator RouteIterator; + std::deque::iterator RouteIterator; while(CurrentNode.PathNodeID != startID) { @@ -300,7 +300,7 @@ std::vector PathManager::FindRoute(int startID, int endID) bool AlreadyInOpenList = false; - std::vector::iterator OpenListIterator, InsertionPoint = OpenList.end(); + std::deque::iterator OpenListIterator, InsertionPoint = OpenList.end(); for(OpenListIterator = OpenList.begin(); OpenListIterator != OpenList.end(); ++OpenListIterator) { @@ -350,11 +350,11 @@ bool SortPathNodesByDistance(PathNodeSortStruct n1, PathNodeSortStruct n2) return n1.Distance < n2.Distance; } -std::vector PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) +std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { _log(PATHING__DEBUG, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); - std::vector noderoute; + std::deque noderoute; float CandidateNodeRangeXY = RuleR(Pathing, CandidateNodeRangeXY); @@ -365,7 +365,7 @@ std::vector PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) // int ClosestPathNodeToStart = -1; - std::vector SortedByDistance; + std::deque SortedByDistance; PathNodeSortStruct TempNode; @@ -456,7 +456,7 @@ std::vector PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { int CulledNodes = 0; - std::vector::iterator First, Second; + std::deque::iterator First, Second; while((noderoute.size() >= 2) && (CulledNodes < NodesToAttemptToCull)) { @@ -487,7 +487,7 @@ std::vector PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { int CulledNodes = 0; - std::vector::iterator First, Second; + std::deque::iterator First, Second; while((noderoute.size() >= 2) && (CulledNodes < NodesToAttemptToCull)) { @@ -611,7 +611,7 @@ void PathManager::MeshTest() if(j == i) continue; - std::vector Route = FindRoute(PathNodes[i].id, PathNodes[j].id); + std::deque Route = FindRoute(PathNodes[i].id, PathNodes[j].id); if(Route.size() == 0) { @@ -638,7 +638,7 @@ void PathManager::SimpleMeshTest() for(uint32 j = 1; j < Head.PathNodeCount; ++j) { - std::vector Route = FindRoute(PathNodes[0].id, PathNodes[j].id); + std::deque Route = FindRoute(PathNodes[0].id, PathNodes[j].id); if(Route.size() == 0) { @@ -695,7 +695,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); - Route.erase(Route.begin()); + Route.pop_front(); ++PathingTraversedNodes; @@ -784,7 +784,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } // We are on the same route, no LOS (or not checking this time, so pop off the node we just reached // - Route.erase(Route.begin()); + Route.pop_front(); ++PathingTraversedNodes; @@ -798,7 +798,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(NextNode == -1) { // -1 indicates a teleport to the next node - Route.erase(Route.begin()); + Route.pop_front(); if(Route.size() == 0) { @@ -814,7 +814,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & mlog(PATHING__DEBUG, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); - Route.erase(Route.begin()); + Route.pop_front(); if(Route.size() == 0) return To; @@ -962,7 +962,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLastNodeVisited = Route.front(); - Route.erase(Route.begin()); + Route.pop_front(); ++PathingTraversedNodes; @@ -975,7 +975,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(NextNode == -1) { // -1 indicates a teleport to the next node - Route.erase(Route.begin()); + Route.pop_front(); if(Route.size() == 0) { @@ -991,7 +991,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & mlog(PATHING__DEBUG, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); - Route.erase(Route.begin()); + Route.pop_front(); if(Route.size() == 0) return To; @@ -1103,7 +1103,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) int ClosestPathNodeToStart = -1; - std::vector SortedByDistance; + std::deque SortedByDistance; PathNodeSortStruct TempNode; diff --git a/zone/pathing.h b/zone/pathing.h index 8c131dbc3..8848547b2 100644 --- a/zone/pathing.h +++ b/zone/pathing.h @@ -3,7 +3,7 @@ #include "map.h" -#include +#include class Client; class Mob; @@ -60,8 +60,8 @@ public: static PathManager *LoadPathFile(const char *ZoneName); bool loadPaths(FILE *fp); void PrintPathing(); - std::vector FindRoute(Map::Vertex Start, Map::Vertex End); - std::vector FindRoute(int startID, int endID); + std::deque FindRoute(Map::Vertex Start, Map::Vertex End); + std::deque FindRoute(int startID, int endID); Map::Vertex GetPathNodeCoordinates(int NodeNumber, bool BestZ = true); bool CheckLosFN(Map::Vertex a, Map::Vertex b); From ba5e5058f96dfa30f9e8c56c5223523318935962 Mon Sep 17 00:00:00 2001 From: Trevius Date: Thu, 18 Dec 2014 13:13:03 -0600 Subject: [PATCH 140/153] Finished lining up the RoF2 Player Profile Struct. Zone times are now normal, and everything from the PP is accurate in game now. --- changelog.txt | 3 ++ common/patches/rof.cpp | 21 ----------- common/patches/rof2.cpp | 80 ++++++++++++++++++----------------------- 3 files changed, 38 insertions(+), 66 deletions(-) diff --git a/changelog.txt b/changelog.txt index 8c2630b6f..9086075f0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/18/2014 == +Trevius: Finished lining up the RoF2 Player Profile Struct. Zone times are now normal, and everything from the PP is accurate in game now. + == 12/17/2014 == demonstar55: Use vectors for route stuff, should be more CPU cache friendly so faster Secrets: EQStream changes as recommended by a community member in private. diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 890fa88aa..5fa44c743 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -2045,15 +2045,6 @@ namespace RoF 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++) @@ -2130,18 +2121,6 @@ namespace RoF outapp->WriteUInt32(structs::BUFF_COUNT); - //*000*/ uint8 slotid; // badly named... seems to be 2 for a real buff, 0 otherwise - //*001*/ float unknown004; // Seen 1 for no buff - //*005*/ uint32 player_id; // 'global' ID of the caster, for wearoff messages - //*009*/ uint32 unknown016; - //*013*/ uint8 bard_modifier; - //*014*/ uint32 duration; - //*018*/ uint8 level; - //*019*/ uint32 spellid; - //*023*/ uint32 counters; - //*027*/ uint8 unknown0028[53]; - //*080*/ - for (uint32 r = 0; r < BUFF_COUNT; r++) { float instrument_mod = 0.0f; diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 0f66184ee..fff449379 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -2123,18 +2123,6 @@ namespace RoF2 outapp->WriteUInt32(structs::BUFF_COUNT); - //*000*/ uint8 slotid; // badly named... seems to be 2 for a real buff, 0 otherwise - //*001*/ float unknown004; // Seen 1 for no buff - //*005*/ uint32 player_id; // 'global' ID of the caster, for wearoff messages - //*009*/ uint32 unknown016; - //*013*/ uint8 bard_modifier; - //*014*/ uint32 duration; - //*018*/ uint8 level; - //*019*/ uint32 spellid; - //*023*/ uint32 counters; - //*027*/ uint8 unknown0028[53]; - //*080*/ - for (uint32 r = 0; r < BUFF_COUNT; r++) { float instrument_mod = 0.0f; @@ -2174,7 +2162,6 @@ namespace RoF2 // 80 bytes of zeroes for (uint32 j = 0; j < 20; ++j) outapp->WriteUInt32(0); - } outapp->WriteUInt32(emu->platinum); @@ -2199,8 +2186,8 @@ namespace RoF2 outapp->WriteUInt32(emu->aapoints_spent); - outapp->WriteUInt32(5); // AA Points count ?? - outapp->WriteUInt32(1234); // AA Points assigned + outapp->WriteUInt32(5); // AA Window Tab Count + outapp->WriteUInt32(0); // AA Points assigned ? outapp->WriteUInt32(0); // AA Points in General ? outapp->WriteUInt32(0); // AA Points in Class ? outapp->WriteUInt32(0); // AA Points in Archetype ? @@ -2328,13 +2315,15 @@ namespace RoF2 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. - outapp->WriteUInt8(0); // Unknown - observed 1 in a live packet. + + outapp->WriteUInt8(0); // Unknown + outapp->WriteUInt32(0); // Unknown + outapp->WriteUInt8(0); // Unknown outapp->WriteUInt32(0); // Unknown - outapp->WriteUInt64(emu->exp); - outapp->WriteUInt8(0); // Unknown + outapp->WriteUInt64(emu->exp); // int32 in client + + outapp->WriteUInt8(0); // Unknown - Seen 5 on Live outapp->WriteUInt32(emu->platinum_bank); outapp->WriteUInt32(emu->gold_bank); @@ -2346,17 +2335,11 @@ namespace RoF2 outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown - outapp->WriteUInt32(42); // The meaning of life ? - - for (uint32 r = 0; r < 42; r++) - { - outapp->WriteUInt32(0); // Unknown - outapp->WriteUInt32(0); // Unknown - } - - outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown + outapp->WriteSInt32(-1); // Unknown + outapp->WriteSInt32(-1); // Unknown + outapp->WriteUInt32(emu->career_tribute_points); outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(emu->tribute_points); @@ -2387,13 +2370,12 @@ namespace RoF2 outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown - - - // Block of 121 unknown bytes - for (uint32 r = 0; r < 121; r++) + for (uint32 r = 0; r < 125; r++) + { outapp->WriteUInt8(0); // Unknown - + } + outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(emu->currentRadCrystals); @@ -2404,15 +2386,12 @@ namespace RoF2 outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown - // Begin RoF2 Test - //for (uint32 r = 0; r < 8000; r++) - //outapp->WriteUInt8(0); // Unknown - // End RoF2 Test - // Unknown String ? outapp->WriteUInt32(64); // Unknown for (uint32 r = 0; r < 64; r++) + { outapp->WriteUInt8(0); // Unknown + } outapp->WriteUInt8(0); // Unknown outapp->WriteUInt8(0); // Unknown @@ -2440,22 +2419,30 @@ namespace RoF2 // Unknown String ? outapp->WriteUInt32(64); // Unknown for (uint32 r = 0; r < 64; r++) + { outapp->WriteUInt8(0); // Unknown + } // Unknown String ? outapp->WriteUInt32(64); // Unknown for (uint32 r = 0; r < 64; r++) + { outapp->WriteUInt8(0); // Unknown + } outapp->WriteUInt32(0); // Unknown // Block of 320 unknown bytes for (uint32 r = 0; r < 320; r++) + { outapp->WriteUInt8(0); // Unknown + } // Block of 343 unknown bytes for (uint32 r = 0; r < 343; r++) + { outapp->WriteUInt8(0); // Unknown + } outapp->WriteUInt32(0); // Unknown @@ -2480,10 +2467,14 @@ namespace RoF2 outapp->WriteUInt32(64); // Group of 64 int32s follow Group/Raid Leadership abilities ? for (uint32 r = 0; r < MAX_LEADERSHIP_AA_ARRAY; r++) + { outapp->WriteUInt32(emu->leader_abilities.ranks[r]); + } for (uint32 r = 0; r < 64 - MAX_LEADERSHIP_AA_ARRAY; r++) + { outapp->WriteUInt32(0); // Unused/unsupported Leadership abilities + } outapp->WriteUInt32(emu->air_remaining); // ? @@ -2536,7 +2527,6 @@ namespace RoF2 outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown - outapp->WriteUInt8(emu->groupAutoconsent); outapp->WriteUInt8(emu->raidAutoconsent); outapp->WriteUInt8(emu->guildAutoconsent); @@ -2551,18 +2541,18 @@ namespace RoF2 outapp->WriteUInt32(1024); // Unknown Count - // Block of 1024 unknown bytes + outapp->WriteUInt8(31); // Unknown - for (uint32 r = 0; r < 1023; r++) + // Block of 1024 unknown bytes + for (uint32 r = 0; r < 1024; r++) + { outapp->WriteUInt8(0); // Unknown + } outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown - // Think we need 1 byte of padding at the end - - outapp->WriteUInt8(0); // Unknown _log(NET__STRUCTS, "Player Profile Packet is %i bytes", outapp->GetWritePosition()); From 8aea6da7dfa9778d7d02085f0a1479070254e9a3 Mon Sep 17 00:00:00 2001 From: Trevius Date: Thu, 18 Dec 2014 17:48:15 -0600 Subject: [PATCH 141/153] Fixed zoning after death for RoF2. --- changelog.txt | 1 + utils/patches/patch_RoF2.conf | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 9086075f0..5eec1f8af 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 12/18/2014 == Trevius: Finished lining up the RoF2 Player Profile Struct. Zone times are now normal, and everything from the PP is accurate in game now. +Trevius: Fixed zoning after death for RoF2. == 12/17/2014 == demonstar55: Use vectors for route stuff, should be more CPU cache friendly so faster diff --git a/utils/patches/patch_RoF2.conf b/utils/patches/patch_RoF2.conf index 6bc63253e..2692481a9 100644 --- a/utils/patches/patch_RoF2.conf +++ b/utils/patches/patch_RoF2.conf @@ -212,7 +212,7 @@ OP_ChannelMessage=0x2b2d OP_Assist=0x4478 OP_AssistGroup=0x27f8 OP_MoveCoin=0x0bcf -OP_ZonePlayerToBind=0x0ecb +OP_ZonePlayerToBind=0x08d8 OP_KeyRing=0x6857 OP_WhoAllRequest=0x674b OP_WhoAllResponse=0x578c @@ -318,7 +318,7 @@ OP_PVPLeaderBoardReply=0x071f OP_PVPLeaderBoardDetailsRequest=0x3707 OP_PVPLeaderBoardDetailsReply=0x25b7 OP_RestState=0x000f -OP_RespawnWindow=0x28bc +OP_RespawnWindow=0x0ecb OP_LDoNButton=0x5327 OP_SetStartCity=0x6326 OP_VoiceMacroIn=0x17fd From 1261aac03681c186c6090dc931403911d988b697 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 18 Dec 2014 18:49:57 -0500 Subject: [PATCH 142/153] Check DivineAura in TryWeaponProc, should resolve #321 --- zone/attack.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zone/attack.cpp b/zone/attack.cpp index 9ecfaa8a3..2bd3a0247 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -3934,6 +3934,11 @@ void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { return; } + if (DivineAura()) { + mlog(COMBAT__PROCS, "Procs canceled, Divine Aura is in effect."); + return; + } + if(!weapon_g) { TrySpellProc(nullptr, (const Item_Struct*)nullptr, on); return; From fce52d7186356f23cf55ae0a15402ccd0eeeacd2 Mon Sep 17 00:00:00 2001 From: Trevius Date: Fri, 19 Dec 2014 02:02:31 -0600 Subject: [PATCH 143/153] (RoF2) Fixed Leadership AA Purchasing and Recipe Search by correcting opcodes. --- changelog.txt | 3 +++ common/patches/rof2.cpp | 1 + common/patches/rof2_ops.h | 1 - utils/patches/patch_RoF2.conf | 29 ++++++++++++++--------------- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/changelog.txt b/changelog.txt index 5eec1f8af..a866613ee 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/19/2014 == +Trevius: (RoF2) Fixed Leadership AA Purchasing and Recipe Search by correcting opcodes. + == 12/18/2014 == Trevius: Finished lining up the RoF2 Player Profile Struct. Zone times are now normal, and everything from the PP is accurate in game now. Trevius: Fixed zoning after death for RoF2. diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index fff449379..c857eaccf 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -3877,6 +3877,7 @@ namespace RoF2 } // DECODE methods + DECODE(OP_AdventureMerchantSell) { DECODE_LENGTH_EXACT(structs::Adventure_Sell_Struct); diff --git a/common/patches/rof2_ops.h b/common/patches/rof2_ops.h index fbdd20575..19519212a 100644 --- a/common/patches/rof2_ops.h +++ b/common/patches/rof2_ops.h @@ -4,7 +4,6 @@ // incoming packets that require a DECODE translation: // Begin RoF2 Decodes - // End RoF2 Encodes/Decodes // These require Encodes/Decodes for RoF, so they do for RoF2 as well diff --git a/utils/patches/patch_RoF2.conf b/utils/patches/patch_RoF2.conf index 2692481a9..60b94e87d 100644 --- a/utils/patches/patch_RoF2.conf +++ b/utils/patches/patch_RoF2.conf @@ -113,7 +113,7 @@ OP_ClientUpdate=0x7dfc OP_ClientReady=0x345d OP_SetServerFilter=0x444d -# Guild Opcodes - Disabled until crashes are resolved in RoF +# Guild Opcodes OP_GetGuildMOTD=0x36e0 OP_GetGuildMOTDReply=0x4f1f OP_GuildMemberUpdate=0x69b9 @@ -121,7 +121,6 @@ OP_GuildInvite=0x7099 OP_GuildRemove=0x1444 OP_GuildPeace=0x67e3 OP_SetGuildMOTD=0x0b0b -OP_GuildList=0x6279 OP_GuildWar=0x1ffb OP_GuildLeader=0x7e09 OP_GuildDelete=0x3708 @@ -287,16 +286,16 @@ OP_ReadBook=0x72df OP_Dye=0x23b9 OP_InterruptCast=0x048c OP_AAAction=0x424e -OP_LeadershipExpToggle=0x6c55 +OP_LeadershipExpToggle=0x74bd OP_LeadershipExpUpdate=0x2797 -OP_PurchaseLeadershipAA=0x0026 -OP_UpdateLeadershipAA=0x026 -OP_MarkNPC=0x5a58 -OP_MarkRaidNPC=0x74bd #unimplemented +OP_PurchaseLeadershipAA=0x6c55 +OP_UpdateLeadershipAA=0x0026 +OP_MarkNPC=0x1fb5 +OP_MarkRaidNPC=0x5a58 #unimplemented OP_ClearNPCMarks=0x2003 OP_ClearRaidNPCMarks=0x20d3 #unimplemented -OP_DelegateAbility=0x76b8 -OP_SetGroupTarget=0x2814 +OP_DelegateAbility=0x4c9d +OP_SetGroupTarget=0x026 OP_Charm=0x5d92 OP_Stun=0x36a4 OP_SendFindableNPCs=0x4613 @@ -367,7 +366,7 @@ OP_DzExpeditionInfo=0x4f7e OP_DzExpeditionList=0x9119 OP_DzMemberStatus=0xb2e3 OP_DzLeaderStatus=0x32f0 -OP_DzExpeditionEndsWarning=0x7e94 +OP_DzExpeditionEndsWarning=0x383c OP_DzMemberList=0x3de9 OP_DzCompass=0x3e0e OP_DzChooseZone=0x0b7d @@ -445,11 +444,11 @@ OP_ShopDelItem=0x724f OP_ClickObject=0x4aa1 OP_ClickObjectAction=0x0c1e OP_ClearObject=0x7a11 -OP_RecipeDetails=0x40d7 +OP_RecipeDetails=0x6e02 OP_RecipesFavorite=0x71b1 -OP_RecipesSearch=0x1db6 -OP_RecipeReply=0x6e02 -OP_RecipeAutoCombine=0x6261 +OP_RecipesSearch=0x6290 +OP_RecipeReply=0x1db6 +OP_RecipeAutoCombine=0x40d7 OP_TradeSkillCombine=0x579a # Tribute Packets: @@ -501,7 +500,7 @@ OP_GroupDisbandOther=0x74da OP_GroupLeaderChange=0x21b4 OP_GroupRoles=0x70e2 OP_GroupMakeLeader=0x4229 -OP_DoGroupLeadershipAbility=0x1fb5 +OP_DoGroupLeadershipAbility=0x6eae OP_GroupLeadershipAAUpdate=0x02cf OP_GroupMentor=0x3342 OP_InspectBuffs=0x486c From ef287bc857cbca1c92a42aa4f6f06e380f563238 Mon Sep 17 00:00:00 2001 From: Trevius Date: Fri, 19 Dec 2014 15:46:01 -0600 Subject: [PATCH 144/153] Fixed Armor Tinting (players and NPCs) that was broken during a previous update. --- changelog.txt | 1 + common/patches/rof.cpp | 5 ----- common/patches/rof2.cpp | 5 ----- world/worlddb.cpp | 12 +++++++++++- zone/bot.cpp | 2 +- zone/client.cpp | 38 ++++++++++++-------------------------- zone/client_packet.cpp | 8 ++++++-- zone/mob.cpp | 13 ++++++++++--- zone/npc.cpp | 2 +- 9 files changed, 42 insertions(+), 44 deletions(-) diff --git a/changelog.txt b/changelog.txt index a866613ee..2ef94660d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 12/19/2014 == Trevius: (RoF2) Fixed Leadership AA Purchasing and Recipe Search by correcting opcodes. +Trevius: Fixed Armor Tinting (players and NPCs) that was broken during a previous update. == 12/18/2014 == Trevius: Finished lining up the RoF2 Player Profile Struct. Zone times are now normal, and everything from the PP is accurate in game now. diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 5fa44c743..8218f1f22 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -5061,11 +5061,6 @@ namespace RoF isbs.augslots[x].unknown = item->AugSlotUnk2[x]; } - // Increased to 6 max aug slots - //isbs.augslots[5].type = 0; - //isbs.augslots[5].visible = 1; - //isbs.augslots[5].unknown = 0; - isbs.ldonpoint_type = item->PointType; isbs.ldontheme = item->LDoNTheme; isbs.ldonprice = item->LDoNPrice; diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index c857eaccf..f1a3d8836 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -5076,11 +5076,6 @@ namespace RoF2 isbs.augslots[x].unknown = item->AugSlotUnk2[x]; } - // Increased to 6 max aug slots - //isbs.augslots[5].type = 0; - //isbs.augslots[5].visible = 1; - //isbs.augslots[5].unknown = 0; - isbs.ldonpoint_type = item->PointType; isbs.ldontheme = item->LDoNTheme; isbs.ldonprice = item->LDoNPrice; diff --git a/world/worlddb.cpp b/world/worlddb.cpp index d9315e80e..e65a3a338 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -213,11 +213,21 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, CharacterSelect_Struct* } else { + uint32 color = 0; + if (pp.item_tint[matslot].rgb.use_tint) + { + color = pp.item_tint[matslot].color; + } + else + { + color = inst->GetColor(); + } + // Armor Materials/Models cs->equip[char_num][matslot].material = item->Material; cs->equip[char_num][matslot].elitematerial = item->EliteMaterial; cs->equip[char_num][matslot].heroforgemodel = inst->GetOrnamentHeroModel(matslot); - cs->equip[char_num][matslot].color.color = inst->GetColor(); + cs->equip[char_num][matslot].color.color = color; } } } diff --git a/zone/bot.cpp b/zone/bot.cpp index 33d36d284..ef40e1bcb 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -11276,7 +11276,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) { if(!results.Success()) return; - int slotmaterial = Inventory::CalcMaterialFromSlot(setslot); + uint8 slotmaterial = Inventory::CalcMaterialFromSlot(setslot); c->GetTarget()->CastToBot()->SendWearChange(slotmaterial); } else { diff --git a/zone/client.cpp b/zone/client.cpp index d2349e02a..181589bf5 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -2685,8 +2685,11 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id) { const Item_Struct* item = database.GetItem(item_id); if (item && (item->ItemClass==ItemClassCommon)) { - uint32 matslot = Inventory::CalcMaterialFromSlot(in_slot); - m_pp.item_material[matslot] = GetEquipmentMaterial(matslot); + uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot); + if (matslot != _MaterialInvalid) + { + m_pp.item_material[matslot] = GetEquipmentMaterial(matslot); + } } } @@ -3016,31 +3019,14 @@ void Client::SetTint(int16 in_slot, uint32 color) { // Still need to reconcile bracer01 versus bracer02 void Client::SetTint(int16 in_slot, Color_Struct& color) { - if (in_slot==MainHead) - m_pp.item_tint[MaterialHead].color=color.color; - else if (in_slot==MainArms) - m_pp.item_tint[MaterialArms].color=color.color; - else if (in_slot==MainWrist1) - m_pp.item_tint[MaterialWrist].color=color.color; - /* - // non-live behavior - else if (in_slot==SLOT_BRACER02) - m_pp.item_tint[MaterialWrist].color=color.color; - */ - else if (in_slot==MainHands) - m_pp.item_tint[MaterialHands].color=color.color; - else if (in_slot==MainPrimary) - m_pp.item_tint[MaterialPrimary].color=color.color; - else if (in_slot==MainSecondary) - m_pp.item_tint[MaterialSecondary].color=color.color; - else if (in_slot==MainChest) - m_pp.item_tint[MaterialChest].color=color.color; - else if (in_slot==MainLegs) - m_pp.item_tint[MaterialLegs].color=color.color; - else if (in_slot==MainFeet) - m_pp.item_tint[MaterialFeet].color=color.color; - database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color.color); + uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot); + if (matslot != _MaterialInvalid) + { + m_pp.item_tint[matslot].color = color.color; + database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color.color); + } + } void Client::SetHideMe(bool flag) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index fa6b4f249..6d032fed2 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1425,8 +1425,12 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) /* Set item material tint */ for (int i = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_END; i++) - if (m_pp.item_tint[i].rgb.use_tint == 1 || m_pp.item_tint[i].rgb.use_tint == 255) - m_pp.item_tint[i].rgb.use_tint = 0xFF; + { + if (m_pp.item_tint[i].rgb.use_tint == 1 || m_pp.item_tint[i].rgb.use_tint == 255) + { + m_pp.item_tint[i].rgb.use_tint = 0xFF; + } + } if (level){ level = m_pp.level; } diff --git a/zone/mob.cpp b/zone/mob.cpp index af7c5a8c7..d031564dd 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -2781,10 +2781,17 @@ uint32 Mob::GetEquipmentColor(uint8 material_slot) const { const Item_Struct *item; - item = database.GetItem(GetEquipment(material_slot)); - if(item != 0) + if (armor_tint[material_slot]) { - return item->Color; + return armor_tint[material_slot]; + } + else + { + item = database.GetItem(GetEquipment(material_slot)); + if (item != 0) + { + return item->Color; + } } return 0; diff --git a/zone/npc.cpp b/zone/npc.cpp index d9833d856..ddfd1b243 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -476,7 +476,7 @@ void NPC::CheckMinMaxLevel(Mob *them) if(themlevel < (*cur)->min_level || themlevel > (*cur)->max_level) { material = Inventory::CalcMaterialFromSlot((*cur)->equip_slot); - if(material != 0xFF) + if (material != _MaterialInvalid) SendWearChange(material); cur = itemlist.erase(cur); From dabe55096698b378c9ee049599c12977811c58b9 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 19 Dec 2014 17:22:05 -0500 Subject: [PATCH 145/153] Fix eq_dictionary.cpp from 62 removal Note: 62 references in clientversion.h need to be cleaned up before we can remove them from other files --- common/eq_dictionary.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/eq_dictionary.cpp b/common/eq_dictionary.cpp index 37414853e..46c8f4ff1 100644 --- a/common/eq_dictionary.cpp +++ b/common/eq_dictionary.cpp @@ -548,6 +548,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapBank] /*Unknown*/ NOT_USED, +/*62*/ NOT_USED, /*Titanium*/ Titanium::consts::MAP_BANK_SIZE, /*SoF*/ EmuConstants::MAP_BANK_SIZE, /*SoD*/ EmuConstants::MAP_BANK_SIZE, @@ -697,6 +698,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapCorpse] /*Unknown*/ NOT_USED, +/*62*/ NOT_USED, /*Titanium*/ Titanium::consts::MAP_CORPSE_SIZE, /*SoF*/ SoF::consts::MAP_CORPSE_SIZE, /*SoD*/ SoD::consts::MAP_CORPSE_SIZE, @@ -726,6 +728,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapInspect] /*Unknown*/ NOT_USED, +/*62*/ NOT_USED, /*Titanium*/ Titanium::consts::MAP_INSPECT_SIZE, /*SoF*/ SoF::consts::MAP_INSPECT_SIZE, /*SoD*/ SoD::consts::MAP_INSPECT_SIZE, @@ -1003,6 +1006,7 @@ uint64 EQLimits::CursorBitmask(uint32 version) { bool EQLimits::AllowsEmptyBagInBag(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ false, +/*62*/ false, /*Titanium*/ Titanium::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*SoF*/ SoF::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*SoD*/ SoD::limits::ALLOWS_EMPTY_BAG_IN_BAG, @@ -1023,6 +1027,8 @@ bool EQLimits::AllowsEmptyBagInBag(uint32 version) { bool EQLimits::AllowsClickCastFromBag(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ false, +/*62*/ false, +/*Titanium*/ Titanium::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*SoF*/ SoF::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*SoD*/ SoD::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*Underfoot*/ Underfoot::limits::ALLOWS_CLICK_CAST_FROM_BAG, @@ -1082,6 +1088,7 @@ uint16 EQLimits::ItemContainerSize(uint32 version) { bool EQLimits::CoinHasWeight(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ true, +/*62*/ true, /*Titanium*/ Titanium::limits::COIN_HAS_WEIGHT, /*SoF*/ SoF::limits::COIN_HAS_WEIGHT, /*SoD*/ SoD::limits::COIN_HAS_WEIGHT, From da75007b0f92deb5615ebaa1addef5dd67be27f9 Mon Sep 17 00:00:00 2001 From: Trevius Date: Fri, 19 Dec 2014 19:42:55 -0600 Subject: [PATCH 146/153] (RoF2) Fixed Rest Timer, Show Helm Option, Auto-Consent Options, and identified Krono in the PP. --- changelog.txt | 1 + common/patches/rof2.cpp | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/changelog.txt b/changelog.txt index 2ef94660d..e4d25c545 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) == 12/19/2014 == Trevius: (RoF2) Fixed Leadership AA Purchasing and Recipe Search by correcting opcodes. Trevius: Fixed Armor Tinting (players and NPCs) that was broken during a previous update. +Trevius: (RoF2) Fixed Rest Timer, Show Helm Option, Auto-Consent Options, and identified Krono in the PP. == 12/18/2014 == Trevius: Finished lining up the RoF2 Player Profile Struct. Zone times are now normal, and everything from the PP is accurate in game now. diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index f1a3d8836..f175c3edc 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -2527,23 +2527,21 @@ namespace RoF2 outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown + outapp->WriteUInt32(0); // Unknown + outapp->WriteUInt32(0); // Krono - itemid 88888 Hard coded in client? + outapp->WriteUInt8(emu->groupAutoconsent); outapp->WriteUInt8(emu->raidAutoconsent); outapp->WriteUInt8(emu->guildAutoconsent); - outapp->WriteUInt8(0); // Unknown - outapp->WriteUInt32(emu->level); // Level3 ? + outapp->WriteUInt32(emu->level); // Level3 ? outapp->WriteUInt8(emu->showhelm); outapp->WriteUInt32(emu->RestTimer); outapp->WriteUInt32(1024); // Unknown Count - - - outapp->WriteUInt8(31); // Unknown - // Block of 1024 unknown bytes for (uint32 r = 0; r < 1024; r++) { From d4506363b8b1d3e136f122b066d87494a6c8fdc0 Mon Sep 17 00:00:00 2001 From: Uleat Date: Fri, 19 Dec 2014 21:25:44 -0500 Subject: [PATCH 147/153] Cleared clientversions.h and eq_dictionary files of Client6.2 references --- changelog.txt | 1 + common/clientversions.h | 3 --- common/eq_dictionary.cpp | 37 ------------------------------------- common/eq_dictionary.h | 2 +- 4 files changed, 2 insertions(+), 41 deletions(-) diff --git a/changelog.txt b/changelog.txt index e4d25c545..f4f756b83 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) Trevius: (RoF2) Fixed Leadership AA Purchasing and Recipe Search by correcting opcodes. Trevius: Fixed Armor Tinting (players and NPCs) that was broken during a previous update. Trevius: (RoF2) Fixed Rest Timer, Show Helm Option, Auto-Consent Options, and identified Krono in the PP. +Uleat: Cleaned out clientversions.h and eq_dictionary files of 6.2 references == 12/18/2014 == Trevius: Finished lining up the RoF2 Player Profile Struct. Zone times are now normal, and everything from the PP is accurate in game now. diff --git a/common/clientversions.h b/common/clientversions.h index ee70d481c..81e12450e 100644 --- a/common/clientversions.h +++ b/common/clientversions.h @@ -20,7 +20,6 @@ static const uint32 BIT_AllClients = 0xFFFFFFFF; typedef enum { EQClientUnknown = 0, - EQClient62, // Build: 'Aug 4 2005 15:40:59' EQClientTitanium, // Build: 'Oct 31 2005 10:33:37' EQClientSoF, // Build: 'Sep 7 2007 09:11:49' EQClientSoD, // Build: 'Dec 19 2008 15:22:49' @@ -46,8 +45,6 @@ static const char* EQClientVersionName(EQClientVersion version) { case EQClientUnknown: return "EQClientUnknown"; - case EQClient62: - return "EQClient62"; case EQClientTitanium: return "EQClientTitanium"; case EQClientSoF: diff --git a/common/eq_dictionary.cpp b/common/eq_dictionary.cpp index 46c8f4ff1..e3de89c76 100644 --- a/common/eq_dictionary.cpp +++ b/common/eq_dictionary.cpp @@ -533,7 +533,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { // for partial range validation checks and 'EmuConstants::MAP_POSSESSIONS_SIZE' for full range iterations { // local[MainPossessions] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_POSSESSIONS_SIZE, /*Titanium*/ EmuConstants::MAP_POSSESSIONS_SIZE, /*SoF*/ EmuConstants::MAP_POSSESSIONS_SIZE, /*SoD*/ EmuConstants::MAP_POSSESSIONS_SIZE, @@ -548,7 +547,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapBank] /*Unknown*/ NOT_USED, -/*62*/ NOT_USED, /*Titanium*/ Titanium::consts::MAP_BANK_SIZE, /*SoF*/ EmuConstants::MAP_BANK_SIZE, /*SoD*/ EmuConstants::MAP_BANK_SIZE, @@ -563,7 +561,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapSharedBank] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_SHARED_BANK_SIZE, /*Titanium*/ EmuConstants::MAP_SHARED_BANK_SIZE, /*SoF*/ EmuConstants::MAP_SHARED_BANK_SIZE, /*SoD*/ EmuConstants::MAP_SHARED_BANK_SIZE, @@ -578,7 +575,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapTrade] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_TRADE_SIZE, /*Titanium*/ EmuConstants::MAP_TRADE_SIZE, /*SoF*/ EmuConstants::MAP_TRADE_SIZE, /*SoD*/ EmuConstants::MAP_TRADE_SIZE, @@ -593,7 +589,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapWorld] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_WORLD_SIZE, /*Titanium*/ EmuConstants::MAP_WORLD_SIZE, /*SoF*/ EmuConstants::MAP_WORLD_SIZE, /*SoD*/ EmuConstants::MAP_WORLD_SIZE, @@ -608,7 +603,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapLimbo] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_LIMBO_SIZE, /*Titanium*/ EmuConstants::MAP_LIMBO_SIZE, /*SoF*/ EmuConstants::MAP_LIMBO_SIZE, /*SoD*/ EmuConstants::MAP_LIMBO_SIZE, @@ -623,7 +617,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapTribute] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_TRIBUTE_SIZE, /*Titanium*/ EmuConstants::MAP_TRIBUTE_SIZE, /*SoF*/ EmuConstants::MAP_TRIBUTE_SIZE, /*SoD*/ EmuConstants::MAP_TRIBUTE_SIZE, @@ -638,7 +631,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapTrophyTribute] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -653,7 +645,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapGuildTribute] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -668,7 +659,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapMerchant] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -683,7 +673,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapDeleted] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -698,7 +687,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapCorpse] /*Unknown*/ NOT_USED, -/*62*/ NOT_USED, /*Titanium*/ Titanium::consts::MAP_CORPSE_SIZE, /*SoF*/ SoF::consts::MAP_CORPSE_SIZE, /*SoD*/ SoD::consts::MAP_CORPSE_SIZE, @@ -713,7 +701,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapBazaar] /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::MAP_BAZAAR_SIZE, /*Titanium*/ EmuConstants::MAP_BAZAAR_SIZE, /*SoF*/ EmuConstants::MAP_BAZAAR_SIZE, /*SoD*/ EmuConstants::MAP_BAZAAR_SIZE, @@ -728,7 +715,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapInspect] /*Unknown*/ NOT_USED, -/*62*/ NOT_USED, /*Titanium*/ Titanium::consts::MAP_INSPECT_SIZE, /*SoF*/ SoF::consts::MAP_INSPECT_SIZE, /*SoD*/ SoD::consts::MAP_INSPECT_SIZE, @@ -743,7 +729,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapRealEstate] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -758,7 +743,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapViewMODPC] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -773,7 +757,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapViewMODBank] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -788,7 +771,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapViewMODSharedBank] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -803,7 +785,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapViewMODLimbo] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -818,7 +799,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapAltStorage] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -833,7 +813,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapArchived] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -848,7 +827,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapMail] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -863,7 +841,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapGuildTrophyTribute] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -878,7 +855,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapKrono] /*Unknown*/ NOT_USED, -/*62*/ NOT_USED, /*Titanium*/ NOT_USED, /*SoF*/ NOT_USED, /*SoD*/ NOT_USED, @@ -893,7 +869,6 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapOther] /*Unknown*/ NOT_USED, -/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -922,7 +897,6 @@ uint64 EQLimits::PossessionsBitmask(uint32 version) { static const uint64 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, -/*62*/ 0x000000027FDFFFFF, /*Titanium*/ 0x000000027FDFFFFF, /*SoF*/ 0x000000027FFFFFFF, /*SoD*/ 0x000000027FFFFFFF, @@ -943,7 +917,6 @@ uint64 EQLimits::PossessionsBitmask(uint32 version) { uint64 EQLimits::EquipmentBitmask(uint32 version) { static const uint64 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, -/*62*/ 0x00000000005FFFFF, /*Titanium*/ 0x00000000005FFFFF, /*SoF*/ 0x00000000007FFFFF, /*SoD*/ 0x00000000007FFFFF, @@ -964,7 +937,6 @@ uint64 EQLimits::EquipmentBitmask(uint32 version) { uint64 EQLimits::GeneralBitmask(uint32 version) { static const uint64 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, -/*62*/ 0x000000007F800000, /*Titanium*/ 0x000000007F800000, /*SoF*/ 0x000000007F800000, /*SoD*/ 0x000000007F800000, @@ -985,7 +957,6 @@ uint64 EQLimits::GeneralBitmask(uint32 version) { uint64 EQLimits::CursorBitmask(uint32 version) { static const uint64 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, -/*62*/ 0x0000000200000000, /*Titanium*/ 0x0000000200000000, /*SoF*/ 0x0000000200000000, /*SoD*/ 0x0000000200000000, @@ -1006,7 +977,6 @@ uint64 EQLimits::CursorBitmask(uint32 version) { bool EQLimits::AllowsEmptyBagInBag(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ false, -/*62*/ false, /*Titanium*/ Titanium::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*SoF*/ SoF::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*SoD*/ SoD::limits::ALLOWS_EMPTY_BAG_IN_BAG, @@ -1027,7 +997,6 @@ bool EQLimits::AllowsEmptyBagInBag(uint32 version) { bool EQLimits::AllowsClickCastFromBag(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ false, -/*62*/ false, /*Titanium*/ Titanium::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*SoF*/ SoF::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*SoD*/ SoD::limits::ALLOWS_CLICK_CAST_FROM_BAG, @@ -1048,7 +1017,6 @@ bool EQLimits::AllowsClickCastFromBag(uint32 version) { uint16 EQLimits::ItemCommonSize(uint32 version) { static const uint16 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::ITEM_COMMON_SIZE, /*Titanium*/ EmuConstants::ITEM_COMMON_SIZE, /*SoF*/ EmuConstants::ITEM_COMMON_SIZE, /*SoD*/ EmuConstants::ITEM_COMMON_SIZE, @@ -1068,7 +1036,6 @@ uint16 EQLimits::ItemCommonSize(uint32 version) { uint16 EQLimits::ItemContainerSize(uint32 version) { static const uint16 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::ITEM_CONTAINER_SIZE, /*Titanium*/ EmuConstants::ITEM_CONTAINER_SIZE, /*SoF*/ EmuConstants::ITEM_CONTAINER_SIZE, /*SoD*/ EmuConstants::ITEM_CONTAINER_SIZE, @@ -1088,7 +1055,6 @@ uint16 EQLimits::ItemContainerSize(uint32 version) { bool EQLimits::CoinHasWeight(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ true, -/*62*/ true, /*Titanium*/ Titanium::limits::COIN_HAS_WEIGHT, /*SoF*/ SoF::limits::COIN_HAS_WEIGHT, /*SoD*/ SoD::limits::COIN_HAS_WEIGHT, @@ -1108,7 +1074,6 @@ bool EQLimits::CoinHasWeight(uint32 version) { uint32 EQLimits::BandoliersCount(uint32 version) { static const uint32 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::BANDOLIERS_COUNT, /*Titanium*/ EmuConstants::BANDOLIERS_COUNT, /*SoF*/ EmuConstants::BANDOLIERS_COUNT, /*SoD*/ EmuConstants::BANDOLIERS_COUNT, @@ -1128,7 +1093,6 @@ uint32 EQLimits::BandoliersCount(uint32 version) { uint32 EQLimits::BandolierSize(uint32 version) { static const uint32 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::BANDOLIER_SIZE, /*Titanium*/ EmuConstants::BANDOLIER_SIZE, /*SoF*/ EmuConstants::BANDOLIER_SIZE, /*SoD*/ EmuConstants::BANDOLIER_SIZE, @@ -1148,7 +1112,6 @@ uint32 EQLimits::BandolierSize(uint32 version) { uint32 EQLimits::PotionBeltSize(uint32 version) { static const uint32 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, -/*62*/ EmuConstants::POTION_BELT_SIZE, /*Titanium*/ EmuConstants::POTION_BELT_SIZE, /*SoF*/ EmuConstants::POTION_BELT_SIZE, /*SoD*/ EmuConstants::POTION_BELT_SIZE, diff --git a/common/eq_dictionary.h b/common/eq_dictionary.h index 43511072f..370c1f253 100644 --- a/common/eq_dictionary.h +++ b/common/eq_dictionary.h @@ -46,7 +46,7 @@ class EmuConstants { // an immutable value is required to initialize arrays, etc... use this class as a repository for those public: // database - static const EQClientVersion CHARACTER_CREATION_CLIENT = EQClientRoF; // adjust according to starting item placement and target client + static const EQClientVersion CHARACTER_CREATION_CLIENT = EQClientRoF2; // adjust according to starting item placement and target client // inventory static uint16 InventoryMapSize(int16 map); From cedec3d8722f60da6e680aefe4b5a44c10ad6589 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 19 Dec 2014 23:08:44 -0500 Subject: [PATCH 148/153] Revert "Cleared clientversions.h and eq_dictionary files of Client6.2 references" This reverts commit d4506363b8b1d3e136f122b066d87494a6c8fdc0. --- changelog.txt | 1 - common/clientversions.h | 3 +++ common/eq_dictionary.cpp | 37 +++++++++++++++++++++++++++++++++++++ common/eq_dictionary.h | 2 +- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index f4f756b83..e4d25c545 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,7 +4,6 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) Trevius: (RoF2) Fixed Leadership AA Purchasing and Recipe Search by correcting opcodes. Trevius: Fixed Armor Tinting (players and NPCs) that was broken during a previous update. Trevius: (RoF2) Fixed Rest Timer, Show Helm Option, Auto-Consent Options, and identified Krono in the PP. -Uleat: Cleaned out clientversions.h and eq_dictionary files of 6.2 references == 12/18/2014 == Trevius: Finished lining up the RoF2 Player Profile Struct. Zone times are now normal, and everything from the PP is accurate in game now. diff --git a/common/clientversions.h b/common/clientversions.h index 81e12450e..ee70d481c 100644 --- a/common/clientversions.h +++ b/common/clientversions.h @@ -20,6 +20,7 @@ static const uint32 BIT_AllClients = 0xFFFFFFFF; typedef enum { EQClientUnknown = 0, + EQClient62, // Build: 'Aug 4 2005 15:40:59' EQClientTitanium, // Build: 'Oct 31 2005 10:33:37' EQClientSoF, // Build: 'Sep 7 2007 09:11:49' EQClientSoD, // Build: 'Dec 19 2008 15:22:49' @@ -45,6 +46,8 @@ static const char* EQClientVersionName(EQClientVersion version) { case EQClientUnknown: return "EQClientUnknown"; + case EQClient62: + return "EQClient62"; case EQClientTitanium: return "EQClientTitanium"; case EQClientSoF: diff --git a/common/eq_dictionary.cpp b/common/eq_dictionary.cpp index e3de89c76..46c8f4ff1 100644 --- a/common/eq_dictionary.cpp +++ b/common/eq_dictionary.cpp @@ -533,6 +533,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { // for partial range validation checks and 'EmuConstants::MAP_POSSESSIONS_SIZE' for full range iterations { // local[MainPossessions] /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::MAP_POSSESSIONS_SIZE, /*Titanium*/ EmuConstants::MAP_POSSESSIONS_SIZE, /*SoF*/ EmuConstants::MAP_POSSESSIONS_SIZE, /*SoD*/ EmuConstants::MAP_POSSESSIONS_SIZE, @@ -547,6 +548,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapBank] /*Unknown*/ NOT_USED, +/*62*/ NOT_USED, /*Titanium*/ Titanium::consts::MAP_BANK_SIZE, /*SoF*/ EmuConstants::MAP_BANK_SIZE, /*SoD*/ EmuConstants::MAP_BANK_SIZE, @@ -561,6 +563,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapSharedBank] /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::MAP_SHARED_BANK_SIZE, /*Titanium*/ EmuConstants::MAP_SHARED_BANK_SIZE, /*SoF*/ EmuConstants::MAP_SHARED_BANK_SIZE, /*SoD*/ EmuConstants::MAP_SHARED_BANK_SIZE, @@ -575,6 +578,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapTrade] /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::MAP_TRADE_SIZE, /*Titanium*/ EmuConstants::MAP_TRADE_SIZE, /*SoF*/ EmuConstants::MAP_TRADE_SIZE, /*SoD*/ EmuConstants::MAP_TRADE_SIZE, @@ -589,6 +593,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapWorld] /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::MAP_WORLD_SIZE, /*Titanium*/ EmuConstants::MAP_WORLD_SIZE, /*SoF*/ EmuConstants::MAP_WORLD_SIZE, /*SoD*/ EmuConstants::MAP_WORLD_SIZE, @@ -603,6 +608,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapLimbo] /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::MAP_LIMBO_SIZE, /*Titanium*/ EmuConstants::MAP_LIMBO_SIZE, /*SoF*/ EmuConstants::MAP_LIMBO_SIZE, /*SoD*/ EmuConstants::MAP_LIMBO_SIZE, @@ -617,6 +623,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapTribute] /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::MAP_TRIBUTE_SIZE, /*Titanium*/ EmuConstants::MAP_TRIBUTE_SIZE, /*SoF*/ EmuConstants::MAP_TRIBUTE_SIZE, /*SoD*/ EmuConstants::MAP_TRIBUTE_SIZE, @@ -631,6 +638,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapTrophyTribute] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -645,6 +653,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapGuildTribute] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -659,6 +668,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapMerchant] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -673,6 +683,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapDeleted] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -687,6 +698,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapCorpse] /*Unknown*/ NOT_USED, +/*62*/ NOT_USED, /*Titanium*/ Titanium::consts::MAP_CORPSE_SIZE, /*SoF*/ SoF::consts::MAP_CORPSE_SIZE, /*SoD*/ SoD::consts::MAP_CORPSE_SIZE, @@ -701,6 +713,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapBazaar] /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::MAP_BAZAAR_SIZE, /*Titanium*/ EmuConstants::MAP_BAZAAR_SIZE, /*SoF*/ EmuConstants::MAP_BAZAAR_SIZE, /*SoD*/ EmuConstants::MAP_BAZAAR_SIZE, @@ -715,6 +728,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapInspect] /*Unknown*/ NOT_USED, +/*62*/ NOT_USED, /*Titanium*/ Titanium::consts::MAP_INSPECT_SIZE, /*SoF*/ SoF::consts::MAP_INSPECT_SIZE, /*SoD*/ SoD::consts::MAP_INSPECT_SIZE, @@ -729,6 +743,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapRealEstate] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -743,6 +758,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapViewMODPC] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -757,6 +773,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapViewMODBank] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -771,6 +788,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapViewMODSharedBank] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -785,6 +803,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapViewMODLimbo] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -799,6 +818,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapAltStorage] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -813,6 +833,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapArchived] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -827,6 +848,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapMail] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -841,6 +863,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapGuildTrophyTribute] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -855,6 +878,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapKrono] /*Unknown*/ NOT_USED, +/*62*/ NOT_USED, /*Titanium*/ NOT_USED, /*SoF*/ NOT_USED, /*SoD*/ NOT_USED, @@ -869,6 +893,7 @@ uint16 EQLimits::InventoryMapSize(int16 map, uint32 version) { }, { // local[MapOther] /*Unknown*/ NOT_USED, +/*62*/ 0, /*Titanium*/ 0, /*SoF*/ 0, /*SoD*/ 0, @@ -897,6 +922,7 @@ uint64 EQLimits::PossessionsBitmask(uint32 version) { static const uint64 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, +/*62*/ 0x000000027FDFFFFF, /*Titanium*/ 0x000000027FDFFFFF, /*SoF*/ 0x000000027FFFFFFF, /*SoD*/ 0x000000027FFFFFFF, @@ -917,6 +943,7 @@ uint64 EQLimits::PossessionsBitmask(uint32 version) { uint64 EQLimits::EquipmentBitmask(uint32 version) { static const uint64 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, +/*62*/ 0x00000000005FFFFF, /*Titanium*/ 0x00000000005FFFFF, /*SoF*/ 0x00000000007FFFFF, /*SoD*/ 0x00000000007FFFFF, @@ -937,6 +964,7 @@ uint64 EQLimits::EquipmentBitmask(uint32 version) { uint64 EQLimits::GeneralBitmask(uint32 version) { static const uint64 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, +/*62*/ 0x000000007F800000, /*Titanium*/ 0x000000007F800000, /*SoF*/ 0x000000007F800000, /*SoD*/ 0x000000007F800000, @@ -957,6 +985,7 @@ uint64 EQLimits::GeneralBitmask(uint32 version) { uint64 EQLimits::CursorBitmask(uint32 version) { static const uint64 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, +/*62*/ 0x0000000200000000, /*Titanium*/ 0x0000000200000000, /*SoF*/ 0x0000000200000000, /*SoD*/ 0x0000000200000000, @@ -977,6 +1006,7 @@ uint64 EQLimits::CursorBitmask(uint32 version) { bool EQLimits::AllowsEmptyBagInBag(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ false, +/*62*/ false, /*Titanium*/ Titanium::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*SoF*/ SoF::limits::ALLOWS_EMPTY_BAG_IN_BAG, /*SoD*/ SoD::limits::ALLOWS_EMPTY_BAG_IN_BAG, @@ -997,6 +1027,7 @@ bool EQLimits::AllowsEmptyBagInBag(uint32 version) { bool EQLimits::AllowsClickCastFromBag(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ false, +/*62*/ false, /*Titanium*/ Titanium::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*SoF*/ SoF::limits::ALLOWS_CLICK_CAST_FROM_BAG, /*SoD*/ SoD::limits::ALLOWS_CLICK_CAST_FROM_BAG, @@ -1017,6 +1048,7 @@ bool EQLimits::AllowsClickCastFromBag(uint32 version) { uint16 EQLimits::ItemCommonSize(uint32 version) { static const uint16 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::ITEM_COMMON_SIZE, /*Titanium*/ EmuConstants::ITEM_COMMON_SIZE, /*SoF*/ EmuConstants::ITEM_COMMON_SIZE, /*SoD*/ EmuConstants::ITEM_COMMON_SIZE, @@ -1036,6 +1068,7 @@ uint16 EQLimits::ItemCommonSize(uint32 version) { uint16 EQLimits::ItemContainerSize(uint32 version) { static const uint16 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::ITEM_CONTAINER_SIZE, /*Titanium*/ EmuConstants::ITEM_CONTAINER_SIZE, /*SoF*/ EmuConstants::ITEM_CONTAINER_SIZE, /*SoD*/ EmuConstants::ITEM_CONTAINER_SIZE, @@ -1055,6 +1088,7 @@ uint16 EQLimits::ItemContainerSize(uint32 version) { bool EQLimits::CoinHasWeight(uint32 version) { static const bool local[_EmuClientCount] = { /*Unknown*/ true, +/*62*/ true, /*Titanium*/ Titanium::limits::COIN_HAS_WEIGHT, /*SoF*/ SoF::limits::COIN_HAS_WEIGHT, /*SoD*/ SoD::limits::COIN_HAS_WEIGHT, @@ -1074,6 +1108,7 @@ bool EQLimits::CoinHasWeight(uint32 version) { uint32 EQLimits::BandoliersCount(uint32 version) { static const uint32 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::BANDOLIERS_COUNT, /*Titanium*/ EmuConstants::BANDOLIERS_COUNT, /*SoF*/ EmuConstants::BANDOLIERS_COUNT, /*SoD*/ EmuConstants::BANDOLIERS_COUNT, @@ -1093,6 +1128,7 @@ uint32 EQLimits::BandoliersCount(uint32 version) { uint32 EQLimits::BandolierSize(uint32 version) { static const uint32 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::BANDOLIER_SIZE, /*Titanium*/ EmuConstants::BANDOLIER_SIZE, /*SoF*/ EmuConstants::BANDOLIER_SIZE, /*SoD*/ EmuConstants::BANDOLIER_SIZE, @@ -1112,6 +1148,7 @@ uint32 EQLimits::BandolierSize(uint32 version) { uint32 EQLimits::PotionBeltSize(uint32 version) { static const uint32 local[_EmuClientCount] = { /*Unknown*/ NOT_USED, +/*62*/ EmuConstants::POTION_BELT_SIZE, /*Titanium*/ EmuConstants::POTION_BELT_SIZE, /*SoF*/ EmuConstants::POTION_BELT_SIZE, /*SoD*/ EmuConstants::POTION_BELT_SIZE, diff --git a/common/eq_dictionary.h b/common/eq_dictionary.h index 370c1f253..43511072f 100644 --- a/common/eq_dictionary.h +++ b/common/eq_dictionary.h @@ -46,7 +46,7 @@ class EmuConstants { // an immutable value is required to initialize arrays, etc... use this class as a repository for those public: // database - static const EQClientVersion CHARACTER_CREATION_CLIENT = EQClientRoF2; // adjust according to starting item placement and target client + static const EQClientVersion CHARACTER_CREATION_CLIENT = EQClientRoF; // adjust according to starting item placement and target client // inventory static uint16 InventoryMapSize(int16 map); From 4ef3c7a9f40e523103991f4970a61a69da712061 Mon Sep 17 00:00:00 2001 From: Trevius Date: Fri, 19 Dec 2014 23:20:10 -0600 Subject: [PATCH 149/153] Fixed Selling for Alternate Currency Merchants for RoF and RoF2. --- changelog.txt | 1 + common/patches/rof.cpp | 6 +++--- common/patches/rof2.cpp | 6 +++--- common/patches/rof2_structs.h | 24 ++++++++++++------------ common/patches/rof_structs.h | 6 ++---- common/patches/underfoot_structs.h | 4 ++-- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/changelog.txt b/changelog.txt index e4d25c545..e9e0946d8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) Trevius: (RoF2) Fixed Leadership AA Purchasing and Recipe Search by correcting opcodes. Trevius: Fixed Armor Tinting (players and NPCs) that was broken during a previous update. Trevius: (RoF2) Fixed Rest Timer, Show Helm Option, Auto-Consent Options, and identified Krono in the PP. +Trevius: Fixed Selling for Alternate Currency Merchants for RoF and RoF2. == 12/18/2014 == Trevius: Finished lining up the RoF2 Player Profile Struct. Zone times are now normal, and everything from the PP is accurate in game now. diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 8218f1f22..ad6fb95d6 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -205,7 +205,7 @@ namespace RoF SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct); OUT(merchant_entity_id); - eq->slot_id = ServerToRoFSlot(emu->slot_id); + eq->slot_id = ServerToRoFMainInvSlot(emu->slot_id); OUT(charges); OUT(cost); @@ -3881,7 +3881,7 @@ namespace RoF SETUP_DIRECT_DECODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct); IN(merchant_entity_id); - emu->slot_id = RoFToServerSlot(eq->slot_id); + emu->slot_id = RoFToServerMainInvSlot(eq->slot_id); IN(charges); IN(cost); @@ -3894,7 +3894,7 @@ namespace RoF SETUP_DIRECT_DECODE(AltCurrencySelectItem_Struct, structs::AltCurrencySelectItem_Struct); IN(merchant_entity_id); - emu->slot_id = RoFToServerSlot(eq->slot_id); + emu->slot_id = RoFToServerMainInvSlot(eq->slot_id); FINISH_DIRECT_DECODE(); } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index f175c3edc..d49f00253 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -205,7 +205,7 @@ namespace RoF2 SETUP_DIRECT_ENCODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct); OUT(merchant_entity_id); - eq->slot_id = ServerToRoF2Slot(emu->slot_id); + eq->slot_id = ServerToRoF2MainInvSlot(emu->slot_id); OUT(charges); OUT(cost); @@ -3895,7 +3895,7 @@ namespace RoF2 SETUP_DIRECT_DECODE(AltCurrencySellItem_Struct, structs::AltCurrencySellItem_Struct); IN(merchant_entity_id); - emu->slot_id = RoF2ToServerSlot(eq->slot_id); + emu->slot_id = RoF2ToServerMainInvSlot(eq->slot_id); IN(charges); IN(cost); @@ -3908,7 +3908,7 @@ namespace RoF2 SETUP_DIRECT_DECODE(AltCurrencySelectItem_Struct, structs::AltCurrencySelectItem_Struct); IN(merchant_entity_id); - emu->slot_id = RoF2ToServerSlot(eq->slot_id); + emu->slot_id = RoF2ToServerMainInvSlot(eq->slot_id); FINISH_DIRECT_DECODE(); } diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index efd80d0e8..6776ff0e7 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -2180,8 +2180,8 @@ struct AltCurrencyUpdate_Struct { //When an item is selected while the alt currency merchant window is open struct AltCurrencySelectItem_Struct { /*000*/ uint32 merchant_entity_id; +/*004*/ MainInvItemSlotStruct slot_id; /*004*/ //uint32 slot_id; - ItemSlotStruct slot_id; /*008*/ uint32 unknown008; /*012*/ uint32 unknown012; /*016*/ uint32 unknown016; @@ -2238,10 +2238,10 @@ struct AltCurrencyReclaim_Struct { struct AltCurrencySellItem_Struct { /*000*/ uint32 merchant_entity_id; +/*004*/ MainInvItemSlotStruct slot_id; /*004*/ //uint32 slot_id; - ItemSlotStruct slot_id; -/*008*/ uint32 charges; -/*012*/ uint32 cost; +/*016*/ uint32 charges; +/*020*/ uint32 cost; }; struct Adventure_Purchase_Struct { @@ -2261,14 +2261,14 @@ struct Adventure_Sell_Struct { }; struct AdventurePoints_Update_Struct { -/*000*/ uint32 ldon_available_points; // Total available points -/*004*/ uint8 unkown_apu004[20]; -/*024*/ uint32 ldon_guk_points; // Earned Deepest Guk points -/*028*/ uint32 ldon_mirugal_points; // Earned Mirugal' Mebagerie points -/*032*/ uint32 ldon_mistmoore_points; // Earned Mismoore Catacombs Points -/*036*/ uint32 ldon_rujarkian_points; // Earned Rujarkian Hills points -/*040*/ uint32 ldon_takish_points; // Earned Takish points -/*044*/ uint8 unknown_apu042[216]; +/*000*/ uint32 ldon_available_points; // Total available points +/*004*/ uint8 unkown_apu004[20]; +/*024*/ uint32 ldon_guk_points; // Earned Deepest Guk points +/*028*/ uint32 ldon_mirugal_points; // Earned Mirugal' Mebagerie points +/*032*/ uint32 ldon_mistmoore_points; // Earned Mismoore Catacombs Points +/*036*/ uint32 ldon_rujarkian_points; // Earned Rujarkian Hills points +/*040*/ uint32 ldon_takish_points; // Earned Takish points +/*044*/ uint8 unknown_apu042[216]; }; diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index a7b494d0d..c84a670a9 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -2174,8 +2174,7 @@ struct AltCurrencyUpdate_Struct { //When an item is selected while the alt currency merchant window is open struct AltCurrencySelectItem_Struct { /*000*/ uint32 merchant_entity_id; -/*004*/ //uint32 slot_id; - ItemSlotStruct slot_id; +/*004*/ MainInvItemSlotStruct slot_id; /*008*/ uint32 unknown008; /*012*/ uint32 unknown012; /*016*/ uint32 unknown016; @@ -2232,8 +2231,7 @@ struct AltCurrencyReclaim_Struct { struct AltCurrencySellItem_Struct { /*000*/ uint32 merchant_entity_id; -/*004*/ //uint32 slot_id; - ItemSlotStruct slot_id; +/*004*/ MainInvItemSlotStruct slot_id; /*008*/ uint32 charges; /*012*/ uint32 cost; }; diff --git a/common/patches/underfoot_structs.h b/common/patches/underfoot_structs.h index 378665db1..3a63a8c0f 100644 --- a/common/patches/underfoot_structs.h +++ b/common/patches/underfoot_structs.h @@ -4365,8 +4365,8 @@ struct AltCurrencySelectItem_Struct { struct AltCurrencySellItem_Struct { /*000*/ uint32 merchant_entity_id; /*004*/ uint32 slot_id; -/*006*/ uint32 charges; -/*010*/ uint32 cost; +/*008*/ uint32 charges; +/*012*/ uint32 cost; }; struct AltCurrencyPopulateEntry_Struct From 812ad530d1fd4595bb6e8ca4906c110f4cd7bf68 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 20 Dec 2014 00:49:14 -0600 Subject: [PATCH 150/153] Updated #cvs to display RoF2 Client Stream count --- changelog.txt | 3 +++ world/clientlist.cpp | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index e9e0946d8..ca32db0d7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/20/2014 == +Akkadius: Updated #cvs to display RoF2 Client Stream count + == 12/19/2014 == Trevius: (RoF2) Fixed Leadership AA Purchasing and Recipe Search by correcting opcodes. Trevius: Fixed Armor Tinting (players and NPCs) that was broken during a previous update. diff --git a/world/clientlist.cpp b/world/clientlist.cpp index d0b90a266..6ef730990 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -1301,6 +1301,8 @@ void ClientList::SendClientVersionSummary(const char *Name) uint32 ClientSoDCount = 0; uint32 ClientUnderfootCount = 0; uint32 ClientRoFCount = 0; + uint32 ClientRoF2Count = 0; + LinkedListIterator Iterator(clientlist); @@ -1343,6 +1345,11 @@ void ClientList::SendClientVersionSummary(const char *Name) ++ClientRoFCount; break; } + case 7: + { + ++ClientRoF2Count; + break; + } default: break; } @@ -1352,7 +1359,7 @@ void ClientList::SendClientVersionSummary(const char *Name) } - zoneserver_list.SendEmoteMessage(Name, 0, 0, 13, "There are %i Titanium, %i SoF, %i SoD, %i UF, %i RoF clients currently connected.", - ClientTitaniumCount, ClientSoFCount, ClientSoDCount, ClientUnderfootCount, ClientRoFCount); + zoneserver_list.SendEmoteMessage(Name, 0, 0, 13, "There are %i Titanium, %i SoF, %i SoD, %i UF, %i RoF, %i RoF2 clients currently connected.", + ClientTitaniumCount, ClientSoFCount, ClientSoDCount, ClientUnderfootCount, ClientRoFCount, ClientRoF2Count); } From b682a2f97a6848253f2cc8b68188d594fd6575d7 Mon Sep 17 00:00:00 2001 From: Trevius Date: Sat, 20 Dec 2014 17:34:47 -0600 Subject: [PATCH 151/153] Potential fix for RoF2 random crashes during zoning. --- common/patches/rof2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index d49f00253..a750d2abb 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -2551,6 +2551,8 @@ namespace RoF2 outapp->WriteUInt32(0); // Unknown outapp->WriteUInt32(0); // Unknown + // Think we need 1 byte of padding at the end + outapp->WriteUInt8(0); // Unknown _log(NET__STRUCTS, "Player Profile Packet is %i bytes", outapp->GetWritePosition()); From 7d95f3f58261d8fd011af8841d257d85f0ed42b1 Mon Sep 17 00:00:00 2001 From: Trevius Date: Sun, 21 Dec 2014 00:32:01 -0600 Subject: [PATCH 152/153] Fix for RoF2 Selling to Merchant. --- utils/patches/patch_RoF2.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/patches/patch_RoF2.conf b/utils/patches/patch_RoF2.conf index 60b94e87d..e6b0fef4c 100644 --- a/utils/patches/patch_RoF2.conf +++ b/utils/patches/patch_RoF2.conf @@ -309,7 +309,7 @@ OP_Sacrifice=0x1821 OP_PopupResponse=0x08a6 OP_OnLevelMessage=0x575b OP_AugmentInfo=0x0afb -OP_Petition=0x1901 +OP_Petition=0x3de3 OP_SomeItemPacketMaybe=0x747c OP_PVPStats=0x4b15 OP_PVPLeaderBoardRequest=0x04aa @@ -433,7 +433,7 @@ OP_ItemVerifyRequest=0x189c OP_ItemVerifyReply=0x097b # merchant stuff -OP_ShopPlayerSell=0x0000 +OP_ShopPlayerSell=0x791b OP_ShopRequest=0x4fed OP_ShopEnd=0x30a8 OP_ShopEndConfirm=0x3196 From f588c54d5258175236a82623b621eb713071ec53 Mon Sep 17 00:00:00 2001 From: Trevius Date: Sun, 21 Dec 2014 12:23:11 -0600 Subject: [PATCH 153/153] (RoF2) Fixed Extended Targets Window by correcting opcodes. --- changelog.txt | 3 +++ utils/patches/patch_RoF2.conf | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/changelog.txt b/changelog.txt index ca32db0d7..01ddc4625 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/21/2014 == +Trevius: (RoF2) Fixed Extended Targets Window by correcting opcodes. + == 12/20/2014 == Akkadius: Updated #cvs to display RoF2 Client Stream count diff --git a/utils/patches/patch_RoF2.conf b/utils/patches/patch_RoF2.conf index e6b0fef4c..88ae7ab31 100644 --- a/utils/patches/patch_RoF2.conf +++ b/utils/patches/patch_RoF2.conf @@ -230,10 +230,10 @@ OP_TargetMouse=0x075d OP_MobHealth=0x37b1 OP_InitialMobHealth=0x0000 # Unused? OP_TargetHoTT=0x0272 -OP_XTargetResponse=0x672f -OP_XTargetRequest=0x45be -OP_XTargetAutoAddHaters=0x792c OP_TargetBuffs=0x4f4b +OP_XTargetResponse=0x4d59 +OP_XTargetRequest=0x3763 +OP_XTargetAutoAddHaters=0x672f OP_BuffCreate=0x3377 OP_BuffRemoveRequest=0x64f2 OP_DeleteSpawn=0x7280 @@ -601,7 +601,7 @@ OP_MoveLogDisregard=0x0000 # gone I think # named unknowns, to make looking for real unknown easier OP_AnnoyingZoneUnknown=0x0000 -OP_Some6ByteHPUpdate=0x0000 seems to happen when you target group members +OP_Some6ByteHPUpdate=0x0000 #seems to happen when you target group members OP_QueryResponseThing=0x0000 @@ -610,9 +610,9 @@ OP_QueryResponseThing=0x0000 #OP_LoginUnknown2=0x040b # OP_SendSkillCapsChecksum # Petition Opcodes -OP_PetitionSearch=0x0000 search term for petition -OP_PetitionSearchResults=0x0000 (list of?) matches from search -OP_PetitionSearchText=0x0000 text results of search +OP_PetitionSearch=0x0000 #search term for petition +OP_PetitionSearchResults=0x0000 #(list of?) matches from search +OP_PetitionSearchText=0x0000 #text results of search OP_PetitionUpdate=0x0000 OP_PetitionCheckout=0x0000