From 0f8c46878b3db8b7d3fda714578da49e06befe99 Mon Sep 17 00:00:00 2001 From: TOM_RUS Date: Thu, 14 Apr 2011 08:12:57 +0400 Subject: [PATCH] Updated some structs and enums. --- src/game/CharacterHandler.cpp | 2 +- src/game/DBCStructure.h | 1029 ++++++++++++++++++--------------- src/game/DBCfmt.h | 2 +- src/game/GMTicketHandler.cpp | 4 +- src/game/MapManager.cpp | 2 +- src/game/MiscHandler.cpp | 8 +- src/game/Opcodes.cpp | 2 +- src/game/Opcodes.h | 392 ++++++------- src/game/Player.cpp | 20 +- src/game/Player.h | 3 +- src/game/QueryHandler.cpp | 4 +- src/game/WorldSession.cpp | 2 +- src/game/WorldSession.h | 2 +- src/realmd/AuthSocket.cpp | 6 +- 14 files changed, 783 insertions(+), 695 deletions(-) diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index 6df711e62..bf89131c7 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -1317,7 +1317,7 @@ void WorldSession::HandleEquipmentSetUseOpcode(WorldPacket &recv_data) _player->SwapItem(item->GetPos(), dstpos); } - WorldPacket data(SMSG_EQUIPMENT_SET_USE_RESULT, 1); + WorldPacket data(SMSG_USE_EQUIPMENT_SET_RESULT, 1); data << uint8(0); // 4 - equipment swap failed - inventory is full SendPacket(&data); } diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 6bb3d3680..3ff4d7e28 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -39,39 +39,39 @@ struct AchievementEntry { - uint32 ID; // 0 - uint32 factionFlag; // 1 -1=all, 0=horde, 1=alliance - uint32 mapID; // 2 -1=none - //uint32 parentAchievement; // 3 its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin) - char *name[16]; // 4-19 - //uint32 name_flags; // 20 - //char *description[16]; // 21-36 - //uint32 desc_flags; // 37 - uint32 categoryId; // 38 - uint32 points; // 39 reward points - //uint32 OrderInCategory; // 40 - uint32 flags; // 41 - //uint32 icon; // 42 icon (from SpellIcon.dbc) - //char *titleReward[16]; // 43-58 - //uint32 titleReward_flags; // 59 - uint32 count; // 60 - need this count of completed criterias (own or referenced achievement criterias) - uint32 refAchievement; // 61 - referenced achievement (counting of all completed criterias) + uint32 ID; // 0 m_ID + uint32 factionFlag; // 1 m_faction -1=all, 0=horde, 1=alliance + uint32 mapID; // 2 m_instance_id -1=none + //uint32 parentAchievement; // 3 m_supercedes its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin) + char *name[16]; // 4-19 m_title_lang + //uint32 name_flags; // 20 string flags + //char *description[16]; // 21-36 m_description_lang + //uint32 desc_flags; // 37 string flags + uint32 categoryId; // 38 m_category + uint32 points; // 39 m_points + //uint32 OrderInCategory; // 40 m_ui_order + uint32 flags; // 41 m_flags + //uint32 icon; // 42 m_iconID + //char *titleReward[16]; // 43-58 m_reward_lang + //uint32 titleReward_flags; // 59 string flags + uint32 count; // 60 m_minimum_criteria - need this count of completed criterias (own or referenced achievement criterias) + uint32 refAchievement; // 61 m_shares_criteria - referenced achievement (counting of all completed criterias) }; struct AchievementCategoryEntry { - uint32 ID; // 0 - uint32 parentCategory; // 1 -1 for main category - //char *name[16]; // 2-17 - //uint32 name_flags; // 18 - //uint32 sortOrder; // 19 + uint32 ID; // 0 m_ID + uint32 parentCategory; // 1 m_parent -1 for main category + //char *name[16]; // 2-17 m_name_lang + //uint32 name_flags; // 18 string flags + //uint32 sortOrder; // 19 m_ui_order }; struct AchievementCriteriaEntry { - uint32 ID; // 0 - uint32 referredAchievement; // 1 - uint32 requiredType; // 2 + uint32 ID; // 0 m_ID + uint32 referredAchievement; // 1 m_achievement_id + uint32 requiredType; // 2 m_type union { // ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0 @@ -87,10 +87,10 @@ struct AchievementCriteriaEntry { uint32 bgMapID; // 3 uint32 winCount; // 4 - uint32 additionalRequirement1_type; // 5 additional requirement 1 type - uint32 additionalRequirement1_value; // 6 additional requirement 1 value - uint32 additionalRequirement2_type; // 7 additional requirement 2 type - uint32 additionalRequirement2_value; // 8 additional requirement 1 value + uint32 additionalRequirement1_type; // 5 + uint32 additionalRequirement1_value; // 6 + uint32 additionalRequirement2_type; // 7 + uint32 additionalRequirement2_value; // 8 } win_bg; // ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5 @@ -481,24 +481,21 @@ struct AchievementCriteriaEntry struct { - uint32 value; // 3 main requirement - uint32 count; // 4 main requirement count - uint32 additionalRequirement1_type; // 5 additional requirement 1 type - uint32 additionalRequirement1_value; // 6 additional requirement 1 value - uint32 additionalRequirement2_type; // 7 additional requirement 2 type - uint32 additionalRequirement2_value; // 8 additional requirement 1 value + uint32 value; // 3 m_asset_id + uint32 count; // 4 m_quantity + uint32 additionalRequirement1_type; // 5 m_start_event + uint32 additionalRequirement1_value; // 6 m_start_asset + uint32 additionalRequirement2_type; // 7 m_fail_event + uint32 additionalRequirement2_value; // 8 m_fail_asset } raw; }; - char* name[16]; // 9-24 + char* name[16]; // 9-24 m_description_lang //uint32 name_flags; // 25 - uint32 completionFlag; // 26 - //uint32 timedCriteriaStartType; // 27 Only appears with timed achievements, seems to be the type of starting a timed Achievement, only type 1 and some of type 6 need manual starting - // 1: ByEventId(?) (serverside IDs), 2: ByQuestId, 5: ByCastSpellId(?) - // 6: BySpellIdTarget(some of these are unknown spells, some not, some maybe spells) - // 7: ByKillNpcId, 9: ByUseItemId - uint32 timedCriteriaMiscId; // 28 Alway appears with timed events, used internally to start the achievement, store - uint32 timeLimit; // 29 time limit in seconds - uint32 showOrder; // 30 show order, also used in achievement shift-links as index in state bitmask + uint32 completionFlag; // 26 m_flags + //uint32 timedCriteriaStartType; // 27 m_timer_start_event Only appears with timed achievements, seems to be the type of starting a timed Achievement, only type 1 and some of type 6 need manual starting: 1: ByEventId(?) (serverside IDs), 2: ByQuestId, 5: ByCastSpellId(?), 6: BySpellIdTarget(some of these are unknown spells, some not, some maybe spells), 7: ByKillNpcId, 9: ByUseItemId + uint32 timedCriteriaMiscId; // 28 m_timer_asset_id Alway appears with timed events, used internally to start the achievement, store + uint32 timeLimit; // 29 m_timer_time + uint32 showOrder; // 30 m_ui_order also used in achievement shift-links as index in state bitmask // helpers bool IsExplicitlyStartedTimedCriteria() const @@ -513,23 +510,28 @@ struct AchievementCriteriaEntry struct AreaTableEntry { - uint32 ID; // 0 - uint32 mapid; // 1 - uint32 zone; // 2 if 0 then it's zone, else it's zone id of this area - uint32 exploreFlag; // 3, main index - uint32 flags; // 4, unknown value but 312 for all cities - // 5-9 unused - int32 area_level; // 10 - char* area_name[16]; // 11-26 - // 27, string flags, unused - uint32 team; // 28 + uint32 ID; // 0 m_ID + uint32 mapid; // 1 m_ContinentID + uint32 zone; // 2 m_ParentAreaID + uint32 exploreFlag; // 3 m_AreaBit + uint32 flags; // 4 m_flags + // 5 m_SoundProviderPref + // 6 m_SoundProviderPrefUnderwater + // 7 m_AmbienceID + // 8 m_ZoneMusic + // 9 m_IntroSound + int32 area_level; // 10 m_ExplorationLevel + char* area_name[16]; // 11-26 m_AreaName_lang + // 27 string flags + uint32 team; // 28 m_factionGroupMask + // m_liquidTypeID, m_minElevation, m_ambient_multiplier, m_lightid... }; struct AreaGroupEntry { - uint32 AreaGroupId; // 0 - uint32 AreaId[6]; // 1-6 - uint32 nextGroup; // 7 index of next group + uint32 AreaGroupId; // 0 m_ID + uint32 AreaId[6]; // 1-6 m_areaID + uint32 nextGroup; // 7 m_nextAreaID }; struct AreaTriggerEntry @@ -548,28 +550,28 @@ struct AreaTriggerEntry struct AuctionHouseEntry { - uint32 houseId; // 0 index - uint32 faction; // 1 id of faction.dbc for player factions associated with city - uint32 depositPercent; // 2 1/3 from real - uint32 cutPercent; // 3 - //char* name[16]; // 4-19 - // 20 string flag, unused + uint32 houseId; // 0 m_ID + uint32 faction; // 1 m_factionID + uint32 depositPercent; // 2 m_depositRate + uint32 cutPercent; // 3 m_consignmentRate + //char* name[16]; // 4-19 m_name_lang + // 20 string flags }; struct BankBagSlotPricesEntry { - uint32 ID; - uint32 price; + uint32 ID; // 0 m_ID + uint32 price; // 1 m_Cost }; struct BarberShopStyleEntry { - uint32 Id; // 0 + uint32 Id; // 0 m_ID uint32 type; // 1 value 0 -> hair, value 2 -> facialhair //char* name[16]; // 2-17 name of hair style - //uint32 name_flags; // 18 - //uint32 unk_name[16]; // 19-34, all empty - //uint32 unk_flags; // 35 + //uint32 name_flags; // 18 string flags + //uint32 unk_name[16]; // 19-34 all empty + //uint32 unk_flags; // 35 string flags //float CostMultiplier; // 36 values 1 and 0.75 uint32 race; // 37 race uint32 gender; // 38 0 -> male, 1 -> female @@ -578,132 +580,134 @@ struct BarberShopStyleEntry struct BattlemasterListEntry { - uint32 id; // 0 - int32 mapid[8]; // 1-8 mapid - uint32 type; // 9 (3 - BG, 4 - arena) - //uint32 canJoinAsGroup; // 10 (0 or 1) - char* name[16]; // 11-26 - //uint32 nameFlags // 27 string flag, unused - uint32 maxGroupSize; // 28 maxGroupSize, used for checking if queue as group - uint32 HolidayWorldStateId; // 29 new 3.1 - uint32 minLevel; // 30, min level (sync with PvPDifficulty.dbc content) - uint32 maxLevel; // 31, max level (sync with PvPDifficulty.dbc content) + uint32 id; // 0 m_ID + int32 mapid[8]; // 1-8 m_mapID[8] + uint32 type; // 9 m_instanceType + //uint32 canJoinAsGroup; // 10 m_groupsAllowed + char* name[16]; // 11-26 m_name_lang + //uint32 nameFlags // 27 string flags + uint32 maxGroupSize; // 28 m_maxGroupSize + uint32 HolidayWorldStateId; // 29 m_holidayWorldState + uint32 minLevel; // 30 m_minlevel (sync with PvPDifficulty.dbc content) + uint32 maxLevel; // 31 m_maxlevel (sync with PvPDifficulty.dbc content) }; /*struct Cfg_CategoriesEntry { - uint32 Index; // categoryId, sent in RealmList packet - uint32 Unk1; - uint32 Unk2; - uint32 IsTournamentRealm; - char *categoryName[16]; + uint32 Index; // m_ID categoryId (sent in RealmList packet) + uint32 Unk1; // m_localeMask + uint32 Unk2; // m_charsetMask + uint32 IsTournamentRealm; // m_flags + char *categoryName[16]; // m_name_lang uint32 categoryNameFlags; }*/ /*struct Cfg_ConfigsEntry { - uint32 Id; - uint32 Type; // sent in RealmList packet - uint32 IsPvp; - uint32 IsRp; + uint32 Id; // m_ID + uint32 Type; // m_realmType (sent in RealmList packet) + uint32 IsPvp; // m_playerKillingAllowed + uint32 IsRp; // m_roleplaying };*/ #define MAX_OUTFIT_ITEMS 24 struct CharStartOutfitEntry { - //uint32 Id; // 0 - uint32 RaceClassGender; // 1 (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender) - int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-25 - //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 26-29 not required at server side - //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 50-73 not required at server side - //uint32 Unknown1; // 74, unique values (index-like with gaps ordered in other way as ids) + //uint32 Id; // 0 m_ID + uint32 RaceClassGender; // 1 m_raceID m_classID m_sexID m_outfitID (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender) + int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-25 m_ItemID + //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 26-29 m_DisplayItemID not required at server side + //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 50-73 m_InventoryType not required at server side + //uint32 Unknown1; // 74 unique values (index-like with gaps ordered in other way as ids) //uint32 Unknown2; // 75 //uint32 Unknown3; // 76 }; struct CharTitlesEntry { - uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId() - //uint32 unk1; // 1 flags? - char* name[16]; // 2-17 - // 18 string flag, unused - //char* name2[16]; // 19-34, unused - // 35 string flag, unused - uint32 bit_index; // 36 used in PLAYER_CHOSEN_TITLE and 1<